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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d7af46985a68866040992b8abd774d0937317454 | 14e18690460ab3fbfdaa24190838c4643dce0089 | /src/usFilter/us_vector_region_filter5.cpp | ca355326ecde3fc9099babe7dd1bc17340aed805 | [] | no_license | MrBigDog/MyProject | e864265b3e299bf6b3b05e3af33cbfcfd7d043ea | a0326b0d5f4c56cd8d269b3efbb61b402d61430c | refs/heads/master | 2021-09-10T21:56:22.886786 | 2018-04-03T01:10:57 | 2018-04-03T01:10:57 | 113,719,751 | 3 | 0 | null | null | null | null | GB18030 | C++ | false | false | 5,421 | cpp | ///////////////////////////////////////////////////////////////////////////
//
// This source file is part of Uniscope Globe
// Copyright (c) 2008-2009 by The Uniscope Team . All Rights Reserved
//
///////////////////////////////////////////////////////////////////////////
//
// Filename: us_vector_region_filter5.cpp
// Author : Uniscope Team
// Modifier: Uniscope Team
// Created :
// Purpose : vector_region_filter5 class
// Reference :
//
///////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "us_vector_region_filter5.h"
namespace uniscope_globe
{
vector_region_filter5::vector_region_filter5( void )
{
}
vector_region_filter5::~vector_region_filter5( void )
{
}
object_base* vector_region_filter5::parse( raw_buffer* stream )
{
vector_raw_data* v_raw_data = new vector_raw_data();
v_raw_data->m_type = vector_type::VECTOR_REGION;
//
// 数据版本及类型
//
us_square_head v_square_head;
stream->read( (void* )&v_square_head, sizeof( us_square_head ) );
v_raw_data->m_version = v_square_head.version;
//
// vertex buffer
//
us_zipped_segment v_zipped_segment;
stream->read((void*)&(v_zipped_segment.segment_type), sizeof(short));
stream->read((void*)&(v_zipped_segment.unzipped_data_size), sizeof(ulong));
stream->read((void*)&(v_zipped_segment.zipped_data_size), sizeof(ulong));
stream->read((void*)&(v_raw_data->m_divide_number), sizeof(short));
stream->read((void*)&(v_raw_data->m_elevation_max), sizeof(float));
stream->read((void*)&(v_raw_data->m_elevation_min), sizeof(float));
stream->read((void*)&(v_raw_data->m_terrian_square_max), sizeof(float));
stream->read((void*)&(v_raw_data->m_terrian_square_min), sizeof(float));
if( v_raw_data->m_elevation_max < v_raw_data->m_elevation_min )
{
v_raw_data->m_elevation_min = 0;
v_raw_data->m_elevation_max = 0;
}
else
{
v_raw_data->m_terrain_elevation = true;
}
byte* v_zipped_vb = new byte[v_zipped_segment.zipped_data_size];
stream->read( (void*)v_zipped_vb, v_zipped_segment.zipped_data_size );
byte* v_unzipped_vb = new byte[ v_zipped_segment.unzipped_data_size ];
uncompress( v_unzipped_vb, &v_zipped_segment.unzipped_data_size, v_zipped_vb, v_zipped_segment.zipped_data_size );
AUTO_DELETE( v_zipped_vb );
v_raw_data->m_vertex_buffer = (short* )v_unzipped_vb;
v_raw_data->m_vertex_buffer_size = v_zipped_segment.unzipped_data_size / sizeof(short);
//
// index buffer
//
stream->read((void*)&(v_zipped_segment.segment_type), sizeof(short));
stream->read((void*)&(v_zipped_segment.unzipped_data_size), sizeof(ulong));
stream->read((void*)&(v_zipped_segment.zipped_data_size), sizeof(ulong));
byte* v_zipped_ib = new byte[v_zipped_segment.zipped_data_size];
stream->read( (void*)v_zipped_ib, v_zipped_segment.zipped_data_size );
byte* v_unzipped_ib = new byte[ v_zipped_segment.unzipped_data_size ];
uncompress( v_unzipped_ib, &v_zipped_segment.unzipped_data_size, v_zipped_ib, v_zipped_segment.zipped_data_size );
AUTO_DELETE( v_zipped_ib );
v_raw_data->m_index_buffer_size = v_zipped_segment.unzipped_data_size / sizeof(ushort);
v_raw_data->m_index_buffer = new ulong[v_raw_data->m_index_buffer_size];
for ( int i = 0; i < v_raw_data->m_index_buffer_size; i++ )
{
v_raw_data->m_index_buffer[i] = (ulong)((ushort*)v_unzipped_ib)[i];
}
AUTO_DELETE( v_unzipped_ib );
//
// line index buffer
//
stream->read((void*)&(v_zipped_segment.segment_type), sizeof(short));
stream->read((void*)&(v_zipped_segment.unzipped_data_size), sizeof(ulong));
stream->read((void*)&(v_zipped_segment.zipped_data_size), sizeof(ulong));
v_zipped_ib = new byte[v_zipped_segment.zipped_data_size];
stream->read( (void*)v_zipped_ib, v_zipped_segment.zipped_data_size );
v_unzipped_ib = new byte[ v_zipped_segment.unzipped_data_size ];
uncompress( v_unzipped_ib, &v_zipped_segment.unzipped_data_size, v_zipped_ib, v_zipped_segment.zipped_data_size );
AUTO_DELETE( v_zipped_ib );
v_raw_data->m_line_index_buffer_size = v_zipped_segment.unzipped_data_size / sizeof(ushort);
v_raw_data->m_line_index_buffer = new ulong[v_raw_data->m_line_index_buffer_size];
for ( int i = 0; i < v_raw_data->m_line_index_buffer_size; i++ )
{
v_raw_data->m_line_index_buffer[i] = (ulong)((ushort*)v_unzipped_ib)[i];
}
AUTO_DELETE( v_unzipped_ib );
//
// contour index buffer
//
stream->read((void*)&(v_zipped_segment.segment_type), sizeof(short));
stream->read((void*)&(v_zipped_segment.unzipped_data_size), sizeof(ulong));
stream->read((void*)&(v_zipped_segment.zipped_data_size), sizeof(ulong));
v_zipped_ib = new byte[v_zipped_segment.zipped_data_size];
stream->read( (void*)v_zipped_ib, v_zipped_segment.zipped_data_size );
v_unzipped_ib = new byte[ v_zipped_segment.unzipped_data_size ];
uncompress( v_unzipped_ib, &v_zipped_segment.unzipped_data_size, v_zipped_ib, v_zipped_segment.zipped_data_size );
AUTO_DELETE( v_zipped_ib );
v_raw_data->m_contour_index_buffer_size = v_zipped_segment.unzipped_data_size / sizeof(ushort);
v_raw_data->m_contour_index_buffer = new ulong[v_raw_data->m_contour_index_buffer_size];
for ( int i = 0; i < v_raw_data->m_contour_index_buffer_size; i++ )
{
v_raw_data->m_contour_index_buffer[i] = (ulong)((ushort*)v_unzipped_ib)[i];
}
AUTO_DELETE( v_unzipped_ib );
return v_raw_data;
}
} | [
"635669462@qq.com"
] | 635669462@qq.com |
abbc9443961b8687b1acbf3429e392e2f2ad4da0 | bcb637b6ce55902142170247703fb770999511a9 | /Driver.cpp | 8b9a6d22bc0a5dd729cce09ee9306bd48ebaff86 | [] | no_license | llendelreyes/compe260-linkedlists | 8bf59cac0930205ecccb936efe019060a8929526 | 151810d2af91c60961a4fb4be216fc4288abab14 | refs/heads/master | 2021-01-01T19:48:30.034549 | 2017-07-28T23:54:02 | 2017-07-28T23:54:02 | 98,692,647 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,515 | cpp | //
// Driver.cpp
// Program #3 Linked Lists
//
// Created by Llendel Reyes.
// Copyright © 2017 Llendel Reyes. All rights reserved.
//
#include "LinkedList.h"
#include <iostream>
using namespace std;
void print(List st)
{ st.display(cout); }
int main() {
List l;
int indexnum, listnum;
cout << "Empty List created?" << endl
<< boolalpha << l.empty() << endl
<< endl;
cout << "How many elements do you want to add to the List: ";
cin >> listnum;
for (int i = 1; i <= listnum; i++)
l.push(10 * i);
cout << "Is list empty? " << endl
<< l.empty() << endl
<< endl;
cout << "List L:"<<endl<<endl;
cout << "**"<<endl;
print(l);
cout << "**";
cout << endl<<endl;
cout << "invalid index or (>0) will terminate function" << endl
<< endl;
while (true) {
cout << "Enter Index: ";
cin >> indexnum;
if (indexnum >= listnum || indexnum < 0) {
cout << endl
<< indexnum << " is an invalid index. Program will now terminate!" << endl;
break;
}
else {
cout << "Index " << indexnum << " contains: " << l.GetNth(indexnum) << endl
<< endl;
}
}
cout << endl
<< "Size of List L: " << l.Length() << " values" << endl;
cout << "Post-Split List (via function): " << l.Split() << endl
<< endl;
}
| [
"noreply@github.com"
] | noreply@github.com |
f795d38a6c9e0f8eee034a89d9cf3dba1f241d07 | 1106985164494c361c6ef017189cd6f53f6009d4 | /02 LinkedLists/Source Files/TripletwhoseSumequalsGivenNoin3LLs.cpp | 151a357387322894683f3a1970a66ea81b70e64c | [] | no_license | SlickHackz/famous-problems-cpp-solutions | b7f0066a03404a20c1a4b483acffda021595c530 | f954b4a8ca856cc749e232bd9d8894a672637ae2 | refs/heads/master | 2022-08-25T23:14:11.975270 | 2022-07-17T22:07:03 | 2022-07-17T22:07:03 | 71,126,427 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,846 | cpp | /*
Take 3 LLs, sort LL2 in ascending and LL3 in descending.
Pick one element from LL1 and one element from LL2 and LL3.
If sum mathces, return;
Else if sum is lesser, look for a bigger number, so increment LL2
Else if sum is greater, look for a smaller number, so increment LL3
*/
#include<iostream>
using namespace std;
struct node
{
int data;
struct node *next;
};
struct node *CreateNode(int a)
{
struct node *temp=new struct node();
temp->data=a;
temp->next=NULL;
return temp;
}
struct node *Push(struct node **refHead,int num)
{
struct node *temp = CreateNode(num);
if(*refHead!=NULL)
temp->next = *refHead;
*refHead = temp;
return *refHead;
}
void printLL(struct node *head)
{
if(head==NULL)
{
cout<<"\nThe LL is empty\n";
return;
}
cout<<endl;
while(head)
{
cout<<head->data<<" ";
head=head->next;
}
}
struct node *MedianofLL(struct node *slow)
{
if(slow==NULL || slow->next==NULL)
return slow;
struct node *fast = slow->next;
while(slow && fast && fast->next)
{
slow = slow->next;
fast = fast->next->next;
}
return slow;
}
void SplitLLintoHalves(struct node *head,struct node **refhalf1,struct node **refhalf2)
{
if(head==NULL || head->next==NULL)
{
*refhalf1 = head;
*refhalf2 = NULL;
return;
}
struct node *middle = MedianofLL(head);
*refhalf2 = middle->next;
middle->next = NULL;
*refhalf1 = head;
}
struct node *mergeSortedLLs(struct node *LL1,struct node *LL2,bool ascend)
{
if(LL1==NULL)
return LL2;
if(LL2==NULL)
return LL1;
struct node *mergedLL = NULL;
if(ascend)
{
if(LL1->data < LL2->data)
{
mergedLL = LL1;
mergedLL->next = mergeSortedLLs(LL1->next,LL2,ascend);
}
else
{
mergedLL = LL2;
mergedLL->next = mergeSortedLLs(LL1,LL2->next,ascend);
}
}
else
{
if(LL1->data > LL2->data)
{
mergedLL = LL1;
mergedLL->next = mergeSortedLLs(LL1->next,LL2,ascend);
}
else
{
mergedLL = LL2;
mergedLL->next = mergeSortedLLs(LL1,LL2->next,ascend);
}
}
return mergedLL;
}
struct node *MergeSort(struct node **refHead,bool ascend=true)
{
struct node *head = *refHead;
if(head==NULL || head->next==NULL)
return head;
struct node *half1 = NULL;
struct node *half2 = NULL;
SplitLLintoHalves(head,&half1,&half2);
MergeSort(&half1,ascend);
MergeSort(&half2,ascend);
*refHead = mergeSortedLLs(half1,half2,ascend);
}
void findTriplet(struct node *LL1,struct node *LL2,struct node *LL3,int findnum)
{
if(LL1==NULL && LL2==NULL && LL3==NULL)
{
cout<<"\n All are empty.. No Triplet!";
return;
}
bool tripletfound = false;
struct node *head2 = LL2;
struct node *head3 = LL3;
while(LL1!=NULL)
{
while(LL2!=NULL && LL3!=NULL)
{
int sum = LL1->data + LL2->data + LL3->data;
if(sum==findnum)
{
cout<<"\nYes..Triplet found! "<<LL1->data<<" + "<<LL2->data<<" + "<<LL3->data<<" = "<<findnum;
tripletfound = true;
break;
}
else if(sum < findnum)
{
LL2 = LL2->next;
}
else
{
LL3 = LL3->next;
}
}
LL1 = LL1->next;
LL2= head2;
LL3= head3;
}
if(!tripletfound)
cout<<"\nSorry.. No Triplet found!";
}
void main()
{
struct node *LL1=NULL;
int num1[] = {29,15,12,22,18,25};
for(int i=(sizeof(num1)/sizeof(num1[0]))-1 ; i>=0 ; i--)
Push(&LL1,num1[i]);
struct node *LL2=NULL;
int num2[] = {42,50,43,54,58,40,55};
for(int i=(sizeof(num2)/sizeof(num2[0]))-1 ; i>=0 ; i--)
Push(&LL2,num2[i]);
struct node *LL3=NULL;
int num3[] = {69,78,64,75};
for(int i=(sizeof(num3)/sizeof(num3[0]))-1 ; i>=0 ; i--)
Push(&LL3,num3[i]);
cout<<"\nInitially...";
printLL(LL1);
printLL(LL2);
printLL(LL3);
MergeSort(&LL2);
MergeSort(&LL3,false);
cout<<"\n\nLL2 sorted in ascending, LL3 sorted in descending..";
printLL(LL1);
printLL(LL2);
printLL(LL3);
cout<<"\n\nAre there triplet?";
findTriplet(LL1,LL2,LL3,2);
cin.get();
}
| [
"prasath17101990@gmail.com"
] | prasath17101990@gmail.com |
87b636e62ec4d2fa6e54ad9c3aaf2f368bd85efc | 2966b8fad330098f8114509a27f9512fa851ef2d | /framework/include/media/MediaUtils.h | 6cc04cd0119348252435471fba58b2de7a89cacc | [
"Apache-2.0"
] | permissive | CypressHJ/TizenRT | ac4e8e86ec6b7b371a0bfd21dfb692502d9a7247 | baac34a860b01a68f5280c2d41d414cb67557562 | refs/heads/master | 2020-03-11T17:47:53.035292 | 2018-04-18T10:01:34 | 2018-04-18T10:01:34 | 125,018,689 | 0 | 0 | Apache-2.0 | 2018-03-13T08:38:56 | 2018-03-13T08:38:56 | null | UTF-8 | C++ | false | false | 2,009 | h | /* ****************************************************************
*
* Copyright 2018 Samsung Electronics 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 __MEDIA_UTILS_H
#define __MEDIA_UTILS_H
#include <string>
namespace media {
namespace utils {
/**
* @brief Audio type.
* @details @b #include <media/MediaUtils.h>
* @since TizenRT v2.0
*/
typedef enum audio_type_e {
/** Audio type is invalid */
AUDIO_TYPE_INVALID = 0,
/** Audio type is mp3 */
AUDIO_TYPE_MP3 = 1,
/** Audio type is AAC */
AUDIO_TYPE_AAC = 2,
/** Audio type is PCM */
AUDIO_TYPE_PCM = 3,
/** Audio type is PCM */
AUDIO_TYPE_OPUS = 4,
/** Audio type is PCM */
AUDIO_TYPE_FLAC = 5
} audio_type_t;
/**
* @brief Replace string with lowercase string.
* @details @b #include <media/MediaUtils.h>
* @param[out] str The str that lowercase string
* @since TizenRT v2.0
*/
void toLowerString(std::string& str);
/**
* @brief Replace string with uppercase string.
* @details @b #include <media/MediaUtils.h>
* @param[out] str The str that uppercase string
* @since TizenRT v2.0
*/
void toUpperString(std::string& str);
/**
* @brief Gets the audio type in path.
* @details @b #include <media/MediaUtils.h>
* @param[in] path The path of audio data
* @return The audio type
* @since TizenRT v2.0
*/
audio_type_t getAudioTypeFromPath(std::string path);
} // namespace utils
} // namespace media
#endif
| [
"jaesick.shin@samsung.com"
] | jaesick.shin@samsung.com |
c1161d30a7b9bb648c8362cf29edb81fe11588ba | 46f53e9a564192eed2f40dc927af6448f8608d13 | /components/content_settings/core/browser/content_settings_policy_provider.cc | 9711640657a6a9fec82c80f3cfd77c833a22483a | [
"BSD-3-Clause"
] | permissive | sgraham/nope | deb2d106a090d71ae882ac1e32e7c371f42eaca9 | f974e0c234388a330aab71a3e5bbf33c4dcfc33c | refs/heads/master | 2022-12-21T01:44:15.776329 | 2015-03-23T17:25:47 | 2015-03-23T17:25:47 | 32,344,868 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 20,437 | cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/content_settings/core/browser/content_settings_policy_provider.h"
#include <string>
#include <vector>
#include "base/bind.h"
#include "base/json/json_reader.h"
#include "base/prefs/pref_service.h"
#include "base/values.h"
#include "components/content_settings/core/browser/content_settings_rule.h"
#include "components/content_settings/core/browser/content_settings_utils.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
namespace {
// The preferences used to manage ContentSettingsTypes.
const char* kPrefToManageType[] = {
prefs::kManagedDefaultCookiesSetting,
prefs::kManagedDefaultImagesSetting,
prefs::kManagedDefaultJavaScriptSetting,
prefs::kManagedDefaultPluginsSetting,
prefs::kManagedDefaultPopupsSetting,
prefs::kManagedDefaultGeolocationSetting,
prefs::kManagedDefaultNotificationsSetting,
NULL, // No policy for default value of content type auto-select-certificate
NULL, // No policy for default value of fullscreen requests
NULL, // No policy for default value of mouse lock requests
NULL, // No policy for default value of mixed script blocking
prefs::kManagedDefaultMediaStreamSetting,
NULL, // No policy for default value of media stream mic
NULL, // No policy for default value of media stream camera
NULL, // No policy for default value of protocol handlers
NULL, // No policy for default value of PPAPI broker
NULL, // No policy for default value of multiple automatic downloads
NULL, // No policy for default value of MIDI system exclusive requests
NULL, // No policy for default value of push messaging requests
NULL, // No policy for default value of SSL certificate decisions
#if defined(OS_WIN)
NULL, // No policy for default value of "switch to desktop"
#elif defined(OS_ANDROID) || defined(OS_CHROMEOS)
NULL, // No policy for default value of protected media identifier
#endif
NULL, // No policy for default value of app banners
};
static_assert(arraysize(kPrefToManageType) == CONTENT_SETTINGS_NUM_TYPES,
"kPrefToManageType should have CONTENT_SETTINGS_NUM_TYPES "
"elements");
struct PrefsForManagedContentSettingsMapEntry {
const char* pref_name;
ContentSettingsType content_type;
ContentSetting setting;
};
const PrefsForManagedContentSettingsMapEntry
kPrefsForManagedContentSettingsMap[] = {
{
prefs::kManagedCookiesAllowedForUrls,
CONTENT_SETTINGS_TYPE_COOKIES,
CONTENT_SETTING_ALLOW
}, {
prefs::kManagedCookiesSessionOnlyForUrls,
CONTENT_SETTINGS_TYPE_COOKIES,
CONTENT_SETTING_SESSION_ONLY
}, {
prefs::kManagedCookiesBlockedForUrls,
CONTENT_SETTINGS_TYPE_COOKIES,
CONTENT_SETTING_BLOCK
}, {
prefs::kManagedImagesAllowedForUrls,
CONTENT_SETTINGS_TYPE_IMAGES,
CONTENT_SETTING_ALLOW
}, {
prefs::kManagedImagesBlockedForUrls,
CONTENT_SETTINGS_TYPE_IMAGES,
CONTENT_SETTING_BLOCK
}, {
prefs::kManagedJavaScriptAllowedForUrls,
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
CONTENT_SETTING_ALLOW
}, {
prefs::kManagedJavaScriptBlockedForUrls,
CONTENT_SETTINGS_TYPE_JAVASCRIPT,
CONTENT_SETTING_BLOCK
}, {
prefs::kManagedPluginsAllowedForUrls,
CONTENT_SETTINGS_TYPE_PLUGINS,
CONTENT_SETTING_ALLOW
}, {
prefs::kManagedPluginsBlockedForUrls,
CONTENT_SETTINGS_TYPE_PLUGINS,
CONTENT_SETTING_BLOCK
}, {
prefs::kManagedPopupsAllowedForUrls,
CONTENT_SETTINGS_TYPE_POPUPS,
CONTENT_SETTING_ALLOW
}, {
prefs::kManagedPopupsBlockedForUrls,
CONTENT_SETTINGS_TYPE_POPUPS,
CONTENT_SETTING_BLOCK
}, {
prefs::kManagedNotificationsAllowedForUrls,
CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
CONTENT_SETTING_ALLOW
}, {
prefs::kManagedNotificationsBlockedForUrls,
CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
CONTENT_SETTING_BLOCK
}
};
} // namespace
namespace content_settings {
// static
void PolicyProvider::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterListPref(prefs::kManagedAutoSelectCertificateForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedCookiesAllowedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedCookiesBlockedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedCookiesSessionOnlyForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedImagesAllowedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedImagesBlockedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedJavaScriptAllowedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedJavaScriptBlockedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedPluginsAllowedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedPluginsBlockedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedPopupsAllowedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedPopupsBlockedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedNotificationsAllowedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterListPref(prefs::kManagedNotificationsBlockedForUrls,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
// Preferences for default content setting policies. If a policy is not set of
// the corresponding preferences below is set to CONTENT_SETTING_DEFAULT.
registry->RegisterIntegerPref(
prefs::kManagedDefaultCookiesSetting,
CONTENT_SETTING_DEFAULT,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kManagedDefaultImagesSetting,
CONTENT_SETTING_DEFAULT,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kManagedDefaultJavaScriptSetting,
CONTENT_SETTING_DEFAULT,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kManagedDefaultPluginsSetting,
CONTENT_SETTING_DEFAULT,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kManagedDefaultPopupsSetting,
CONTENT_SETTING_DEFAULT,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kManagedDefaultGeolocationSetting,
CONTENT_SETTING_DEFAULT,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kManagedDefaultNotificationsSetting,
CONTENT_SETTING_DEFAULT,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
registry->RegisterIntegerPref(
prefs::kManagedDefaultMediaStreamSetting,
CONTENT_SETTING_DEFAULT,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
}
PolicyProvider::PolicyProvider(PrefService* prefs) : prefs_(prefs) {
ReadManagedDefaultSettings();
ReadManagedContentSettings(false);
pref_change_registrar_.Init(prefs_);
PrefChangeRegistrar::NamedChangeCallback callback =
base::Bind(&PolicyProvider::OnPreferenceChanged, base::Unretained(this));
pref_change_registrar_.Add(
prefs::kManagedAutoSelectCertificateForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedCookiesBlockedForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedCookiesAllowedForUrls, callback);
pref_change_registrar_.Add(
prefs::kManagedCookiesSessionOnlyForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedImagesBlockedForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedImagesAllowedForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedJavaScriptBlockedForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedJavaScriptAllowedForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedPluginsBlockedForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedPluginsAllowedForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedPopupsBlockedForUrls, callback);
pref_change_registrar_.Add(prefs::kManagedPopupsAllowedForUrls, callback);
pref_change_registrar_.Add(
prefs::kManagedNotificationsAllowedForUrls, callback);
pref_change_registrar_.Add(
prefs::kManagedNotificationsBlockedForUrls, callback);
// The following preferences are only used to indicate if a default content
// setting is managed and to hold the managed default setting value. If the
// value for any of the following preferences is set then the corresponding
// default content setting is managed. These preferences exist in parallel to
// the preference default content settings. If a default content settings type
// is managed any user defined exceptions (patterns) for this type are
// ignored.
pref_change_registrar_.Add(prefs::kManagedDefaultCookiesSetting, callback);
pref_change_registrar_.Add(prefs::kManagedDefaultImagesSetting, callback);
pref_change_registrar_.Add(prefs::kManagedDefaultJavaScriptSetting, callback);
pref_change_registrar_.Add(prefs::kManagedDefaultPluginsSetting, callback);
pref_change_registrar_.Add(prefs::kManagedDefaultPopupsSetting, callback);
pref_change_registrar_.Add(
prefs::kManagedDefaultGeolocationSetting, callback);
pref_change_registrar_.Add(
prefs::kManagedDefaultNotificationsSetting, callback);
pref_change_registrar_.Add(
prefs::kManagedDefaultMediaStreamSetting, callback);
}
PolicyProvider::~PolicyProvider() {
DCHECK(!prefs_);
}
RuleIterator* PolicyProvider::GetRuleIterator(
ContentSettingsType content_type,
const ResourceIdentifier& resource_identifier,
bool incognito) const {
return value_map_.GetRuleIterator(content_type, resource_identifier, &lock_);
}
void PolicyProvider::GetContentSettingsFromPreferences(
OriginIdentifierValueMap* value_map) {
for (size_t i = 0; i < arraysize(kPrefsForManagedContentSettingsMap); ++i) {
const char* pref_name = kPrefsForManagedContentSettingsMap[i].pref_name;
// Skip unset policies.
if (!prefs_->HasPrefPath(pref_name)) {
VLOG(2) << "Skipping unset preference: " << pref_name;
continue;
}
const PrefService::Preference* pref = prefs_->FindPreference(pref_name);
DCHECK(pref);
DCHECK(pref->IsManaged());
const base::ListValue* pattern_str_list = NULL;
if (!pref->GetValue()->GetAsList(&pattern_str_list)) {
NOTREACHED();
return;
}
for (size_t j = 0; j < pattern_str_list->GetSize(); ++j) {
std::string original_pattern_str;
if (!pattern_str_list->GetString(j, &original_pattern_str)) {
NOTREACHED();
continue;
}
PatternPair pattern_pair = ParsePatternString(original_pattern_str);
// Ignore invalid patterns.
if (!pattern_pair.first.IsValid()) {
VLOG(1) << "Ignoring invalid content settings pattern: " <<
original_pattern_str;
continue;
}
ContentSettingsType content_type =
kPrefsForManagedContentSettingsMap[i].content_type;
DCHECK_NE(content_type, CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE);
// If only one pattern was defined auto expand it to a pattern pair.
ContentSettingsPattern secondary_pattern =
!pattern_pair.second.IsValid() ? ContentSettingsPattern::Wildcard()
: pattern_pair.second;
value_map->SetValue(pattern_pair.first,
secondary_pattern,
content_type,
NO_RESOURCE_IDENTIFIER,
new base::FundamentalValue(
kPrefsForManagedContentSettingsMap[i].setting));
}
}
}
void PolicyProvider::GetAutoSelectCertificateSettingsFromPreferences(
OriginIdentifierValueMap* value_map) {
const char* pref_name = prefs::kManagedAutoSelectCertificateForUrls;
if (!prefs_->HasPrefPath(pref_name)) {
VLOG(2) << "Skipping unset preference: " << pref_name;
return;
}
const PrefService::Preference* pref = prefs_->FindPreference(pref_name);
DCHECK(pref);
DCHECK(pref->IsManaged());
const base::ListValue* pattern_filter_str_list = NULL;
if (!pref->GetValue()->GetAsList(&pattern_filter_str_list)) {
NOTREACHED();
return;
}
// Parse the list of pattern filter strings. A pattern filter string has
// the following JSON format:
//
// {
// "pattern": <content settings pattern string>,
// "filter" : <certificate filter in JSON format>
// }
//
// e.g.
// {
// "pattern": "[*.]example.com",
// "filter": {
// "ISSUER": {
// "CN": "some name"
// }
// }
// }
for (size_t j = 0; j < pattern_filter_str_list->GetSize(); ++j) {
std::string pattern_filter_json;
if (!pattern_filter_str_list->GetString(j, &pattern_filter_json)) {
NOTREACHED();
continue;
}
scoped_ptr<base::Value> value(base::JSONReader::Read(pattern_filter_json,
base::JSON_ALLOW_TRAILING_COMMAS));
if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) {
VLOG(1) << "Ignoring invalid certificate auto select setting. Reason:"
" Invalid JSON object: " << pattern_filter_json;
continue;
}
scoped_ptr<base::DictionaryValue> pattern_filter_pair(
static_cast<base::DictionaryValue*>(value.release()));
std::string pattern_str;
bool pattern_read = pattern_filter_pair->GetStringWithoutPathExpansion(
"pattern", &pattern_str);
base::DictionaryValue* cert_filter = NULL;
pattern_filter_pair->GetDictionaryWithoutPathExpansion("filter",
&cert_filter);
if (!pattern_read || !cert_filter) {
VLOG(1) << "Ignoring invalid certificate auto select setting. Reason:"
" Missing pattern or filter.";
continue;
}
ContentSettingsPattern pattern =
ContentSettingsPattern::FromString(pattern_str);
// Ignore invalid patterns.
if (!pattern.IsValid()) {
VLOG(1) << "Ignoring invalid certificate auto select setting:"
" Invalid content settings pattern: " << pattern.ToString();
continue;
}
// Don't pass removed values from |value|, because base::Values read with
// JSONReader use a shared string buffer. Instead, DeepCopy here.
value_map->SetValue(pattern,
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
std::string(),
cert_filter->DeepCopy());
}
}
void PolicyProvider::ReadManagedDefaultSettings() {
for (size_t type = 0; type < arraysize(kPrefToManageType); ++type) {
if (kPrefToManageType[type] == NULL) {
continue;
}
UpdateManagedDefaultSetting(ContentSettingsType(type));
}
}
void PolicyProvider::UpdateManagedDefaultSetting(
ContentSettingsType content_type) {
// If a pref to manage a default-content-setting was not set (NOTICE:
// "HasPrefPath" returns false if no value was set for a registered pref) then
// the default value of the preference is used. The default value of a
// preference to manage a default-content-settings is CONTENT_SETTING_DEFAULT.
// This indicates that no managed value is set. If a pref was set, than it
// MUST be managed.
DCHECK(!prefs_->HasPrefPath(kPrefToManageType[content_type]) ||
prefs_->IsManagedPreference(kPrefToManageType[content_type]));
base::AutoLock auto_lock(lock_);
int setting = prefs_->GetInteger(kPrefToManageType[content_type]);
if (setting == CONTENT_SETTING_DEFAULT) {
value_map_.DeleteValue(
ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
content_type,
std::string());
} else {
value_map_.SetValue(ContentSettingsPattern::Wildcard(),
ContentSettingsPattern::Wildcard(),
content_type,
std::string(),
new base::FundamentalValue(setting));
}
}
void PolicyProvider::ReadManagedContentSettings(bool overwrite) {
base::AutoLock auto_lock(lock_);
if (overwrite)
value_map_.clear();
GetContentSettingsFromPreferences(&value_map_);
GetAutoSelectCertificateSettingsFromPreferences(&value_map_);
}
// Since the PolicyProvider is a read only content settings provider, all
// methodes of the ProviderInterface that set or delete any settings do nothing.
bool PolicyProvider::SetWebsiteSetting(
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern,
ContentSettingsType content_type,
const ResourceIdentifier& resource_identifier,
base::Value* value) {
return false;
}
void PolicyProvider::ClearAllContentSettingsRules(
ContentSettingsType content_type) {
}
void PolicyProvider::ShutdownOnUIThread() {
DCHECK(CalledOnValidThread());
RemoveAllObservers();
if (!prefs_)
return;
pref_change_registrar_.RemoveAll();
prefs_ = NULL;
}
void PolicyProvider::OnPreferenceChanged(const std::string& name) {
DCHECK(CalledOnValidThread());
if (name == prefs::kManagedDefaultCookiesSetting) {
UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_COOKIES);
} else if (name == prefs::kManagedDefaultImagesSetting) {
UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_IMAGES);
} else if (name == prefs::kManagedDefaultJavaScriptSetting) {
UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_JAVASCRIPT);
} else if (name == prefs::kManagedDefaultPluginsSetting) {
UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_PLUGINS);
} else if (name == prefs::kManagedDefaultPopupsSetting) {
UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_POPUPS);
} else if (name == prefs::kManagedDefaultGeolocationSetting) {
UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_GEOLOCATION);
} else if (name == prefs::kManagedDefaultNotificationsSetting) {
UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
} else if (name == prefs::kManagedDefaultMediaStreamSetting) {
UpdateManagedDefaultSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM);
} else if (name == prefs::kManagedAutoSelectCertificateForUrls ||
name == prefs::kManagedCookiesAllowedForUrls ||
name == prefs::kManagedCookiesBlockedForUrls ||
name == prefs::kManagedCookiesSessionOnlyForUrls ||
name == prefs::kManagedImagesAllowedForUrls ||
name == prefs::kManagedImagesBlockedForUrls ||
name == prefs::kManagedJavaScriptAllowedForUrls ||
name == prefs::kManagedJavaScriptBlockedForUrls ||
name == prefs::kManagedPluginsAllowedForUrls ||
name == prefs::kManagedPluginsBlockedForUrls ||
name == prefs::kManagedPopupsAllowedForUrls ||
name == prefs::kManagedPopupsBlockedForUrls ||
name == prefs::kManagedNotificationsAllowedForUrls ||
name == prefs::kManagedNotificationsBlockedForUrls) {
ReadManagedContentSettings(true);
ReadManagedDefaultSettings();
}
NotifyObservers(ContentSettingsPattern(),
ContentSettingsPattern(),
CONTENT_SETTINGS_TYPE_DEFAULT,
std::string());
}
} // namespace content_settings
| [
"scottmg@chromium.org"
] | scottmg@chromium.org |
5553318b333ec594ca4f568dfcb949c1657c8dec | add3ceac089f89cccf992b27a84498a4cd4e1642 | /Tarea3_201602935/include/nodo.h | 73f3bcd7ca3a623737f88a60dbfdf9a0d6d505c0 | [] | no_license | loumisha96/EDD | 873068156f8b2fba1736d74d380674462df04ebe | 01937f07652385e3a64124b15abdebff82ae598a | refs/heads/master | 2020-06-23T04:34:47.121439 | 2019-08-21T05:23:56 | 2019-08-21T05:23:56 | 198,364,334 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 311 | h | #ifndef NODO_H
#define NODO_H
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
struct Dia{
string dia;
// nodo(dia);
Dia *sig;
};
struct Dias{
Dia *primero;
Dia *ultimo;
int tam ;
Dias();
void insertar(string dia);
void print();
};
#endif // NODO_H
| [
"lourdeslorenochoa@gmail.com"
] | lourdeslorenochoa@gmail.com |
a2c1203e55df44665a2ca676186f37f43dd95da7 | 5f07e7f91c713d42a38a1439072dae3e207df516 | /P3Examen1_PaulinaEuceda.cpp | 9d6e7ce5ff2e3e6fbfdc019199a88d00f40fbe16 | [
"MIT"
] | permissive | PaulinaEEF/P3Examen1_PaulinaEuceda | f999a5dd1155473708248a1bcf424396f1cb193d | 87c86b9877b4bb15a57e6240292d2120f28fbfbc | refs/heads/master | 2022-08-26T12:09:25.558777 | 2020-05-30T00:26:59 | 2020-05-30T00:26:59 | 267,935,045 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 7,502 | cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include "Empleado.cpp"
#include "Tarea.cpp"
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;
int main(int argc, char** argv) {
bool salida = true;
Empleado* objEmpleado =NULL;
vector<Empleado> empleados;
empleados.push_back(Empleado("Paulina", 18, 2, 54, 24, 0));
empleados.push_back(Empleado("Yuda", 21, 3, 71, 51, 0));
vector<Tarea> backlog;
backlog.push_back(Tarea("Crear MYPIMES", 1, 4));
backlog.push_back(Tarea("Crear Baleadas", 2, 8));
backlog.push_back(Tarea("Crear Choripanes", 3, 1));
bool salidaProyecto=false, inicioProyecto=false;
while(salida){
cout<<"1. Contratar empleado"<<endl
<<"2. Despedir empleado"<<endl
<<"3. Listar empleados"<<endl
<<"4. Crear tarea"<<endl
<<"5. Listar tareas"<<endl
<<"6. Iniciar proyecto"<<endl
<<"7. Salir"<<endl;
int menuPrincipal;
cout<<"Ingrese la opcion que desea: ";
cin >> menuPrincipal;
switch(menuPrincipal){
case 1:{
//string nombre, int edad, int nivel, int habilidad, int pereza
if(inicioProyecto==false){
string nombreRegistro;
int edad, nivel, habilidad, pereza;
cout<<"Escriba su nombre: ";
cin >> nombreRegistro;
cout<<"Escriba su edad: ";
cin >> edad;
while(edad<=0){
cout<<"No es un valor valido. Escriba su edad: ";
cin >> edad;
}
cout<<"Escriba su nivel [1-3]: ";
cin >> nivel;
while(nivel<1 || nivel>3){
cout<<"Rangos incorrectos. Escriba su nivel [1-3]: ";
cin >> nivel;
}
cout<<"Escriba el porcentaje de habilidad: ";
cin >> habilidad;
while(habilidad<0 || habilidad>100){
cout<<"No es un valor valido. Escriba el porcentaje de habilidad: ";
cin >> habilidad;
}
cout<<"Escriba el porcentaje pereza: ";
cin >> pereza;
while(pereza <0 || pereza > 100){
cout<<"No es un valor valido. Escriba el porcentaje de pereza: ";
cin >> pereza;
}
empleados.push_back(Empleado(nombreRegistro, edad, nivel, habilidad, pereza, 0));
}else{
cout<<"Hay un proyecto en ejecucion"<<endl;
}
break;
}
case 2:{
for(int i = 0; i<empleados.size(); i++){
cout<< i <<") "<<empleados[i].getNombre()<<", "<<empleados[i].getEdad()<<", "<<empleados[i].getNivel()<<", "<<empleados[i].getHabilidad()<<", "<<empleados[i].getPereza()<<endl;
}
int despedirPos;
cout <<endl <<"Elija a quien quiere despedir: ";
cin >> despedirPos;
while(despedirPos >= empleados.size()){
cout <<endl <<"Valor no valida. Elija a quien quiere despedir: ";
cin >> despedirPos;
}
empleados.erase(empleados.begin() + despedirPos);
break;
}
case 3:{
for(int i = 0; i<empleados.size(); i++){
cout<< empleados[i].getNombre()<<empleados[i].getEdad()<<empleados[i].getNivel()<<empleados[i].getHabilidad()<<empleados[i].getPereza()<<endl;
}
break;
}
case 4:{
if(inicioProyecto==false){
string descripcion;
int nivel, carga;
cout<<"Escriba la descripcion: ";
cin >> descripcion;
cout<<"Escriba el nivel [1-3]: ";
cin >> nivel;
while(nivel<1 || nivel>3){
cout<<"Rangos incorrectos. Escriba su nivel [1-3]: ";
cin >> nivel;
}
cout<<"Escriba la carga de tareas: ";
cin >> carga;
while(carga<=0){
cout<<"Ese numero no es valido. Escriba la carga de tareas: ";
cin >> carga;
}
backlog.push_back(Tarea(descripcion, nivel, carga));
}else{
cout<<"Hay un proyecto en ejecucion"<<endl;
}
break;
}
case 5:{
for(int i = 0; i<backlog.size(); i++){
cout<< backlog[i].getDescripcion()<<", "<<backlog[i].getNivel()<<", "<<backlog[i].getCarga()<<", "<<endl;
}
break;
}
case 6:{
if(backlog.size()>0){
int N=0;
for(int i = 0; i<backlog.size(); i++){
N+=backlog[i].getCarga();
}
int diasEsperados;
diasEsperados = N + N*0.2;
cout << "Dias esperados del proyecto: "<<diasEsperados<<endl;
salidaProyecto=true, inicioProyecto=true;
int opcionProyecto;
int numeroRandom, tareasRealizadas=0, tareasIniciales = backlog.size();
srand((unsigned)time(0));
int logrosEmpleados=0 ,fallosEmpleados=0, perezaEmpleados=0, tareasProgreso=0;
while(salidaProyecto){
cout<<endl<<endl;
cout<<"---Proyecto---"<<endl;
cout<<"1. Siguiente día"<<endl
<<"2. Generar reporte"<<endl
<<"3. Salir"<<endl
<<"Ingrese la opcion que desea: ";
cin >> opcionProyecto;
switch(opcionProyecto){
case 1:{
logrosEmpleados=0 ,fallosEmpleados=0, perezaEmpleados=0, tareasProgreso=0;
for(int i=0; i<empleados.size(); i++){
for(int j=0; j<backlog.size(); i++){
if(empleados[i].getEstado() == 0){
if(empleados[i].getNivel() >= backlog[j].getNivel()){
empleados[i].setTarea(backlog[j]);
backlog.erase(backlog.begin() + j);
empleados[i].setEstado(1);
break;
}
}else{
break;
}
}
}
for(int i=0; i<empleados.size(); i++){
numeroRandom = rand() % 100;
if(empleados[i].getTarea().getCarga() != 0){
if(empleados[i].getPereza() < numeroRandom){
if(empleados[i].getHabilidad()>=numeroRandom){
logrosEmpleados++;
empleados[i].ReducirDiasTarea();
cout<<"Habilidad: "<<empleados[i].getHabilidad()<<" Porcentaje: "<<numeroRandom<<endl;
if(empleados[i].getTarea().getCarga() == 0){
tareasRealizadas++;
empleados[i].setEstado(0);
cout<<endl<< "Se completo una tarea"<<endl;
}
}else{
fallosEmpleados++;
cout<<"Habilidad: "<<empleados[i].getHabilidad()<<" Porcentaje: "<<numeroRandom<<endl;
}
}else{
cout<<"Pereza: "<<empleados[i].getPereza()<<" Porcentaje: "<<numeroRandom<<endl;
perezaEmpleados++;
}
tareasProgreso++;
}
}
cout<<endl<<endl;
cout<<"Dias para terminar el proyecto: " << diasEsperados--<<endl;
break;
}
case 2:{
cout<<"Tareas en backlog: "<<backlog.size()<<endl
<<"Tareas en progeso: "<<tareasProgreso<<endl
<<"Empleados perezosos: "<<perezaEmpleados<<endl
<<"Empleados que fallaron: "<<fallosEmpleados<<endl
<<"Empleados que lograron el dia: "<<logrosEmpleados<<endl;
cout<<endl<<endl;
cout<<"Dias para terminar el proyecto: " << diasEsperados--<<endl;
break;
}
case 3:{
salidaProyecto = false;
break;
}
}
if(backlog.size()==0 && tareasRealizadas==tareasIniciales){
salidaProyecto = false;
cout<<"Adiosito"<<endl;
}
}
}else{
cout<<"No hay proyectos"<<endl;
}
break;
}
case 7:{
salida = false;
break;
}
}
cout<<endl;
cout<<endl;
}
delete objEmpleado;
return 0;
}
| [
"noheliaeucedaf@gmail.com"
] | noheliaeucedaf@gmail.com |
36d6ae099a62c886d13f76a425e93d4ccb3b9d73 | 339aca423e73308b8e87ebd5553081eed46d10fb | /include/algorithm/max_element.cc | e00802a22e31399e1e4e3d8d4c145716f123dfd9 | [] | no_license | wuhongyi/TechnicalReserves | 26aa44b067a6cc898eba8088c6f36300f5b6bb4f | 2f3148942633a2b9731e88735f3b652056f811f4 | refs/heads/master | 2021-06-26T08:56:39.492125 | 2019-05-18T09:53:32 | 2019-05-18T09:53:32 | 135,350,605 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,290 | cc | // max_element.cc ---
//
// Description:
// Author: Hongyi Wu(吴鸿毅)
// Email: wuhongyi@qq.com
// Created: 日 5月 24 17:02:42 2015 (+0800)
// Last-Updated: 日 5月 24 17:03:05 2015 (+0800)
// By: Hongyi Wu(吴鸿毅)
// Update #: 1
// URL: http://wuhongyi.cn
// min_element/max_element example
#include <iostream> // std::cout
#include <algorithm> // std::min_element, std::max_element
bool myfn(int i, int j) { return i<j; }
struct myclass {
bool operator() (int i,int j) { return i<j; }
} myobj;
int main () {
int myints[] = {3,7,2,5,6,4,9};
// using default comparison:
std::cout << "The smallest element is " << *std::min_element(myints,myints+7) << '\n';
std::cout << "The largest element is " << *std::max_element(myints,myints+7) << '\n';
// using function myfn as comp:
std::cout << "The smallest element is " << *std::min_element(myints,myints+7,myfn) << '\n';
std::cout << "The largest element is " << *std::max_element(myints,myints+7,myfn) << '\n';
// using object myobj as comp:
std::cout << "The smallest element is " << *std::min_element(myints,myints+7,myobj) << '\n';
std::cout << "The largest element is " << *std::max_element(myints,myints+7,myobj) << '\n';
return 0;
}
//
// max_element.cc ends here
| [
"81845742@qq.com"
] | 81845742@qq.com |
b435326b828636ad14e63855870bd961fc29a8e7 | be6034591b8cb67e47d74c052098f97df607a06e | /src/ngraph/runtime/plaidml/plaidml_logger.cpp | b76bf5a98c97038da2c6a73923809c9ca0065afd | [
"Apache-2.0"
] | permissive | huningxin/ngraph | ebf17fc722a92a221187fb193dfe7c0657a31a7a | 28622bdea4b4ad84405b8484b31673ae7d31cf76 | refs/heads/master | 2020-04-12T09:24:07.502933 | 2018-12-18T17:14:20 | 2018-12-18T17:14:20 | 162,401,238 | 0 | 0 | Apache-2.0 | 2018-12-19T07:46:01 | 2018-12-19T07:46:00 | null | UTF-8 | C++ | false | false | 1,875 | cpp | //*****************************************************************************
// Copyright 2017-2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#include <plaidml/plaidml++.h>
#include "ngraph/log.hpp"
#include "ngraph/runtime/plaidml/plaidml_logger.hpp"
namespace
{
void logger(void* debug, vai_log_severity severity, const char* message)
{
switch (severity)
{
case VAI_LOG_SEVERITY_VERBOSE:
case VAI_LOG_SEVERITY_TRACE:
case VAI_LOG_SEVERITY_DEBUG:
if (debug)
{
PLAIDML_DEBUG << message;
}
return;
case VAI_LOG_SEVERITY_INFO:
// We treat PlaidML info-level logs as nGraph debug-level logs, since we expect that
// most nGraph users think of PlaidML details as debugging information.
if (debug)
{
PLAIDML_DEBUG << message;
}
return;
case VAI_LOG_SEVERITY_WARNING: NGRAPH_WARN << message; return;
case VAI_LOG_SEVERITY_ERROR:
default: NGRAPH_ERR << message; return;
}
}
}
void ngraph::runtime::plaidml::configure_plaidml_logger(bool debug)
{
vai_set_logger(&logger, reinterpret_cast<void*>(debug ? 1 : 0));
}
| [
"robert.kimball@intel.com"
] | robert.kimball@intel.com |
11cc05c46045cd862b909caa667f2c0611b03c6e | 72bba1e25ac60432d40a6ce4aaf404dd53fe1fc4 | /src/Homie/Datatypes/Interface.hpp | 1c95b23f8669b33a1fa2a0dd5b0fe1076dd927e2 | [
"MIT"
] | permissive | eprzenic/homie-esp8266 | e9186ab12084faf35ed33d67f671fb66e84ee611 | 06e32c058bee12cb67b925913820d520d6af1989 | refs/heads/master | 2021-01-15T09:03:31.793746 | 2016-03-29T14:41:07 | 2016-03-29T14:41:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 973 | hpp | #pragma once
#include "../Limits.hpp"
#include "./Callbacks.hpp"
#include "../../HomieNode.h"
#include "../../HomieEvent.h"
namespace HomieInternals {
struct Interface {
/***** User configurable data *****/
char brand[MAX_BRAND_LENGTH];
struct Firmware {
char name[MAX_FIRMWARE_NAME_LENGTH];
char version[MAX_FIRMWARE_VERSION_LENGTH];
} firmware;
struct LED {
bool enable;
unsigned char pin;
byte on;
} led;
struct Reset {
bool enable;
bool able;
unsigned char triggerPin;
byte triggerState;
unsigned int triggerTime;
ResetFunction userFunction;
} reset;
HomieNode* registeredNodes[MAX_REGISTERED_NODES_COUNT];
unsigned char registeredNodesCount;
GlobalInputHandler globalInputHandler;
OperationFunction setupFunction;
OperationFunction loopFunction;
EventHandler eventHandler;
/***** Runtime data *****/
bool readyToOperate;
};
}
| [
"nivramdu94@gmail.com"
] | nivramdu94@gmail.com |
5f34495379e5f75fd21481d086126db742206471 | 8cf4166877ef1929ab680add3744da32bfa94a3a | /sources/LongForgottenEarth/Gradient.h | ecc990306f35f4bed4357fe9dc4ab0e1ff965fcc | [
"MIT"
] | permissive | Sphinkie/LongForgottenEarth | de14f9401b50c1ecb8f87141e2b51993457523d3 | 9008e4381091579e38feee03c56c5e3435419474 | refs/heads/master | 2022-12-16T01:35:57.807501 | 2020-09-16T20:07:00 | 2020-09-16T20:07:00 | 293,591,655 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,305 | h | /* ------------------------------------------------------------------------- */
// File : Gradient.h
// Project : Long Forgotten Earth
// Author : David de Lorenzo
/* ------------------------------------------------------------------------- */
#ifndef _GRADIENT_H_
#define _GRADIENT_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include "ogre.h"
#include "XMLparser_T.h"
using namespace Ogre;
/* ------------------------------------------------------------------------- */
/// Analyse un fichier gradient au format SVG.
/* ------------------------------------------------------------------------- */
class Gradient
{
public:
Gradient(String SVGfilename);
~Gradient();
ColourValue getGradient(int stop_n);
Real getOffset(int stop_n);
ColourValue getColour(Real G_offset);
ColourValue getNextGradient();
Real getLastOffset();
protected:
XMLParser_T* mSVGfile; /// Fichier de gradients de couleur
int mIndex; /// Index des elements stop dans le fichier SVG.
Real mLastOffset; /// La valeur de l'offset du dernier gradient (ou "stop") lu.
bool openGradientFile(String SVGfilename);
void closeGradientFile();
ColourValue parseRGB1(String colorString);
ColourValue parseRGB2(String colorString);
Ogre::uint8 dec(char C);
};
#endif
| [
"de.lorenzo.david@gmail.com"
] | de.lorenzo.david@gmail.com |
3e771e27adec017bcb38470ca847b739d2a367c6 | fb653a222497d03db916b84824bebaf98cf302bb | /src/wallet.cpp | 7e9a32ae09d51234c03187302ed10a13d009165c | [
"MIT"
] | permissive | bumbacoin/CommunityCoin1.5.1 | e3581f7ca06e06d6c86118ab54164d1836002720 | 59edc82ed438d5f0036fab66b879cadca768cbb1 | refs/heads/master | 2021-01-13T14:20:11.965494 | 2015-07-22T09:30:03 | 2015-07-22T09:30:03 | 37,983,671 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 79,274 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "main.h"
#include "wallet.h"
#include "walletdb.h"
#include "crypter.h"
#include "ui_interface.h"
#include "base58.h"
#include "kernel.h"
#include <boost/algorithm/string.hpp>
using namespace std;
extern int nStakeMaxAge;
unsigned int nStakeSplitAge = 60 * 60 * 24 * 30;
int64_t nStakeCombineThreshold = 1000 * COIN;
//////////////////////////////////////////////////////////////////////////////
//
// mapWallet
//
struct CompareValueOnly
{
bool operator()(const pair<int64, pair<const CWalletTx*, unsigned int> >& t1,
const pair<int64, pair<const CWalletTx*, unsigned int> >& t2) const
{
return t1.first < t2.first;
}
};
CPubKey CWallet::GenerateNewKey()
{
bool fCompressed = CanSupportFeature(FEATURE_COMPRPUBKEY); // default to compressed public keys if we want 0.6.0 wallets
RandAddSeedPerfmon();
CKey key;
key.MakeNewKey(fCompressed);
// Compressed public keys were introduced in version 0.6.0
if (fCompressed)
SetMinVersion(FEATURE_COMPRPUBKEY);
if (!AddKey(key))
throw std::runtime_error("CWallet::GenerateNewKey() : AddKey failed");
return key.GetPubKey();
}
bool CWallet::AddKey(const CKey& key)
{
if (!CCryptoKeyStore::AddKey(key))
return false;
if (!fFileBacked)
return true;
if (!IsCrypted())
return CWalletDB(strWalletFile).WriteKey(key.GetPubKey(), key.GetPrivKey());
return true;
}
bool CWallet::AddCryptedKey(const CPubKey &vchPubKey, const vector<unsigned char> &vchCryptedSecret)
{
if (!CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret))
return false;
if (!fFileBacked)
return true;
{
LOCK(cs_wallet);
if (pwalletdbEncryption)
return pwalletdbEncryption->WriteCryptedKey(vchPubKey, vchCryptedSecret);
else
return CWalletDB(strWalletFile).WriteCryptedKey(vchPubKey, vchCryptedSecret);
}
return false;
}
bool CWallet::AddCScript(const CScript& redeemScript)
{
if (!CCryptoKeyStore::AddCScript(redeemScript))
return false;
if (!fFileBacked)
return true;
return CWalletDB(strWalletFile).WriteCScript(Hash160(redeemScript), redeemScript);
}
// ppcoin: optional setting to unlock wallet for block minting only;
// serves to disable the trivial sendmoney when OS account compromised
bool fWalletUnlockMintOnly = false;
bool CWallet::Unlock(const SecureString& strWalletPassphrase)
{
if (!IsLocked())
return false;
CCrypter crypter;
CKeyingMaterial vMasterKey;
{
LOCK(cs_wallet);
BOOST_FOREACH(const MasterKeyMap::value_type& pMasterKey, mapMasterKeys)
{
if(!crypter.SetKeyFromPassphrase(strWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
return false;
if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey))
return false;
if (CCryptoKeyStore::Unlock(vMasterKey))
return true;
}
}
return false;
}
bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase)
{
bool fWasLocked = IsLocked();
{
LOCK(cs_wallet);
Lock();
CCrypter crypter;
CKeyingMaterial vMasterKey;
BOOST_FOREACH(MasterKeyMap::value_type& pMasterKey, mapMasterKeys)
{
if(!crypter.SetKeyFromPassphrase(strOldWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
return false;
if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey))
return false;
if (CCryptoKeyStore::Unlock(vMasterKey))
{
int64 nStartTime = GetTimeMillis();
crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod);
pMasterKey.second.nDeriveIterations = pMasterKey.second.nDeriveIterations * (100 / ((double)(GetTimeMillis() - nStartTime)));
nStartTime = GetTimeMillis();
crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod);
pMasterKey.second.nDeriveIterations = (pMasterKey.second.nDeriveIterations + pMasterKey.second.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2;
if (pMasterKey.second.nDeriveIterations < 25000)
pMasterKey.second.nDeriveIterations = 25000;
printf("Wallet passphrase changed to an nDeriveIterations of %i\n", pMasterKey.second.nDeriveIterations);
if (!crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
return false;
if (!crypter.Encrypt(vMasterKey, pMasterKey.second.vchCryptedKey))
return false;
CWalletDB(strWalletFile).WriteMasterKey(pMasterKey.first, pMasterKey.second);
if (fWasLocked)
Lock();
return true;
}
}
}
return false;
}
void CWallet::SetBestChain(const CBlockLocator& loc)
{
CWalletDB walletdb(strWalletFile);
walletdb.WriteBestBlock(loc);
}
// This class implements an addrIncoming entry that causes pre-0.4
// clients to crash on startup if reading a private-key-encrypted wallet.
class CCorruptAddress
{
public:
IMPLEMENT_SERIALIZE
(
if (nType & SER_DISK)
READWRITE(nVersion);
)
};
bool CWallet::SetMinVersion(enum WalletFeature nVersion, CWalletDB* pwalletdbIn, bool fExplicit)
{
if (nWalletVersion >= nVersion)
return true;
// when doing an explicit upgrade, if we pass the max version permitted, upgrade all the way
if (fExplicit && nVersion > nWalletMaxVersion)
nVersion = FEATURE_LATEST;
nWalletVersion = nVersion;
if (nVersion > nWalletMaxVersion)
nWalletMaxVersion = nVersion;
if (fFileBacked)
{
CWalletDB* pwalletdb = pwalletdbIn ? pwalletdbIn : new CWalletDB(strWalletFile);
if (nWalletVersion >= 40000)
{
// Versions prior to 0.4.0 did not support the "minversion" record.
// Use a CCorruptAddress to make them crash instead.
CCorruptAddress corruptAddress;
pwalletdb->WriteSetting("addrIncoming", corruptAddress);
}
if (nWalletVersion > 40000)
pwalletdb->WriteMinVersion(nWalletVersion);
if (!pwalletdbIn)
delete pwalletdb;
}
return true;
}
bool CWallet::SetMaxVersion(int nVersion)
{
// cannot downgrade below current version
if (nWalletVersion > nVersion)
return false;
nWalletMaxVersion = nVersion;
return true;
}
bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
{
if (IsCrypted())
return false;
CKeyingMaterial vMasterKey;
RandAddSeedPerfmon();
vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE);
RAND_bytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE);
CMasterKey kMasterKey;
RandAddSeedPerfmon();
kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE);
RAND_bytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE);
CCrypter crypter;
int64 nStartTime = GetTimeMillis();
crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, 25000, kMasterKey.nDerivationMethod);
kMasterKey.nDeriveIterations = 2500000 / ((double)(GetTimeMillis() - nStartTime));
nStartTime = GetTimeMillis();
crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod);
kMasterKey.nDeriveIterations = (kMasterKey.nDeriveIterations + kMasterKey.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2;
if (kMasterKey.nDeriveIterations < 25000)
kMasterKey.nDeriveIterations = 25000;
printf("Encrypting Wallet with an nDeriveIterations of %i\n", kMasterKey.nDeriveIterations);
if (!crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod))
return false;
if (!crypter.Encrypt(vMasterKey, kMasterKey.vchCryptedKey))
return false;
{
LOCK(cs_wallet);
mapMasterKeys[++nMasterKeyMaxID] = kMasterKey;
if (fFileBacked)
{
pwalletdbEncryption = new CWalletDB(strWalletFile);
if (!pwalletdbEncryption->TxnBegin())
return false;
pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey);
}
if (!EncryptKeys(vMasterKey))
{
if (fFileBacked)
pwalletdbEncryption->TxnAbort();
exit(1); //We now probably have half of our keys encrypted in memory, and half not...die and let the user reload their unencrypted wallet.
}
// Encryption was introduced in version 0.4.0
SetMinVersion(FEATURE_WALLETCRYPT, pwalletdbEncryption, true);
if (fFileBacked)
{
if (!pwalletdbEncryption->TxnCommit())
exit(1); //We now have keys encrypted in memory, but no on disk...die to avoid confusion and let the user reload their unencrypted wallet.
delete pwalletdbEncryption;
pwalletdbEncryption = NULL;
}
Lock();
Unlock(strWalletPassphrase);
NewKeyPool();
Lock();
// Need to completely rewrite the wallet file; if we don't, bdb might keep
// bits of the unencrypted private key in slack space in the database file.
CDB::Rewrite(strWalletFile);
}
NotifyStatusChanged(this);
return true;
}
int64 CWallet::IncOrderPosNext(CWalletDB *pwalletdb)
{
int64 nRet = nOrderPosNext++;
if (pwalletdb) {
pwalletdb->WriteOrderPosNext(nOrderPosNext);
} else {
CWalletDB(strWalletFile).WriteOrderPosNext(nOrderPosNext);
}
return nRet;
}
CWallet::TxItems CWallet::OrderedTxItems(std::list<CAccountingEntry>& acentries, std::string strAccount)
{
CWalletDB walletdb(strWalletFile);
// First: get all CWalletTx and CAccountingEntry into a sorted-by-order multimap.
TxItems txOrdered;
// Note: maintaining indices in the database of (account,time) --> txid and (account, time) --> acentry
// would make this much faster for applications that do this a lot.
for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
CWalletTx* wtx = &((*it).second);
txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0)));
}
acentries.clear();
walletdb.ListAccountCreditDebit(strAccount, acentries);
BOOST_FOREACH(CAccountingEntry& entry, acentries)
{
txOrdered.insert(make_pair(entry.nOrderPos, TxPair((CWalletTx*)0, &entry)));
}
return txOrdered;
}
void CWallet::WalletUpdateSpent(const CTransaction &tx)
{
// Anytime a signature is successfully verified, it's proof the outpoint is spent.
// Update the wallet spent flag if it doesn't know due to wallet.dat being
// restored from backup or the user making copies of wallet.dat.
{
LOCK(cs_wallet);
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
map<uint256, CWalletTx>::iterator mi = mapWallet.find(txin.prevout.hash);
if (mi != mapWallet.end())
{
CWalletTx& wtx = (*mi).second;
if (txin.prevout.n >= wtx.vout.size())
printf("WalletUpdateSpent: bad wtx %s\n", wtx.GetHash().ToString().c_str());
else if (!wtx.IsSpent(txin.prevout.n) && IsMine(wtx.vout[txin.prevout.n]))
{
printf("WalletUpdateSpent found spent coin %s C2OMM %s\n", FormatMoney(wtx.GetCredit()).c_str(), wtx.GetHash().ToString().c_str());
wtx.MarkSpent(txin.prevout.n);
wtx.WriteToDisk();
NotifyTransactionChanged(this, txin.prevout.hash, CT_UPDATED);
}
}
}
}
}
void CWallet::MarkDirty()
{
{
LOCK(cs_wallet);
BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
item.second.MarkDirty();
}
}
bool CWallet::AddToWallet(const CWalletTx& wtxIn)
{
uint256 hash = wtxIn.GetHash();
{
LOCK(cs_wallet);
// Inserts only if not already there, returns tx inserted or tx found
pair<map<uint256, CWalletTx>::iterator, bool> ret = mapWallet.insert(make_pair(hash, wtxIn));
CWalletTx& wtx = (*ret.first).second;
wtx.BindWallet(this);
bool fInsertedNew = ret.second;
if (fInsertedNew)
{
wtx.nTimeReceived = GetAdjustedTime();
wtx.nOrderPos = IncOrderPosNext();
wtx.nTimeSmart = wtx.nTimeReceived;
if (wtxIn.hashBlock != 0)
{
if (mapBlockIndex.count(wtxIn.hashBlock))
{
unsigned int latestNow = wtx.nTimeReceived;
unsigned int latestEntry = 0;
{
// Tolerate times up to the last timestamp in the wallet not more than 5 minutes into the future
int64 latestTolerated = latestNow + 300;
std::list<CAccountingEntry> acentries;
TxItems txOrdered = OrderedTxItems(acentries);
for (TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;
if (pwtx == &wtx)
continue;
CAccountingEntry *const pacentry = (*it).second.second;
int64 nSmartTime;
if (pwtx)
{
nSmartTime = pwtx->nTimeSmart;
if (!nSmartTime)
nSmartTime = pwtx->nTimeReceived;
}
else
nSmartTime = pacentry->nTime;
if (nSmartTime <= latestTolerated)
{
latestEntry = nSmartTime;
if (nSmartTime > latestNow)
latestNow = nSmartTime;
break;
}
}
}
unsigned int& blocktime = mapBlockIndex[wtxIn.hashBlock]->nTime;
wtx.nTimeSmart = std::max(latestEntry, std::min(blocktime, latestNow));
}
else
printf("AddToWallet() : found %s in block %s not in index\n",
wtxIn.GetHash().ToString().substr(0,10).c_str(),
wtxIn.hashBlock.ToString().c_str());
}
}
bool fUpdated = false;
if (!fInsertedNew)
{
// Merge
if (wtxIn.hashBlock != 0 && wtxIn.hashBlock != wtx.hashBlock)
{
wtx.hashBlock = wtxIn.hashBlock;
fUpdated = true;
}
if (wtxIn.nIndex != -1 && (wtxIn.vMerkleBranch != wtx.vMerkleBranch || wtxIn.nIndex != wtx.nIndex))
{
wtx.vMerkleBranch = wtxIn.vMerkleBranch;
wtx.nIndex = wtxIn.nIndex;
fUpdated = true;
}
if (wtxIn.fFromMe && wtxIn.fFromMe != wtx.fFromMe)
{
wtx.fFromMe = wtxIn.fFromMe;
fUpdated = true;
}
fUpdated |= wtx.UpdateSpent(wtxIn.vfSpent);
}
//// debug print
printf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString().substr(0,10).c_str(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : ""));
// Write to disk
if (fInsertedNew || fUpdated)
if (!wtx.WriteToDisk())
return false;
#ifndef QT_GUI
// If default receiving address gets used, replace it with a new one
CScript scriptDefaultKey;
scriptDefaultKey.SetDestination(vchDefaultKey.GetID());
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
if (txout.scriptPubKey == scriptDefaultKey)
{
CPubKey newDefaultKey;
if (GetKeyFromPool(newDefaultKey, false))
{
SetDefaultKey(newDefaultKey);
SetAddressBookName(vchDefaultKey.GetID(), "");
}
}
}
#endif
// since AddToWallet is called directly for self-originating transactions, check for consumption of own coins
WalletUpdateSpent(wtx);
// Notify UI of new or updated transaction
NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED);
// notify an external script when a wallet transaction comes in or is updated
std::string strCmd = GetArg("-walletnotify", "");
if ( !strCmd.empty())
{
boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());
boost::thread t(runCommand, strCmd); // thread runs free
}
}
return true;
}
// Add a transaction to the wallet, or update it.
// pblock is optional, but should be provided if the transaction is known to be in a block.
// If fUpdate is true, existing transactions will be updated.
bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate, bool fFindBlock)
{
uint256 hash = tx.GetHash();
{
LOCK(cs_wallet);
bool fExisted = mapWallet.count(hash);
if (fExisted && !fUpdate) return false;
if (fExisted || IsMine(tx) || IsFromMe(tx))
{
CWalletTx wtx(this,tx);
// Get merkle branch if transaction was found in a block
if (pblock)
wtx.SetMerkleBranch(pblock);
return AddToWallet(wtx);
}
else
WalletUpdateSpent(tx);
}
return false;
}
bool CWallet::EraseFromWallet(uint256 hash)
{
if (!fFileBacked)
return false;
{
LOCK(cs_wallet);
if (mapWallet.erase(hash))
CWalletDB(strWalletFile).EraseTx(hash);
}
return true;
}
bool CWallet::IsMine(const CTxIn &txin) const
{
{
LOCK(cs_wallet);
map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
if (mi != mapWallet.end())
{
const CWalletTx& prev = (*mi).second;
if (txin.prevout.n < prev.vout.size())
if (IsMine(prev.vout[txin.prevout.n]))
return true;
}
}
return false;
}
int64 CWallet::GetDebit(const CTxIn &txin) const
{
{
LOCK(cs_wallet);
map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
if (mi != mapWallet.end())
{
const CWalletTx& prev = (*mi).second;
if (txin.prevout.n < prev.vout.size())
if (IsMine(prev.vout[txin.prevout.n]))
return prev.vout[txin.prevout.n].nValue;
}
}
return 0;
}
bool CWallet::IsChange(const CTxOut& txout) const
{
CTxDestination address;
// TODO: fix handling of 'change' outputs. The assumption is that any
// payment to a TX_PUBKEYHASH that is mine but isn't in the address book
// is change. That assumption is likely to break when we implement multisignature
// wallets that return change back into a multi-signature-protected address;
// a better way of identifying which outputs are 'the send' and which are
// 'the change' will need to be implemented (maybe extend CWalletTx to remember
// which output, if any, was change).
if (ExtractDestination(txout.scriptPubKey, address) && ::IsMine(*this, address))
{
LOCK(cs_wallet);
if (!mapAddressBook.count(address))
return true;
}
return false;
}
int64 CWalletTx::GetTxTime() const
{
int64 n = nTimeSmart;
return n ? n : nTimeReceived;
}
int CWalletTx::GetRequestCount() const
{
// Returns -1 if it wasn't being tracked
int nRequests = -1;
{
LOCK(pwallet->cs_wallet);
if (IsCoinBase() || IsCoinStake())
{
// Generated block
if (hashBlock != 0)
{
map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock);
if (mi != pwallet->mapRequestCount.end())
nRequests = (*mi).second;
}
}
else
{
// Did anyone request this transaction?
map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(GetHash());
if (mi != pwallet->mapRequestCount.end())
{
nRequests = (*mi).second;
// How about the block it's in?
if (nRequests == 0 && hashBlock != 0)
{
map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock);
if (mi != pwallet->mapRequestCount.end())
nRequests = (*mi).second;
else
nRequests = 1; // If it's in someone else's block it must have got out
}
}
}
}
return nRequests;
}
void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, list<pair<CTxDestination, int64> >& listReceived,
list<pair<CTxDestination, int64> >& listSent, int64& nFee, string& strSentAccount) const
{
nGeneratedImmature = nGeneratedMature = nFee = 0;
listReceived.clear();
listSent.clear();
strSentAccount = strFromAccount;
if (IsCoinBase() || IsCoinStake())
{
if (GetBlocksToMaturity() > 0)
nGeneratedImmature = pwallet->GetCredit(*this);
else
nGeneratedMature = GetCredit();
return;
}
// Compute fee:
int64 nDebit = GetDebit();
if (nDebit > 0) // debit>0 means we signed/sent this transaction
{
int64 nValueOut = GetValueOut();
nFee = nDebit - nValueOut;
}
// Sent/received.
BOOST_FOREACH(const CTxOut& txout, vout)
{
CTxDestination address;
vector<unsigned char> vchPubKey;
if (!ExtractDestination(txout.scriptPubKey, address))
{
printf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n",
this->GetHash().ToString().c_str());
}
// Don't report 'change' txouts
if (nDebit > 0 && pwallet->IsChange(txout))
continue;
if (nDebit > 0)
listSent.push_back(make_pair(address, txout.nValue));
if (pwallet->IsMine(txout))
listReceived.push_back(make_pair(address, txout.nValue));
}
}
void CWalletTx::GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived,
int64& nSent, int64& nFee) const
{
nGenerated = nReceived = nSent = nFee = 0;
int64 allGeneratedImmature, allGeneratedMature, allFee;
string strSentAccount;
list<pair<CTxDestination, int64> > listReceived;
list<pair<CTxDestination, int64> > listSent;
GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount);
if (strAccount == "")
nGenerated = allGeneratedMature;
if (strAccount == strSentAccount)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& s, listSent)
nSent += s.second;
nFee = allFee;
nGenerated = allGeneratedMature;
}
{
LOCK(pwallet->cs_wallet);
BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& r, listReceived)
{
if (pwallet->mapAddressBook.count(r.first))
{
map<CTxDestination, string>::const_iterator mi = pwallet->mapAddressBook.find(r.first);
if (mi != pwallet->mapAddressBook.end() && (*mi).second == strAccount)
nReceived += r.second;
}
else if (strAccount.empty())
{
nReceived += r.second;
}
}
}
}
void CWalletTx::AddSupportingTransactions(CTxDB& txdb)
{
vtxPrev.clear();
const int COPY_DEPTH = 3;
if (SetMerkleBranch() < COPY_DEPTH)
{
vector<uint256> vWorkQueue;
BOOST_FOREACH(const CTxIn& txin, vin)
vWorkQueue.push_back(txin.prevout.hash);
// This critsect is OK because txdb is already open
{
LOCK(pwallet->cs_wallet);
map<uint256, const CMerkleTx*> mapWalletPrev;
set<uint256> setAlreadyDone;
for (unsigned int i = 0; i < vWorkQueue.size(); i++)
{
uint256 hash = vWorkQueue[i];
if (setAlreadyDone.count(hash))
continue;
setAlreadyDone.insert(hash);
CMerkleTx tx;
map<uint256, CWalletTx>::const_iterator mi = pwallet->mapWallet.find(hash);
if (mi != pwallet->mapWallet.end())
{
tx = (*mi).second;
BOOST_FOREACH(const CMerkleTx& txWalletPrev, (*mi).second.vtxPrev)
mapWalletPrev[txWalletPrev.GetHash()] = &txWalletPrev;
}
else if (mapWalletPrev.count(hash))
{
tx = *mapWalletPrev[hash];
}
else if (!fClient && txdb.ReadDiskTx(hash, tx))
{
;
}
else
{
printf("ERROR: AddSupportingTransactions() : unsupported transaction\n");
continue;
}
int nDepth = tx.SetMerkleBranch();
vtxPrev.push_back(tx);
if (nDepth < COPY_DEPTH)
{
BOOST_FOREACH(const CTxIn& txin, tx.vin)
vWorkQueue.push_back(txin.prevout.hash);
}
}
}
}
reverse(vtxPrev.begin(), vtxPrev.end());
}
bool CWalletTx::WriteToDisk()
{
return CWalletDB(pwallet->strWalletFile).WriteTx(GetHash(), *this);
}
// Scan the block chain (starting in pindexStart) for transactions
// from or to us. If fUpdate is true, found transactions that already
// exist in the wallet will be updated.
int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
{
int ret = 0;
CBlockIndex* pindex = pindexStart;
{
LOCK(cs_wallet);
while (pindex)
{
CBlock block;
block.ReadFromDisk(pindex, true);
BOOST_FOREACH(CTransaction& tx, block.vtx)
{
if (AddToWalletIfInvolvingMe(tx, &block, fUpdate))
ret++;
}
pindex = pindex->pnext;
}
}
return ret;
}
int CWallet::ScanForWalletTransaction(const uint256& hashTx)
{
CTransaction tx;
tx.ReadFromDisk(COutPoint(hashTx, 0));
if (AddToWalletIfInvolvingMe(tx, NULL, true, true))
return 1;
return 0;
}
void CWallet::ReacceptWalletTransactions()
{
CTxDB txdb("r");
bool fRepeat = true;
while (fRepeat)
{
LOCK(cs_wallet);
fRepeat = false;
vector<CDiskTxPos> vMissingTx;
BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
{
CWalletTx& wtx = item.second;
if ((wtx.IsCoinBase() && wtx.IsSpent(0)) || (wtx.IsCoinStake() && wtx.IsSpent(1)))
continue;
CTxIndex txindex;
bool fUpdated = false;
if (txdb.ReadTxIndex(wtx.GetHash(), txindex))
{
// Update fSpent if a tx got spent somewhere else by a copy of wallet.dat
if (txindex.vSpent.size() != wtx.vout.size())
{
printf("ERROR: ReacceptWalletTransactions() : txindex.vSpent.size() %"PRIszu" != wtx.vout.size() %"PRIszu"\n", txindex.vSpent.size(), wtx.vout.size());
continue;
}
for (unsigned int i = 0; i < txindex.vSpent.size(); i++)
{
if (wtx.IsSpent(i))
continue;
if (!txindex.vSpent[i].IsNull() && IsMine(wtx.vout[i]))
{
wtx.MarkSpent(i);
fUpdated = true;
vMissingTx.push_back(txindex.vSpent[i]);
}
}
if (fUpdated)
{
printf("ReacceptWalletTransactions found spent coin %snvc %s\n", FormatMoney(wtx.GetCredit()).c_str(), wtx.GetHash().ToString().c_str());
wtx.MarkDirty();
wtx.WriteToDisk();
}
}
else
{
// Re-accept any txes of ours that aren't already in a block
if (!(wtx.IsCoinBase() || wtx.IsCoinStake()))
wtx.AcceptWalletTransaction(txdb, false);
}
}
if (!vMissingTx.empty())
{
// TODO: optimize this to scan just part of the block chain?
if (ScanForWalletTransactions(pindexGenesisBlock))
fRepeat = true; // Found missing transactions: re-do re-accept.
}
}
}
void CWalletTx::RelayWalletTransaction(CTxDB& txdb)
{
BOOST_FOREACH(const CMerkleTx& tx, vtxPrev)
{
if (!(tx.IsCoinBase() || tx.IsCoinStake()))
{
uint256 hash = tx.GetHash();
if (!txdb.ContainsTx(hash))
RelayMessage(CInv(MSG_TX, hash), (CTransaction)tx);
}
}
if (!(IsCoinBase() || IsCoinStake()))
{
uint256 hash = GetHash();
if (!txdb.ContainsTx(hash))
{
printf("Relaying wtx %s\n", hash.ToString().substr(0,10).c_str());
RelayMessage(CInv(MSG_TX, hash), (CTransaction)*this);
}
}
}
void CWalletTx::RelayWalletTransaction()
{
CTxDB txdb("r");
RelayWalletTransaction(txdb);
}
void CWallet::ResendWalletTransactions()
{
// Do this infrequently and randomly to avoid giving away
// that these are our transactions.
static int64 nNextTime;
if (GetTime() < nNextTime)
return;
bool fFirst = (nNextTime == 0);
nNextTime = GetTime() + GetRand(30 * 60);
if (fFirst)
return;
// Only do it if there's been a new block since last time
static int64 nLastTime;
if (nTimeBestReceived < nLastTime)
return;
nLastTime = GetTime();
// Rebroadcast any of our txes that aren't in a block yet
printf("ResendWalletTransactions()\n");
CTxDB txdb("r");
{
LOCK(cs_wallet);
// Sort them in chronological order
multimap<unsigned int, CWalletTx*> mapSorted;
BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
{
CWalletTx& wtx = item.second;
// Don't rebroadcast until it's had plenty of time that
// it should have gotten in already by now.
if (nTimeBestReceived - (int64)wtx.nTimeReceived > 5 * 60)
mapSorted.insert(make_pair(wtx.nTimeReceived, &wtx));
}
BOOST_FOREACH(PAIRTYPE(const unsigned int, CWalletTx*)& item, mapSorted)
{
CWalletTx& wtx = *item.second;
if (wtx.CheckTransaction())
wtx.RelayWalletTransaction(txdb);
else
printf("ResendWalletTransactions() : CheckTransaction failed for transaction %s\n", wtx.GetHash().ToString().c_str());
}
}
}
//////////////////////////////////////////////////////////////////////////////
//
// Actions
//
int64 CWallet::GetBalance() const
{
int64 nTotal = 0;
{
LOCK(cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;
if (pcoin->IsFinal() && pcoin->IsConfirmed())
nTotal += pcoin->GetAvailableCredit();
}
}
return nTotal;
}
int64 CWallet::GetUnconfirmedBalance() const
{
int64 nTotal = 0;
{
LOCK(cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;
if (!pcoin->IsFinal() || !pcoin->IsConfirmed())
nTotal += pcoin->GetAvailableCredit();
}
}
return nTotal;
}
int64 CWallet::GetImmatureBalance() const
{
int64 nTotal = 0;
{
LOCK(cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx& pcoin = (*it).second;
if (pcoin.IsCoinBase() && pcoin.GetBlocksToMaturity() > 0 && pcoin.IsInMainChain())
nTotal += GetCredit(pcoin);
}
}
return nTotal;
}
// populate vCoins with vector of spendable COutputs
void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed) const
{
vCoins.clear();
{
LOCK(cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;
if (!pcoin->IsFinal())
continue;
if (fOnlyConfirmed && !pcoin->IsConfirmed())
continue;
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
continue;
if(pcoin->IsCoinStake() && pcoin->GetBlocksToMaturity() > 0)
continue;
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
if (!(pcoin->IsSpent(i)) && IsMine(pcoin->vout[i]) && pcoin->vout[i].nValue > 0)
vCoins.push_back(COutput(pcoin, i, pcoin->GetDepthInMainChain()));
}
}
}
void CWallet::AvailableCoinsMinConf(vector<COutput>& vCoins, int nConf) const
{
vCoins.clear();
{
LOCK(cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;
if (!pcoin->IsFinal())
continue;
if(pcoin->GetDepthInMainChain() < nConf)
continue;
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
if (!(pcoin->IsSpent(i)) && IsMine(pcoin->vout[i]) && pcoin->vout[i].nValue >= nMinimumInputValue)
vCoins.push_back(COutput(pcoin, i, pcoin->GetDepthInMainChain()));
}
}
}
static void ApproximateBestSubset(vector<pair<int64, pair<const CWalletTx*,unsigned int> > >vValue, int64 nTotalLower, int64 nTargetValue,
vector<char>& vfBest, int64& nBest, int iterations = 1000)
{
vector<char> vfIncluded;
vfBest.assign(vValue.size(), true);
nBest = nTotalLower;
for (int nRep = 0; nRep < iterations && nBest != nTargetValue; nRep++)
{
vfIncluded.assign(vValue.size(), false);
int64 nTotal = 0;
bool fReachedTarget = false;
for (int nPass = 0; nPass < 2 && !fReachedTarget; nPass++)
{
for (unsigned int i = 0; i < vValue.size(); i++)
{
if (nPass == 0 ? rand() % 2 : !vfIncluded[i])
{
nTotal += vValue[i].first;
vfIncluded[i] = true;
if (nTotal >= nTargetValue)
{
fReachedTarget = true;
if (nTotal < nBest)
{
nBest = nTotal;
vfBest = vfIncluded;
}
nTotal -= vValue[i].first;
vfIncluded[i] = false;
}
}
}
}
}
}
// ppcoin: total coins staked (non-spendable until maturity)
int64 CWallet::GetStake() const
{
int64 nTotal = 0;
LOCK(cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;
if (pcoin->IsCoinStake() && pcoin->GetBlocksToMaturity() > 0 && pcoin->GetDepthInMainChain() > 0)
nTotal += CWallet::GetCredit(*pcoin);
}
return nTotal;
}
bool CWallet::GetStakeWeight(const CKeyStore& keystore, uint64_t& nMinWeight, uint64_t& nMaxWeight, uint64_t& nWeight)
{
// Choose coins to use
int64_t nBalance = GetBalance();
if (nBalance <= nReserveBalance)
return false;
vector<const CWalletTx*> vwtxPrev;
set<pair<const CWalletTx*,unsigned int> > setCoins;
int64_t nValueIn = 0;
if (!SelectCoinsSimple(nBalance - nReserveBalance, GetTime(), nCoinbaseMaturity + 10, setCoins, nValueIn))
return false;
if (setCoins.empty())
return false;
CTxDB txdb("r");
BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
{
CTxIndex txindex;
{
LOCK2(cs_main, cs_wallet);
if (!txdb.ReadTxIndex(pcoin.first->GetHash(), txindex))
continue;
}
int64_t nTimeWeight = GetWeight((int64_t)pcoin.first->nTime, (int64_t)GetTime());
CBigNum bnCoinDayWeight = CBigNum(pcoin.first->vout[pcoin.second].nValue) * nTimeWeight / COIN / (24 * 60 * 60);
// Weight is greater than zero
if (nTimeWeight > 0)
{
nWeight += bnCoinDayWeight.getuint64();
}
// Weight is greater than zero, but the maximum value isn't reached yet
if (nTimeWeight > 0 && nTimeWeight < nStakeMaxAge)
{
nMinWeight += bnCoinDayWeight.getuint64();
}
// Maximum weight was reached
if (nTimeWeight == nStakeMaxAge)
{
nMaxWeight += bnCoinDayWeight.getuint64();
}
}
return true;
}
// Select some coins without random shuffle or best subset approximation
bool CWallet::SelectCoinsSimple(int64_t nTargetValue, unsigned int nSpendTime, int nMinConf, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet) const
{
vector<COutput> vCoins;
AvailableCoinsMinConf(vCoins, nMinConf);
setCoinsRet.clear();
nValueRet = 0;
BOOST_FOREACH(COutput output, vCoins)
{
const CWalletTx *pcoin = output.tx;
int i = output.i;
// Stop if we've chosen enough inputs
if (nValueRet >= nTargetValue)
break;
// Follow the timestamp rules
if (pcoin->nTime > nSpendTime)
continue;
int64_t n = pcoin->vout[i].nValue;
pair<int64_t,pair<const CWalletTx*,unsigned int> > coin = make_pair(n,make_pair(pcoin, i));
if (n >= nTargetValue)
{
// If input value is greater or equal to target then simply insert
// it into the current subset and exit
setCoinsRet.insert(coin.second);
nValueRet += coin.first;
break;
}
else if (n < nTargetValue + CENT)
{
setCoinsRet.insert(coin.second);
nValueRet += coin.first;
}
}
return true;
}
int64 CWallet::GetNewMint() const
{
int64 nTotal = 0;
LOCK(cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0 && pcoin->GetDepthInMainChain() > 0)
nTotal += CWallet::GetCredit(*pcoin);
}
return nTotal;
}
bool CWallet::SelectCoinsMinConf(int64 nTargetValue, unsigned int nSpendTime, int nConfMine, int nConfTheirs, vector<COutput> vCoins, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const
{
setCoinsRet.clear();
nValueRet = 0;
// List of values less than target
pair<int64, pair<const CWalletTx*,unsigned int> > coinLowestLarger;
coinLowestLarger.first = std::numeric_limits<int64>::max();
coinLowestLarger.second.first = NULL;
vector<pair<int64, pair<const CWalletTx*,unsigned int> > > vValue;
int64 nTotalLower = 0;
random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt);
BOOST_FOREACH(COutput output, vCoins)
{
const CWalletTx *pcoin = output.tx;
if (output.nDepth < (pcoin->IsFromMe() ? nConfMine : nConfTheirs))
continue;
int i = output.i;
if (pcoin->nTime > nSpendTime)
continue; // ppcoin: timestamp must not exceed spend time
int64 n = pcoin->vout[i].nValue;
pair<int64,pair<const CWalletTx*,unsigned int> > coin = make_pair(n,make_pair(pcoin, i));
if (n == nTargetValue)
{
setCoinsRet.insert(coin.second);
nValueRet += coin.first;
return true;
}
else if (n < nTargetValue + CENT)
{
vValue.push_back(coin);
nTotalLower += n;
}
else if (n < coinLowestLarger.first)
{
coinLowestLarger = coin;
}
}
if (nTotalLower == nTargetValue)
{
for (unsigned int i = 0; i < vValue.size(); ++i)
{
setCoinsRet.insert(vValue[i].second);
nValueRet += vValue[i].first;
}
return true;
}
if (nTotalLower < nTargetValue)
{
if (coinLowestLarger.second.first == NULL)
return false;
setCoinsRet.insert(coinLowestLarger.second);
nValueRet += coinLowestLarger.first;
return true;
}
// Solve subset sum by stochastic approximation
sort(vValue.rbegin(), vValue.rend(), CompareValueOnly());
vector<char> vfBest;
int64 nBest;
ApproximateBestSubset(vValue, nTotalLower, nTargetValue, vfBest, nBest, 1000);
if (nBest != nTargetValue && nTotalLower >= nTargetValue + CENT)
ApproximateBestSubset(vValue, nTotalLower, nTargetValue + CENT, vfBest, nBest, 1000);
// If we have a bigger coin and (either the stochastic approximation didn't find a good solution,
// or the next bigger coin is closer), return the bigger coin
if (coinLowestLarger.second.first &&
((nBest != nTargetValue && nBest < nTargetValue + CENT) || coinLowestLarger.first <= nBest))
{
setCoinsRet.insert(coinLowestLarger.second);
nValueRet += coinLowestLarger.first;
}
else {
for (unsigned int i = 0; i < vValue.size(); i++)
if (vfBest[i])
{
setCoinsRet.insert(vValue[i].second);
nValueRet += vValue[i].first;
}
if (fDebug && GetBoolArg("-printpriority"))
{
//// debug print
printf("SelectCoins() best subset: ");
for (unsigned int i = 0; i < vValue.size(); i++)
if (vfBest[i])
printf("%s ", FormatMoney(vValue[i].first).c_str());
printf("total %s\n", FormatMoney(nBest).c_str());
}
}
return true;
}
bool CWallet::SelectCoins(int64 nTargetValue, unsigned int nSpendTime, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const
{
vector<COutput> vCoins;
AvailableCoins(vCoins);
return (SelectCoinsMinConf(nTargetValue, nSpendTime, 1, 6, vCoins, setCoinsRet, nValueRet) ||
SelectCoinsMinConf(nTargetValue, nSpendTime, 1, 1, vCoins, setCoinsRet, nValueRet) ||
SelectCoinsMinConf(nTargetValue, nSpendTime, 0, 1, vCoins, setCoinsRet, nValueRet));
}
bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet)
{
int64 nValue = 0;
BOOST_FOREACH (const PAIRTYPE(CScript, int64)& s, vecSend)
{
if (nValue < 0)
return false;
nValue += s.second;
}
if (vecSend.empty() || nValue < 0)
return false;
wtxNew.BindWallet(this);
{
LOCK2(cs_main, cs_wallet);
// txdb must be opened before the mapWallet lock
CTxDB txdb("r");
{
nFeeRet = nTransactionFee;
loop()
{
wtxNew.vin.clear();
wtxNew.vout.clear();
wtxNew.fFromMe = true;
int64 nTotalValue = nValue + nFeeRet;
double dPriority = 0;
// vouts to the payees
BOOST_FOREACH (const PAIRTYPE(CScript, int64)& s, vecSend)
wtxNew.vout.push_back(CTxOut(s.second, s.first));
// Choose coins to use
set<pair<const CWalletTx*,unsigned int> > setCoins;
int64 nValueIn = 0;
if (!SelectCoins(nTotalValue, wtxNew.nTime, setCoins, nValueIn))
return false;
BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
{
int64 nCredit = pcoin.first->vout[pcoin.second].nValue;
dPriority += (double)nCredit * pcoin.first->GetDepthInMainChain();
}
int64 nChange = nValueIn - nValue - nFeeRet;
// if sub-cent change is required, the fee must be raised to at least MIN_TX_FEE
// or until nChange becomes zero
// NOTE: this depends on the exact behaviour of GetMinFee
if (nFeeRet < MIN_TX_FEE && nChange > 0 && nChange < CENT)
{
int64 nMoveToFee = min(nChange, MIN_TX_FEE - nFeeRet);
nChange -= nMoveToFee;
nFeeRet += nMoveToFee;
}
// ppcoin: sub-cent change is moved to fee
if (nChange > 0 && nChange < MIN_TXOUT_AMOUNT)
{
nFeeRet += nChange;
nChange = 0;
}
if (nChange > 0)
{
// Note: We use a new key here to keep it from being obvious which side is the change.
// The drawback is that by not reusing a previous key, the change may be lost if a
// backup is restored, if the backup doesn't have the new private key for the change.
// If we reused the old key, it would be possible to add code to look for and
// rediscover unknown transactions that were written with keys of ours to recover
// post-backup change.
// Reserve a new key pair from key pool
CPubKey vchPubKey = reservekey.GetReservedKey();
// assert(mapKeys.count(vchPubKey));
// Fill a vout to ourself
// TODO: pass in scriptChange instead of reservekey so
// change transaction isn't always pay-to-bitcoin-address
CScript scriptChange;
scriptChange.SetDestination(vchPubKey.GetID());
// Insert change txn at random position:
vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size());
wtxNew.vout.insert(position, CTxOut(nChange, scriptChange));
}
else
reservekey.ReturnKey();
// Fill vin
BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins)
wtxNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second));
// Sign
int nIn = 0;
BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins)
if (!SignSignature(*this, *coin.first, wtxNew, nIn++))
return false;
// Limit size
unsigned int nBytes = ::GetSerializeSize(*(CTransaction*)&wtxNew, SER_NETWORK, PROTOCOL_VERSION);
if (nBytes >= MAX_BLOCK_SIZE_GEN/5)
return false;
dPriority /= nBytes;
// Check that enough fee is included
int64 nPayFee = nTransactionFee * (1 + (int64)nBytes / 1000);
int64 nMinFee = wtxNew.GetMinFee(1, false, GMF_SEND);
if (nFeeRet < max(nPayFee, nMinFee))
{
nFeeRet = max(nPayFee, nMinFee);
continue;
}
// Fill vtxPrev by copying from previous transactions vtxPrev
wtxNew.AddSupportingTransactions(txdb);
wtxNew.fTimeReceivedIsTxTime = true;
break;
}
}
}
return true;
}
bool CWallet::CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet)
{
vector< pair<CScript, int64> > vecSend;
vecSend.push_back(make_pair(scriptPubKey, nValue));
return CreateTransaction(vecSend, wtxNew, reservekey, nFeeRet);
}
// ppcoin: create coin stake transaction
bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int64 nSearchInterval, CTransaction& txNew)
{
// The following split & combine thresholds are important to security
// Should not be adjusted if you don't understand the consequences
static unsigned int nStakeSplitAge = (60 * 60 * 24 * 30);
const CBlockIndex* pIndex0 = GetLastBlockIndex(pindexBest, false);
int64 nCombineThreshold = 0;
if(pIndex0->pprev)
nCombineThreshold = GetProofOfWorkReward(pIndex0->nHeight, MIN_TX_FEE, pIndex0->pprev->GetBlockHash()) / 3;
CBigNum bnTargetPerCoinDay;
bnTargetPerCoinDay.SetCompact(nBits);
txNew.vin.clear();
txNew.vout.clear();
// Mark coin stake transaction
CScript scriptEmpty;
scriptEmpty.clear();
txNew.vout.push_back(CTxOut(0, scriptEmpty));
// Choose coins to use
int64 nBalance = GetBalance();
int64 nReserveBalance = 0;
if (mapArgs.count("-reservebalance") && !ParseMoney(mapArgs["-reservebalance"], nReserveBalance))
return error("CreateCoinStake : invalid reserve balance amount");
if (nBalance <= nReserveBalance)
return false;
set<pair<const CWalletTx*,unsigned int> > setCoins;
vector<const CWalletTx*> vwtxPrev;
int64 nValueIn = 0;
if (!SelectCoins(nBalance - nReserveBalance, txNew.nTime, setCoins, nValueIn))
return false;
if (setCoins.empty())
return false;
int64 nCredit = 0;
CScript scriptPubKeyKernel;
BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
{
CTxDB txdb("r");
CTxIndex txindex;
{
LOCK2(cs_main, cs_wallet);
if (!txdb.ReadTxIndex(pcoin.first->GetHash(), txindex))
continue;
}
// Read block header
CBlock block;
{
LOCK2(cs_main, cs_wallet);
if (!block.ReadFromDisk(txindex.pos.nFile, txindex.pos.nBlockPos, false))
continue;
}
static int nMaxStakeSearchInterval = 60;
// printf(">> block.GetBlockTime() = %"PRI64d", nStakeMinAge = %d, txNew.nTime = %d\n", block.GetBlockTime(), nStakeMinAge,txNew.nTime);
if (block.GetBlockTime() + nStakeMinAge > txNew.nTime - nMaxStakeSearchInterval)
continue; // only count coins meeting min age requirement
bool fKernelFound = false;
for (unsigned int n=0; n<min(nSearchInterval,(int64)nMaxStakeSearchInterval) && !fKernelFound && !fShutdown; n++)
{
// printf(">> In.....\n");
// Search backward in time from the given txNew timestamp
// Search nSearchInterval seconds back up to nMaxStakeSearchInterval
uint256 hashProofOfStake = 0;
COutPoint prevoutStake = COutPoint(pcoin.first->GetHash(), pcoin.second);
if (CheckStakeKernelHash(nBits, block, txindex.pos.nTxPos - txindex.pos.nBlockPos, *pcoin.first, prevoutStake, txNew.nTime - n, hashProofOfStake))
{
// Found a kernel
if (fDebug && GetBoolArg("-printcoinstake"))
printf("CreateCoinStake : kernel found\n");
vector<valtype> vSolutions;
txnouttype whichType;
CScript scriptPubKeyOut;
scriptPubKeyKernel = pcoin.first->vout[pcoin.second].scriptPubKey;
if (!Solver(scriptPubKeyKernel, whichType, vSolutions))
{
if (fDebug && GetBoolArg("-printcoinstake"))
printf("CreateCoinStake : failed to parse kernel\n");
break;
}
if (fDebug && GetBoolArg("-printcoinstake"))
printf("CreateCoinStake : parsed kernel type=%d\n", whichType);
if (whichType != TX_PUBKEY && whichType != TX_PUBKEYHASH)
{
if (fDebug && GetBoolArg("-printcoinstake"))
printf("CreateCoinStake : no support for kernel type=%d\n", whichType);
break; // only support pay to public key and pay to address
}
if (whichType == TX_PUBKEYHASH) // pay to address type
{
// convert to pay to public key type
CKey key;
if (!keystore.GetKey(uint160(vSolutions[0]), key))
{
if (fDebug && GetBoolArg("-printcoinstake"))
printf("CreateCoinStake : failed to get key for kernel type=%d\n", whichType);
break; // unable to find corresponding public key
}
scriptPubKeyOut << key.GetPubKey() << OP_CHECKSIG;
}
else
scriptPubKeyOut = scriptPubKeyKernel;
txNew.nTime -= n;
txNew.vin.push_back(CTxIn(pcoin.first->GetHash(), pcoin.second));
nCredit += pcoin.first->vout[pcoin.second].nValue;
// printf(">> Wallet: CreateCoinStake: nCredit = %"PRI64d"\n", nCredit);
vwtxPrev.push_back(pcoin.first);
txNew.vout.push_back(CTxOut(0, scriptPubKeyOut));
if (block.GetBlockTime() + nStakeSplitAge > txNew.nTime)
txNew.vout.push_back(CTxOut(0, scriptPubKeyOut)); //split stake
if (fDebug && GetBoolArg("-printcoinstake"))
printf("CreateCoinStake : added kernel type=%d\n", whichType);
fKernelFound = true;
break;
}
}
if (fKernelFound || fShutdown)
break; // if kernel is found stop searching
}
if (nCredit == 0 || nCredit > nBalance - nReserveBalance)
{
// printf(">> Wallet: CreateCoinStake: nCredit = %"PRI64d", nBalance = %"PRI64d", nReserveBalance = %"PRI64d"\n", nCredit, nBalance, nReserveBalance);
return false;
}
BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
{
// Attempt to add more inputs
// Only add coins of the same key/address as kernel
if (txNew.vout.size() == 2 && ((pcoin.first->vout[pcoin.second].scriptPubKey == scriptPubKeyKernel || pcoin.first->vout[pcoin.second].scriptPubKey == txNew.vout[1].scriptPubKey))
&& pcoin.first->GetHash() != txNew.vin[0].prevout.hash)
{
// Stop adding more inputs if already too many inputs
if (txNew.vin.size() >= 100)
break;
// Stop adding more inputs if value is already pretty significant
if (nCredit > nCombineThreshold)
break;
// Stop adding inputs if reached reserve limit
if (nCredit + pcoin.first->vout[pcoin.second].nValue > nBalance - nReserveBalance)
break;
// Do not add additional significant input
if (pcoin.first->vout[pcoin.second].nValue > nCombineThreshold)
continue;
// Do not add input that is still too young
if (pcoin.first->nTime + nStakeMaxAge > txNew.nTime)
continue;
txNew.vin.push_back(CTxIn(pcoin.first->GetHash(), pcoin.second));
nCredit += pcoin.first->vout[pcoin.second].nValue;
vwtxPrev.push_back(pcoin.first);
}
}
// Calculate coin age reward
{
uint64 nCoinAge;
CTxDB txdb("r");
if (!txNew.GetCoinAge(txdb, nCoinAge))
return error("CreateCoinStake : failed to calculate coin age");
nCredit += GetProofOfStakeReward(nCoinAge, nBits, txNew.nTime, pindexBest->nHeight + 1);
}
int64 nMinFee = 0;
loop()
{
// Set output amount
if (txNew.vout.size() == 3)
{
txNew.vout[1].nValue = ((nCredit - nMinFee) / 2 / CENT) * CENT;
txNew.vout[2].nValue = nCredit - nMinFee - txNew.vout[1].nValue;
}
else
txNew.vout[1].nValue = nCredit - nMinFee;
// Sign
int nIn = 0;
BOOST_FOREACH(const CWalletTx* pcoin, vwtxPrev)
{
if (!SignSignature(*this, *pcoin, txNew, nIn++))
return error("CreateCoinStake : failed to sign coinstake");
}
// Limit size
unsigned int nBytes = ::GetSerializeSize(txNew, SER_NETWORK, PROTOCOL_VERSION);
if (nBytes >= MAX_BLOCK_SIZE_GEN/5)
return error("CreateCoinStake : exceeded coinstake size limit");
// Check enough fee is paid
if (nMinFee < txNew.GetMinFee() - MIN_TX_FEE)
{
nMinFee = txNew.GetMinFee() - MIN_TX_FEE;
continue; // try signing again
}
else
{
if (fDebug && GetBoolArg("-printfee"))
printf("CreateCoinStake : fee for coinstake %s\n", FormatMoney(nMinFee).c_str());
break;
}
}
// Successfully generated coinstake
return true;
}
// Call after CreateTransaction unless you want to abort
bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
{
{
LOCK2(cs_main, cs_wallet);
printf("CommitTransaction:\n%s", wtxNew.ToString().c_str());
{
// This is only to keep the database open to defeat the auto-flush for the
// duration of this scope. This is the only place where this optimization
// maybe makes sense; please don't do it anywhere else.
CWalletDB* pwalletdb = fFileBacked ? new CWalletDB(strWalletFile,"r") : NULL;
// Take key pair from key pool so it won't be used again
reservekey.KeepKey();
// Add tx to wallet, because if it has change it's also ours,
// otherwise just for transaction history.
AddToWallet(wtxNew);
// Mark old coins as spent
set<CWalletTx*> setCoins;
BOOST_FOREACH(const CTxIn& txin, wtxNew.vin)
{
CWalletTx &coin = mapWallet[txin.prevout.hash];
coin.BindWallet(this);
coin.MarkSpent(txin.prevout.n);
coin.WriteToDisk();
NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED);
}
if (fFileBacked)
delete pwalletdb;
}
// Track how many getdata requests our transaction gets
mapRequestCount[wtxNew.GetHash()] = 0;
// Broadcast
if (!wtxNew.AcceptToMemoryPool())
{
// This must not fail. The transaction has already been signed and recorded.
printf("CommitTransaction() : Error: Transaction not valid");
return false;
}
wtxNew.RelayWalletTransaction();
}
return true;
}
string CWallet::SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee)
{
CReserveKey reservekey(this);
int64 nFeeRequired;
if (IsLocked())
{
string strError = _("Error: Wallet locked, unable to create transaction ");
printf("SendMoney() : %s", strError.c_str());
return strError;
}
if (fWalletUnlockMintOnly)
{
string strError = _("Error: Wallet unlocked for block minting only, unable to create transaction.");
printf("SendMoney() : %s", strError.c_str());
return strError;
}
if (!CreateTransaction(scriptPubKey, nValue, wtxNew, reservekey, nFeeRequired))
{
string strError;
if (nValue + nFeeRequired > GetBalance())
strError = strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds "), FormatMoney(nFeeRequired).c_str());
else
strError = _("Error: Transaction creation failed ");
printf("SendMoney() : %s", strError.c_str());
return strError;
}
if (fAskFee && !uiInterface.ThreadSafeAskFee(nFeeRequired, _("Sending...")))
return "ABORTED";
if (!CommitTransaction(wtxNew, reservekey))
return _("Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.");
return "";
}
string CWallet::SendMoneyToDestination(const CTxDestination& address, int64 nValue, CWalletTx& wtxNew, bool fAskFee)
{
// Check amount
if (nValue <= 0)
return _("Invalid amount");
if (nValue + nTransactionFee > GetBalance())
return _("Insufficient funds");
// Parse Bitcoin address
CScript scriptPubKey;
scriptPubKey.SetDestination(address);
return SendMoney(scriptPubKey, nValue, wtxNew, fAskFee);
}
DBErrors CWallet::LoadWallet(bool& fFirstRunRet)
{
if (!fFileBacked)
return DB_LOAD_OK;
fFirstRunRet = false;
DBErrors nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this);
if (nLoadWalletRet == DB_NEED_REWRITE)
{
if (CDB::Rewrite(strWalletFile, "\x04pool"))
{
setKeyPool.clear();
// Note: can't top-up keypool here, because wallet is locked.
// User will be prompted to unlock wallet the next operation
// the requires a new key.
}
}
if (nLoadWalletRet != DB_LOAD_OK)
return nLoadWalletRet;
fFirstRunRet = !vchDefaultKey.IsValid();
NewThread(ThreadFlushWalletDB, &strWalletFile);
return DB_LOAD_OK;
}
DBErrors CWallet::ZapWalletTx(std::vector<CWalletTx>& vWtx)
{
if (!fFileBacked)
return DB_LOAD_OK;
DBErrors nZapWalletTxRet = CWalletDB(strWalletFile,"cr+").ZapWalletTx(this, vWtx);
if (nZapWalletTxRet == DB_NEED_REWRITE)
{
if (CDB::Rewrite(strWalletFile, "\x04pool"))
{
LOCK(cs_wallet);
setKeyPool.clear();
// Note: can't top-up keypool here, because wallet is locked.
// User will be prompted to unlock wallet the next operation
// that requires a new key.
}
}
if (nZapWalletTxRet != DB_LOAD_OK)
return nZapWalletTxRet;
return DB_LOAD_OK;
}
bool CWallet::SetAddressBookName(const CTxDestination& address, const string& strName)
{
std::map<CTxDestination, std::string>::iterator mi = mapAddressBook.find(address);
mapAddressBook[address] = strName;
NotifyAddressBookChanged(this, address, strName, ::IsMine(*this, address), (mi == mapAddressBook.end()) ? CT_NEW : CT_UPDATED);
if (!fFileBacked)
return false;
return CWalletDB(strWalletFile).WriteName(CBitcoinAddress(address).ToString(), strName);
}
bool CWallet::DelAddressBookName(const CTxDestination& address)
{
mapAddressBook.erase(address);
NotifyAddressBookChanged(this, address, "", ::IsMine(*this, address), CT_DELETED);
if (!fFileBacked)
return false;
return CWalletDB(strWalletFile).EraseName(CBitcoinAddress(address).ToString());
}
void CWallet::PrintWallet(const CBlock& block)
{
{
LOCK(cs_wallet);
if (block.IsProofOfWork() && mapWallet.count(block.vtx[0].GetHash()))
{
CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()];
printf(" mine: %d %d %"PRI64d"", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit());
}
if (block.IsProofOfStake() && mapWallet.count(block.vtx[1].GetHash()))
{
CWalletTx& wtx = mapWallet[block.vtx[1].GetHash()];
printf(" stake: %d %d %"PRI64d"", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit());
}
}
printf("\n");
}
bool CWallet::GetTransaction(const uint256 &hashTx, CWalletTx& wtx)
{
{
LOCK(cs_wallet);
map<uint256, CWalletTx>::iterator mi = mapWallet.find(hashTx);
if (mi != mapWallet.end())
{
wtx = (*mi).second;
return true;
}
}
return false;
}
bool CWallet::SetDefaultKey(const CPubKey &vchPubKey)
{
if (fFileBacked)
{
if (!CWalletDB(strWalletFile).WriteDefaultKey(vchPubKey))
return false;
}
vchDefaultKey = vchPubKey;
return true;
}
bool GetWalletFile(CWallet* pwallet, string &strWalletFileOut)
{
if (!pwallet->fFileBacked)
return false;
strWalletFileOut = pwallet->strWalletFile;
return true;
}
//
// Mark old keypool keys as used,
// and generate all new keys
//
bool CWallet::NewKeyPool()
{
{
LOCK(cs_wallet);
CWalletDB walletdb(strWalletFile);
BOOST_FOREACH(int64 nIndex, setKeyPool)
walletdb.ErasePool(nIndex);
setKeyPool.clear();
if (IsLocked())
return false;
int64 nKeys = max(GetArg("-keypool", 100), (int64)0);
for (int i = 0; i < nKeys; i++)
{
int64 nIndex = i+1;
walletdb.WritePool(nIndex, CKeyPool(GenerateNewKey()));
setKeyPool.insert(nIndex);
}
printf("CWallet::NewKeyPool wrote %"PRI64d" new keys\n", nKeys);
}
return true;
}
bool CWallet::TopUpKeyPool()
{
{
LOCK(cs_wallet);
if (IsLocked())
return false;
CWalletDB walletdb(strWalletFile);
// Top up key pool
unsigned int nTargetSize = max(GetArg("-keypool", 100), 0LL);
while (setKeyPool.size() < (nTargetSize + 1))
{
int64 nEnd = 1;
if (!setKeyPool.empty())
nEnd = *(--setKeyPool.end()) + 1;
if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey())))
throw runtime_error("TopUpKeyPool() : writing generated key failed");
setKeyPool.insert(nEnd);
printf("keypool added key %"PRI64d", size=%"PRIszu"\n", nEnd, setKeyPool.size());
}
}
return true;
}
void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
{
nIndex = -1;
keypool.vchPubKey = CPubKey();
{
LOCK(cs_wallet);
if (!IsLocked())
TopUpKeyPool();
// Get the oldest key
if(setKeyPool.empty())
return;
CWalletDB walletdb(strWalletFile);
nIndex = *(setKeyPool.begin());
setKeyPool.erase(setKeyPool.begin());
if (!walletdb.ReadPool(nIndex, keypool))
throw runtime_error("ReserveKeyFromKeyPool() : read failed");
if (!HaveKey(keypool.vchPubKey.GetID()))
throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
assert(keypool.vchPubKey.IsValid());
if (fDebug && GetBoolArg("-printkeypool"))
printf("keypool reserve %"PRI64d"\n", nIndex);
}
}
int64 CWallet::AddReserveKey(const CKeyPool& keypool)
{
{
LOCK2(cs_main, cs_wallet);
CWalletDB walletdb(strWalletFile);
int64 nIndex = 1 + *(--setKeyPool.end());
if (!walletdb.WritePool(nIndex, keypool))
throw runtime_error("AddReserveKey() : writing added key failed");
setKeyPool.insert(nIndex);
return nIndex;
}
return -1;
}
void CWallet::KeepKey(int64 nIndex)
{
// Remove from key pool
if (fFileBacked)
{
CWalletDB walletdb(strWalletFile);
walletdb.ErasePool(nIndex);
}
if(fDebug)
printf("keypool keep %"PRI64d"\n", nIndex);
}
void CWallet::ReturnKey(int64 nIndex)
{
// Return to key pool
{
LOCK(cs_wallet);
setKeyPool.insert(nIndex);
}
if(fDebug)
printf("keypool return %"PRI64d"\n", nIndex);
}
bool CWallet::GetKeyFromPool(CPubKey& result, bool fAllowReuse)
{
int64 nIndex = 0;
CKeyPool keypool;
{
LOCK(cs_wallet);
ReserveKeyFromKeyPool(nIndex, keypool);
if (nIndex == -1)
{
if (fAllowReuse && vchDefaultKey.IsValid())
{
result = vchDefaultKey;
return true;
}
if (IsLocked()) return false;
result = GenerateNewKey();
return true;
}
KeepKey(nIndex);
result = keypool.vchPubKey;
}
return true;
}
int64 CWallet::GetOldestKeyPoolTime()
{
int64 nIndex = 0;
CKeyPool keypool;
ReserveKeyFromKeyPool(nIndex, keypool);
if (nIndex == -1)
return GetTime();
ReturnKey(nIndex);
return keypool.nTime;
}
std::map<CTxDestination, int64> CWallet::GetAddressBalances()
{
map<CTxDestination, int64> balances;
{
LOCK(cs_wallet);
BOOST_FOREACH(PAIRTYPE(uint256, CWalletTx) walletEntry, mapWallet)
{
CWalletTx *pcoin = &walletEntry.second;
if (!pcoin->IsFinal() || !pcoin->IsConfirmed())
continue;
if ((pcoin->IsCoinBase() || pcoin->IsCoinStake()) && pcoin->GetBlocksToMaturity() > 0)
continue;
int nDepth = pcoin->GetDepthInMainChain();
if (nDepth < (pcoin->IsFromMe() ? 0 : 1))
continue;
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
{
CTxDestination addr;
if (!IsMine(pcoin->vout[i]))
continue;
if(!ExtractDestination(pcoin->vout[i].scriptPubKey, addr))
continue;
int64 n = pcoin->IsSpent(i) ? 0 : pcoin->vout[i].nValue;
if (!balances.count(addr))
balances[addr] = 0;
balances[addr] += n;
}
}
}
return balances;
}
set< set<CTxDestination> > CWallet::GetAddressGroupings()
{
set< set<CTxDestination> > groupings;
set<CTxDestination> grouping;
BOOST_FOREACH(PAIRTYPE(uint256, CWalletTx) walletEntry, mapWallet)
{
CWalletTx *pcoin = &walletEntry.second;
if (pcoin->vin.size() > 0 && IsMine(pcoin->vin[0]))
{
// group all input addresses with each other
BOOST_FOREACH(CTxIn txin, pcoin->vin)
{
CTxDestination address;
if(!ExtractDestination(mapWallet[txin.prevout.hash].vout[txin.prevout.n].scriptPubKey, address))
continue;
grouping.insert(address);
}
// group change with input addresses
BOOST_FOREACH(CTxOut txout, pcoin->vout)
if (IsChange(txout))
{
CWalletTx tx = mapWallet[pcoin->vin[0].prevout.hash];
CTxDestination txoutAddr;
if(!ExtractDestination(txout.scriptPubKey, txoutAddr))
continue;
grouping.insert(txoutAddr);
}
groupings.insert(grouping);
grouping.clear();
}
// group lone addrs by themselves
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
if (IsMine(pcoin->vout[i]))
{
CTxDestination address;
if(!ExtractDestination(pcoin->vout[i].scriptPubKey, address))
continue;
grouping.insert(address);
groupings.insert(grouping);
grouping.clear();
}
}
set< set<CTxDestination>* > uniqueGroupings; // a set of pointers to groups of addresses
map< CTxDestination, set<CTxDestination>* > setmap; // map addresses to the unique group containing it
BOOST_FOREACH(set<CTxDestination> grouping, groupings)
{
// make a set of all the groups hit by this new group
set< set<CTxDestination>* > hits;
map< CTxDestination, set<CTxDestination>* >::iterator it;
BOOST_FOREACH(CTxDestination address, grouping)
if ((it = setmap.find(address)) != setmap.end())
hits.insert((*it).second);
// merge all hit groups into a new single group and delete old groups
set<CTxDestination>* merged = new set<CTxDestination>(grouping);
BOOST_FOREACH(set<CTxDestination>* hit, hits)
{
merged->insert(hit->begin(), hit->end());
uniqueGroupings.erase(hit);
delete hit;
}
uniqueGroupings.insert(merged);
// update setmap
BOOST_FOREACH(CTxDestination element, *merged)
setmap[element] = merged;
}
set< set<CTxDestination> > ret;
BOOST_FOREACH(set<CTxDestination>* uniqueGrouping, uniqueGroupings)
{
ret.insert(*uniqueGrouping);
delete uniqueGrouping;
}
return ret;
}
// ppcoin: check 'spent' consistency between wallet and txindex
// ppcoin: fix wallet spent state according to txindex
void CWallet::FixSpentCoins(int& nMismatchFound, int64& nBalanceInQuestion, bool fCheckOnly)
{
nMismatchFound = 0;
nBalanceInQuestion = 0;
LOCK(cs_wallet);
vector<CWalletTx*> vCoins;
vCoins.reserve(mapWallet.size());
for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
vCoins.push_back(&(*it).second);
CTxDB txdb("r");
BOOST_FOREACH(CWalletTx* pcoin, vCoins)
{
// Find the corresponding transaction index
CTxIndex txindex;
if (!txdb.ReadTxIndex(pcoin->GetHash(), txindex))
continue;
for (unsigned int n=0; n < pcoin->vout.size(); n++)
{
if (IsMine(pcoin->vout[n]) && pcoin->IsSpent(n) && (txindex.vSpent.size() <= n || txindex.vSpent[n].IsNull()))
{
printf("FixSpentCoins found lost coin %sppc %s[%d], %s\n",
FormatMoney(pcoin->vout[n].nValue).c_str(), pcoin->GetHash().ToString().c_str(), n, fCheckOnly? "repair not attempted" : "repairing");
nMismatchFound++;
nBalanceInQuestion += pcoin->vout[n].nValue;
if (!fCheckOnly)
{
pcoin->MarkUnspent(n);
pcoin->WriteToDisk();
}
}
else if (IsMine(pcoin->vout[n]) && !pcoin->IsSpent(n) && (txindex.vSpent.size() > n && !txindex.vSpent[n].IsNull()))
{
printf("FixSpentCoins found spent coin %sppc %s[%d], %s\n",
FormatMoney(pcoin->vout[n].nValue).c_str(), pcoin->GetHash().ToString().c_str(), n, fCheckOnly? "repair not attempted" : "repairing");
nMismatchFound++;
nBalanceInQuestion += pcoin->vout[n].nValue;
if (!fCheckOnly)
{
pcoin->MarkSpent(n);
pcoin->WriteToDisk();
}
}
}
}
}
// ppcoin: disable transaction (only for coinstake)
void CWallet::DisableTransaction(const CTransaction &tx)
{
if (!tx.IsCoinStake() || !IsFromMe(tx))
return; // only disconnecting coinstake requires marking input unspent
LOCK(cs_wallet);
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
map<uint256, CWalletTx>::iterator mi = mapWallet.find(txin.prevout.hash);
if (mi != mapWallet.end())
{
CWalletTx& prev = (*mi).second;
if (txin.prevout.n < prev.vout.size() && IsMine(prev.vout[txin.prevout.n]))
{
prev.MarkUnspent(txin.prevout.n);
prev.WriteToDisk();
}
}
}
}
CPubKey CReserveKey::GetReservedKey()
{
if (nIndex == -1)
{
CKeyPool keypool;
pwallet->ReserveKeyFromKeyPool(nIndex, keypool);
if (nIndex != -1)
vchPubKey = keypool.vchPubKey;
else
{
printf("CReserveKey::GetReservedKey(): Warning: Using default key instead of a new key, top up your keypool!");
vchPubKey = pwallet->vchDefaultKey;
}
}
assert(vchPubKey.IsValid());
return vchPubKey;
}
void CReserveKey::KeepKey()
{
if (nIndex != -1)
pwallet->KeepKey(nIndex);
nIndex = -1;
vchPubKey = CPubKey();
}
void CReserveKey::ReturnKey()
{
if (nIndex != -1)
pwallet->ReturnKey(nIndex);
nIndex = -1;
vchPubKey = CPubKey();
}
void CWallet::GetAllReserveKeys(set<CKeyID>& setAddress)
{
setAddress.clear();
CWalletDB walletdb(strWalletFile);
LOCK2(cs_main, cs_wallet);
BOOST_FOREACH(const int64& id, setKeyPool)
{
CKeyPool keypool;
if (!walletdb.ReadPool(id, keypool))
throw runtime_error("GetAllReserveKeyHashes() : read failed");
assert(keypool.vchPubKey.IsValid());
CKeyID keyID = keypool.vchPubKey.GetID();
if (!HaveKey(keyID))
throw runtime_error("GetAllReserveKeyHashes() : unknown key in key pool");
setAddress.insert(keyID);
}
}
void CWallet::UpdatedTransaction(const uint256 &hashTx)
{
{
LOCK(cs_wallet);
// Only notify UI if this transaction is in this wallet
map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(hashTx);
if (mi != mapWallet.end())
NotifyTransactionChanged(this, hashTx, CT_UPDATED);
}
}
| [
"bumbacoin@gmail.com"
] | bumbacoin@gmail.com |
f5a8301557c399631f7691e6886adefd9613e846 | 070d4f78a6ed254f784d1023519957cb30e4af2e | /labb1/labb1-polymul-runner/polymul.cpp | 5e633ba39fe596857e90194e3ddcf4f054f0a9d1 | [
"MIT"
] | permissive | ZetaTwo/dd2458-library | 90a95f80e570448eb67556fbf4cb0d3fa795dd65 | b4b8c9ba5fd5f5839674c48c5d5bd8eec31fbbd0 | refs/heads/master | 2016-09-06T03:32:54.081775 | 2015-04-17T00:02:20 | 2015-04-17T00:02:20 | 23,675,371 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,122 | cpp | #include <cstdio>
#include <vector>
#include <iterator>
using namespace std;
#include "polymul.hpp"
#ifdef _WIN32
#define scanf scanf_s
#endif
int main() {
//Number of test cases
int T;
scanf("%d", &T);
//Perform each test case
for (int i = 0; i < T; i++)
{
//Polynomial degrees
int degree1, degree2;
//Get polynomial 1
scanf("%d", °ree1);
vector<int> polynomial1(degree1+1);
for (int j = 0; j <= degree1; j++)
{
scanf("%d", &polynomial1[j]);
}
//Get polynomial 2
scanf("%d", °ree2);
vector<int> polynomial2(degree2+1);
for (int j = 0; j <= degree2; j++)
{
scanf("%d", &polynomial2[j]);
}
//Multiply
vector<int> result = polymul::polymul<int>(polynomial1, polynomial2);
//Output result
printf("%lu\n", result.size() - 1);
bool first = true;
for (vector<int>::const_iterator coeff = result.cbegin(); coeff != result.cend(); coeff++)
{
if (first) {
first = false;
}
else {
printf(" ");
}
printf("%d", *coeff);
}
printf("\n");
}
return 0;
} | [
"calle.svensson@zeta-two.com"
] | calle.svensson@zeta-two.com |
e787c061d881c1c9c71ffa1f103cca36f38465ca | 6e1524f57097936598cd535e260ab29c85020588 | /sheet_b/cf16-d2-b/main.cc | cb8e6db664b0ad024ac89827321b9c4e92979a70 | [] | no_license | kashparty/cp_junior_sheet | 930a36d04635f5cdf1b8ba8f926897fa63594fa1 | 810b398cf5c5703da4a9c91e574b55aed117086a | refs/heads/master | 2023-08-21T09:24:26.597175 | 2021-09-24T17:45:08 | 2021-09-24T17:45:08 | 403,414,844 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 617 | cc | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<pair<int, int>> data(m);
for (int i = 0; i < m; i++) cin >> data[i].first >> data[i].second;
sort(data.begin(), data.end(), [](const auto& a, const auto& b) {
return a.second > b.second;
});
int ans = 0;
for (int i = 0; i < m; i++) {
if (n >= data[i].first) {
ans += data[i].first * data[i].second;
n -= data[i].first;
} else {
ans += n * data[i].second;
break;
}
}
cout << ans << "\n";
return 0;
} | [
"sharma.pratyaksh@gmail.com"
] | sharma.pratyaksh@gmail.com |
48f54f9d032f02be6c1fcb3c8e170cf09c05ca42 | 02ecce5be0f268da2595be87f45d54732ebdabaa | /第7阶段-C++实战项目机房预约资料/代码/机房预约系统 2/机房预约系统/student.cpp | e91c45a94c358ae8ef3bab12d3fe8069bd65e609 | [] | no_license | yaozhi1234/C-learning-materials | fc2e5db078219fa1340ae5775d25f68607f344de | 4f419ca99434fd163c10f6dd88dd967f4b857480 | refs/heads/master | 2023-06-11T14:21:09.981155 | 2021-06-24T15:42:15 | 2021-06-24T15:42:15 | 379,933,467 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 6,872 | cpp | #include "student.h"
//默认构造
Student::Student()
{
}
//有参构造 参数:学号、姓名、密码
Student::Student(int id, string name, string pwd)
{
//初始化属性
this->m_Id = id;
this->m_Name = name;
this->m_Pwd = pwd;
//初始化机房信息
ifstream ifs;
ifs.open(COMPUTER_FILE, ios::in);
ComputerRoom com;
while ( ifs >> com.m_ComId && ifs >> com.m_MaxNum)
{
//将读取的信息放入到 容器中
vCom.push_back(com);
}
ifs.close();
}
//菜单界面
void Student::operMenu()
{
cout << "欢迎学生代表:" << this->m_Name << "登录!" << endl;
cout << "\t\t ----------------------------------\n";
cout << "\t\t| |\n";
cout << "\t\t| 1.申请预约 |\n";
cout << "\t\t| |\n";
cout << "\t\t| 2.查看我的预约 |\n";
cout << "\t\t| |\n";
cout << "\t\t| 3.查看所有预约 |\n";
cout << "\t\t| |\n";
cout << "\t\t| 4.取消预约 |\n";
cout << "\t\t| |\n";
cout << "\t\t| 0.注销登录 |\n";
cout << "\t\t| |\n";
cout << "\t\t ----------------------------------\n";
cout << "请选择您的操作: " << endl;
}
//申请预约
void Student::applyOrder()
{
cout << "机房开放时间为周一至周五!" << endl;
cout << "请输入申请预约的时间:" << endl;
cout << "1、周一" << endl;
cout << "2、周二" << endl;
cout << "3、周三" << endl;
cout << "4、周四" << endl;
cout << "5、周五" << endl;
int date = 0; //日期
int interval = 0; //时间段
int room = 0; //机房编号
while (true)
{
cin >> date;
if (date >= 1 && date <= 5)
{
break;
}
cout << "输入有误,请重新输入" << endl;
}
cout << "请输入申请预约时间段:" << endl;
cout << "1、上午" << endl;
cout << "2、下午" << endl;
while (true)
{
cin >> interval;
if (interval >= 1 && interval <= 2)
{
break;
}
cout << "输入有误,请重新输入" << endl;
}
cout << "请选择机房:" << endl;
for (int i = 0; i < vCom.size(); i++)
{
cout << vCom[i].m_ComId << "号机房容量为: " << vCom[i].m_MaxNum << endl;
}
while (true)
{
cin >> room;
if (room >= 1 && room <= 3)
{
break;
}
cout << "输入有误,请重新输入" << endl;
}
cout << "预约成功!审核中" << endl;
ofstream ofs;
ofs.open(ORDER_FILE, ios::app);
ofs << "date:" << date << " ";
ofs << "interval:" << interval << " ";
ofs << "stuId:" << this->m_Id << " ";
ofs << "stuName:" << this->m_Name << " ";
ofs << "roomId:" << room << " ";
ofs << "status:" << 1 << endl;
ofs.close();
system("pause");
system("cls");
}
//查看自身预约
void Student::showMyOrder()
{
OrderFile of;
if (of.m_Size == 0)
{
cout << "无预约记录!" << endl;
system("pause");
system("cls");
return;
}
for (int i = 0; i < of.m_Size; i++)
{
// string 转 int
// string 利用 .c_str() 转 const char *
//利用 atoi ( const char *) 转 int
if (this->m_Id == atoi(of.m_orderData[i]["stuId"].c_str())) //找到自身预约
{
cout << "预约日期: 周" << of.m_orderData[i]["date"];
cout << " 时间段: " << (of.m_orderData[i]["interval"] == "1" ? "上午" : "下午");
cout << " 机房号: " << of.m_orderData[i]["roomId"];
string status = "状态: ";
// 1 审核中 2 已预约 -1 预约失败 0 取消预约
if (of.m_orderData[i]["status"] == "1")
{
status += "审核中";
}
else if (of.m_orderData[i]["status"] == "2")
{
status += "预约成功";
}
else if (of.m_orderData[i]["status"] == "-1")
{
status += "预约失败,审核未通过";
}
else
{
status += "预约已取消";
}
cout << status << endl;
}
}
system("pause");
system("cls");
}
//查看所有预约
void Student::showAllOrder()
{
OrderFile of;
if (of.m_Size == 0)
{
cout << "无预约记录" << endl;
system("pasue");
system("cls");
return;
}
for (int i = 0; i < of.m_Size; i++)
{
cout << i + 1 << "、 ";
cout << "预约日期: 周" << of.m_orderData[i]["date"];
cout << " 时间段: " << (of.m_orderData[i]["interval"] == "1" ? "上午" : "下午");
cout << " 学号: " << of.m_orderData[i]["stuId"];
cout << " 姓名: " << of.m_orderData[i]["stuName"];
cout << " 机房编号: " << of.m_orderData[i]["roomId"];
string status = " 状态:";
// 1 审核中 2 已预约 -1预约失败 0 取消预约
if (of.m_orderData[i]["status"] == "1")
{
status += "审核中";
}
else if (of.m_orderData[i]["status"] == "2")
{
status += "预约成功";
}
else if (of.m_orderData[i]["status"] == "-1")
{
status += "预约失败,审核未通过";
}
else
{
status += "预约已取消";
}
cout << status << endl;
}
system("pause");
system("cls");
}
//取消预约
void Student::cancelOrder()
{
OrderFile of;
if (of.m_Size == 0)
{
cout << "无预约记录" << endl;
system("pause");
system("cls");
return;
}
cout << "审核中或预约成功的记录可以取消,请输入取消的记录" << endl;
vector<int>v; //存放在最大容器中的下标编号
int index = 1;
for (int i = 0; i < of.m_Size; i++)
{
//先判断是自身学号
if (this->m_Id == atoi(of.m_orderData[i]["stuId"].c_str()))
{
//再筛选状态 审核中或预约成功
if (of.m_orderData[i]["status"] == "1" || of.m_orderData[i]["status"] == "2")
{
v.push_back(i);
cout << index++ << "、 ";
cout << "预约日期: 周" << of.m_orderData[i]["date"];
cout << " 时间段: " << (of.m_orderData[i]["interval"] == "1" ? "上午" : "下午");
cout << " 机房编号: " << of.m_orderData[i]["roomId"];
string status = " 状态: ";
if (of.m_orderData[i]["status"] == "1")
{
status += "审核中";
}
else if (of.m_orderData[i]["status"] == "2")
{
status += "预约成功";
}
cout << status << endl;
}
}
}
cout << "请输入取消的记录,0代表返回" << endl;
int select = 0;
while (true)
{
cin >> select;
if (select >= 0 && select <= v.size())
{
if (select == 0)
{
break;
}
else
{
of.m_orderData[v[select - 1]]["status"] = "0";
of.updateOrder();
cout << "已取消预约" << endl;
break;
}
}
cout << "输入有误,请重新输入" << endl;
}
system("pause");
system("cls");
} | [
"yaozhi1234@126.com"
] | yaozhi1234@126.com |
32c7e63422befafda99a77e3376e7f6539357d10 | 095e8145dcd6687839c778129138bbde19467117 | /Sail/src/Sail/patterns/Subject.h | 294ffc39f7abd3464d80d6efa5532c5e43af98d5 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | BTH-StoraSpel-DXR/SPLASH | 684c2b4d64e2a225226940bcb69328a01b7de80a | 1bf4c9b96cbcce570ed3a97f30a556a992e1ad08 | refs/heads/master | 2020-07-12T08:24:10.465242 | 2020-06-26T14:14:39 | 2020-06-26T14:14:39 | 204,763,643 | 14 | 2 | MIT | 2020-06-26T14:14:41 | 2019-08-27T18:18:36 | C++ | UTF-8 | C++ | false | false | 379 | h | #pragma once
#include "Observer.h"
#include <vector>
class Subject {
public:
void addObserver(Observer* observer) {
m_observers.push_back(observer);
}
// TODO: Remove observer method
protected:
void notify(void* data, Event event) {
for (Observer* observer : m_observers) {
observer->onNotify(data, event);
}
}
private:
std::vector<Observer*> m_observers;
}; | [
"alexander.wester@gmail.com"
] | alexander.wester@gmail.com |
da2bab55f8eb5e37b3aa2467be8eb57726417d26 | e98e505de1a1a3542189125ef4bdde147f9c77cd | /printing/backend/cups_jobs.h | 12c2d513f43f2fe1c3593fbd96f985f2c184d335 | [
"BSD-3-Clause"
] | permissive | jesonlay/chromium | b98fca219ab71d230df9a758252058a18e075a06 | 292532fedbb55d68a83b46c106fd04849a47571d | refs/heads/master | 2022-12-16T15:25:13.723395 | 2017-03-20T14:36:34 | 2017-03-20T15:37:49 | 158,929,892 | 0 | 0 | NOASSERTION | 2018-11-24T11:32:20 | 2018-11-24T11:32:19 | null | UTF-8 | C++ | false | false | 4,188 | h | // Copyright 2017 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.
// Implementations of IPP requests for printer queue information.
#ifndef PRINTING_BACKEND_CUPS_JOBS_H_
#define PRINTING_BACKEND_CUPS_JOBS_H_
#include <cups/cups.h>
#include <string>
#include <vector>
#include "printing/printing_export.h"
namespace printing {
// Represents a print job sent to the queue.
struct PRINTING_EXPORT CupsJob {
// Corresponds to job-state from RFC2911.
enum JobState {
UNKNOWN,
PENDING, // waiting to be processed
HELD, // the job has not begun printing and will not without intervention
COMPLETED,
PROCESSING, // job is being sent to the printer/printed
STOPPED, // job was being processed and has now stopped
CANCELED, // either the spooler or a user canclled the job
ABORTED // an error occurred causing the printer to give up
};
// job id
int id = -1;
// printer name in CUPS
std::string printer_id;
JobState state = UNKNOWN;
// the last page printed
int current_pages = -1;
// detail for the job state
std::vector<std::string> state_reasons;
// human readable message explaining the state
std::string state_message;
// most recent timestamp where the job entered PROCESSING
int processing_started = 0;
};
// Represents the status of a printer containing the properties printer-state,
// printer-state-reasons, and printer-state-message.
struct PrinterStatus {
struct PrinterReason {
// Standardized reasons from RFC2911.
enum Reason {
UNKNOWN_REASON,
NONE,
MEDIA_NEEDED,
MEDIA_JAM,
MOVING_TO_PAUSED,
PAUSED,
SHUTDOWN,
CONNECTING_TO_DEVICE,
TIMED_OUT,
STOPPING,
STOPPED_PARTLY,
TONER_LOW,
TONER_EMPTY,
SPOOL_AREA_FULL,
COVER_OPEN,
INTERLOCK_OPEN,
DOOR_OPEN,
INPUT_TRAY_MISSING,
MEDIA_LOW,
MEDIA_EMPTY,
OUTPUT_TRAY_MISSING,
OUTPUT_AREA_ALMOST_FULL,
OUTPUT_AREA_FULL,
MARKER_SUPPLY_LOW,
MARKER_SUPPLY_EMPTY,
MARKER_WASTE_ALMOST_FULL,
MARKER_WASTE_FULL,
FUSER_OVER_TEMP,
FUSER_UNDER_TEMP,
OPC_NEAR_EOL,
OPC_LIFE_OVER,
DEVELOPER_LOW,
DEVELOPER_EMPTY,
INTERPRETER_RESOURCE_UNAVAILABLE
};
// Severity of the state-reason.
enum Severity { UNKNOWN_SEVERITY, REPORT, WARNING, ERROR };
Reason reason;
Severity severity;
};
// printer-state
ipp_pstate_t state;
// printer-state-reasons
std::vector<PrinterReason> reasons;
// printer-state-message
std::string message;
};
// Specifies classes of jobs.
enum JobCompletionState {
COMPLETED, // only completed jobs
PROCESSING // only jobs that are being processed
};
// Extracts structured job information from the |response| for |printer_id|.
// Extracted jobs are added to |jobs|.
void ParseJobsResponse(ipp_t* response,
const std::string& printer_id,
std::vector<CupsJob>* jobs);
// Attempts to extract a PrinterStatus object out of |response|.
void ParsePrinterStatus(ipp_t* response, PrinterStatus* printer_status);
// Attempts to retrieve printer status using connection |http| for |printer_id|.
// Returns true if succcssful and updates the fields in |printer_status| as
// appropriate. Returns false if the request failed.
bool GetPrinterStatus(http_t* http,
const std::string& printer_id,
PrinterStatus* printer_status);
// Attempts to retrieve job information using connection |http| for the printer
// named |printer_id|. Retrieves at most |limit| jobs. If |completed| then
// completed jobs are retrieved. Otherwise, jobs that are currently in progress
// are retrieved. Results are added to |jobs| if the operation was successful.
bool GetCupsJobs(http_t* http,
const std::string& printer_id,
int limit,
JobCompletionState completed,
std::vector<CupsJob>* jobs);
} // namespace printing
#endif // PRINTING_BACKEND_CUPS_JOBS_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
8a30053c72e9d31645ece183446f4a7c74e30e58 | 3695fa31c48e451e2e6dc618f49bf622ea45200f | /HandMadeIterator.cpp | 1963f71f565042323b6d907edbcfd215fc1ae377 | [] | no_license | AlexeyGorbunov72/lab7 | 7026669428fe684708387571eed8da4390826afc | b75abec7f76dc9fde0319297a862d786ff59ffd6 | refs/heads/master | 2022-07-04T12:22:40.707099 | 2020-05-07T06:55:20 | 2020-05-07T06:55:20 | 261,792,482 | 0 | 0 | null | 2020-05-10T17:52:55 | 2020-05-06T14:57:15 | C++ | UTF-8 | C++ | false | false | 1,713 | cpp | //
// Created by Alexey on 30.04.2020.
//
#include "HandMadeIterator.h"
template <class T>
HandMadeIterator<T>::HandMadeIterator() {}
template <class T>
void HandMadeIterator<T>::operator++(int){
this->counter++;
this->tail = &this->sequence[this->counter % this->size];
if (this->tail == this->head){
this->head = &this->sequence[(this->counter + 1) % this->size];
}
//std::cout << *tail << std::endl;
}
template <class T>
void HandMadeIterator<T>::operator--(int) {
this->counter--;
if(this->counter < 1){
this->counter = this->size + this->counter;
}
this->tail = &this->sequence[this->counter % this->size];
//std::cout << *tail << "counter: " << this->counter << std::endl;
}
template <class T>
void HandMadeIterator<T>::setUpIterator(T* sequence, int size) {
this->size = size;
this->sequence = sequence;
this->tail = &sequence[0];
this->head = &sequence[0];
this->counter = 0;
}
template <class T>
void HandMadeIterator<T>::operator<<(T value) {
*this->tail = value;
if (this->tail == this->head){
this->head = &this->sequence[(this->counter + 1) % this->size];
}
}
template <class T>
T* HandMadeIterator<T>::getTail() {
return this->tail;
}
template <class T>
T* HandMadeIterator<T>::getHead() {
return this->head;
}
template <class T>
void HandMadeIterator<T>::setHead(T *value) {
this->head = value;
}
template <class T>
void HandMadeIterator<T>::setTail(T *value) {
this->tail = value;
}
template <class T>
void HandMadeIterator<T>::setCounter(int value) {
this->counter = value;
}
template <class T>
int HandMadeIterator<T>::getCounter() {
return this->counter;
} | [
"korri.13@inbox.ru"
] | korri.13@inbox.ru |
015b6b2883bcd1bf7e91d758b67ed0ae626ee08a | 1da4946da8911fbce1290ddbf7b1a6141716057c | /CodeModel/ModuleHeader/RenderD3D11/Camera.h | c6a0d219b52f8dea190a5591120a2af06fbf8d18 | [] | no_license | liqunzheng/Dx11Study | 7ec206348788fb599b86a84ca76801f95f6eaa14 | ca126c8cf6ec9047aa43e293881aa437e8662cb8 | refs/heads/master | 2021-01-20T07:03:10.532414 | 2014-12-22T13:16:17 | 2014-12-22T13:16:17 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 937 | h | #pragma once
#include "RenderExport.h"
class RENDERD3D11_API CCamera
{
public:
//支持两种摄像机模型 AIRCRAFT 允许在空间自由运动,具有6个自由度
// LANDOBJECT 沿某些特定轴进行移动
enum CameraType { LANDOBJECT, AIRCRAFT };
CCamera();
~CCamera();
void strafe(float units); // 左右
void fly(float units); // 上下
void walk(float units); // 前后
void pitch(float angle); // 旋转view坐标系right向量
void yaw(float angle); // 旋转up向量
void roll(float angle); // 旋转look向量
void getViewMatrix(D3DXMATRIX* V);
void setCameraType(CameraType cameraType);
void getPosition(D3DXVECTOR3* pos);
void setPosition(D3DXVECTOR3* pos);
void getRight(D3DXVECTOR3* right);
void getUp(D3DXVECTOR3* up);
void getLook(D3DXVECTOR3* look);
void reCorver();
private:
CameraType _cameraType;
D3DXVECTOR3 _right;
D3DXVECTOR3 _up;
D3DXVECTOR3 _look;
D3DXVECTOR3 _pos;
};
| [
"lqzv@163.com"
] | lqzv@163.com |
24a37ca0ceb5692fbad6b814e90536de054dfca8 | a181e4c65ccef369d4ab7e182e2818aa622debc1 | /yact/dosbox_emu/stdafx.cpp | 13fe2722fd70a6d0c071b04026eb25696af97943 | [] | no_license | c1p31065/Win86emu | 259c32eb5bac1ed9c4f5ceebe2ca0aa07fdf4843 | 71c723fcab44d5aae3b6b3c86c87154ad3c4abb5 | refs/heads/master | 2021-12-02T18:24:51.564748 | 2014-02-06T14:12:11 | 2014-02-06T14:12:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 289 | cpp | // stdafx.cpp : source file that includes just the standard includes
// dosbox_emu.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
| [
"saberconer@gmail.com"
] | saberconer@gmail.com |
37dff1e1177da571829c528a061afc45544cab60 | 89d7facf3b5f4a982ce5c1ef050baf9958e17e85 | /吉田学園情報ビジネス専門学校_管原司/ハッカソン/ソースコード/HGS_2021_Spring(自身が制作した部分)/particle.cpp | 6dc923aa71d83560f27b7997b3d62ac462beaadf | [] | no_license | sugawaratukasa/Jobi_SugawaraTsukasa | 09827fa67d88a4c364dfba3b598eac4a76b60e4e | f3ea7866e78564308e709aeec1eb3cd61af4db9f | refs/heads/master | 2023-08-25T21:39:35.140466 | 2021-10-25T04:48:50 | 2021-10-25T04:48:50 | 389,308,380 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 15,441 | cpp | //******************************************************************************
// particle.cpp
// Author : 管原 司
//******************************************************************************
//******************************************************************************
// インクルードファイル
//******************************************************************************
#include "main.h"
#include "manager.h"
#include "renderer.h"
#include "billboard.h"
#include "particle_texture.h"
#include "particle.h"
#include "player_3d.h"
#include "mode_game.h"
//******************************************************************************
// マクロ定義
//******************************************************************************
#define MAX_TEXT (1024) // テキストの最大数
#define RANDOM_POS_MUT (10) // 10倍
#define MUT (2) // 2倍
#define ROT (D3DXVECTOR3(0.0f,0.0f,0.0f)) // 向き
#define MIN_COL (0.0f) // 色の最小値
#define MIN_LIFE (0) // ライフの最小値
#define MIN_SCALE (0.0f) // 拡大率の最小値
#define DEVIDE_SIZE (10) // サイズ除算
#define ROT_RANDOM (360) // 向きのランダム値
//******************************************************************************
// コンストラクタ
//******************************************************************************
CParticle::CParticle()
{
m_bAlpha_Blend = false;
m_bLife = false;
m_bRandomPos = false;
m_bRandomSize = false;
m_bAddScale = false;
m_bSubColor = false;
m_bRotRandom = false;
m_bTexRandom = false;
m_pos = INITIAL_D3DXVECTOR3;
m_Random_pos = INITIAL_D3DXVECTOR3;
m_size = INITIAL_D3DXVECTOR3;
m_move = INITIAL_D3DXVECTOR3;
m_AddAngle = INITIAL_D3DXVECTOR3;
m_color = INITIAL_D3DXCOLOR;
m_SubColor = INITIAL_D3DXCOLOR;
m_nAlpha = INIT_INT;
m_nLife = INIT_INT;
m_nTexNum = INIT_INT;
m_nMinTex_RandomNum = INIT_INT;
m_nMaxTex_RandomNum = INIT_INT;
m_fAngle = INIT_FLOAT;
m_fAddAngle = INIT_FLOAT;
m_fRandom_Min_Size = INIT_FLOAT;
m_fRandom_Max_Size = INIT_FLOAT;
m_fAddScale = INIT_FLOAT;
}
//******************************************************************************
// デストラクタ
//******************************************************************************
CParticle::~CParticle()
{
}
//******************************************************************************
// 生成関数
//******************************************************************************
CParticle *CParticle::Create(D3DXVECTOR3 pos, const char *cText)
{
// CParticleのポインタ
CParticle *pParticle;
// メモリ確保
pParticle = new CParticle;
// 位置代入
pParticle->SetPosition(pos);
// テキスト読み込み
pParticle->LoadParticle(cText);
// 初期化
pParticle->Init();
// ポインタを返す
return pParticle;
}
//******************************************************************************
// 初期化
//******************************************************************************
HRESULT CParticle::Init(void)
{
// 初期化
CBillboard::Init();
// サイズ設定
SetSize(m_size);
// サイズ設定
SetRotation(ROT);
// 色設定
SetColor(m_color);
if (m_bTexRandom == false)
{
// テクスチャ受け渡し
BindTexture(CManager::GetParticle_Texture()->GetTexture(m_nTexNum));
}
if (m_bTexRandom == true)
{
// テクスチャランダム
int nTexNum = (rand() % m_nMaxTex_RandomNum + m_nMinTex_RandomNum);
// テクスチャ受け渡し
BindTexture(CManager::GetParticle_Texture()->GetTexture(nTexNum));
}
// trueの場合
if (m_bRotRandom == true)
{
D3DXVECTOR3 rot = INITIAL_D3DXVECTOR3;
// 向きランダム
rot.z = float(rand() % ROT_RANDOM);
// ラジアン変換
rot = D3DXToRadian(rot);
// 向き設定
SetRotation(rot);
}
// trueの場合
if (m_bRandomSize == true)
{
// サイズ
D3DXVECTOR3 size = INITIAL_D3DXVECTOR3;
// サイズをランダム
float fRandomSize = float(rand() % (int)m_fRandom_Max_Size + (int)m_fRandom_Min_Size);
// サイズを設定
size.x = fRandomSize;
// サイズを設定
size.y = fRandomSize;
// サイズ設定
SetSize(size);
}
// trueの場合
if (m_bRandomPos == true)
{
// 向き取得
D3DXVECTOR3 pos = INITIAL_D3DXVECTOR3;
// 位置ランダム
pos.x = float(rand() % (int)m_pos.x *RANDOM_POS_MUT * MUT - (int)m_pos.x *RANDOM_POS_MUT / MUT);
// 除算
pos.x = pos.x / RANDOM_POS_MUT;
// 位置ランダム
pos.y = float(rand() % (int)m_pos.y * RANDOM_POS_MUT);
// 除算
pos.y = pos.y / RANDOM_POS_MUT;
// 位置ランダム
m_pos += pos;
// 位置設定
SetPosition(m_pos);
}
// 角度ランダム
m_fAngle = float(rand() % (int)m_fAngle);
// 角度取得
m_Angle.x = m_fAngle;
m_Angle.y = m_fAngle;
m_Angle.z = m_fAngle;
return S_OK;
}
//******************************************************************************
// 終了
//******************************************************************************
void CParticle::Uninit(void)
{
// 終了
CBillboard::Uninit();
}
//******************************************************************************
// 更新
//******************************************************************************
void CParticle::Update(void)
{
CPlayer3d * pPlayer = CGameMode::GetPlayer3d();
m_pos = pPlayer->GetPosition();
// 更新
CBillboard::Update();
// 位置取得
D3DXVECTOR3 pos = GetPosition();
// サイズ取得
D3DXVECTOR3 size = GetSize();
// 色取得
D3DXCOLOR col = GetColor();
// 拡大率取得
float fScale = GetScale();
// 角度加算
m_Angle.x += m_AddAngle.x;
m_Angle.y += m_AddAngle.y;
m_Angle.z += m_AddAngle.z;
// ライフを使用する場合
if (m_bLife == true)
{
// デクリメント
m_nLife--;
// ライフが0以下の場合
if (m_nLife <= MIN_LIFE)
{
// 終了
Uninit();
return;
}
}
// 拡大率加算が使用状態なら
if (m_bAddScale == true)
{
// 拡大率加算
fScale += m_fAddScale;
// 拡大率が0.0f以下の場合
if (fScale <= MIN_SCALE)
{
// 終了
Uninit();
return;
}
}
// 色減算を使用する場合
if (m_bSubColor == true)
{
// 減算
col -= m_SubColor;
// α値が0.0f以下の場合
if (col.a <= MIN_COL)
{
// 終了
Uninit();
return;
}
}
// 拡大率設定
SetScale(fScale);
// サイズ設定
SetSize(size);
// 色設定
SetColor(col);
// 位置更新
pos.x += cosf(D3DXToRadian(m_Angle.x))*m_move.x;
pos.y += sinf(D3DXToRadian(m_Angle.y))*m_move.y;
pos.z += sinf(D3DXToRadian(m_Angle.z))*m_move.z;
SetPosition(pos);
}
//******************************************************************************
// 描画
//******************************************************************************
void CParticle::Draw(void)
{
// 加算合成を行わない場合
if (m_bAlpha_Blend == false)
{
// 描画
CBillboard::Draw();
}
// 加算合成を行う場合
if (m_bAlpha_Blend == true)
{
// レンダラー取得
LPDIRECT3DDEVICE9 pDevice = CManager::GetRenderer()->GetDevice();
// 加算合成の設定
pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
// 描画
CBillboard::Draw();
// 元に戻す
pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
}
}
//******************************************************************************
// 情報設定
//******************************************************************************
void CParticle::LoadParticle(const char * cText)
{
// 読み込み用
char cReedText[MAX_TEXT];
// 文字の判別用
char cHeadText[MAX_TEXT];
// 使わない文字
char cDie[MAX_TEXT];
// ファイルポインタ
FILE *pFile = NULL;
// NULLの場合
if (pFile == NULL)
{
//ファイルを開く
pFile = fopen(cText, "r");
// NULLでない場合
if (pFile != NULL)
{
// SCRIPTの文字が見つかるまで
while (strcmp(cHeadText, "SCRIPT") != INIT_INT)
{
// テキストからcReedText分文字を読み込む
fgets(cReedText, sizeof(cReedText), pFile);
// 読み込んだ文字ををcHeadTextに格納
sscanf(cReedText, "%s", &cHeadText);
}
// cHeadTextがSCRIPTだったら
if (strcmp(cHeadText, "SCRIPT") == INIT_INT)
{
// END_SCRIPTの文字が見つかるまで
while (strcmp(cHeadText, "END_SCRIPT") != INIT_INT)
{
// テキストからcReedText分文字を読み込む
fgets(cReedText, sizeof(cReedText), pFile);
// 読み込んだ文字ををcHeadTextに格納
sscanf(cReedText, "%s", &cHeadText);
// cHeadTextがMOTIONSETだったら
if (strcmp(cHeadText, "SETTINGS") == INIT_INT)
{
// END_MOTIONSETの文字が見つかるまで
while (strcmp(cHeadText, "END_SETTINGS") != INIT_INT)
{
// テキストからcReedText分文字を読み込む
fgets(cReedText, sizeof(cReedText), pFile);
// 読み込んだ文字ををcHeadTextに格納
sscanf(cReedText, "%s", &cHeadText);
// cHeadTextがALPHA_BLENDの場合
if (strcmp(cHeadText, "ALPHA_BLEND") == INIT_INT)
{
// 情報をm_bAlpha_Blendに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, (int*)&m_bAlpha_Blend);
}
// cHeadTextがLIFEの場合
if (strcmp(cHeadText, "LIFE") == INIT_INT)
{
// 情報をm_bLifeに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, (int*)&m_bLife);
}
// cHeadTextがRANDOM_POSの場合
if (strcmp(cHeadText, "RANDOM_POS") == INIT_INT)
{
// 情報をm_bRandomPosに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, (int*)&m_bRandomPos);
}
// cHeadTextがRANDOM_SIZEの場合
if (strcmp(cHeadText, "RANDOM_SIZE") == INIT_INT)
{
// 情報をm_bRandomSizeに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, (int*)&m_bRandomSize);
}
// cHeadTextがADD_SCALEの場合
if (strcmp(cHeadText, "ADD_SCALE") == INIT_INT)
{
// 情報をm_bAddScaleに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, (int*)&m_bAddScale);
}
// cHeadTextがCOLOR_SUBTRACTの場合
if (strcmp(cHeadText, "COLOR_SUBTRACT") == INIT_INT)
{
// 情報をm_bSubColorに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, (int*)&m_bSubColor);
}
// cHeadTextがROT_RANDOMの場合
if (strcmp(cHeadText, "ROT_RANDOM") == INIT_INT)
{
// 情報をm_bRotRandomに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, (int*)&m_bRotRandom);
}
// cHeadTextがTEX_RANDOMの場合
if (strcmp(cHeadText, "TEX_RANDOM") == INIT_INT)
{
// 情報をm_bTexRandomに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, (int*)&m_bTexRandom);
}
// cHeadTextがTEXTURE_NUMの場合
if (strcmp(cHeadText, "TEXTURE_NUM") == INIT_INT)
{
// 情報をm_nTexNumに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, &m_nTexNum);
}
// cHeadTextがMIN_TEXTURE_RANDOM_NUMの場合
if (strcmp(cHeadText, "MIN_TEXTURE_RANDOM_NUM") == INIT_INT)
{
// 情報をm_nMinTex_RandomNumに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, &m_nMinTex_RandomNum);
}
// cHeadTextがMAX_TEXTURE_RANDOM_NUMの場合
if (strcmp(cHeadText, "MAX_TEXTURE_RANDOM_NUM") == INIT_INT)
{
// 情報をm_nMaxTex_RandomNumに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, &m_nMaxTex_RandomNum);
}
// cHeadTextがALPHA_NUMの場合
if (strcmp(cHeadText, "ALPHA_NUM") == INIT_INT)
{
// 情報をm_nAlphaに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, &m_nAlpha);
}
// cHeadTextがSIZEの場合
if (strcmp(cHeadText, "SIZE") == INIT_INT)
{
// 情報をm_bRandomPosに格納
sscanf(cReedText, "%s %s %f %f %f", &cDie, &cDie, &m_size.x, &m_size.y, &m_size.z);
}
// cHeadTextがMOVEの場合
if (strcmp(cHeadText, "MOVE") == INIT_INT)
{
// 情報をm_moveに格納
sscanf(cReedText, "%s %s %f %f %f", &cDie, &cDie, &m_move.x, &m_move.y, &m_move.z);
}
// cHeadTextがANGLEの場合
if (strcmp(cHeadText, "ANGLE") == INIT_INT)
{
// 情報をm_fAngleに格納
sscanf(cReedText, "%s %s %f", &cDie, &cDie, &m_fAngle);
}
// cHeadTextがANGLEの場合
if (strcmp(cHeadText, "ADD_ANGLE") == INIT_INT)
{
// 情報をm_fAngleに格納
sscanf(cReedText, "%s %s %f %f %f", &cDie, &cDie, &m_AddAngle.x, &m_AddAngle.y, &m_AddAngle.z);
}
// cHeadTextがCOLORの場合
if (strcmp(cHeadText, "COLOR") == INIT_INT)
{
// 情報をm_colorに格納
sscanf(cReedText, "%s %s %f %f %f %f", &cDie, &cDie, &m_color.r, &m_color.g, &m_color.b, &m_color.a);
}
// cHeadTextがLIFE_VALUEの場合
if (strcmp(cHeadText, "LIFE_VALUE") == INIT_INT)
{
// 情報をm_nLifeに格納
sscanf(cReedText, "%s %s %d", &cDie, &cDie, &m_nLife);
}
// cHeadTextがADD_SCALE_VALUEの場合
if (strcmp(cHeadText, "ADD_SCALE_VALUE") == INIT_INT)
{
/// 情報をm_fAddScaleに格納
sscanf(cReedText, "%s %s %f", &cDie, &cDie, &m_fAddScale);
}
// cHeadTextがCOLOR_SUB_VALUEの場合
if (strcmp(cHeadText, "COLOR_SUB_VALUE") == INIT_INT)
{
// 情報をm_SubColorに格納
sscanf(cReedText, "%s %s %f %f %f %f", &cDie, &cDie, &m_SubColor.r, &m_SubColor.g, &m_SubColor.b, &m_SubColor.a);
}
// cHeadTextがMIN_SIZE_VALUEの場合
if (strcmp(cHeadText, "MIN_SIZE_VALUE") == INIT_INT)
{
// 情報をm_fRandom_Min_Sizeに格納
sscanf(cReedText, "%s %s %f", &cDie, &cDie, &m_fRandom_Min_Size);
}
// cHeadTextがMAX_SIZE_VALUEの場合
if (strcmp(cHeadText, "MAX_SIZE_VALUE") == INIT_INT)
{
// 情報をm_fRandom_Max_Sizeに格納
sscanf(cReedText, "%s %s %f", &cDie, &cDie, &m_fRandom_Max_Size);
}
// cHeadTextがRANDOM_POS_VALUEの場合
if (strcmp(cHeadText, "RANDOM_POS_VALUE") == INIT_INT)
{
// 情報をm_fRandomPosに格納
sscanf(cReedText, "%s %s %f %f %f", &cDie, &cDie, &m_Random_pos.x, &m_Random_pos.y, &m_Random_pos.z);
}
}
}
}
// ファイルを閉じる
fclose(pFile);
}
// 開けなかったら
else
{
printf("ファイルを開く事が出来ませんでした。\n");
}
}
}
}
//******************************************************************************
// テクスチャ番号設定
//******************************************************************************
void CParticle::SetTexNum(int nTexNum)
{
m_nTexNum = nTexNum;
}
//******************************************************************************
// エフェクト生成
//******************************************************************************
void CParticle::CreateEffect(D3DXVECTOR3 pos, int nCreateNum, const char *cText)
{
// 数分生成
for (int nCnt = INIT_INT; nCnt < nCreateNum; nCnt++)
{
// 生成
Create(pos, cText);
}
} | [
"stjbi99956@gmail.com"
] | stjbi99956@gmail.com |
a890902848d538a135c80901fabcf5b1a00debf5 | 51635684d03e47ebad12b8872ff469b83f36aa52 | /external/gcc-12.1.0/libstdc++-v3/testsuite/26_numerics/random/ranlux48_base.cc | 745e76c51c1f6e316109e67d02b977e0d8f3c289 | [
"Zlib",
"LicenseRef-scancode-public-domain",
"LGPL-2.1-only",
"GPL-3.0-only",
"GCC-exception-3.1",
"GPL-2.0-only",
"LGPL-3.0-only",
"LGPL-2.0-or-later"
] | permissive | zhmu/ananas | 8fb48ddfe3582f85ff39184fc7a3c58725fe731a | 30850c1639f03bccbfb2f2b03361792cc8fae52e | refs/heads/master | 2022-06-25T10:44:46.256604 | 2022-06-12T17:04:40 | 2022-06-12T17:04:40 | 30,108,381 | 59 | 8 | Zlib | 2021-09-26T17:30:30 | 2015-01-31T09:44:33 | C | UTF-8 | C++ | false | false | 1,178 | cc | // { dg-do run { target c++11 } }
// { dg-require-cstdint "" }
//
// 2008-11-18 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2008-2022 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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 3, 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 26.4.5 Engines and egine adaptors with predefined parameters [rand.predef]
// 26.4.5 [6]
#include <random>
#include <testsuite_hooks.h>
void
test01()
{
std::ranlux48_base a;
a.discard(9999);
VERIFY( a() == 61839128582725ull );
}
int main()
{
test01();
return 0;
}
| [
"rink@rink.nu"
] | rink@rink.nu |
9f15e0c3edc87c90c6714e7cd876addc8371caaf | 71b6f2ae57ccca18a53d2e75cc543cdf44e3a02f | /剑指offer/58-2.cpp | 9ff08c2282318a898acbc39bf7ed436846a446b5 | [] | no_license | tangjiahua/all-my-code | bbaf00cd2f9341e75cba7c32e02be39f1251779c | 62b8606372aeeae456087418a3213e7516ffa4c9 | refs/heads/master | 2023-06-01T14:52:02.333317 | 2021-06-14T19:01:17 | 2021-06-14T19:01:17 | 353,415,805 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 197 | cpp | char* reverseLeftWords(char* s, int n){
int len = strlen(s);
char *p = (char*)malloc(sizeof(char)*len+1);
strcpy(p, s+n);
strncpy(p+len-n, s, n);
p[len] = '\0';
return p;
}
| [
"tangjiahuabit@qq.com"
] | tangjiahuabit@qq.com |
101b64df614b7cb9ab5aa9f3d67518869dd2b064 | 7a550d2268bc4bc7e2fec608ffb1db4b2e5e94a0 | /0901-1000/0978-Longest Turbulent Subarray/0978-Longest Turbulent Subarray.cpp | 4b55819f1010586a8a6a8e2ef02c14e1416d67fd | [
"MIT"
] | permissive | jiadaizhao/LeetCode | be31bd0db50cc6835d9c9eff8e0175747098afc6 | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | refs/heads/master | 2021-11-05T04:38:47.252590 | 2021-10-31T09:54:53 | 2021-10-31T09:54:53 | 99,655,604 | 52 | 28 | MIT | 2020-10-02T12:47:47 | 2017-08-08T05:57:26 | C++ | UTF-8 | C++ | false | false | 563 | cpp | class Solution {
public:
int maxTurbulenceSize(vector<int>& A) {
int maxLen = 1, inc = 1, dec = 1;
for (int i = 1; i < A.size(); ++i) {
if (A[i] > A[i - 1]) {
inc = dec + 1;
maxLen = max(maxLen, inc);
dec = 1;
}
else if (A[i] < A[i - 1]) {
dec = inc + 1;
maxLen = max(maxLen, dec);
inc = 1;
}
else {
inc = dec = 1;
}
}
return maxLen;
}
};
| [
"jiadaizhao@gmail.com"
] | jiadaizhao@gmail.com |
5dd8f3b48e33d1048e41ee8d4b907404b18dc09c | b3439873c106d69b6ae8110c36bcd77264e8c5a7 | /server/Common/Packets/GWMail.h | 5252faf7820c5d1548cb8e2369da682aa4746c1b | [] | no_license | cnsuhao/web-pap | b41356411dc8dad0e42a11e62a27a1b4336d91e2 | 7c9b1f49d9ba8d8e40f8fddae829c2e414ccfeca | refs/heads/master | 2021-05-28T01:01:18.122567 | 2013-11-19T06:49:41 | 2013-11-19T06:49:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,348 | h |
#ifndef __GWMAIL_H__
#define __GWMAIL_H__
#include "Type.h"
#include "Packet.h"
#include "PacketFactory.h"
namespace Packets
{
class GWMail : public Packet
{
public:
GWMail( ){} ;
virtual ~GWMail( ){} ;
//公用继承接口
virtual BOOL Read( SocketInputStream& iStream ) ;
virtual BOOL Write( SocketOutputStream& oStream )const ;
virtual UINT Execute( Player* pPlayer ) ;
virtual PacketID_t GetPacketID()const { return PACKET_GW_MAIL ; }
virtual UINT GetPacketSize()const
{
return GetMailSize(m_Mail) ;
}
public:
//使用数据接口
VOID SetMail( MAIL* pMail ){ m_Mail = *pMail ; }
MAIL* GetMail( ){ return &m_Mail ; }
private:
//数据
MAIL m_Mail ;
};
class GWMailFactory : public PacketFactory
{
public:
Packet* CreatePacket() { return new GWMail() ; }
PacketID_t GetPacketID()const { return PACKET_GW_MAIL ; }
UINT GetPacketMaxSize()const { return sizeof(MAIL) ; }
};
class GWMailHandler
{
public:
static UINT Execute( GWMail* pPacket, Player* pPlayer ) ;
};
};
using namespace Packets ;
#endif
| [
"viticm@126.com"
] | viticm@126.com |
d01361cec6df272b0a5bb5792c78b14a582f2c50 | 06bed8ad5fd60e5bba6297e9870a264bfa91a71d | /LayoutEditor/xmladapter.h | a75fdb01825bb0f2e782a0825b7945c6fe373caf | [] | no_license | allenck/DecoderPro_app | 43aeb9561fe3fe9753684f7d6d76146097d78e88 | 226c7f245aeb6951528d970f773776d50ae2c1dc | refs/heads/master | 2023-05-12T07:36:18.153909 | 2023-05-10T21:17:40 | 2023-05-10T21:17:40 | 61,044,197 | 4 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 7,423 | h | #ifndef XMLADAPTER_H
#define XMLADAPTER_H
#include <QObject>
#include <QtXml>
#include "exceptions.h"
#include "configxmlmanager.h"
#include "liblayouteditor_global.h"
#include "dialogerrorhandler.h"
/**
* Interface assumed during configuration operations.
*
* @author Bob Jacobsen Copyright (c) 2002
* @version $Revision: 18102 $
* @see ConfigXmlManager
*/
class ConfigXmlManager;
/*public*/ /*interface*/ class LIBLAYOUTEDITORSHARED_EXPORT XmlAdapter : public QObject {
Q_OBJECT
public:
/**
* Create a set of configured objects from their
* XML description
* @param e Top-level XML element containing the description
* @throws Exception when a error prevents creating the objects as
* as required by the input XML.
* @return true if successful
*/
/*public*/ virtual bool load(QDomElement /*e*/) /*throw (Exception)*/ { return false;}
/**
* Create a set of configured objects from their XML description.
*
* @param shared Top-level XML element containing the common, multi-node
* elements of the description
* @param perNode Top-level XML element containing the private, single-node
* elements of the description
* @throws Exception when a error prevents creating the objects as as
* required by the input XML.
* @return true if successful
*/
/*public*/ virtual bool load(QDomElement /*shared*/, QDomElement /*perNode*/) {return false;} //throws Exception;
/**
* Determine if this set of configured objects should
* be loaded after basic GUI construction is completed
* @return true to defer loading
* @since 2.11.2
*/
/*public*/ virtual bool loadDeferred()const =0;
/**
* Create a set of configured objects from their
* XML description, using an auxiliary object.
* <P>
* For example, the auxilary object o might be a manager or GUI of some type
* that needs to be informed as each object is created.
*
* @param e Top-level XML element containing the description
* @param o Implementation-specific Object needed for the conversion
* @throws Exception when a error prevents creating the objects as
* as required by the input XML.
*/
/*public*/ virtual void load(QDomElement /*e*/, QObject* /*o*/) /*throw (Exception)*/ {}
/**
* Create a set of configured objects from their XML description, using an
* auxiliary object.
* <P>
* For example, the auxilary object o might be a manager or GUI of some type
* that needs to be informed as each object is created.
*
* @param shared Top-level XML element containing the common description
* @param perNode Top-level XML element containing the per-node description
* @param o Implementation-specific Object needed for the conversion
* @throws Exception when a error prevents creating the objects as as
* required by the input XML.
*/
/*public*/ virtual void load(QDomElement /*shared*/, QDomElement /*perNode*/, QObject* /*o*/) /*throw (JmriConfigureXmlException)*/ {}
/**
* Store the
* @param o The object to be recorded. Specific XmlAdapter
* implementations will require this to be of a specific
* type; that binding is done in ConfigXmlManager.
* @return The XML representation QDomElement
*/
/*public*/ virtual QDomElement store(QObject* o)
{
Q_UNUSED(o)
return QDomElement();
}
/**
* Store the object in XML
*
* @param o The object to be recorded. Specific XmlAdapter
* implementations will require this to be of a specific type;
* that binding is done in ConfigXmlManager.
* @param shared true if the returned element should be the common XML and
* false if the returned element should be per-node.
* @return The XML representation Element
*/
/*public*/ virtual QDomElement store(QObject* o, bool shared)
{
if (shared)
{
return store(o);
}
return QDomElement();
}
/*public*/ virtual int loadOrder() const =0;
/**
* Invoke common handling of errors that
* happen during the "load" process.
*
* This is part of the interface to ensure that
* all the necessary classes provide it; eventually
* it will be coupled to a reporting mechanism of some
* sort.
*
* @param description description of error encountered
* @param systemName System name of bean being handled, may be null
* @param userName used name of the bean being handled, may be null
* @param exception Any exception being handled in the processing, may be null
* @throws JmriConfigureXmlException in place for later expansion;
* should be propagated upward to higher-level error handling
*/
QT_DEPRECATED/*public*/ virtual void creationErrorEncountered (
QString description,
QString systemName,
QString userName,
Exception* exception
) /*throw (JmriConfigureXmlException)*/
{
this->handleException(description, nullptr, systemName, userName, exception);
}
/**
* Provide a simple handler for errors.
*
* Calls the configured {@link jmri.configurexml.ErrorHandler} with an
* {@link jmri.configurexml.ErrorMemo} created using the provided
* parameters.
*
* @param description description of error encountered
* @param operation the operation being performed, may be null
* @param systemName system name of bean being handled, may be null
* @param userName user name of the bean being handled, may be null
* @param exception Any exception being handled in the processing, may be
* null
* @throws JmriConfigureXmlException in place for later expansion; should be
* propagated upward to higher-level error
* handling
*/
virtual/*public*/ void handleException(
/*@Nonnull*/ QString /*description*/,
/*@Nullable*/ QString /*operation*/,
/*@Nullable*/ QString /*systemName*/,
/*@Nullable*/ QString /*userName*/,
/*@Nullable*/ Exception* /*exception*/) { }/*throws JmriConfigureXmlException*/
/**
* Set the error handler that will handle any errors encountered while
* parsing the XML. If not specified, the default error handler will be
* used.
*
* @param errorHandler the error handler or null to ignore parser errors
*/
/*public*/ void setExceptionHandler(ErrorHandler* errorHandler);
/**
* Get the current error handler.
*
* @return the error handler or null if no error handler is assigned
*/
/*public*/ ErrorHandler* getExceptionHandler();
/**
* Get the default error handler.
*
* @return the default error handler
*/
/*public*/ static ErrorHandler* getDefaultExceptionHandler() {
// if (GraphicsEnvironment.isHeadless()) {
// return new ErrorHandler();
// }
return new DialogErrorHandler();
}
/*public*/ virtual void setConfigXmlManager(ConfigXmlManager* /*c*/) {}
friend class PanelEditorXml;
friend class AbstractSignalHeadManagerXml;
friend class ControlPanelEditorXml;
};
#endif // XMLADAPTER_H
| [
"allenck@windstream.net"
] | allenck@windstream.net |
57397b1f6e8d3bac1414e69102b71da83b5489c2 | 910c6b561221b5ff03f20486ba88e43978d6e3db | /AntsLib/include/AntsLib/Core/Board/Board.hpp | 7fb91402dbc78f55ff66d05c43aeb94d95ac3300 | [] | no_license | MarekOchocki/AntsProject | 1d5f00e702574c253de3dc2fcc971fa971db23b1 | 25c76ba482d8848512617cd7c7ccd2f55c8045c0 | refs/heads/main | 2023-01-21T17:17:01.365466 | 2020-12-04T13:58:16 | 2020-12-04T13:58:16 | 318,532,222 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,729 | hpp | #pragma once
#include <SFML/Graphics.hpp>
#include <Utils/Types.hpp>
#include <AntsLib/Core/Board/BoardState/BoardEntity.hpp>
#include <AntsLib/Core/Board/BoardState/Tile.hpp>
class BoardEntity;
enum BoardEntityType;
class Board {
private:
Vector2i size;
std::vector<Tile> tiles;
std::map<int, std::shared_ptr<BoardEntity>> entities;
sf::VertexArray tilesVertexes;
int lastUsedId = 0;
void initTilesVertexes(const std::vector<Tile> tiles);
void appendVertexesFromTile(Tile &tile);
sf::IntRect getVisibleRectangleOfTiles(const sf::RenderTarget& target) const;
sf::IntRect createVisibleRectangleOfTiles(const sf::RenderTarget& target) const;
void trimVisibleRectangeOfTiles(sf::IntRect& rectangleToTrim) const;
void updateColorsOfVisibleTiles(sf::RenderTarget & target);
void updateVertexesColorForTile(int x, int y);
int positionToIndexInTiles(int x, int y) const;
void initTiles();
std::vector<int> getIdsOfDeadEntities() const;
void removeDeadEntities();
public:
Board(Vector2i size);
void perform1Cycle();
void drawOn(sf::RenderTarget & target);
void addEntity(std::shared_ptr<BoardEntity> newEntity);
int getNextAvailableId();
Vector2i getSize() const;
Tile& getTileOnPosition(int x, int y);
Tile& getTileOnPosition(const Vector2i& position);
const Tile& getTileOnPosition(int x, int y) const;
const Tile& getTileOnPosition(const Vector2i& position) const;
int getEntityOnTileTeamId(int x, int y) const;
int getEntityOnTileTeamId(const Vector2i& position) const;
BoardEntityType getEntityOnTileType(int x, int y) const;
BoardEntityType getEntityOnTileType(const Vector2i& position) const;
bool isPositionOnBoard(int x, int y) const;
bool isPositionOnBoard(Vector2i position) const;
}; | [
"marcopolo97@vp.pl"
] | marcopolo97@vp.pl |
4110a5690a712ec03e9d4747b688ccafcf02ace9 | 32acee5e0e04e52ae6cb37ba4b5a9ef76ff5e7e4 | /Engine/Engine_Utility/Codes/ResourcesMgr.h | ecf86d720886826f6cf72d50f82eea5212506311 | [] | no_license | Repell/DragOn | 4fc777ddf09ef2ff4fc66e067f9d056e29c3b133 | 6e49e6ab27d7e193acc2d02b444721d3245d3ed5 | refs/heads/master | 2020-06-19T22:46:32.733968 | 2019-08-07T12:49:13 | 2019-08-07T12:49:13 | 196,902,561 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,847 | h | #ifndef ResourcesMgr_h__
#define ResourcesMgr_h__
#include "Engine_Define.h"
#include "Base.h"
#include "Texture.h"
#include "TriCol.h"
#include "TriTex.h"
#include "RcCol.h"
#include "RcTex.h"
#include "CubeTex.h"
#include "SkyBox.h"
#include "TerrainTex.h"
#include "StaticMesh.h"
#include "DynamicMesh.h"
#include "NaviMesh.h"
NS_BEGIN(ENGINE)
class ENGINE_DLL CResourcesMgr :
public CBase
{
DECLARE_SINGLETON(CResourcesMgr)
private:
explicit CResourcesMgr(void);
virtual ~CResourcesMgr(void);
public:
HRESULT Reserve_ContainerSize(const _ushort& wSize);
HRESULT Ready_Buffers(LPDIRECT3DDEVICE9 pGraphicDev,
const _ushort& wContainerIdx,
const _tchar* pBufferTag,
BUFFERID eID, const WORD vtxX = 0, const WORD vtxY = 0, const WORD Intv = 0, const WORD wDetail = 1);
HRESULT Ready_Texture(LPDIRECT3DDEVICE9 pGraphicDev,
const _ushort& wContainerIdx,
const _tchar* pTextureTag,
TEXTURETYPE eType,
const _tchar* pPath,
const _uint& iCnt = 1);
HRESULT Ready_Meshes(LPDIRECT3DDEVICE9 pGraphicDev,
const _ushort& wContainerIdx,
const _tchar* pMeshTag,
MESHTYPE eType,
const _tchar* pFilePath,
const _tchar* pFileName);
void Render_Buffers(const _ushort& wContainerIdx,
const _tchar* pBufferTag);
void Render_Texture(const _ushort & wContainerIdx, const _tchar * pTextureTag, const _uint iCnt = 0);
private:
CResourceses* Find_Resources(const _ushort wContainerIdx,
const _tchar* pResourcesTag);
public:
CResourceses* Clone_Resources(const _ushort& wContainIdx, const _tchar* pResourceTag);
void Release_Terrain(const _ushort wContainerIdx, const _tchar * pResourceTag);
private:
map<const _tchar*, CResourceses*>* m_pMapResources;
typedef map<const _tchar*, CResourceses*> MAP_RESOURCES;
_ulong m_iContainerSize;
public:
virtual void Free(void);
};
NS_END
#endif // ResourcesMgr_h__
| [
"EASTNOTE@EASTNOTE"
] | EASTNOTE@EASTNOTE |
4c00309ec042e7813c4f2180aca8224fe1dd4fa3 | 4bc71c372535554f9a9c9b612796213770204a0a | /Embarcadero/XE5/CPP/BoostAlgorithms/MainForm.h | 02833004b72887ca94ef01f01af38f5f9a884078 | [] | no_license | jimmyat2023/Firemonkey | e843cea2a4475138ec281ae712455d9240a062c4 | fe8a78893c6df92fe6a6aa472d8698d3fe1f52e0 | refs/heads/master | 2023-03-22T10:44:55.203200 | 2020-02-19T14:09:36 | 2020-02-19T14:09:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,198 | h | //---------------------------------------------------------------------------
#ifndef MainFormH
#define MainFormH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <FMX.Controls.hpp>
#include <FMX.Forms.hpp>
#include <FMX.Edit.hpp>
#include <FMX.Layouts.hpp>
#include <FMX.ListBox.hpp>
#include <FMX.Memo.hpp>
#include <FMX.Types.hpp>
#include <FMX.StdCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *AddToListButton;
TListBox *ListBox1;
TButton *TestButton;
TMemo *Memo1;
TNumberBox *NumberBox1;
TButton *ClearListButton;
TNumberBox *NumberBox2;
void __fastcall AddToListButtonClick(TObject *Sender);
void __fastcall TestButtonClick(TObject *Sender);
void __fastcall ClearListButtonClick(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
| [
"eli@peacekeeper.com"
] | eli@peacekeeper.com |
44ddc8fdab2f2551cba1ae68b2ba94d6cb6d3373 | 0ab5b3e86ea65a9fb216e7178b3f8ae5fe6b3a1c | /mobile/taf/src/node/CommandDestroy.h | 5146b694ea977a322f1bd5955a87cc8e62fba7de | [] | no_license | lineCode/mobile-1 | 197675bcde3d8db021c84858e276fc961b960643 | 66971911b57105b8ef5ad126b089b3fd1cc0f9b0 | refs/heads/master | 2020-03-29T11:02:22.037467 | 2017-02-13T09:40:59 | 2017-02-13T09:40:59 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,340 | h | #ifndef __DESTROY_COMMAND_H_
#define __DESTROY_COMMAND_H_
#include "ServerCommand.h"
/**
* 销毁服务
*
*/
class CommandDestroy : public ServerCommand
{
public:
CommandDestroy(const ServerObjectPtr &pServerObjectPtr,bool bByNode = false);
ExeStatus canExecute(string &sResult);
int execute(string &sResult);
private:
bool _bByNode;
ServerDescriptor _tDesc;
ServerObjectPtr _pServerObjectPtr;
private:
StatExChangePtr _pStatExChange;
};
//////////////////////////////////////////////////////////////
//
inline CommandDestroy::CommandDestroy(const ServerObjectPtr &pServerObjectPtr,bool bByNode)
:_bByNode(bByNode)
,_pServerObjectPtr(pServerObjectPtr)
{
_tDesc = _pServerObjectPtr->getServerDescriptor();
}
//////////////////////////////////////////////////////////////
//
inline ServerCommand::ExeStatus CommandDestroy::canExecute(string &sResult)
{
TC_ThreadRecLock::Lock lock( *_pServerObjectPtr );
LOG->debug() << _tDesc.application<< "." << _tDesc.serverName << " beging destroyed------|"<< endl;
ServerObject::InternalServerState eState = _pServerObjectPtr->getInternalState();
if (eState != ServerObject::Inactive)
{
sResult = "server state is not Inactive. the curent state is " + _pServerObjectPtr->toStringState( eState );
LOG->debug() << sResult << endl;
return DIS_EXECUTABLE;
}
_pStatExChange = new StatExChange(_pServerObjectPtr, ServerObject::Destroying, ServerObject::Destroyed);
return EXECUTABLE;
}
//////////////////////////////////////////////////////////////
//
inline int CommandDestroy::execute(string &sResult)
{
try
{
string sServerDir = _pServerObjectPtr->getServerDir();
string sServerId = _pServerObjectPtr->getServerId();
if(TC_File::isFileExistEx(sServerDir, S_IFDIR))
{
TC_File::removeFile(sServerDir,true);
}
else
{
LOG->error() << "[" << sServerId << "]'s server path doesnot exist:" << sServerDir << endl;
}
//删除服务日志目录
//>>added by spinnerxu@20110728
string sLogPath = _pServerObjectPtr->getLogPath();
if (sLogPath.empty())
{//使用默认路径
sLogPath = "/usr/local/app/taf/app_log/";
}
vector<string> vtServerNames = TC_Common::sepstr<string>(sServerId,".");
if (vtServerNames.size() != 2)
{
LOG->error() << __FUNCTION__ << ":" << __LINE__ << "|parse serverid error:" << sServerId << "|" << vtServerNames.size() << endl;
sResult = "failed to remove log path, server name error:" + sServerId;
//return -1;
}
else
{
sLogPath += vtServerNames[0] + "/" + vtServerNames[1];
sLogPath = TC_File::simplifyDirectory(sLogPath);
if (TC_File::isFileExistEx(sLogPath, S_IFDIR))
{
if (0 == TC_File::removeFile(sLogPath,true))
{
LOG->debug() << "remove log path success:" << sLogPath << "|" << sServerId << endl;
}
else
{
LOG->error() << "failed to remove log path:" << sLogPath << "|" << sServerId << endl;
}
}
else
{
LOG->debug() << "[" << sServerId << "]'s log path doesnot exist:" << sLogPath << endl;
}
}
//<<
}
catch (exception& e)
{
sResult = "ServerObject::destroy Exception:" + string(e.what());
LOG->error() <<sResult;
return -1;
}
return 0;
}
#endif
| [
"zys0633@175game.com"
] | zys0633@175game.com |
6d2abaf76cfa631508c45333be9fc4f7152a1a69 | 54cd0abad1a3c5a9ca2f6ad8f7f6b6d7a1a9eec9 | /leetcode-daily/part3/q6/main.cpp | c2166f5e4d67a172c6e7c0a98efc28696b74a552 | [] | no_license | AceCoooool/Own-Note | f0e2e3038018c2eb23b0f1d3351b35a68a8d552d | 0e4faff298b7b8813ed8d8384b8c74ad482c3cc5 | refs/heads/master | 2020-03-27T20:19:20.063690 | 2019-03-20T14:32:00 | 2019-03-20T14:32:00 | 147,058,946 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 476 | cpp | #include <iostream>
#include <vector>
using namespace std;
int removeDuplicates(vector<int> &nums) {
int cur = 0;
for (int j = 1; j < nums.size(); ++j) {
if (nums[j] != nums[cur])
nums[++cur] = nums[j];
}
return nums.size() == 0 ? cur : cur + 1;
}
int main() {
vector<int> nums{0, 0, 1, 1, 1, 2, 2, 3, 3, 4};
auto res = removeDuplicates(nums);
for (int i = 0; i < res; ++i)
cout << nums[i] << " ";
cout << endl;
} | [
"tinyshine@yeah.net"
] | tinyshine@yeah.net |
837d9c8c5749c2f0c96b2fc3fbfa0ee49ac5ca04 | e7f9a827fcc675371aa726c49ce657a1e83ede97 | /w3/w3cpp/Car/Car.cpp | abd7564ec412458869b2048511aa2a8bce3032d3 | [] | no_license | Altahoma/boot-camp | 3d2ea722e07dab4a89c90ef7f8cc61e143593106 | 848b645fa11ea307e75f5dcd967d0d68b1de22b3 | refs/heads/master | 2020-05-19T19:54:53.366155 | 2019-05-06T12:33:51 | 2019-05-06T12:33:51 | 185,191,425 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,746 | cpp | #include <iostream>
#include "Car.h"
#include "Point.h"
Car::Car(double capacity, double consumption, const Point& location, const std::string& model) {
this->fuelAmount = 0;
this->fuelCapacity = capacity;
this->fuelConsumption = consumption;
this->location = location;
this->model = model;
}
Car::~Car() {
}
double Car::getFuelAmount() const {
return this->fuelAmount;
}
double Car::getFuelCapacity() const {
return this->fuelCapacity;
}
double Car::getFuelConsumption() const {
return this->fuelConsumption;
}
const Point& Car::getLocation() const {
return this->location;
}
const std::string& Car::getModel () const {
return this->model;
}
void Car::drive(const Point& destination) {
double fuelNeeded = location.distance(destination) * fuelConsumption;
if ( fuelNeeded > fuelAmount ) {
throw OutOfFuel();
}
this->fuelAmount -= fuelNeeded;
this->location = destination;
}
void Car::drive(double x, double y) {
double fuelNeeded = location.distance(Point(x, y)) * fuelConsumption;
if ( fuelNeeded > fuelAmount ) {
throw OutOfFuel();
}
this->fuelAmount -= fuelNeeded;
this->location = Point(x, y);
}
void Car::refill(double fuel) {
if ( fuel <= 0 ) {
throw OutOfFuel();
}
if ( fuel > fuelCapacity - fuelAmount ) {
throw ToMuchFuel();
}
this->fuelAmount += fuel;
}
std::ostream& operator<<(std::ostream& out, const Car& car) {
out << car.getModel() << ' ' << "[Amount fuel: " << car.getFuelAmount() << '/' << car.getFuelCapacity() << ']' << ' ' << "[Consumption: " << car.getFuelConsumption() << "] " << "[Location: " << car.getLocation() << ']';
return out;
} | [
"none"
] | none |
f483609971927f2e8ba163e0e23a724101929a5b | 88ba6c1ba297367b29aed53cacafbf66adc3dfb4 | /pdf/draw_utils/coordinates.cc | d3ed045df5ec2f2902952be6480ba3bd9969d937 | [
"BSD-3-Clause"
] | permissive | Toufique-Sk/chromium | 13f7d1dd7e89ef9bffdaca278b2d24f96db2b64b | 5d5c53d4e092e121dacf7f3a965231eca2d2cb44 | refs/heads/master | 2023-03-17T17:52:10.591739 | 2019-07-16T17:08:58 | 2019-07-16T17:08:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 860 | cc | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "pdf/draw_utils/coordinates.h"
#include <math.h>
#include "base/logging.h"
#include "ppapi/cpp/point.h"
namespace chrome_pdf {
namespace draw_utils {
pp::Rect GetScreenRect(const pp::Rect& rect,
const pp::Point& position,
double zoom) {
DCHECK_GT(zoom, 0);
int x = static_cast<int>(rect.x() * zoom - position.x());
int y = static_cast<int>(rect.y() * zoom - position.y());
int right = static_cast<int>(ceil(rect.right() * zoom - position.x()));
int bottom = static_cast<int>(ceil(rect.bottom() * zoom - position.y()));
return pp::Rect(x, y, right - x, bottom - y);
}
} // namespace draw_utils
} // namespace chrome_pdf
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
871db832bf1e5a24a509aa1c7ee05cff96f4a346 | b5f0a4540d122b98e7c11196544e44c597decbe7 | /Ejercicio Resueltos por mi/Punteros7.cpp | dc59efd901c974a235c46662631075587712a7fa | [] | no_license | joaquinheliop/CPP-Practicas- | 964f604c7429842235cacf8a5a8e0013a3167d53 | ab1276126b17632e54f7dc95cbb41916b5c9a41c | refs/heads/main | 2023-08-14T05:50:55.573323 | 2021-10-07T18:55:11 | 2021-10-07T18:55:11 | 410,961,049 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,501 | cpp | #include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
int nElementos, *elemento;
void pedirDatos()
{
cout << "Digite el numero de elementos del arreglo: ";
cin >> nElementos;
elemento = new int[nElementos]; //Reservo el espacio de memoria para nElementos x int y le digo a mi puntero elemento la direccion de inicio de mi arreglo
for (int i = 0; i < nElementos; i++)
{
cout << "Ingrese el elemento " << i + 1 << " del arreglo:";
cin >> *(elemento + i); // es como poner elemento[i] pero aca lo hago con puntero
}
}
void ordenarDatos(int *elemento, int nElementos)
{
cout << "Digite el numero de elementos del arreglo: ";
int aux;
for (int i = 0; i < nElementos; i++)
{
for (int j = 0; j < nElementos; j++)
{
if (*(elemento + j) > *(elemento + j + 1))
{ // es lo mismo que hacer elementos[j]>elemetnos[j+1]
aux = *(elemento + j);
*(elemento + j) = *(elemento + j + 1);
*(elemento + j + 1) = aux;
}
}
}
}
void mostrarDatos(int *elemento, int nElementos){
cout<<"Mostrando arreglo ordenado "<<endl;
for (int i = 0; i < nElementos; i++)
{
cout<< *(elemento+i);
}
}
int main()
{
pedirDatos();
ordenarDatos(elemento,nElementos);
mostrarDatos(elemento, nElementos);
delete[] elemento; //liobero la memoria de mi arreglo dinamico
getch();
return 0;
}
| [
"joaquin.helio.p@hotmail.com"
] | joaquin.helio.p@hotmail.com |
c2301c71a920c22b0672bfa7f681ac7bb7053101 | cc615f928d5149fb87679fdeaebf49f565a3445e | /Tutorial/gray-scott/plot/render_isosurface.cpp | 99fe64caf5a324b01064f3e15e135b6fd8817a48 | [] | no_license | eisenhauer/adiosvm | 3fb89e31b57a30a2c0ec9ad07490fd6bc15b6368 | 3bfaddb82884651635ca5045d83976ee3bd30ae6 | refs/heads/master | 2020-06-01T17:25:48.303588 | 2019-06-06T07:23:09 | 2019-06-06T07:23:09 | 190,864,196 | 0 | 0 | null | 2019-06-08T08:30:30 | 2019-06-08T08:30:29 | null | UTF-8 | C++ | false | false | 5,687 | cpp | /*
* Visualization code for the Gray-Scott simulation.
* Reads and renders iso-surface mesh data.
*
* Keichi Takahashi <takahashi.keichi@ais.cmc.osaka-u.ac.jp>
*
*/
#include <chrono>
#include <iostream>
#include <adios2.h>
#include <vtkActor.h>
#include <vtkCallbackCommand.h>
#include <vtkCellArray.h>
#include <vtkDoubleArray.h>
#include <vtkInteractorStyleSwitch.h>
#include <vtkPointData.h>
#include <vtkPoints.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkRenderView.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkSmartPointer.h>
typedef struct {
vtkRenderView *renderView;
vtkPolyDataMapper *mapper;
adios2::IO *inIO;
adios2::Engine *reader;
} Context;
vtkSmartPointer<vtkPolyData> read_mesh(const std::vector<double> &bufPoints,
const std::vector<int> &bufCells,
const std::vector<double> &bufNormals)
{
int nPoints = bufPoints.size() / 3;
int nCells = bufCells.size() / 3;
auto points = vtkSmartPointer<vtkPoints>::New();
points->SetNumberOfPoints(nPoints);
for (vtkIdType i = 0; i < nPoints; i++) {
points->SetPoint(i, &bufPoints[i * 3]);
}
auto polys = vtkSmartPointer<vtkCellArray>::New();
for (vtkIdType i = 0; i < nCells; i++) {
vtkIdType a = bufCells[i * 3 + 0];
vtkIdType b = bufCells[i * 3 + 1];
vtkIdType c = bufCells[i * 3 + 2];
polys->InsertNextCell(3);
polys->InsertCellPoint(a);
polys->InsertCellPoint(b);
polys->InsertCellPoint(c);
}
auto normals = vtkSmartPointer<vtkDoubleArray>::New();
normals->SetNumberOfComponents(3);
for (vtkIdType i = 0; i < nPoints; i++) {
normals->InsertNextTuple(&bufNormals[i * 3]);
}
auto polyData = vtkSmartPointer<vtkPolyData>::New();
polyData->SetPoints(points);
polyData->SetPolys(polys);
polyData->GetPointData()->SetNormals(normals);
return polyData;
}
void timer_func(vtkObject *object, unsigned long eid, void *clientdata,
void *calldata)
{
Context *context = static_cast<Context *>(clientdata);
std::vector<double> points;
std::vector<int> cells;
std::vector<double> normals;
int step;
adios2::StepStatus status =
context->reader->BeginStep(adios2::StepMode::NextAvailable);
if (status != adios2::StepStatus::OK) {
return;
}
auto varPoint = context->inIO->InquireVariable<double>("point");
auto varCell = context->inIO->InquireVariable<int>("cell");
auto varNormal = context->inIO->InquireVariable<double>("normal");
auto varStep = context->inIO->InquireVariable<int>("step");
if (varPoint.Shape().size() > 0 || varCell.Shape().size() > 0) {
varPoint.SetSelection(
{{0, 0}, {varPoint.Shape()[0], varPoint.Shape()[1]}});
varCell.SetSelection(
{{0, 0}, {varCell.Shape()[0], varCell.Shape()[1]}});
varNormal.SetSelection(
{{0, 0}, {varNormal.Shape()[0], varNormal.Shape()[1]}});
context->reader->Get<double>(varPoint, points);
context->reader->Get<int>(varCell, cells);
context->reader->Get<double>(varNormal, normals);
}
context->reader->Get<int>(varStep, &step);
context->reader->EndStep();
std::cout << "render_isosurface at step " << step << std::endl;
vtkSmartPointer<vtkPolyData> polyData = read_mesh(points, cells, normals);
context->mapper->SetInputData(polyData);
context->renderView->ResetCamera();
context->renderView->Render();
}
int main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
int rank, procs, wrank;
MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
const unsigned int color = 7;
MPI_Comm comm;
MPI_Comm_split(MPI_COMM_WORLD, color, wrank, &comm);
MPI_Comm_rank(comm, &rank);
MPI_Comm_size(comm, &procs);
if (argc < 2) {
if (rank == 0) {
std::cerr << "Too few arguments" << std::endl;
std::cout << "Usage: render_isosurface input" << std::endl;
}
MPI_Abort(MPI_COMM_WORLD, -1);
}
if (procs != 1) {
if (rank == 0) {
std::cerr << "render_isosurface only supports serial execution"
<< std::endl;
}
MPI_Abort(MPI_COMM_WORLD, -1);
}
const std::string input_fname(argv[1]);
adios2::ADIOS adios("adios2.xml", comm, adios2::DebugON);
adios2::IO inIO = adios.DeclareIO("IsosurfaceOutput");
adios2::Engine reader = inIO.Open(input_fname, adios2::Mode::Read);
auto mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
auto actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
auto renderView = vtkSmartPointer<vtkRenderView>::New();
renderView->GetRenderer()->AddActor(actor);
renderView->Update();
auto style = vtkSmartPointer<vtkInteractorStyleSwitch>::New();
style->SetCurrentStyleToTrackballCamera();
auto interactor = renderView->GetInteractor();
interactor->Initialize();
interactor->SetInteractorStyle(style);
interactor->CreateRepeatingTimer(100);
Context context = {
.renderView = renderView,
.mapper = mapper,
.inIO = &inIO,
.reader = &reader,
};
auto timerCallback = vtkSmartPointer<vtkCallbackCommand>::New();
timerCallback->SetCallback(timer_func);
timerCallback->SetClientData(&context);
interactor->AddObserver(vtkCommand::TimerEvent, timerCallback);
renderView->Render();
interactor->Start();
reader.Close();
}
| [
"keichi.t@me.com"
] | keichi.t@me.com |
ef5f3647ebc8d8fddc10a2a990b3a6b5c36ac054 | a75d0418b2143d6f59635a8833bff49bc903df5e | /DofusMessages/IdolPartyLostMessage.h | 0c608b934e166e5fcd59c80cacc49e35707d15d1 | [] | no_license | Arkwell9112/dofus_bot | 30b80850ba41b6a2b562705ec8aa1a6c87cfb8f8 | fc1b805b70c0ed43cbc585322806ece89d057585 | refs/heads/master | 2023-01-16T01:08:06.710649 | 2020-11-23T20:53:00 | 2020-11-23T20:53:00 | 314,084,045 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 380 | h | #ifndef IDOLPARTYLOSTMESSAGE_H
#define IDOLPARTYLOSTMESSAGE_H
#include "../BotCoreAPI/BotCoreAPI.h"
#include "../DofusTypes/Idol.h"
#include <string>
#include <vector>
class IdolPartyLostMessage : public DeserializeInterface {
public:
unsigned int idolId = 0;
void deserialize(CustomDataInput *input);
private:
void _idolIdFunc(CustomDataInput *input);
};
#endif | [
"arkwell9112@github.com"
] | arkwell9112@github.com |
b3a0d69548ad2ccde79449e872d701b997fd258d | 5de9c0c802762cc667a928b67785aeab932ab3fe | /src/data/linearscale.cpp | 0ce12a489ca48fed15ea310a3693dc5e69988400 | [
"MIT"
] | permissive | betrixed/AGW | 1d73ebab943e699befd45762213a30fd63847b66 | 22147e41a882a0e5d859869fd72716738bde6f6a | refs/heads/master | 2022-05-07T19:53:09.217375 | 2020-06-08T11:07:39 | 2020-06-08T11:07:39 | 53,102,841 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,233 | cpp | #include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstopcd
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "plotxy.h"
#include "helper.h"
#define kTestTickSize 9
double sRealTick[kTestTickSize] = {0.1,0.2,0.5,1,2,5,10,20,50};
int sRealLabels[kTestTickSize] = {5,5,4,5,5,4,5,5,4};
using namespace agw;
LinearScale::LinearScale(ScaleCoord co, ScaleFlow flow) : scale_(1.0), offset_(0.0),
axisTicks_(1.0), refValue_(0.0), coord_(co), direct_(flow)
{
dataMin_ = 0.0;
dataMax_ = 1.0;
units_ = DEFAULT;
autoLimits_ = true;
autoTicks_ = true;
showMajorGrid_ = true;
showMinorTicks_ = false;
doFixedSize_ = true;
refLine_ = true;
axisDiv_ = 1;
fixedSize_ = 400;
insideTick_ = false;
insideLabel_ = false;
if (coord_ == ScaleCoord::YCOORD)
tickRotate_ = TextRotate::ACW_90;
else
tickRotate_ = TextRotate::R_0;
}
void LinearScale::drawBottomXAxis(wxDC& dc, PixelWorld& px)
{
double dtick;
double firstTick;
if (units_ == DATE_MONTH_NUM)
{
firstTick = 1.0;
axisDiv_= 0;
}
else {
firstTick = dataMin_;
}
modf(firstTick/axisTicks_,&dtick);
if (dtick == -0.0)
dtick = 0.0;
double tick = dtick * axisTicks_;
wxString label;
wxCoord txw, txh; // retrieve Text extents
wxPen gridPen(px.gridColor_);
auto axispos = px.yspan_ + px.top_;
auto endpos = px.left_ + px.xspan_;
int bigTickTop, bigTickBottom;
int tickTop, tickBottom;
int otherSide = px.top_;
if (insideTick_)
{
bigTickTop = axispos - 10;
bigTickBottom = axispos;
tickTop = axispos - 5;
tickBottom = axispos;
}
else {
bigTickTop = axispos;
bigTickBottom = axispos+10;
tickTop = axispos;
tickBottom = axispos+5;
}
int angle = degreesRotation(tickRotate_);
double prevTick = (dtick-1.0)* axisTicks_;
int prevPt = (int)( (prevTick-offset_)* scale_ ) + px.left_;
int tempx;
while (prevTick <= dataMax_)
{
int xpt = (int)( (tick- offset_)* scale_ ) + px.left_;
if (xpt >= px.left_ && xpt <= endpos)
{
dc.DrawLine(xpt, bigTickTop, xpt, bigTickBottom);
if (showMajorGrid_ && (xpt > px.left_) && (xpt < endpos))
{
auto savePen = dc.GetPen();
dc.SetPen(gridPen);
dc.DrawLine(xpt, bigTickTop, xpt, otherSide);
dc.SetPen(savePen);
}
// into textaxispos
if (units_ == DATE_MONTH_NUM)
{
int checkMonth = (int) tick;
if (checkMonth >= 1 && checkMonth <= 12)
{
auto monthno = (wxDateTime::Month) (checkMonth-1);
label.Printf(wxT("%s"),wxDateTime::GetMonthName(monthno,wxDateTime::NameFlags::Name_Abbr));
}
else
label.Clear();
}
else
label.Printf(wxT("%g"),tick);
label.Trim(false);label.Trim(true);
if (label.size() > 0)
{
dc.GetTextExtent(label, &txw, &txh);
if (tickRotate_ == TextRotate::R_0)
{
int ylabel = insideLabel_ ? bigTickTop - txh - 3 : bigTickBottom + 3;
dc.DrawText(label, xpt - txw/2, ylabel);
}
else if (tickRotate_ == TextRotate::CW_90)
{
int ylabel = insideLabel_ ? bigTickTop - txw - 3 : bigTickBottom + 3;
dc.DrawRotatedText(label, xpt + txh/2, ylabel, angle);
}
else if (tickRotate_ == TextRotate::ACW_90)
{
int ylabel = insideLabel_ ? bigTickTop + 3 : bigTickBottom - txw - 3;
dc.DrawRotatedText(label, xpt + txh/2, ylabel, angle);
}
}
}
if (axisDiv_ > 0)
{
for(uint ix = 1; ix < axisDiv_; ix++)
{
tempx = prevPt - ((prevPt-xpt)*(int)ix) / (int)axisDiv_;
if ((tempx <= endpos) && (tempx > px.left_))
{
dc.DrawLine(tempx,tickTop, tempx, tickBottom );
if (showMinorTicks_)
{
auto savePen = dc.GetPen();
dc.SetPen(gridPen);
dc.DrawLine(tempx,tickTop, tempx, otherSide );
dc.SetPen(savePen);
}
}
}
prevPt = xpt;
}
dtick += 1.0;
prevTick = tick;
tick = dtick * axisTicks_;
}
}
void LinearScale::drawBottomDateAxis(wxDC& dc, PixelWorld& px)
{
wxString label;
wxCoord txw, txh; // retrieve Text extents
double dtick;
wxDateTime startDate(dataMin_ + 2400000.5);
auto year = startDate.GetYear();
modf(year/axisTicks_,&dtick);
auto tick = dtick * axisTicks_; // in years
auto yeardate = wxDateTime(1,wxDateTime::Month::Jan, tick);
auto datetick = yeardate.GetModifiedJulianDayNumber();
auto axispos = px.yspan_ + px.top_;
auto endpos = px.left_ + px.xspan_;
int bigTickTop, bigTickBottom;
int tickTop, tickBottom;
int tempx;
int otherSide = px.top_;
if (insideTick_)
{
bigTickTop = axispos - 10;
bigTickBottom = axispos;
tickTop = axispos - 5;
tickBottom = axispos;
}
else {
bigTickTop = axispos;
bigTickBottom = axispos+10;
tickTop = axispos;
tickBottom = axispos+5;
}
wxPen gridPen(px.gridColor_);
double prevTick = (dtick-1.0)* axisTicks_;
int prevPt = (int)( (prevTick-offset_)* scale_ ) + px.left_;
while (prevTick <= dataMax_)
{
auto xpt = (int)( (datetick-offset_)* scale_ ) + px.left_;
if (showMajorGrid_ && (xpt > px.left_) && (xpt < endpos))
{
auto savePen = dc.GetPen();
dc.SetPen(gridPen);
dc.DrawLine(xpt, bigTickTop, xpt, otherSide);
dc.SetPen(savePen);
}
if (xpt >= px.left_ && (xpt < endpos))
{
dc.DrawLine(xpt, axispos, xpt, axispos+10);
// into text
label.Printf(wxT("%d"),yeardate.GetYear());
dc.GetTextExtent(label, &txw, &txh);
dc.DrawText(label, xpt - txw/2, axispos + txh + 10);
}
if (axisDiv_ > 0)
{
for(uint ix = 1; ix < axisDiv_; ix++)
{
tempx = prevPt - ((prevPt-xpt)*(int)ix) / (int)axisDiv_;
if ((tempx <= endpos) && (tempx > px.left_))
{
dc.DrawLine(tempx,tickTop, tempx, tickBottom );
if (showMinorTicks_)
{
auto savePen = dc.GetPen();
dc.SetPen(gridPen);
dc.DrawLine(tempx,tickTop, tempx, otherSide );
dc.SetPen(savePen);
}
}
}
prevPt = xpt;
}
dtick += 1.0;
prevTick = tick;
tick = dtick * axisTicks_;
yeardate = wxDateTime(1, wxDateTime::Month::Jan, tick);
datetick = yeardate.GetModifiedJulianDayNumber();
}
}
void LinearScale::drawLeftYAxis(wxDC& dc, PixelWorld& px)
{
double firstTick = dataMin_;
double dtick;
modf(firstTick/axisTicks_,&dtick);
if (dtick == -0.0)
dtick = 0.0;
wxString label; // generate numeric strings
wxCoord txw, txh; // retrieve Text extents
wxCoord axispos = px.left_;
wxCoord axisLimit = px.top_ + px.yspan_;
int tempy;
//wxCoord maxGridTickWidth = 0;
// left axis
double prevTick = (dtick-1.0)* axisTicks_;
auto prevYPt = (int)( (prevTick-offset_)* scale_ ) + px.top_;
double tick = dtick * axisTicks_;
wxPen gridPen(px.gridColor_);
// draw reference line ??
// draw yaxisDiv_ small ticks between prevYPt and ypt
int bigTickLeft, bigTickRight;
int tickLeft, tickRight;
if (insideTick_)
{
bigTickLeft = axispos;
bigTickRight = axispos + 10;
tickLeft = axispos;
tickRight = axispos + 5;
}
else {
bigTickLeft = axispos - 10;
bigTickRight = axispos;
tickLeft = axispos - 5;
tickRight = axispos;
}
int otherSide = axispos+px.xspan_;
int angle = degreesRotation(tickRotate_);
int minLeftBound = axispos;
int textx = 0;
if (bigTickLeft < minLeftBound)
minLeftBound = bigTickLeft;
while (prevTick < dataMax_)
{
auto ypt = (int)( (tick - offset_)* scale_ ) + px.top_;
if ((ypt <= axisLimit) && (ypt >= px.top_))
{
dc.DrawLine(bigTickLeft, ypt, bigTickRight, ypt);
if (showMajorGrid_ && (ypt < axisLimit) && (ypt > px.top_))
{
auto savePen = dc.GetPen();
dc.SetPen(gridPen);
// draw grid line
dc.DrawLine(bigTickRight, ypt, otherSide, ypt);
dc.SetPen(savePen);
}
// into text
label.Printf(wxT("%g"),tick);
dc.GetTextExtent(label, &txw, &txh);
/* if (txw > maxGridTickWidth)
maxGridTickWidth = txw; */
if (tickRotate_ == TextRotate::R_0)
{
textx = insideLabel_ ? bigTickRight + 3 : bigTickLeft - txw - 10;
dc.DrawText(label, textx, ypt - txh/2);
}
else if (tickRotate_ == TextRotate::CW_90)
{
textx = insideLabel_ ? bigTickRight + txh + 2 : bigTickLeft - txh - 2;
dc.DrawRotatedText(label, textx, ypt - txw/2, angle);
}
else if (tickRotate_ == TextRotate::ACW_90)
{
textx = insideLabel_ ? bigTickRight + 2 : bigTickLeft - txh - 2;
dc.DrawRotatedText(label, textx, ypt + txw/2, angle);
}
if (textx < minLeftBound)
minLeftBound = textx;
}
if (axisDiv_ > 0)
{
for(uint ix = 1; ix < axisDiv_; ix++)
{
tempy = prevYPt - ((prevYPt-ypt)*(int)ix)/ (int)axisDiv_;
if ((tempy <= axisLimit) && (tempy > px.top_))
{
dc.DrawLine(tickLeft,tempy, tickRight, tempy );
if (showMinorTicks_)
{
auto savePen = dc.GetPen();
dc.SetPen(gridPen);
dc.DrawLine(tickRight,tempy, otherSide, tempy );
dc.SetPen(savePen);
}
}
}
}
prevTick = tick;
prevYPt = ypt;
dtick += 1.0;
tick = dtick * axisTicks_;
}
px.leftAxisBound_ = axispos - minLeftBound; // save it?
if (this->refLine_)
{
auto ypt = (int)( (this->refValue_ - offset_)* scale_ ) + px.top_;
if (ypt <= axisLimit)
{
wxPen refPen(px.refColor_);
auto savePen = dc.GetPen();
dc.SetPen(refPen);
dc.DrawLine(axispos, ypt, otherSide, ypt);
dc.SetPen(savePen);
}
}
}
void LinearScale::renderDC(wxDC& dc, PixelWorld& px)
{
// y axis
if (coord_ == YCOORD)
{
drawLeftYAxis(dc,px);
}
else if (coord_ == XCOORD)
{
if ((units_==DATE_JULIAN_MOD) || (units_ == DATE_YEAR_MONTH) )
{
drawBottomDateAxis(dc,px);
}
else {
drawBottomXAxis(dc,px);
}
}
}
void LinearScale::AutoAxis(long pspan, double a1, double a2, double &tics, uint &labels)
{
double pTen,iTen;
double range,nRange;
int i;
int pAdjust;
int pIndex;
double dmajor,dminor;
range = fabs(a1 - a2);
pTen = log10(range);
pTen = modf(pTen,&iTen);
if( pTen < 0.0) {
pAdjust = 2-(int)iTen;
}else {
pAdjust = 1-(int)iTen;
}
nRange = range * pow((double)10.0,(double)pAdjust);
// normalise to between 10 and 100
dminor = (10*nRange)/pspan;
// aim for at least 10 pixels per minor tic
dmajor = (range/2);
// try to fit 2 major ticks in the range
pIndex = kTestTickSize-1;
for( i = 0; i < kTestTickSize; i++)
{
if( dminor <= sRealTick[i] )
{
pIndex = i;
break;
}
}
labels = sRealLabels[pIndex];
tics = sRealTick[pIndex] * pow(10.0,-pAdjust) * labels;
if( (tics > dmajor))
{
if( pIndex > 0)
{
pIndex -= 1;
labels = sRealLabels[pIndex];
tics = sRealTick[pIndex] * pow(10.0,-pAdjust) * labels;
if( tics > dmajor )
{
tics /= labels;
labels = 1;
}
}
}
}
void LinearScale::ReadJSON(const Json::Value& json)
{
std::string tempStr;
int itemp;
bool tbool;
if (readInt(json,"direction",itemp))
direct_ = ScaleFlow(itemp);
if (readString(json, "coord", tempStr))
{
if (tempStr == "X")
{
coord_ = ScaleCoord::XCOORD;
}
else if (tempStr == "Y")
{
coord_ = ScaleCoord::YCOORD;
}
}
if (json.isMember("unit"))
{
auto temp = json["unit"].asString();
this->units(toSeriesUnit(temp));
}
if (readString(json,"label",tempStr))
label_ = tempStr;
readBool(json,"showGrid", showMajorGrid_);
readBool(json,"smallTicks", showMinorTicks_);
readDouble(json, "dataMax", dataMax_);
readDouble(json, "dataMin", dataMin_);
readBool(json,"autoLimits", autoLimits_);
readBool(json,"autoTicks", autoTicks_);
readBool(json,"fixSize", doFixedSize_);
readUInt(json, "pixels", fixedSize_);
readDouble(json, "majorTick", axisTicks_);
readUInt(json, "smallTick", axisDiv_);
readDouble(json, "refLine", refValue_);
readBool(json,"showRef", refLine_);
if (readInt(json,"tickRotate", itemp))
tickRotate_ = TextRotate(itemp);
if (readBool(json,"tickInside", tbool))
insideTick_ = TextRotate(tbool);
if (readBool(json,"labelInside", tbool))
insideLabel_ = TextRotate(tbool);
}
void LinearScale::SaveJSON(Json::Value& json)
{
json["direction"] = (int) direct_;
json["coord"] = (coord_ == ScaleCoord::XCOORD) ? "X" : "Y";
json["unit"] = unitAsString(units_);
json["showGrid"] = showMajorGrid_;
json["smallTicks"] = showMinorTicks_;
json["dataMax"] = dataMax_;
json["dataMin"] = dataMin_;
json["autoTicks"] = autoTicks_;
json["autoLimits"] = autoLimits_;
json["fixSize"] = doFixedSize_;
json["pixels"] = fixedSize_;
json["majorTick"] = axisTicks_;
json["smallTick"] = axisDiv_;
json["refLine"] = refValue_;
json["showRef"] = refLine_;
json["label"] = label_;
json["tickRotate"] = tickRotate_;
json["tickInside"] = insideTick_;
json["labelInside"] = insideLabel_;
}
void PixelWorld::ReadJSON(const Json::Value& json)
{
readColor(json,"back-color",backColor_);
readColor(json,"axis-color",axisColor_);
readColor(json,"ref-color",refColor_);
readColor(json,"grid-color",gridColor_);
readBool(json,"left-frame", leftFrame_);
readBool(json,"top-frame", topFrame_);
readBool(json,"right-frame", rightFrame_);
readBool(json,"bottom-frame", bottomFrame_);
if (json.isMember("margins"))
{
const Json::Value& margins = json["margins"];
left_ = margins[0].asInt();
top_ = margins[1].asInt();
right_ = margins[2].asInt();
bottom_ = margins[3].asInt();
}
if (json.isMember("fixed-size"))
{
const Json::Value& fixed = json["fixed-size"];
xfixed_ = fixed[0].asInt();
yfixed_ = fixed[1].asInt();
}
if (json.isMember("var-size"))
{
const Json::Value& varsize = json["var-size"];
xspan_ = varsize[0].asInt();
yspan_ = varsize[1].asInt();
}
readBool(json,"is-fixed-size", fixed_);
if (json.isMember("xaxis"))
{
const Json::Value& axis = json["xaxis"];
xScale_.ReadJSON(axis);
}
if (json.isMember("yaxis"))
{
const Json::Value& axis = json["yaxis"];
yScale_.ReadJSON(axis);
}
}
void PixelWorld::SaveJSON(Json::Value& json)
{
Json::Value margins(Json::arrayValue);
margins[0] = left_;
margins[1] = top_;
margins[2] = right_;
margins[3] = bottom_;
json["margins"] = margins;
Json::Value fixed(Json::arrayValue);
fixed[0] = xfixed_; // dimensions of plot area if fixed
fixed[1] = yfixed_;
json["is-fixed-size"] = fixed_;
json["fixed-size"] = fixed;
Json::Value varsize(Json::arrayValue);
varsize[0] = xspan_; // dimensions of plot area if resizeable
varsize[1] = yspan_;
json["var-size"] = varsize;
// flags for axis border line
json["left-frame"] = leftFrame_;
json["top-frame"] = topFrame_;
json["right-frame"] = rightFrame_;
json["bottom-frame"] = bottomFrame_;
Json::Value xsys (Json::objectValue);
Json::Value ysys (Json::objectValue);
xScale_.SaveJSON(xsys);
yScale_.SaveJSON(ysys);
json["xaxis"] = xsys;
json["yaxis" ] = ysys;
json["back-color"] = colorAsString(backColor_);
json["axis-color"] = colorAsString(axisColor_);
json["ref-color"] = colorAsString(refColor_);
json["grid-color"] = colorAsString(gridColor_);
}
PixelWorld::PixelWorld() : left_(100), right_(50), top_(80), bottom_(80)
, xspan_(500), yspan_(350), xScale_(ScaleCoord::XCOORD, ScaleFlow::POSITIVE), yScale_(ScaleCoord::YCOORD, ScaleFlow::NEGATIVE)
{
backColor_.Set("white");
axisColor_.Set("black");
refColor_.Set("black");
gridColor_.Set(0xFF,0xD7,0xE1);
leftFrame_ = true;
topFrame_ = true;
rightFrame_ = true;
bottomFrame_ = true;
fixed_ = false;
xfixed_ = 500;
yfixed_ = 350;
}
void PixelWorld::autoXDataLimits(std::vector<PlotLayer_sptr>& layers, double& xMin, double &xMax)
{
bool xvalid = false;
auto it = layers.begin();
auto fin = layers.end();
for( ; it != fin; it++)
{
DataLayer* layer = dynamic_cast<DataLayer*>(it->get());
if (layer == nullptr)
continue;
if (!xvalid)
{
if (!layer->xstats_.valid_)
{
layer->calcStats();
}
if (layer->xstats_.valid_)
{
xvalid = (layer->xstats_.n_ > 0);
if (xvalid)
{
xMax = layer->xstats_.maxval_;
xMin = layer->xstats_.minval_;
}
}
}
else {
if (layer->xstats_.valid_ && (layer->xstats_.n_ > 0))
{
if(xMax < layer->xstats_.maxval_)
xMax = layer->xstats_.maxval_;
if (xMin > layer->xstats_.minval_)
xMin = layer->xstats_.minval_;
}
}
}
}
void PixelWorld::autoYDataLimits(std::vector<PlotLayer_sptr>& layers, double& yMin, double &yMax)
{
bool yvalid = false;
auto it = layers.begin();
auto fin = layers.end();
for( ; it != fin; it++)
{
DataLayer* layer = dynamic_cast<DataLayer*>(it->get());
if (layer == nullptr)
continue;
if (!yvalid)
{
if (layer->ystats_.valid_)
{
yvalid = (layer->ystats_.n_ > 0);
if (yvalid)
{
yMax = layer->ystats_.maxval_;
yMin = layer->ystats_.minval_;
}
}
}
else {
if (layer->ystats_.valid_ && (layer->ystats_.n_ > 0))
{
if(yMax < layer->ystats_.maxval_)
yMax = layer->ystats_.maxval_;
if (yMin > layer->ystats_.minval_)
yMin = layer->ystats_.minval_;
}
}
if (layer->errorbar_ != nullptr)
{
double maxError = layer->errorMax_;
if (!isnan(maxError)) {
yMin -= maxError;
yMax += maxError;
}
}
}
}
void PixelWorld::calcScales(std::vector<PlotLayer_sptr>& layers)
{
if (this->xScale_.autoLimits_)
{
double xMax = 0.0;
double xMin = 0.0;
autoXDataLimits(layers, xMin, xMax);
xScale_.setDataLimits(xMin, xMax);
double widen = 0.02;
if (xScale_.insideLabel_)
widen += 0.01;
if (xScale_.insideTick_)
widen += 0.01;
xScale_.widenLimits(widen);
xScale_.calcScale(this->xspan_);
}
else {
xScale_.calcScale(this->xspan_);
}
if (this->yScale_.autoLimits_)
{
double yMax = 0.0;
double yMin = 0.0;
autoYDataLimits(layers, yMin, yMax);
yScale_.setDataLimits(yMin, yMax);
double widen = 0.02;
if (yScale_.insideLabel_)
widen += 0.01;
if (yScale_.insideTick_)
widen += 0.01;
yScale_.widenLimits(widen);
yScale_.calcScale(this->yspan_);
}
else {
yScale_.calcScale(this->yspan_);
}
}
| [
"michael.rynn.500@gmail.com"
] | michael.rynn.500@gmail.com |
9f1e1d2f4b95e3373d4e8bc7ca4b73f3926420b7 | 300b29a4c225efed3eecc1cff4948a7506315bc0 | /simple_server/header.h | f30eb19316aab2b024b4118c3668d95dfa4291cc | [] | no_license | BogdanAriton/Simple-Web-Server | 55a3c34d6520fe4ff1388171732cef79fb42e35e | e55f51bb530da87f8e7d6f79460d82c767a106ce | refs/heads/main | 2023-02-28T01:42:24.574555 | 2021-01-30T18:24:40 | 2021-01-30T18:24:40 | 334,479,806 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 232 | h | #ifndef HTTP_HEADER
#define HTTP_HEADER
#include <string>
namespace http {
namespace server {
struct header
{
std::string name;
std::string value;
};
} // namespace server
} // namespace http
#endif // HTTP_HEADER | [
"bogdan.mihail.ariton@gmail.com"
] | bogdan.mihail.ariton@gmail.com |
affb4ff84dad8d08658896fd149e25591997dc95 | 751352f85359b69f901285ce7ee02d052a3fc7ab | /thirdparty/libigl/include/igl/grad.h | df375ba61446a3a4b44ba88bece532fc6cf036a8 | [
"MIT",
"GPL-3.0-only",
"MPL-2.0",
"LicenseRef-scancode-unknown"
] | permissive | ZhengZerong/simpleuv | fa7c27be080d84f803ab92843768c43b1b4f3e2c | a3f5bbbac93352b57973c657c38867832749d74d | refs/heads/master | 2020-09-25T14:23:43.535660 | 2019-12-11T07:46:24 | 2019-12-11T07:46:24 | 226,023,168 | 1 | 2 | MIT | 2019-12-05T05:28:31 | 2019-12-05T05:28:31 | null | UTF-8 | C++ | false | false | 1,681 | h | // This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_GRAD_MAT_H
#define IGL_GRAD_MAT_H
#include "igl_inline.h"
#include <Eigen/Core>
#include <Eigen/Sparse>
namespace igl {
// GRAD
// G = grad(V,F)
//
// Compute the numerical gradient operator
//
// Inputs:
// V #vertices by 3 list of mesh vertex positions
// F #faces by 3 list of mesh face indices [or a #faces by 4 list of tetrahedral indices]
// uniform boolean (default false) - Use a uniform mesh instead of the vertices V
// Outputs:
// G #faces*dim by #V Gradient operator
//
// Gradient of a scalar function defined on piecewise linear elements (mesh)
// is constant on each triangle [tetrahedron] i,j,k:
// grad(Xijk) = (Xj-Xi) * (Vi - Vk)^R90 / 2A + (Xk-Xi) * (Vj - Vi)^R90 / 2A
// where Xi is the scalar value at vertex i, Vi is the 3D position of vertex
// i, and A is the area of triangle (i,j,k). ^R90 represent a rotation of
// 90 degrees
//
template <typename DerivedV, typename DerivedF>
IGL_INLINE void grad(const Eigen::PlainObjectBase<DerivedV>&V,
const Eigen::PlainObjectBase<DerivedF>&F,
Eigen::SparseMatrix<typename DerivedV::Scalar> &G,
bool uniform = false);
}
#ifndef IGL_STATIC_LIBRARY
# include "grad.cpp"
#endif
#endif
| [
"huxingyi@msn.com"
] | huxingyi@msn.com |
d45c664edf55e284b8246b290e7a917026632e63 | 4b9b64c10db245a835ebee846473bceb7cb12158 | /LinkedList4.cpp | 37a7d9228c27acf0c93fd8eacc9c4635085d7807 | [] | no_license | soumik12345/Linked-List | 4a704cbeba49a3be13a0e6497ba3b90b34aca229 | 164c30ac16de0ee45a1268b4c0864b183585eca2 | refs/heads/master | 2021-01-21T19:36:39.155260 | 2017-05-26T22:01:08 | 2017-05-26T22:01:08 | 92,144,389 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,792 | cpp | //Program to reverse a linked list iteratively
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node* next;
};
Node* head;
void Insert_beg(int x)//method to insert at the beginning of the list
{
Node* temp=(Node*)(malloc(sizeof(Node)));//we create a new node temp
temp->data=x;//we set the data of the node to the data entered by the user
temp->next=head;//We point the next node to temp as the previous head
head=temp;//We set temp as the new head
}
void Print()//method to print the list
{
Node* temp=head;//creating a new node pointin to head
cout<<"The list is: ";
while(temp!=NULL)//the loop runs till the end of the list
{
cout<<temp->data<<" ";//the data for the current node is printed
temp=temp->next;//we move the pointer to the next node
}
cout<<endl;
}
void Reverse()//method to reverse the list
{
Node* current;//stores the current node
Node* prev;//stores the adress of the node previous to current
Node* next;//stores the address of the node next to current
current=head;//temp initialised as head
prev=NULL;//previoud of head is NULL
while(current!=NULL)//traversing the list
{
next=current->next;//next is set to next of the current node
current->next=prev;//the current node points to the previous one
prev=current;//the previous node becomes the current node
current=next;//the current node becomes the next node
}
head=prev;//adjusting head
}
int main()
{
cout<<"Enter the number of inputs: ";
int n,i,x;
cin>>n;
for(i=0;i<n;i++)
{
cout<<"Enter the data to be inserted: ";
cin>>x;
Insert_beg(x);//method call to insert at the beginning of the list
Print();//method call to print the list
}
Reverse();//method call to reverse the list
cout<<"Link in reverse order: "<<endl;
Print();
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
4f4a2ddabacecfb9e84667f1b9d832ae41417ab0 | 43002261a9692167930ca388bf4aebd095daf40d | /src/qt/paymentserver.cpp | 1f7350ab0536e6dfea4724a30294e4439a0dabe8 | [
"MIT"
] | permissive | bencebereczki/bakercoin | 6f237c1b9c482454e47ff0947cacce4c4f0c1724 | df880ce1fe056ef1acd78ad5b1b5e1dd82065e68 | refs/heads/master | 2023-07-20T06:49:55.225759 | 2018-09-22T10:43:35 | 2018-09-22T10:43:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 25,018 | cpp | // Copyright (c) 2011-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2018 The BAKER developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "paymentserver.h"
#include "bitcoinunits.h"
#include "guiutil.h"
#include "optionsmodel.h"
#include "base58.h"
#include "chainparams.h"
#include "ui_interface.h"
#include "util.h"
#include "wallet.h"
#include <cstdlib>
#include <openssl/x509.h>
#include <openssl/x509_vfy.h>
#include <QApplication>
#include <QByteArray>
#include <QDataStream>
#include <QDateTime>
#include <QDebug>
#include <QFile>
#include <QFileOpenEvent>
#include <QHash>
#include <QList>
#include <QLocalServer>
#include <QLocalSocket>
#include <QNetworkAccessManager>
#include <QNetworkProxy>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QSslCertificate>
#include <QSslError>
#include <QSslSocket>
#include <QStringList>
#include <QTextDocument>
#if QT_VERSION < 0x050000
#include <QUrl>
#else
#include <QUrlQuery>
#endif
using namespace boost;
using namespace std;
const int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds
const QString BITCOIN_IPC_PREFIX("baker:");
// BIP70 payment protocol messages
const char* BIP70_MESSAGE_PAYMENTACK = "PaymentACK";
const char* BIP70_MESSAGE_PAYMENTREQUEST = "PaymentRequest";
// BIP71 payment protocol media types
const char* BIP71_MIMETYPE_PAYMENT = "application/baker-payment";
const char* BIP71_MIMETYPE_PAYMENTACK = "application/baker-paymentack";
const char* BIP71_MIMETYPE_PAYMENTREQUEST = "application/baker-paymentrequest";
// BIP70 max payment request size in bytes (DoS protection)
const qint64 BIP70_MAX_PAYMENTREQUEST_SIZE = 50000;
struct X509StoreDeleter {
void operator()(X509_STORE* b) {
X509_STORE_free(b);
}
};
struct X509Deleter {
void operator()(X509* b) { X509_free(b); }
};
namespace // Anon namespace
{
std::unique_ptr<X509_STORE, X509StoreDeleter> certStore;
}
//
// Create a name that is unique for:
// testnet / non-testnet
// data directory
//
static QString ipcServerName()
{
QString name("BAKERQt");
// Append a simple hash of the datadir
// Note that GetDataDir(true) returns a different path
// for -testnet versus main net
QString ddir(QString::fromStdString(GetDataDir(true).string()));
name.append(QString::number(qHash(ddir)));
return name;
}
//
// We store payment URIs and requests received before
// the main GUI window is up and ready to ask the user
// to send payment.
static QList<QString> savedPaymentRequests;
static void ReportInvalidCertificate(const QSslCertificate& cert)
{
qDebug() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName);
}
//
// Load OpenSSL's list of root certificate authorities
//
void PaymentServer::LoadRootCAs(X509_STORE* _store)
{
// Unit tests mostly use this, to pass in fake root CAs:
if (_store) {
certStore.reset(_store);
return;
}
// Normal execution, use either -rootcertificates or system certs:
certStore.reset(X509_STORE_new());
// Note: use "-system-" default here so that users can pass -rootcertificates=""
// and get 'I don't like X.509 certificates, don't trust anybody' behavior:
QString certFile = QString::fromStdString(GetArg("-rootcertificates", "-system-"));
if (certFile.isEmpty())
return; // Empty store
QList<QSslCertificate> certList;
if (certFile != "-system-") {
certList = QSslCertificate::fromPath(certFile);
// Use those certificates when fetching payment requests, too:
QSslSocket::setDefaultCaCertificates(certList);
} else
certList = QSslSocket::systemCaCertificates();
int nRootCerts = 0;
const QDateTime currentTime = QDateTime::currentDateTime();
foreach (const QSslCertificate& cert, certList) {
if (currentTime < cert.effectiveDate() || currentTime > cert.expiryDate()) {
ReportInvalidCertificate(cert);
continue;
}
#if QT_VERSION >= 0x050000
if (cert.isBlacklisted()) {
ReportInvalidCertificate(cert);
continue;
}
#endif
QByteArray certData = cert.toDer();
const unsigned char* data = (const unsigned char*)certData.data();
std::unique_ptr<X509, X509Deleter> x509(d2i_X509(0, &data, certData.size()));
if (x509 && X509_STORE_add_cert(certStore.get(), x509.get())) {
// Note: X509_STORE increases the reference count to the X509 object,
// we still have to release our reference to it.
++nRootCerts;
} else {
ReportInvalidCertificate(cert);
continue;
}
}
qWarning() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates";
// Project for another day:
// Fetch certificate revocation lists, and add them to certStore.
// Issues to consider:
// performance (start a thread to fetch in background?)
// privacy (fetch through tor/proxy so IP address isn't revealed)
// would it be easier to just use a compiled-in blacklist?
// or use Qt's blacklist?
// "certificate stapling" with server-side caching is more efficient
}
//
// Sending to the server is done synchronously, at startup.
// If the server isn't already running, startup continues,
// and the items in savedPaymentRequest will be handled
// when uiReady() is called.
//
// Warning: ipcSendCommandLine() is called early in init,
// so don't use "emit message()", but "QMessageBox::"!
//
void PaymentServer::ipcParseCommandLine(int argc, char* argv[])
{
for (int i = 1; i < argc; i++) {
QString arg(argv[i]);
if (arg.startsWith("-"))
continue;
// If the baker: URI contains a payment request, we are not able to detect the
// network as that would require fetching and parsing the payment request.
// That means clicking such an URI which contains a testnet payment request
// will start a mainnet instance and throw a "wrong network" error.
if (arg.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // baker: URI
{
savedPaymentRequests.append(arg);
SendCoinsRecipient r;
if (GUIUtil::parseBitcoinURI(arg, &r) && !r.address.isEmpty()) {
CBitcoinAddress address(r.address.toStdString());
if (address.IsValid(Params(CBaseChainParams::MAIN))) {
SelectParams(CBaseChainParams::MAIN);
} else if (address.IsValid(Params(CBaseChainParams::TESTNET))) {
SelectParams(CBaseChainParams::TESTNET);
}
}
} else if (QFile::exists(arg)) // Filename
{
savedPaymentRequests.append(arg);
PaymentRequestPlus request;
if (readPaymentRequestFromFile(arg, request)) {
if (request.getDetails().network() == "main") {
SelectParams(CBaseChainParams::MAIN);
} else if (request.getDetails().network() == "test") {
SelectParams(CBaseChainParams::TESTNET);
}
}
} else {
// Printing to debug.log is about the best we can do here, the
// GUI hasn't started yet so we can't pop up a message box.
qWarning() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg;
}
}
}
//
// Sending to the server is done synchronously, at startup.
// If the server isn't already running, startup continues,
// and the items in savedPaymentRequest will be handled
// when uiReady() is called.
//
bool PaymentServer::ipcSendCommandLine()
{
bool fResult = false;
foreach (const QString& r, savedPaymentRequests) {
QLocalSocket* socket = new QLocalSocket();
socket->connectToServer(ipcServerName(), QIODevice::WriteOnly);
if (!socket->waitForConnected(BITCOIN_IPC_CONNECT_TIMEOUT)) {
delete socket;
socket = NULL;
return false;
}
QByteArray block;
QDataStream out(&block, QIODevice::WriteOnly);
out.setVersion(QDataStream::Qt_4_0);
out << r;
out.device()->seek(0);
socket->write(block);
socket->flush();
socket->waitForBytesWritten(BITCOIN_IPC_CONNECT_TIMEOUT);
socket->disconnectFromServer();
delete socket;
socket = NULL;
fResult = true;
}
return fResult;
}
PaymentServer::PaymentServer(QObject* parent, bool startLocalServer) : QObject(parent),
saveURIs(true),
uriServer(0),
netManager(0),
optionsModel(0)
{
// Verify that the version of the library that we linked against is
// compatible with the version of the headers we compiled against.
GOOGLE_PROTOBUF_VERIFY_VERSION;
// Install global event filter to catch QFileOpenEvents
// on Mac: sent when you click baker: links
// other OSes: helpful when dealing with payment request files (in the future)
if (parent)
parent->installEventFilter(this);
QString name = ipcServerName();
// Clean up old socket leftover from a crash:
QLocalServer::removeServer(name);
if (startLocalServer) {
uriServer = new QLocalServer(this);
if (!uriServer->listen(name)) {
// constructor is called early in init, so don't use "emit message()" here
QMessageBox::critical(0, tr("Payment request error"),
tr("Cannot start baker: click-to-pay handler"));
} else {
connect(uriServer, SIGNAL(newConnection()), this, SLOT(handleURIConnection()));
connect(this, SIGNAL(receivedPaymentACK(QString)), this, SLOT(handlePaymentACK(QString)));
}
}
}
PaymentServer::~PaymentServer()
{
google::protobuf::ShutdownProtobufLibrary();
}
//
// OSX-specific way of handling baker: URIs and
// PaymentRequest mime types
//
bool PaymentServer::eventFilter(QObject* object, QEvent* event)
{
// clicking on baker: URIs creates FileOpen events on the Mac
if (event->type() == QEvent::FileOpen) {
QFileOpenEvent* fileEvent = static_cast<QFileOpenEvent*>(event);
if (!fileEvent->file().isEmpty())
handleURIOrFile(fileEvent->file());
else if (!fileEvent->url().isEmpty())
handleURIOrFile(fileEvent->url().toString());
return true;
}
return QObject::eventFilter(object, event);
}
void PaymentServer::initNetManager()
{
if (!optionsModel)
return;
if (netManager != NULL)
delete netManager;
// netManager is used to fetch paymentrequests given in baker: URIs
netManager = new QNetworkAccessManager(this);
QNetworkProxy proxy;
// Query active SOCKS5 proxy
if (optionsModel->getProxySettings(proxy)) {
netManager->setProxy(proxy);
qDebug() << "PaymentServer::initNetManager : Using SOCKS5 proxy" << proxy.hostName() << ":" << proxy.port();
} else
qDebug() << "PaymentServer::initNetManager : No active proxy server found.";
connect(netManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(netRequestFinished(QNetworkReply*)));
connect(netManager, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)),
this, SLOT(reportSslErrors(QNetworkReply*, const QList<QSslError>&)));
}
void PaymentServer::uiReady()
{
initNetManager();
saveURIs = false;
foreach (const QString& s, savedPaymentRequests) {
handleURIOrFile(s);
}
savedPaymentRequests.clear();
}
void PaymentServer::handleURIOrFile(const QString& s)
{
if (saveURIs) {
savedPaymentRequests.append(s);
return;
}
if (s.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // baker: URI
{
#if QT_VERSION < 0x050000
QUrl uri(s);
#else
QUrlQuery uri((QUrl(s)));
#endif
if (uri.hasQueryItem("r")) // payment request URI
{
QByteArray temp;
temp.append(uri.queryItemValue("r"));
QString decoded = QUrl::fromPercentEncoding(temp);
QUrl fetchUrl(decoded, QUrl::StrictMode);
if (fetchUrl.isValid()) {
qDebug() << "PaymentServer::handleURIOrFile : fetchRequest(" << fetchUrl << ")";
fetchRequest(fetchUrl);
} else {
qWarning() << "PaymentServer::handleURIOrFile : Invalid URL: " << fetchUrl;
emit message(tr("URI handling"),
tr("Payment request fetch URL is invalid: %1").arg(fetchUrl.toString()),
CClientUIInterface::ICON_WARNING);
}
return;
} else // normal URI
{
SendCoinsRecipient recipient;
if (GUIUtil::parseBitcoinURI(s, &recipient)) {
CBitcoinAddress address(recipient.address.toStdString());
if (!address.IsValid()) {
emit message(tr("URI handling"), tr("Invalid payment address %1").arg(recipient.address),
CClientUIInterface::MSG_ERROR);
} else
emit receivedPaymentRequest(recipient);
} else
emit message(tr("URI handling"),
tr("URI cannot be parsed! This can be caused by an invalid BAKER address or malformed URI parameters."),
CClientUIInterface::ICON_WARNING);
return;
}
}
if (QFile::exists(s)) // payment request file
{
PaymentRequestPlus request;
SendCoinsRecipient recipient;
if (!readPaymentRequestFromFile(s, request)) {
emit message(tr("Payment request file handling"),
tr("Payment request file cannot be read! This can be caused by an invalid payment request file."),
CClientUIInterface::ICON_WARNING);
} else if (processPaymentRequest(request, recipient))
emit receivedPaymentRequest(recipient);
return;
}
}
void PaymentServer::handleURIConnection()
{
QLocalSocket* clientConnection = uriServer->nextPendingConnection();
while (clientConnection->bytesAvailable() < (int)sizeof(quint32))
clientConnection->waitForReadyRead();
connect(clientConnection, SIGNAL(disconnected()),
clientConnection, SLOT(deleteLater()));
QDataStream in(clientConnection);
in.setVersion(QDataStream::Qt_4_0);
if (clientConnection->bytesAvailable() < (int)sizeof(quint16)) {
return;
}
QString msg;
in >> msg;
handleURIOrFile(msg);
}
//
// Warning: readPaymentRequestFromFile() is used in ipcSendCommandLine()
// so don't use "emit message()", but "QMessageBox::"!
//
bool PaymentServer::readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request)
{
QFile f(filename);
if (!f.open(QIODevice::ReadOnly)) {
qWarning() << QString("PaymentServer::%1: Failed to open %2").arg(__func__).arg(filename);
return false;
}
// BIP70 DoS protection
if (f.size() > BIP70_MAX_PAYMENTREQUEST_SIZE) {
qWarning() << QString("PaymentServer::%1: Payment request %2 is too large (%3 bytes, allowed %4 bytes).")
.arg(__func__)
.arg(filename)
.arg(f.size())
.arg(BIP70_MAX_PAYMENTREQUEST_SIZE);
return false;
}
QByteArray data = f.readAll();
return request.parse(data);
}
bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoinsRecipient& recipient)
{
if (!optionsModel)
return false;
if (request.IsInitialized()) {
const payments::PaymentDetails& details = request.getDetails();
// Payment request network matches client network?
if (details.network() != Params().NetworkIDString()) {
emit message(tr("Payment request rejected"), tr("Payment request network doesn't match client network."),
CClientUIInterface::MSG_ERROR);
return false;
}
// Expired payment request?
if (details.has_expires() && (int64_t)details.expires() < GetTime()) {
emit message(tr("Payment request rejected"), tr("Payment request has expired."),
CClientUIInterface::MSG_ERROR);
return false;
}
} else {
emit message(tr("Payment request error"), tr("Payment request is not initialized."),
CClientUIInterface::MSG_ERROR);
return false;
}
recipient.paymentRequest = request;
recipient.message = GUIUtil::HtmlEscape(request.getDetails().memo());
request.getMerchant(certStore.get(), recipient.authenticatedMerchant);
QList<std::pair<CScript, CAmount> > sendingTos = request.getPayTo();
QStringList addresses;
foreach (const PAIRTYPE(CScript, CAmount) & sendingTo, sendingTos) {
// Extract and check destination addresses
CTxDestination dest;
if (ExtractDestination(sendingTo.first, dest)) {
// Append destination address
addresses.append(QString::fromStdString(CBitcoinAddress(dest).ToString()));
} else if (!recipient.authenticatedMerchant.isEmpty()) {
// Insecure payments to custom baker addresses are not supported
// (there is no good way to tell the user where they are paying in a way
// they'd have a chance of understanding).
emit message(tr("Payment request rejected"),
tr("Unverified payment requests to custom payment scripts are unsupported."),
CClientUIInterface::MSG_ERROR);
return false;
}
// Extract and check amounts
CTxOut txOut(sendingTo.second, sendingTo.first);
if (txOut.IsDust(::minRelayTxFee)) {
emit message(tr("Payment request error"), tr("Requested payment amount of %1 is too small (considered dust).").arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)),
CClientUIInterface::MSG_ERROR);
return false;
}
recipient.amount += sendingTo.second;
}
// Store addresses and format them to fit nicely into the GUI
recipient.address = addresses.join("<br />");
if (!recipient.authenticatedMerchant.isEmpty()) {
qDebug() << "PaymentServer::processPaymentRequest : Secure payment request from " << recipient.authenticatedMerchant;
} else {
qDebug() << "PaymentServer::processPaymentRequest : Insecure payment request to " << addresses.join(", ");
}
return true;
}
void PaymentServer::fetchRequest(const QUrl& url)
{
QNetworkRequest netRequest;
netRequest.setAttribute(QNetworkRequest::User, BIP70_MESSAGE_PAYMENTREQUEST);
netRequest.setUrl(url);
netRequest.setRawHeader("User-Agent", CLIENT_NAME.c_str());
netRequest.setRawHeader("Accept", BIP71_MIMETYPE_PAYMENTREQUEST);
netManager->get(netRequest);
}
void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction)
{
const payments::PaymentDetails& details = recipient.paymentRequest.getDetails();
if (!details.has_payment_url())
return;
QNetworkRequest netRequest;
netRequest.setAttribute(QNetworkRequest::User, BIP70_MESSAGE_PAYMENTACK);
netRequest.setUrl(QString::fromStdString(details.payment_url()));
netRequest.setHeader(QNetworkRequest::ContentTypeHeader, BIP71_MIMETYPE_PAYMENT);
netRequest.setRawHeader("User-Agent", CLIENT_NAME.c_str());
netRequest.setRawHeader("Accept", BIP71_MIMETYPE_PAYMENTACK);
payments::Payment payment;
payment.set_merchant_data(details.merchant_data());
payment.add_transactions(transaction.data(), transaction.size());
// Create a new refund address, or re-use:
QString account = tr("Refund from %1").arg(recipient.authenticatedMerchant);
std::string strAccount = account.toStdString();
set<CTxDestination> refundAddresses = wallet->GetAccountAddresses(strAccount);
if (!refundAddresses.empty()) {
CScript s = GetScriptForDestination(*refundAddresses.begin());
payments::Output* refund_to = payment.add_refund_to();
refund_to->set_script(&s[0], s.size());
} else {
CPubKey newKey;
if (wallet->GetKeyFromPool(newKey)) {
CKeyID keyID = newKey.GetID();
wallet->SetAddressBook(keyID, strAccount, "refund");
CScript s = GetScriptForDestination(keyID);
payments::Output* refund_to = payment.add_refund_to();
refund_to->set_script(&s[0], s.size());
} else {
// This should never happen, because sending coins should have
// just unlocked the wallet and refilled the keypool.
qWarning() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set";
}
}
int length = payment.ByteSize();
netRequest.setHeader(QNetworkRequest::ContentLengthHeader, length);
QByteArray serData(length, '\0');
if (payment.SerializeToArray(serData.data(), length)) {
netManager->post(netRequest, serData);
} else {
// This should never happen, either.
qWarning() << "PaymentServer::fetchPaymentACK : Error serializing payment message";
}
}
void PaymentServer::netRequestFinished(QNetworkReply* reply)
{
reply->deleteLater();
// BIP70 DoS protection
if (reply->size() > BIP70_MAX_PAYMENTREQUEST_SIZE) {
QString msg = tr("Payment request %1 is too large (%2 bytes, allowed %3 bytes).")
.arg(reply->request().url().toString())
.arg(reply->size())
.arg(BIP70_MAX_PAYMENTREQUEST_SIZE);
qWarning() << QString("PaymentServer::%1:").arg(__func__) << msg;
emit message(tr("Payment request DoS protection"), msg, CClientUIInterface::MSG_ERROR);
return;
}
if (reply->error() != QNetworkReply::NoError) {
QString msg = tr("Error communicating with %1: %2")
.arg(reply->request().url().toString())
.arg(reply->errorString());
qWarning() << "PaymentServer::netRequestFinished: " << msg;
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR);
return;
}
QByteArray data = reply->readAll();
QString requestType = reply->request().attribute(QNetworkRequest::User).toString();
if (requestType == BIP70_MESSAGE_PAYMENTREQUEST) {
PaymentRequestPlus request;
SendCoinsRecipient recipient;
if (!request.parse(data)) {
qWarning() << "PaymentServer::netRequestFinished : Error parsing payment request";
emit message(tr("Payment request error"),
tr("Payment request cannot be parsed!"),
CClientUIInterface::MSG_ERROR);
} else if (processPaymentRequest(request, recipient))
emit receivedPaymentRequest(recipient);
return;
} else if (requestType == BIP70_MESSAGE_PAYMENTACK) {
payments::PaymentACK paymentACK;
if (!paymentACK.ParseFromArray(data.data(), data.size())) {
QString msg = tr("Bad response from server %1")
.arg(reply->request().url().toString());
qWarning() << "PaymentServer::netRequestFinished : " << msg;
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR);
} else {
emit receivedPaymentACK(GUIUtil::HtmlEscape(paymentACK.memo()));
}
}
}
void PaymentServer::reportSslErrors(QNetworkReply* reply, const QList<QSslError>& errs)
{
Q_UNUSED(reply);
QString errString;
foreach (const QSslError& err, errs) {
qWarning() << "PaymentServer::reportSslErrors : " << err;
errString += err.errorString() + "\n";
}
emit message(tr("Network request error"), errString, CClientUIInterface::MSG_ERROR);
}
void PaymentServer::setOptionsModel(OptionsModel* optionsModel)
{
this->optionsModel = optionsModel;
}
void PaymentServer::handlePaymentACK(const QString& paymentACKMsg)
{
// currently we don't futher process or store the paymentACK message
emit message(tr("Payment acknowledged"), paymentACKMsg, CClientUIInterface::ICON_INFORMATION | CClientUIInterface::MODAL);
}
X509_STORE* PaymentServer::getCertStore()
{
return certStore.get();
}
| [
"32452342+reloopbenny@users.noreply.github.com"
] | 32452342+reloopbenny@users.noreply.github.com |
f12957bbc63290ebba7c193bdf6f95916107e94e | b38f20bf87238849d481c2b2647320461556a27d | /Code/PrevTestLab_Win32/PrevTestLab_Win32/CAudioComponent.cpp | 2b7366768f08767b7fd70c24be426039a92bb4f4 | [] | no_license | batherit/BatheritEngine | f132f32865ba17a26762870c839900d237b027d1 | 6a1595b673570cf069f3ad9ca39a486c2973adf7 | refs/heads/master | 2021-09-22T21:32:09.160482 | 2018-09-16T09:29:07 | 2018-09-16T09:29:07 | 132,496,036 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 163 | cpp | #include "CAudioComponent.h"
#include "CIniFileLoaderBase.h"
#include "CFMOD.h"
CAudioComponent::CAudioComponent()
{
}
CAudioComponent::~CAudioComponent()
{
}
| [
"batherit0703@naver.com"
] | batherit0703@naver.com |
16868744b96d007ecb31490c97ef6e9f1d9c2ffc | 9f30967e6c53dddd01a0e6e60947a266209199c2 | /zty-Contest/zty-Exercise/luogu/P1084/P1084.cpp | 8b9d99cb070f3b80763db76a9017726ddd518535 | [] | no_license | zty111/OI | 80ce2cfcace751673a56f7808259c0622d5689a4 | 5f49047ef3f8d17eb1677ad38f1829fd44e85abc | refs/heads/master | 2020-07-29T23:48:59.956933 | 2019-10-31T15:18:02 | 2019-10-31T15:18:02 | 165,688,652 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,629 | cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 200010;
int n,cnt=1,e[N],to[N],h[N],nxt[N],m,num[N],ans,l,r;
inline char nc(){
static char buf[100000],*p1=buf,*p2=buf;
return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
inline int read(){
char ch=nc();int sum=0;
while(ch<'0'||ch>'9')ch=nc();
while(ch>='0'&&ch<='9')sum=sum*10+ch-48,ch=nc();
return sum;
}
void add_edge(int u,int v,int w){
e[++cnt]=w;
to[cnt]=v;
nxt[cnt]=h[u];
h[u]=cnt;
}
vector<int>army;
vector<int>ok;
vector<int>need;
int dis[N],fa[N],have[N];
void dfs(int u){
for(int i = h[u]; i; i = nxt[i]){
int v = to[i];
if(!dis[v]){
fa[v] = u;
dis[v] = dis[u] + e[i];
r += dis[v] * num[v];
dfs(v);
}
}
}
bool cmp(int a,int b){
return a > b;
}
int vis[N],ne[N];
void dfs2(int u, int topf){
vis[u] = 1;
int flag = 1;
for(int i = h[u]; i; i = nxt[i]){
int v = to[i];
if(have[to[i]]||vis[v])continue;
flag = 0;
dfs2(v, topf);
if(ne[topf])return;
}
if(flag)ne[topf]=1;
}
bool check(int x) {
for(int i = 0; i < army.size(); i++) {
int now = army[i];
if(dis[now] <= x) {
int ret = x;
while(fa[now]!=1 && ret > dis[now] - dis[fa[now]]){
ret -= dis[now] - dis[fa[now]];
now = fa[now];
}
if(ret > 2 * dis[now]){
ok.push_back(ret - dis[now]);
}
else have[now]=1;
}
else {
int ret = x;
while(ret > dis[now] - dis[fa[now]]){
ret -= dis[now] - dis[fa[now]];
now = fa[now];
}
have[now]=1;
}
}
sort(ok.begin(),ok.end(),cmp);
for(int i = h[1]; i; i = nxt[i]){
int v = to[i];
if(!have[v])dfs2(v,v);
if(ne[v])need.push_back(dis[v]);
}
sort(need.begin(),need.end(),cmp);
for(int i = 0; i < need.size(); i++){
if(i >= ok.size())return false;
if(ok[i] < need[i])return false;
}
return true;
}
int main(){
n=read();
for(int i=1;i<=n-1;i++){
int u,v,w;
u=read();v=read();w=read();
add_edge(u,v,w);
add_edge(v,u,w);
}
m=read();
for(int i=1;i<=m;i++){
int a=read();
num[a]++;
army.push_back(a);
}
dfs(1);
while(l <= r){
int mid = (l + r) / 2;
if(check(mid)) ans = mid, r = mid -1;
else l = mid + 1;
}
printf("%d\n", ans);
return 0;
} | [
"1225013181@qq.com"
] | 1225013181@qq.com |
0be62ef07036046fff9215800ace826daf1764a2 | 4ccc93c43061a18de9064569020eb50509e75541 | /base/message_loop/message_loop.cc | 0eb24cf7d2f89641950bf36ba7768ca7d2dc7ccc | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | SaschaMester/delicium | f2bdab35d51434ac6626db6d0e60ee01911797d7 | b7bc83c3b107b30453998daadaeee618e417db5a | refs/heads/master | 2021-01-13T02:06:38.740273 | 2015-07-06T00:22:53 | 2015-07-06T00:22:53 | 38,457,128 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 22,154 | cc | // Copyright 2013 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 "base/message_loop/message_loop.h"
#include <algorithm>
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_pump_default.h"
#include "base/metrics/histogram.h"
#include "base/metrics/statistics_recorder.h"
#include "base/run_loop.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread_local.h"
#include "base/time/time.h"
#include "base/tracked_objects.h"
#if defined(OS_MACOSX)
#include "base/message_loop/message_pump_mac.h"
#endif
#if defined(OS_POSIX) && !defined(OS_IOS)
#include "base/message_loop/message_pump_libevent.h"
#endif
#if defined(OS_ANDROID)
#include "base/message_loop/message_pump_android.h"
#endif
#if defined(USE_GLIB)
#include "base/message_loop/message_pump_glib.h"
#endif
namespace base {
namespace {
// A lazily created thread local storage for quick access to a thread's message
// loop, if one exists. This should be safe and free of static constructors.
LazyInstance<base::ThreadLocalPointer<MessageLoop> >::Leaky lazy_tls_ptr =
LAZY_INSTANCE_INITIALIZER;
// Logical events for Histogram profiling. Run with -message-loop-histogrammer
// to get an accounting of messages and actions taken on each thread.
const int kTaskRunEvent = 0x1;
#if !defined(OS_NACL)
const int kTimerEvent = 0x2;
// Provide range of message IDs for use in histogramming and debug display.
const int kLeastNonZeroMessageId = 1;
const int kMaxMessageId = 1099;
const int kNumberOfDistinctMessagesDisplayed = 1100;
// Provide a macro that takes an expression (such as a constant, or macro
// constant) and creates a pair to initalize an array of pairs. In this case,
// our pair consists of the expressions value, and the "stringized" version
// of the expression (i.e., the exrpression put in quotes). For example, if
// we have:
// #define FOO 2
// #define BAR 5
// then the following:
// VALUE_TO_NUMBER_AND_NAME(FOO + BAR)
// will expand to:
// {7, "FOO + BAR"}
// We use the resulting array as an argument to our histogram, which reads the
// number as a bucket identifier, and proceeds to use the corresponding name
// in the pair (i.e., the quoted string) when printing out a histogram.
#define VALUE_TO_NUMBER_AND_NAME(name) {name, #name},
const LinearHistogram::DescriptionPair event_descriptions_[] = {
// Provide some pretty print capability in our histogram for our internal
// messages.
// A few events we handle (kindred to messages), and used to profile actions.
VALUE_TO_NUMBER_AND_NAME(kTaskRunEvent)
VALUE_TO_NUMBER_AND_NAME(kTimerEvent)
{-1, NULL} // The list must be null terminated, per API to histogram.
};
#endif // !defined(OS_NACL)
bool enable_histogrammer_ = false;
MessageLoop::MessagePumpFactory* message_pump_for_ui_factory_ = NULL;
#if defined(OS_IOS)
typedef MessagePumpIOSForIO MessagePumpForIO;
#elif defined(OS_NACL_SFI)
typedef MessagePumpDefault MessagePumpForIO;
#elif defined(OS_POSIX)
typedef MessagePumpLibevent MessagePumpForIO;
#endif
#if !defined(OS_NACL_SFI)
MessagePumpForIO* ToPumpIO(MessagePump* pump) {
return static_cast<MessagePumpForIO*>(pump);
}
#endif // !defined(OS_NACL_SFI)
scoped_ptr<MessagePump> ReturnPump(scoped_ptr<MessagePump> pump) {
return pump;
}
} // namespace
//------------------------------------------------------------------------------
MessageLoop::TaskObserver::TaskObserver() {
}
MessageLoop::TaskObserver::~TaskObserver() {
}
MessageLoop::DestructionObserver::~DestructionObserver() {
}
//------------------------------------------------------------------------------
MessageLoop::MessageLoop(Type type)
: MessageLoop(type, MessagePumpFactoryCallback()) {
BindToCurrentThread();
}
MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump)
: MessageLoop(TYPE_CUSTOM, Bind(&ReturnPump, Passed(&pump))) {
BindToCurrentThread();
}
MessageLoop::~MessageLoop() {
// current() could be NULL if this message loop is destructed before it is
// bound to a thread.
DCHECK(current() == this || !current());
// iOS just attaches to the loop, it doesn't Run it.
// TODO(stuartmorgan): Consider wiring up a Detach().
#if !defined(OS_IOS)
DCHECK(!run_loop_);
#endif
#if defined(OS_WIN)
if (in_high_res_mode_)
Time::ActivateHighResolutionTimer(false);
#endif
// Clean up any unprocessed tasks, but take care: deleting a task could
// result in the addition of more tasks (e.g., via DeleteSoon). We set a
// limit on the number of times we will allow a deleted task to generate more
// tasks. Normally, we should only pass through this loop once or twice. If
// we end up hitting the loop limit, then it is probably due to one task that
// is being stubborn. Inspect the queues to see who is left.
bool did_work;
for (int i = 0; i < 100; ++i) {
DeletePendingTasks();
ReloadWorkQueue();
// If we end up with empty queues, then break out of the loop.
did_work = DeletePendingTasks();
if (!did_work)
break;
}
DCHECK(!did_work);
// Let interested parties have one last shot at accessing this.
FOR_EACH_OBSERVER(DestructionObserver, destruction_observers_,
WillDestroyCurrentMessageLoop());
thread_task_runner_handle_.reset();
// Tell the incoming queue that we are dying.
incoming_task_queue_->WillDestroyCurrentMessageLoop();
incoming_task_queue_ = NULL;
task_runner_ = NULL;
// OK, now make it so that no one can find us.
lazy_tls_ptr.Pointer()->Set(NULL);
}
// static
MessageLoop* MessageLoop::current() {
// TODO(darin): sadly, we cannot enable this yet since people call us even
// when they have no intention of using us.
// DCHECK(loop) << "Ouch, did you forget to initialize me?";
return lazy_tls_ptr.Pointer()->Get();
}
// static
void MessageLoop::EnableHistogrammer(bool enable) {
enable_histogrammer_ = enable;
}
// static
bool MessageLoop::InitMessagePumpForUIFactory(MessagePumpFactory* factory) {
if (message_pump_for_ui_factory_)
return false;
message_pump_for_ui_factory_ = factory;
return true;
}
// static
scoped_ptr<MessagePump> MessageLoop::CreateMessagePumpForType(Type type) {
// TODO(rvargas): Get rid of the OS guards.
#if defined(USE_GLIB) && !defined(OS_NACL)
typedef MessagePumpGlib MessagePumpForUI;
#elif defined(OS_LINUX) && !defined(OS_NACL)
typedef MessagePumpLibevent MessagePumpForUI;
#endif
#if defined(OS_IOS) || defined(OS_MACOSX)
#define MESSAGE_PUMP_UI scoped_ptr<MessagePump>(MessagePumpMac::Create())
#elif defined(OS_NACL)
// Currently NaCl doesn't have a UI MessageLoop.
// TODO(abarth): Figure out if we need this.
#define MESSAGE_PUMP_UI scoped_ptr<MessagePump>()
#else
#define MESSAGE_PUMP_UI scoped_ptr<MessagePump>(new MessagePumpForUI())
#endif
#if defined(OS_MACOSX)
// Use an OS native runloop on Mac to support timer coalescing.
#define MESSAGE_PUMP_DEFAULT \
scoped_ptr<MessagePump>(new MessagePumpCFRunLoop())
#else
#define MESSAGE_PUMP_DEFAULT scoped_ptr<MessagePump>(new MessagePumpDefault())
#endif
if (type == MessageLoop::TYPE_UI) {
if (message_pump_for_ui_factory_)
return message_pump_for_ui_factory_();
return MESSAGE_PUMP_UI;
}
if (type == MessageLoop::TYPE_IO)
return scoped_ptr<MessagePump>(new MessagePumpForIO());
#if defined(OS_ANDROID)
if (type == MessageLoop::TYPE_JAVA)
return scoped_ptr<MessagePump>(new MessagePumpForUI());
#endif
DCHECK_EQ(MessageLoop::TYPE_DEFAULT, type);
return MESSAGE_PUMP_DEFAULT;
}
void MessageLoop::AddDestructionObserver(
DestructionObserver* destruction_observer) {
DCHECK_EQ(this, current());
destruction_observers_.AddObserver(destruction_observer);
}
void MessageLoop::RemoveDestructionObserver(
DestructionObserver* destruction_observer) {
DCHECK_EQ(this, current());
destruction_observers_.RemoveObserver(destruction_observer);
}
void MessageLoop::PostTask(
const tracked_objects::Location& from_here,
const Closure& task) {
task_runner_->PostTask(from_here, task);
}
void MessageLoop::PostDelayedTask(
const tracked_objects::Location& from_here,
const Closure& task,
TimeDelta delay) {
task_runner_->PostDelayedTask(from_here, task, delay);
}
void MessageLoop::PostNonNestableTask(
const tracked_objects::Location& from_here,
const Closure& task) {
task_runner_->PostNonNestableTask(from_here, task);
}
void MessageLoop::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const Closure& task,
TimeDelta delay) {
task_runner_->PostNonNestableDelayedTask(from_here, task, delay);
}
void MessageLoop::Run() {
DCHECK(pump_);
RunLoop run_loop;
run_loop.Run();
}
void MessageLoop::RunUntilIdle() {
DCHECK(pump_);
RunLoop run_loop;
run_loop.RunUntilIdle();
}
void MessageLoop::QuitWhenIdle() {
DCHECK_EQ(this, current());
if (run_loop_) {
run_loop_->quit_when_idle_received_ = true;
} else {
NOTREACHED() << "Must be inside Run to call Quit";
}
}
void MessageLoop::QuitNow() {
DCHECK_EQ(this, current());
if (run_loop_) {
pump_->Quit();
} else {
NOTREACHED() << "Must be inside Run to call Quit";
}
}
bool MessageLoop::IsType(Type type) const {
return type_ == type;
}
static void QuitCurrentWhenIdle() {
MessageLoop::current()->QuitWhenIdle();
}
// static
Closure MessageLoop::QuitWhenIdleClosure() {
return Bind(&QuitCurrentWhenIdle);
}
void MessageLoop::SetNestableTasksAllowed(bool allowed) {
if (allowed) {
// Kick the native pump just in case we enter a OS-driven nested message
// loop.
pump_->ScheduleWork();
}
nestable_tasks_allowed_ = allowed;
}
bool MessageLoop::NestableTasksAllowed() const {
return nestable_tasks_allowed_;
}
bool MessageLoop::IsNested() {
return run_loop_->run_depth_ > 1;
}
void MessageLoop::AddTaskObserver(TaskObserver* task_observer) {
DCHECK_EQ(this, current());
task_observers_.AddObserver(task_observer);
}
void MessageLoop::RemoveTaskObserver(TaskObserver* task_observer) {
DCHECK_EQ(this, current());
task_observers_.RemoveObserver(task_observer);
}
bool MessageLoop::is_running() const {
DCHECK_EQ(this, current());
return run_loop_ != NULL;
}
bool MessageLoop::HasHighResolutionTasks() {
return incoming_task_queue_->HasHighResolutionTasks();
}
bool MessageLoop::IsIdleForTesting() {
// We only check the imcoming queue|, since we don't want to lock the work
// queue.
return incoming_task_queue_->IsIdleForTesting();
}
//------------------------------------------------------------------------------
scoped_ptr<MessageLoop> MessageLoop::CreateUnbound(
Type type, MessagePumpFactoryCallback pump_factory) {
return make_scoped_ptr(new MessageLoop(type, pump_factory));
}
MessageLoop::MessageLoop(Type type, MessagePumpFactoryCallback pump_factory)
: type_(type),
#if defined(OS_WIN)
pending_high_res_tasks_(0),
in_high_res_mode_(false),
#endif
nestable_tasks_allowed_(true),
#if defined(OS_WIN)
os_modal_loop_(false),
#endif // OS_WIN
pump_factory_(pump_factory),
message_histogram_(NULL),
run_loop_(NULL),
incoming_task_queue_(new internal::IncomingTaskQueue(this)),
task_runner_(new internal::MessageLoopTaskRunner(incoming_task_queue_)) {
// If type is TYPE_CUSTOM non-null pump_factory must be given.
DCHECK_EQ(type_ == TYPE_CUSTOM, !pump_factory_.is_null());
}
void MessageLoop::BindToCurrentThread() {
DCHECK(!pump_);
if (!pump_factory_.is_null())
pump_ = pump_factory_.Run();
else
pump_ = CreateMessagePumpForType(type_);
DCHECK(!current()) << "should only have one message loop per thread";
lazy_tls_ptr.Pointer()->Set(this);
incoming_task_queue_->StartScheduling();
task_runner_->BindToCurrentThread();
thread_task_runner_handle_.reset(new ThreadTaskRunnerHandle(task_runner_));
}
void MessageLoop::RunHandler() {
DCHECK_EQ(this, current());
StartHistogrammer();
#if defined(OS_WIN)
if (run_loop_->dispatcher_ && type() == TYPE_UI) {
static_cast<MessagePumpForUI*>(pump_.get())->
RunWithDispatcher(this, run_loop_->dispatcher_);
return;
}
#endif
pump_->Run(this);
}
bool MessageLoop::ProcessNextDelayedNonNestableTask() {
if (run_loop_->run_depth_ != 1)
return false;
if (deferred_non_nestable_work_queue_.empty())
return false;
PendingTask pending_task = deferred_non_nestable_work_queue_.front();
deferred_non_nestable_work_queue_.pop();
RunTask(pending_task);
return true;
}
void MessageLoop::RunTask(const PendingTask& pending_task) {
DCHECK(nestable_tasks_allowed_);
#if defined(OS_WIN)
if (pending_task.is_high_res) {
pending_high_res_tasks_--;
CHECK_GE(pending_high_res_tasks_, 0);
}
#endif
// Execute the task and assume the worst: It is probably not reentrant.
nestable_tasks_allowed_ = false;
HistogramEvent(kTaskRunEvent);
FOR_EACH_OBSERVER(TaskObserver, task_observers_,
WillProcessTask(pending_task));
task_annotator_.RunTask(
"MessageLoop::PostTask", "MessageLoop::RunTask", pending_task);
FOR_EACH_OBSERVER(TaskObserver, task_observers_,
DidProcessTask(pending_task));
nestable_tasks_allowed_ = true;
}
bool MessageLoop::DeferOrRunPendingTask(const PendingTask& pending_task) {
if (pending_task.nestable || run_loop_->run_depth_ == 1) {
RunTask(pending_task);
// Show that we ran a task (Note: a new one might arrive as a
// consequence!).
return true;
}
// We couldn't run the task now because we're in a nested message loop
// and the task isn't nestable.
deferred_non_nestable_work_queue_.push(pending_task);
return false;
}
void MessageLoop::AddToDelayedWorkQueue(const PendingTask& pending_task) {
// Move to the delayed work queue.
delayed_work_queue_.push(pending_task);
}
bool MessageLoop::DeletePendingTasks() {
bool did_work = !work_queue_.empty();
while (!work_queue_.empty()) {
PendingTask pending_task = work_queue_.front();
work_queue_.pop();
if (!pending_task.delayed_run_time.is_null()) {
// We want to delete delayed tasks in the same order in which they would
// normally be deleted in case of any funny dependencies between delayed
// tasks.
AddToDelayedWorkQueue(pending_task);
}
}
did_work |= !deferred_non_nestable_work_queue_.empty();
while (!deferred_non_nestable_work_queue_.empty()) {
deferred_non_nestable_work_queue_.pop();
}
did_work |= !delayed_work_queue_.empty();
// Historically, we always delete the task regardless of valgrind status. It's
// not completely clear why we want to leak them in the loops above. This
// code is replicating legacy behavior, and should not be considered
// absolutely "correct" behavior. See TODO above about deleting all tasks
// when it's safe.
while (!delayed_work_queue_.empty()) {
delayed_work_queue_.pop();
}
return did_work;
}
void MessageLoop::ReloadWorkQueue() {
// We can improve performance of our loading tasks from the incoming queue to
// |*work_queue| by waiting until the last minute (|*work_queue| is empty) to
// load. That reduces the number of locks-per-task significantly when our
// queues get large.
if (work_queue_.empty()) {
#if defined(OS_WIN)
pending_high_res_tasks_ +=
incoming_task_queue_->ReloadWorkQueue(&work_queue_);
#else
incoming_task_queue_->ReloadWorkQueue(&work_queue_);
#endif
}
}
void MessageLoop::ScheduleWork() {
pump_->ScheduleWork();
}
//------------------------------------------------------------------------------
// Method and data for histogramming events and actions taken by each instance
// on each thread.
void MessageLoop::StartHistogrammer() {
#if !defined(OS_NACL) // NaCl build has no metrics code.
if (enable_histogrammer_ && !message_histogram_
&& StatisticsRecorder::IsActive()) {
DCHECK(!thread_name_.empty());
message_histogram_ = LinearHistogram::FactoryGetWithRangeDescription(
"MsgLoop:" + thread_name_,
kLeastNonZeroMessageId, kMaxMessageId,
kNumberOfDistinctMessagesDisplayed,
message_histogram_->kHexRangePrintingFlag,
event_descriptions_);
}
#endif
}
void MessageLoop::HistogramEvent(int event) {
#if !defined(OS_NACL)
if (message_histogram_)
message_histogram_->Add(event);
#endif
}
bool MessageLoop::DoWork() {
if (!nestable_tasks_allowed_) {
// Task can't be executed right now.
return false;
}
for (;;) {
ReloadWorkQueue();
if (work_queue_.empty())
break;
// Execute oldest task.
do {
PendingTask pending_task = work_queue_.front();
work_queue_.pop();
if (!pending_task.delayed_run_time.is_null()) {
AddToDelayedWorkQueue(pending_task);
// If we changed the topmost task, then it is time to reschedule.
if (delayed_work_queue_.top().task.Equals(pending_task.task))
pump_->ScheduleDelayedWork(pending_task.delayed_run_time);
} else {
if (DeferOrRunPendingTask(pending_task))
return true;
}
} while (!work_queue_.empty());
}
// Nothing happened.
return false;
}
bool MessageLoop::DoDelayedWork(TimeTicks* next_delayed_work_time) {
if (!nestable_tasks_allowed_ || delayed_work_queue_.empty()) {
recent_time_ = *next_delayed_work_time = TimeTicks();
return false;
}
// When we "fall behind," there will be a lot of tasks in the delayed work
// queue that are ready to run. To increase efficiency when we fall behind,
// we will only call Time::Now() intermittently, and then process all tasks
// that are ready to run before calling it again. As a result, the more we
// fall behind (and have a lot of ready-to-run delayed tasks), the more
// efficient we'll be at handling the tasks.
TimeTicks next_run_time = delayed_work_queue_.top().delayed_run_time;
if (next_run_time > recent_time_) {
recent_time_ = TimeTicks::Now(); // Get a better view of Now();
if (next_run_time > recent_time_) {
*next_delayed_work_time = next_run_time;
return false;
}
}
PendingTask pending_task = delayed_work_queue_.top();
delayed_work_queue_.pop();
if (!delayed_work_queue_.empty())
*next_delayed_work_time = delayed_work_queue_.top().delayed_run_time;
return DeferOrRunPendingTask(pending_task);
}
bool MessageLoop::DoIdleWork() {
if (ProcessNextDelayedNonNestableTask())
return true;
if (run_loop_->quit_when_idle_received_)
pump_->Quit();
// When we return we will do a kernel wait for more tasks.
#if defined(OS_WIN)
// On Windows we activate the high resolution timer so that the wait
// _if_ triggered by the timer happens with good resolution. If we don't
// do this the default resolution is 15ms which might not be acceptable
// for some tasks.
bool high_res = pending_high_res_tasks_ > 0;
if (high_res != in_high_res_mode_) {
in_high_res_mode_ = high_res;
Time::ActivateHighResolutionTimer(in_high_res_mode_);
}
#endif
return false;
}
void MessageLoop::DeleteSoonInternal(const tracked_objects::Location& from_here,
void(*deleter)(const void*),
const void* object) {
PostNonNestableTask(from_here, Bind(deleter, object));
}
void MessageLoop::ReleaseSoonInternal(
const tracked_objects::Location& from_here,
void(*releaser)(const void*),
const void* object) {
PostNonNestableTask(from_here, Bind(releaser, object));
}
#if !defined(OS_NACL)
//------------------------------------------------------------------------------
// MessageLoopForUI
#if defined(OS_ANDROID)
void MessageLoopForUI::Start() {
// No Histogram support for UI message loop as it is managed by Java side
static_cast<MessagePumpForUI*>(pump_.get())->Start(this);
}
#endif
#if defined(OS_IOS)
void MessageLoopForUI::Attach() {
static_cast<MessagePumpUIApplication*>(pump_.get())->Attach(this);
}
#endif
#if defined(USE_OZONE) || (defined(USE_X11) && !defined(USE_GLIB))
bool MessageLoopForUI::WatchFileDescriptor(
int fd,
bool persistent,
MessagePumpLibevent::Mode mode,
MessagePumpLibevent::FileDescriptorWatcher *controller,
MessagePumpLibevent::Watcher *delegate) {
return static_cast<MessagePumpLibevent*>(pump_.get())->WatchFileDescriptor(
fd,
persistent,
mode,
controller,
delegate);
}
#endif
#endif // !defined(OS_NACL)
//------------------------------------------------------------------------------
// MessageLoopForIO
#if !defined(OS_NACL_SFI)
void MessageLoopForIO::AddIOObserver(
MessageLoopForIO::IOObserver* io_observer) {
ToPumpIO(pump_.get())->AddIOObserver(io_observer);
}
void MessageLoopForIO::RemoveIOObserver(
MessageLoopForIO::IOObserver* io_observer) {
ToPumpIO(pump_.get())->RemoveIOObserver(io_observer);
}
#if defined(OS_WIN)
void MessageLoopForIO::RegisterIOHandler(HANDLE file, IOHandler* handler) {
ToPumpIO(pump_.get())->RegisterIOHandler(file, handler);
}
bool MessageLoopForIO::RegisterJobObject(HANDLE job, IOHandler* handler) {
return ToPumpIO(pump_.get())->RegisterJobObject(job, handler);
}
bool MessageLoopForIO::WaitForIOCompletion(DWORD timeout, IOHandler* filter) {
return ToPumpIO(pump_.get())->WaitForIOCompletion(timeout, filter);
}
#elif defined(OS_POSIX)
bool MessageLoopForIO::WatchFileDescriptor(int fd,
bool persistent,
Mode mode,
FileDescriptorWatcher* controller,
Watcher* delegate) {
return ToPumpIO(pump_.get())->WatchFileDescriptor(
fd,
persistent,
mode,
controller,
delegate);
}
#endif
#endif // !defined(OS_NACL_SFI)
} // namespace base
| [
"g4jc@github.com"
] | g4jc@github.com |
9520b955b33ce7b659694644c642f80fe5f27a22 | 466ac193a31b2c0e0ec49b711ee1ee8164a3957e | /model/src/Move.cpp | c96a4b3aefea3b5364ab6c85686650977309bf2c | [] | no_license | jeffnuss/chess | 33bb6089368cc4b5c7d3f21f7168b8ee4da223b7 | 5862634173d41ddaf9e0beee03494c7f30a282d4 | refs/heads/master | 2021-01-10T09:01:53.175925 | 2012-04-11T02:04:58 | 2012-04-11T02:04:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,021 | cpp | /*
* Move.cpp
*
* Created on: Apr 9, 2012
* Author: jnuss
*/
#include "../inc/Move.h"
Move::Move()
{
}
Move::Move(const Move & other)
: pieceType(other.pieceType),
pieceColor(other.pieceColor),
moveFrom(other.moveFrom),
moveTo(other.moveTo),
capturedPieceType(other.capturedPieceType),
caputuredPiecePosition(other.caputuredPiecePosition)
{
}
Move::Move(const Piece * movedPiece, const BoardPosition & moveFrom,
const BoardPosition & moveTo)
: pieceType(movedPiece->GetType()),
pieceColor(movedPiece->GetColor()),
moveFrom(moveFrom),
moveTo(moveTo),
capturedPieceType(-1),
caputuredPiecePosition(BoardPosition(-1, -1))
{
}
Move::Move(const Piece * movedPiece, const BoardPosition & moveFrom,
const BoardPosition & moveTo, const Piece * capturedPiece,
const BoardPosition & caputuredPiecePosition)
: pieceType(movedPiece->GetType()),
pieceColor(movedPiece->GetColor()),
moveFrom(moveFrom),
moveTo(moveTo),
capturedPieceType(capturedPiece->GetType()),
caputuredPiecePosition(caputuredPiecePosition)
{
}
Move::Move(const int movedPieceType, const int movedPieceColor, const BoardPosition & moveFrom,
const BoardPosition & moveTo, const int capturedPieceType,
const BoardPosition & caputuredPiecePosition)
: pieceType(movedPieceType),
pieceColor(movedPieceColor),
moveFrom(moveFrom),
moveTo(moveTo),
capturedPieceType(capturedPieceType),
caputuredPiecePosition(caputuredPiecePosition)
{
}
int Move::GetPieceType() const
{
return pieceType;
}
int Move::GetPieceColor() const
{
return pieceColor;
}
BoardPosition Move::GetOriginPosition() const
{
return moveFrom;
}
BoardPosition Move::GetDestinationPosition() const
{
return moveTo;
}
int Move::GetCapturedPieceType() const
{
return capturedPieceType;
}
int Move::GetCapturedPieceColor() const
{
return (pieceColor == Piece::BLACK ? Piece::WHITE : Piece::BLACK);
}
BoardPosition Move::GetCapturedPiecePosition() const
{
return caputuredPiecePosition;
}
| [
"jeffnuss@hotmail.com"
] | jeffnuss@hotmail.com |
0573b74877cd10711450117852d6e797ac837f14 | bce9e3f4da414e13981fdb32992bac5cce14832c | /yuan_pattern.h | e80631e9e00bcb91167d73680eddaabb0fdd1c9b | [] | no_license | zhouhaoyuan/structured-light | 61410a79f7a4b0d511ee0988da4ff78aa5c44296 | f9bdb453f8aef2e1f545fc8d5aa2101db289379e | refs/heads/master | 2020-07-29T05:13:22.481695 | 2019-09-20T01:45:44 | 2019-09-20T01:45:44 | 209,681,635 | 7 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 7,212 | h | #ifndef YUAN_PATTERN_H
#define YUAN_PATTERN_H
#include <common/returncode.hpp>
#include <common/debug.hpp>
#include <common/parameters.hpp>
#include <common/capture/capture.hpp>
#include <common/pattern/pattern.hpp>
#include <common/disparity_map.hpp>
#include <structured_light/structured_light.hpp>
#include <structured_light/gray_code/gray_code.hpp>
#include <structured_light/three_phase/three_phase.hpp>
#define _USE_MATH_DEFINES
#include <math.h>
#define YUAN_PATTERN_FREQUENCY_MISSING "YUAN_PATTERN_FREQUENCY_MISSING"
#define YUAN_PATTERN_SEQUENCE_COUNT_MISSING "YUAN_PATTERN_SEQUENCE_COUNT_MISSING"
#define YUAN_PATTERN_PIXELS_PER_PERIOD_MISSING "YUAN_PATTERN_PIXELS_PER_PERIOD_MISSING"
#define YUAN_PATTERN_PIXELS_PER_PERIOD_NOT_DIVISIBLE_BY_EIGHT "YUAN_PATTERN_PIXELS_PER_PERIOD_NOT_DIVISIBLE_BY_EIGHT"
#define YUAN_PATTERN_BITDEPTH_MISSING "YUAN_PATTERN_BITDEPTH_MISSING"
#define YUAN_PATTERN_BITDEPTH_TOO_SMALL "YUAN_PATTERN_BITDEPTH_TOO_SMALL"
namespace dlp{
/**
* @brief The yuan_pattern class used to generate and decode patterns
*/
class yuan_pattern : public dlp::StructuredLight
{
public:
yuan_pattern();
~yuan_pattern();
class Parameters{
public:
//自定义变量
DLP_NEW_PARAMETERS_ENTRY(Frequency, "YUAN_PATTERN_PARAMETERS_FREQUENCY", double, 2.0);
DLP_NEW_PARAMETERS_ENTRY(SequenceCount, "YUAN_PATTERN_PARAMETERS_SEQUENCE_COUNT", unsigned int, 0);
DLP_NEW_PARAMETERS_ENTRY(PixelsPerPeriod, "YUAN_PATTERN_PARAMETERS_PIXELS_PER_PERIOD", unsigned int, 8);
DLP_NEW_PARAMETERS_ENTRY(Bitdepth, "YUAN_PATTERN_PARAMETERS_BITDEPTH", dlp::Pattern::Bitdepth, dlp::Pattern::Bitdepth::MONO_8BPP);
DLP_NEW_PARAMETERS_ENTRY(RepeatPhases, "YUAN_PATTERN_PARAMETERS_REPEAT_PHASES", unsigned int, 1);
};
ReturnCode Setup(const dlp::Parameters &settings);
ReturnCode GetSetup( dlp::Parameters *settings) const;
ReturnCode GeneratePatternSequence(dlp::Pattern::Sequence *pattern_sequence);
ReturnCode DecodeCaptureSequence(Capture::Sequence *capture_sequence,dlp::DisparityMap *disparity_map);
private:
void Patterns_TransformToDlp(std::vector<cv::Mat> &matlist, dlp::Pattern::Sequence *pattern_sequence);
bool reconstruction_parameters_set();
public:
//coding
void generate_sinusoidal_fringe(std::vector<cv::Mat> &image,dlp::Pattern::Orientation orientation,
Parameters::PixelsPerPeriod _PixelsPerPeriod,const int stepNum,
double phaseshift = 0);
void generate_threeFrequencyHeterodyning(std::vector<cv::Mat> &image,const int stepNum,
const int P1 = 40,const int P2 = 46, const int P3 = 350 );
//彩色双频双三步
void generate_color_dual_three_step_sin_pattern(std::vector<cv::Mat> &colorPattern,
int pixelperperiod_1,int pixelperperiod_2,
int stepNum, double phaseShift,
dlp::Pattern::Orientation orientation);
//decoding
void decode_phaseShifting_LookUpTable(cv::Mat &mask, std::vector<cv::Mat> &srcImageSequence, cv::Mat &dstImage,const int stepNum);
void decode_multiStep_phaseShifting(cv::Mat &mask, std::vector<cv::Mat> &srcImageSequence, cv::Mat &dstImage,const int stepNum);
void decode_dualStepPhaseShift(cv::Mat &mask, std::vector<cv::Mat> &srcImageSequence, cv::Mat &dstImage,const int stepNum);
void decode_multiFrequencyHeterodyning(std::vector<cv::Mat> &image, const cv::Mat &maskImage,cv::Mat &unwrap);
void decode_multiWavelength(std::vector<cv::Mat> &image, const cv::Mat &maskImage,cv::Mat &unwrap,dlp::Pattern::Orientation orientation);
void decode_dualFrequencyHeterodyning(std::vector<cv::Mat> &image,const int T1,const int T2, const cv::Mat &maskImage,cv::Mat &unwrap);
//reconstruction
void reconstruct3D_by_singleCameraSystem(cv::Mat &unwrap, std::vector<cv::Point3f> &pCloud,cv::Mat &mask);
void reconstruct3D_by_DlpCameraSystem(std::vector<cv::Point2f> leftPoints, std::vector<cv::Point2f> rightPoints, std::vector<cv::Point3f> &pCloud);
void createCorrectPoints(const cv::Mat &unwrapX,const cv::Mat &unwrapY,int pixels,std::vector<cv::Point2f> &l_points, std::vector<cv::Point2f> &r_points,const cv::Mat &mask);
bool AXbSolve(cv::Mat &A, cv::Mat &b, double* x, int n);
void savePointCloud(std::vector<cv::Point3f> pCloud,QString path);
//设置
void set_multiFrequency(const int p1, const int p2, const int p3);
void set_ImageSize(const int imageHeight,const int imageWidth);
private:
Parameters::Frequency frequency_;
Parameters::SequenceCount sequence_count_;
Parameters::PixelsPerPeriod pixels_per_period_;
Parameters::Bitdepth bitdepth_;
Parameters::RepeatPhases repeat_phases_;
float phase_counts_;
float maximum_value_;
unsigned int resolution_;
//Look-up-table
double** atan2Table_threeStep;
double** atan2Table_fourStep;
int frequency_P1;
int frequency_P2;
int frequency_P3;
int ImageHeight = 800;
int ImageWidth = 1280;
//CalibrateResult
cv::Mat aMat;
cv::Mat camera_intrinsic;
cv::Mat camera_distCoeffs;
cv::Mat E_1,E_2;
cv::Mat M_1,M_2;
cv::Mat _R,_T;
cv::Mat left_intrinsic,right_intrinsic;
cv::Mat left_distCoeffs,right_distCoeffs;
bool singleReconstructionFlag;
};
inline bool yuan_pattern::reconstruction_parameters_set()
{
// cv::FileStorage fs;
// fs.open("../ScanData/SingleCalibResult.yml",cv::FileStorage::READ);
// if(!fs.isOpened())
// {
// std::cout<<"Error: the SingleCalibResult yml file can not be opened!......"<<std::endl;
// }else{
// std::cout<<"The SingleCalibResult yml file opened successfully!......"<<std::endl;
// fs["cameraIntrinsic"]>>camera_intrinsic;
// fs["cameraDistCoeffs"]>>camera_distCoeffs;
// fs["aMatrix"]>>aMat;
// fs.release();
// singleReconstructionFlag = true;
// }
cv::FileStorage fs1;
fs1.open("../ScanData/DoubleCalibResult.yml",cv::FileStorage::READ);
if(!fs1.isOpened())
{
std::cout<<"Error: the DoubleCalibResult yml file can not be opened!......"<<std::endl;
return false;
}else{
std::cout<<"The DoubleCalibResult yml file opened successfully!......"<<std::endl;
fs1["R"]>>_R;
fs1["T"]>>_T;
fs1["cameraM"]>>left_intrinsic;
fs1["proM"]>>right_intrinsic;
fs1["cameraKc"]>>left_distCoeffs;
fs1["proKc"]>>right_distCoeffs;
fs1.release();
singleReconstructionFlag = false;
return true;
}
// if( !fs1.isOpened()){
// return false;
// }else{
// return true;
// }
}
}
#endif // YUAN_PATTERN_H
| [
"noreply@github.com"
] | noreply@github.com |
da9e46232b00567f58e9112d9c09850024449071 | e49cc64ce9256d7b7d9700ca2ba779a4da2d2e1b | /src/kinect2_raw_node.cpp | 36c2395cc970139e09b7187d4c1d53d5843a5da6 | [] | no_license | doge-of-the-day/kinect2 | 01c16de9c3171636763befd8d383d707332ede93 | 5e28bb33b432b60227d7a0ab578e1c95adc5cf9b | refs/heads/master | 2021-01-22T20:13:08.858361 | 2017-10-17T14:46:43 | 2017-10-17T14:46:43 | 85,297,529 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,327 | cpp | /// HEADER
#include <kinect2/kinect2_raw_node.h>
/// SYSTEM
#include <sensor_msgs/distortion_models.h>
#include <sensor_msgs/image_encodings.h>
#include <pcl_ros/point_cloud.h>
#include <sensor_msgs/PointCloud2.h>
#include <functional>
using namespace kinect2;
Kinect2RawNode::Kinect2RawNode() :
nh_private_("~")
{
}
Kinect2RawNode::~Kinect2RawNode()
{
kinterface_.stop();
}
bool Kinect2RawNode::setup()
{
const std::string topic_color = nh_private_.param<std::string>("topic_color", "/kinect2/image_color");
const std::string topic_color_info = nh_private_.param<std::string>("topic_color_info", "/kinect2/image_color/camera_info");
const std::string topic_depth = nh_private_.param<std::string>("topic_depth", "/kinect2/depth");
const std::string topic_depth_info = nh_private_.param<std::string>("topic_depth_info", "/kinect2/depth/camera_info");
const std::string topic_ir = nh_private_.param<std::string>("topic_ir", "/kinect2/image_ir");
const std::string topic_ir_info = nh_private_.param<std::string>("topic_ir_info", "/kinect2/image_ir/camera_info");
const std::string topic_kinect2_info = nh_private_.param<std::string>("topic_kinect2_info", "/kinect2/camera_info");
const std::string topic_color_registered = nh_private_.param<std::string>("topic_color_registered", "/kinect2/color_registered");
const std::string topic_depth_rectified = nh_private_.param<std::string>("topic_depth_undistorted", "/kinect2/depth_rectified");
const std::string topic_pointcloud = nh_private_.param<std::string>("topic_rgb", "/kinect2/points");
const std::string service_name_wakeup = nh_private_.param<std::string>("service_name_wakeup", "/kinect2/wakeup");
const std::string service_name_sleep = nh_private_.param<std::string>("service_name_sleep", "/kinect2/sleep");
const double time_offset_ir = nh_private_.param<double>("time_offset_ir", 0.0);
const double time_offset_rgb = nh_private_.param<double>("time_offset_rgb", 0.0);;
time_offset_ir_.fromNSec(static_cast<long>(std::floor(1e9 * time_offset_ir + 0.5)));
time_offset_rgb_.fromNSec(static_cast<long>(std::floor(1e9 * time_offset_rgb + 0.5)));
pub_rate_preferred_ = nh_private_.param<double>("preferred_publication_rate", -1.0);
frame_id_rgb_ = nh_private_.param<std::string>("frame_id_color", "kinect2_color_optical_frame");
frame_id_ir_ = nh_private_.param<std::string>("frame_id_ir", "kinect2_depth_optical_frame");
kinterface_parameters_.get_points = true;
kinterface_parameters_.get_color = nh_private_.param<bool>("publish_color", false);
kinterface_parameters_.get_ir = nh_private_.param<bool>("publish_ir", false);
kinterface_parameters_.get_depth = nh_private_.param<bool>("publish_depth", false);
kinterface_parameters_.get_color_registered = nh_private_.param<bool>("publish_color_registered", false);
kinterface_parameters_.get_depth_rectified = nh_private_.param<bool>("publish_depth_rectified", false);
const std::string pipeline_type = nh_private_.param<std::string>("pipeline_type", "CUDA");
if(pipeline_type == "GL") {
kinterface_parameters_.mode = Kinect2Interface::GL;
} else if(pipeline_type == "OCL") {
kinterface_parameters_.mode = Kinect2Interface::OCL;
} else if(pipeline_type == "CUDA") {
kinterface_parameters_.mode = Kinect2Interface::CUDA;
} else if(pipeline_type == "KDE_CUDA") {
kinterface_parameters_.mode = Kinect2Interface::KDE_CUDA;
} else if(pipeline_type == "KDE_OCL") {
kinterface_parameters_.mode = Kinect2Interface::KDE_OCL;
} else {
kinterface_parameters_.mode = Kinect2Interface::CPU;
}
if(!kinterface_.setup(kinterface_parameters_)) {
std::cerr << "[Kinect2Node]: Cannot setup Kinect2Interface!" << std::endl;
ros::shutdown();
}
if(kinterface_parameters_.get_color) {
pub_rgb_ = nh_.advertise<sensor_msgs::Image>(topic_color, 1);
pub_rgb_info_ = nh_.advertise<sensor_msgs::CameraInfo>(topic_color_info, 1);
}
if(kinterface_parameters_.get_depth) {
pub_depth_ = nh_.advertise<sensor_msgs::Image>(topic_depth, 1);
pub_depth_info_ = nh_.advertise<sensor_msgs::CameraInfo>(topic_depth_info, 1);
}
if(kinterface_parameters_.get_ir) {
pub_ir_ = nh_.advertise<sensor_msgs::Image>(topic_ir, 1);
pub_ir_info_ = nh_.advertise<sensor_msgs::CameraInfo>(topic_ir_info, 1);
}
if(kinterface_parameters_.get_color_registered) {
pub_rgb_registered_ = nh_.advertise<sensor_msgs::Image>(topic_color_registered, 1);
}
if(kinterface_parameters_.get_depth_rectified) {
pub_depth_undistorted_ = nh_.advertise<sensor_msgs::Image>(topic_depth_rectified, 1);
}
pub_pointcloud_ = nh_.advertise<pcl::PointCloud<pcl::PointXYZRGB>>(topic_pointcloud, 1);
pub_kinect2_info_ = nh_.advertise<Kinect2Info>(topic_kinect2_info, 1);
service_sleep_ = nh_.advertiseService(service_name_sleep, &Kinect2RawNode::sleep, this);
service_wakeup_ = nh_.advertiseService(service_name_wakeup, &Kinect2RawNode::wakeup, this);
return kinterface_.start();
}
int Kinect2RawNode::run()
{
if(pub_rate_preferred_ <= 0.0) {
while(ros::ok()) {
if(kinterface_.isRunning()) {
publish();
} else {
ros::Rate(1.0).sleep();
}
ros::spinOnce();
}
} else {
ros::Rate rate(pub_rate_preferred_);
while(ros::ok()) {
if(kinterface_.isRunning()) {
publish();
rate.sleep();
} else {
ros::Rate(1.0).sleep();
}
}
}
kinterface_.stop();
ros::shutdown();
return 0;
}
void Kinect2RawNode::publish()
{
auto convertRGB = [](const Kinect2Interface::Stamped<cv::Mat> &rgb,
const std::string &frame_id,
sensor_msgs::Image::Ptr &image){
const std::size_t rows = rgb.data.rows;
const std::size_t cols = rgb.data.cols;
const std::size_t rgb_channels = rgb.data.channels();
const std::size_t channels = 3;
if(!image) {
image.reset(new sensor_msgs::Image);
const std::size_t bbc = 1;
image->height = rows;
image->width = cols;
image->encoding = sensor_msgs::image_encodings::BGR8;
image->is_bigendian = false;
image->step = cols * channels * bbc;
image->data.resize(channels * rows * cols);
image->header.frame_id = frame_id;
}
image->header.stamp.fromNSec(rgb.stamp);
const uchar * rgb_ptr = rgb.data.data;
uchar * image_ptr = image->data.data();
for(std::size_t i = 0 ; i < rows ; ++i) {
for(std::size_t j = 0 ; j < cols ; ++j) {
for(std::size_t k = 0 ; k < 3 ; ++k) {
image_ptr[(i * cols + j) * channels + k] =
rgb_ptr[(i * cols + (cols - 1 - j)) * rgb_channels + k];
}
}
}
};
auto convertFloat = [](const Kinect2Interface::Stamped<cv::Mat> &mat,
const std::string &frame_id,
sensor_msgs::Image::Ptr &image)
{
const std::size_t rows = mat.data.rows;
const std::size_t cols = mat.data.cols;
const std::size_t bbp = 2;
if(!image) {
image.reset(new sensor_msgs::Image);
image->height = rows;
image->width = cols;
image->encoding = sensor_msgs::image_encodings::MONO16;
image->is_bigendian = false;
image->step = mat.data.cols * bbp;
image->data.resize(bbp * rows * cols);
image->header.frame_id = frame_id;
}
image->header.stamp.fromNSec(mat.stamp);
const float * mat_ptr = mat.data.ptr<float>();
ushort * image_ptr = (ushort*) image->data.data();
for(std::size_t i = 0 ; i < rows ; ++i) {
for(std::size_t j = 0 ; j < cols ; ++j) {
image_ptr[i * cols + j] =
mat_ptr[i * cols + (cols - j - 1)];
}
}
};
Kinect2Interface::Data::Ptr data = kinterface_.getData();
if(data) {
updateCameraInfo();
if(kinterface_parameters_.get_color) {
convertRGB(data->rgb, frame_id_rgb_, image_rgb_);
image_rgb_->header.stamp += time_offset_rgb_;
pub_rgb_.publish(image_rgb_);
pub_rgb_info_.publish(camera_info_rgb_);
}
if(kinterface_parameters_.get_ir) {
convertFloat(data->ir, frame_id_ir_, image_ir_);
image_ir_->header.stamp += time_offset_ir_;
pub_ir_.publish(image_ir_);
pub_ir_info_.publish(camera_info_ir_);
}
if(kinterface_parameters_.get_depth) {
convertFloat(data->depth, frame_id_ir_, image_depth_);
image_depth_->header.stamp += time_offset_ir_;
pub_depth_.publish(image_depth_);
pub_depth_info_.publish(camera_info_ir_);
}
if(kinterface_parameters_.get_depth_rectified) {
convertFloat(data->depth_rectified, frame_id_ir_, image_depth_rectified_);
image_depth_rectified_->header.stamp += time_offset_ir_;
pub_depth_undistorted_.publish(image_depth_rectified_);
}
if(kinterface_parameters_.get_color_registered) {
convertRGB(data->rgb_registered, frame_id_ir_, image_rgb_registered_);
image_rgb_registered_->header.stamp += time_offset_rgb_;
pub_rgb_registered_.publish(image_rgb_registered_);
}
if(!data->points->points.empty()) {
data->points->header.frame_id = frame_id_ir_;
data->points->header.stamp += time_offset_ir_.toNSec() / 1000;
pub_pointcloud_.publish(data->points);
}
pub_kinect2_info_.publish(kinect2_info_);
}
}
bool Kinect2RawNode::sleep(std_srvs::Empty::Request &req,
std_srvs::Empty::Response &res)
{
return kinterface_.stop();
}
bool Kinect2RawNode::wakeup(std_srvs::Empty::Request &req,
std_srvs::Empty::Response &res)
{
return kinterface_.start();
}
void Kinect2RawNode::updateCameraInfo()
{
if(!kinterface_camera_parameters_) {
kinterface_camera_parameters_.reset(new CameraParameters);
kinterface_.getCameraParameters(*kinterface_camera_parameters_);
}
if(!camera_info_ir_) {
camera_info_ir_.reset(new sensor_msgs::CameraInfo);
camera_info_ir_->header.frame_id = frame_id_ir_;
camera_info_ir_->width = kinterface_camera_parameters_->width_ir;
camera_info_ir_->height = kinterface_camera_parameters_->height_ir;
camera_info_ir_->distortion_model = sensor_msgs::distortion_models::PLUMB_BOB;
kinterface_camera_parameters_->getDistortionCoefficientsIR(camera_info_ir_->D);
kinterface_camera_parameters_->getCameraMatrixIR(camera_info_ir_->K);
kinterface_camera_parameters_->getRectificationMatrixIR(camera_info_ir_->R);
kinterface_camera_parameters_->getProjectionMatrixIR(camera_info_ir_->P);
}
if(!camera_info_rgb_) {
camera_info_rgb_.reset(new sensor_msgs::CameraInfo);
camera_info_rgb_->header.frame_id = frame_id_rgb_;
camera_info_rgb_->width = kinterface_camera_parameters_->width_rgb;
camera_info_rgb_->height = kinterface_camera_parameters_->height_rgb;
camera_info_rgb_->distortion_model = sensor_msgs::distortion_models::PLUMB_BOB;
kinterface_camera_parameters_->getDistortionCoefficientsRGB(camera_info_rgb_->D);
kinterface_camera_parameters_->getCameraMatrixRGB(camera_info_rgb_->K);
kinterface_camera_parameters_->getRectificationMatrixRGB(camera_info_rgb_->R);
kinterface_camera_parameters_->getProjectionMatrixRGB(camera_info_rgb_->P);
}
if(!kinect2_info_ && camera_info_rgb_ && camera_info_ir_) {
kinect2_info_.reset(new Kinect2Info);
kinect2_info_->header = camera_info_ir_->header;
/// rgb
kinect2_info_->distortion_model_rgb = camera_info_rgb_->distortion_model;
kinect2_info_->height_rgb = camera_info_rgb_->height;
kinect2_info_->width_rgb = camera_info_rgb_->width;
kinect2_info_->D_rgb = camera_info_rgb_->D;
kinect2_info_->K_rgb = camera_info_rgb_->K;
kinect2_info_->R_rgb = camera_info_rgb_->R;
kinect2_info_->P_rgb = camera_info_rgb_->P;
kinterface_camera_parameters_->getMappingCoefficientsRGB(kinect2_info_->M_x_rgb,
kinect2_info_->M_y_rgb);
kinect2_info_->shift_d_rgb = kinterface_camera_parameters_->color.shift_d;
kinect2_info_->shift_m_rgb = kinterface_camera_parameters_->color.shift_m;
/// ir
kinect2_info_->distortion_model_ir = camera_info_ir_->distortion_model;
kinect2_info_->height_ir = camera_info_ir_->height;
kinect2_info_->width_ir = camera_info_ir_->width;
kinect2_info_->D_ir = camera_info_ir_->D;
kinect2_info_->K_ir = camera_info_ir_->K;
kinect2_info_->R_ir = camera_info_ir_->R;
kinect2_info_->P_ir = camera_info_ir_->P;
}
ros::Time stamp = ros::Time::now();
camera_info_rgb_->header.stamp = stamp;
camera_info_ir_->header.stamp = stamp;
kinect2_info_->header.stamp = stamp;
}
int main(int argc, char *argv[])
{
ros::init(argc, argv, "kinect2_node");
Kinect2RawNode kn;
kn.setup();
return kn.run();
}
| [
"richard.hanten@uni-tuebingen.de"
] | richard.hanten@uni-tuebingen.de |
61708cfe86f0e4402bd219c2d7f99c0e18d3dc79 | 01b23678724d9784a2c1fd19dbe5361073384734 | /Linked List/Insert In the middle function.cpp | e3b6fa53a538c946e56ec5fd1709ed0a412ac9fa | [] | no_license | AzizulTareq/data-structures-and-algorithms | 42241b3ec0544c5741adc8a3999a37d2f818cae3 | 19c34575ff051e9fcb14861c31f5e2387333619c | refs/heads/master | 2023-06-18T04:12:00.529070 | 2021-07-17T06:22:16 | 2021-07-17T06:22:16 | 262,660,059 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,095 | cpp | #include <iostream>
using namespace std;
class node {
public:
int data;
node* next;
node(int data){
this -> data = data;
next = NULL;
}
};
void insertAtHead (node * &head, int data){
if(head == NULL){
head = new node(data);
return;
}
//otherwise
node * n = new node(data);
n -> next = head;
head = n;
}
void insertAtMiddle (node* &head, int data, int pos) {
if(pos == 0){
insertAtHead(head, data);
} else {
node * temp = head;
for(int i=1; i<=pos-1; i++){
temp = temp -> next;
}
node * n = new node(data);
n -> next = temp -> next;
temp -> next = n;
}
}
void printLL( node * head){
while(head != NULL){
cout << head->data <<"-->";
head = head->next;
}
cout<<endl;
}
int main() {
node* head = NULL;
insertAtHead(head, 4);
insertAtHead(head, 6);
insertAtHead(head, 9);
insertAtHead(head, 3);
insertAtHead(head, 7);
insertAtMiddle(head, 111, 2);
printLL(head);
return 0;
}
| [
"azizul.tareq@northsouth.edu"
] | azizul.tareq@northsouth.edu |
e43006e73834faad25677710c30d9d167e151efa | f0cfa1f5e30845a6061fefbf87547e63b2c22b41 | /devel/include/rss_msgs/BumpMsg.h | 72b5815639638b564a4337b4ab5208319b0e3c20 | [
"MIT"
] | permissive | WeirdCoder/rss-2014-team-3 | d9ba488dff5b7f17bd278a3eef135a39bdcf8e19 | f7565e14de018b3fac5e2cfeb6633d32047eb70a | refs/heads/master | 2021-01-01T06:55:14.626711 | 2014-05-06T23:25:24 | 2014-05-06T23:25:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,570 | h | /* Software License Agreement (BSD License)
*
* Copyright (c) 2011, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER 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.
*
* Auto-generated by genmsg_cpp from file /home/rss-student/rss-2014-team-3/src/rss_msgs/msg/BumpMsg.msg
*
*/
#ifndef RSS_MSGS_MESSAGE_BUMPMSG_H
#define RSS_MSGS_MESSAGE_BUMPMSG_H
#include <string>
#include <vector>
#include <map>
#include <ros/types.h>
#include <ros/serialization.h>
#include <ros/builtin_message_traits.h>
#include <ros/message_operations.h>
namespace rss_msgs
{
template <class ContainerAllocator>
struct BumpMsg_
{
typedef BumpMsg_<ContainerAllocator> Type;
BumpMsg_()
: left(false)
, right(false) {
}
BumpMsg_(const ContainerAllocator& _alloc)
: left(false)
, right(false) {
}
typedef uint8_t _left_type;
_left_type left;
typedef uint8_t _right_type;
_right_type right;
typedef boost::shared_ptr< ::rss_msgs::BumpMsg_<ContainerAllocator> > Ptr;
typedef boost::shared_ptr< ::rss_msgs::BumpMsg_<ContainerAllocator> const> ConstPtr;
boost::shared_ptr<std::map<std::string, std::string> > __connection_header;
}; // struct BumpMsg_
typedef ::rss_msgs::BumpMsg_<std::allocator<void> > BumpMsg;
typedef boost::shared_ptr< ::rss_msgs::BumpMsg > BumpMsgPtr;
typedef boost::shared_ptr< ::rss_msgs::BumpMsg const> BumpMsgConstPtr;
// constants requiring out of line definition
template<typename ContainerAllocator>
std::ostream& operator<<(std::ostream& s, const ::rss_msgs::BumpMsg_<ContainerAllocator> & v)
{
ros::message_operations::Printer< ::rss_msgs::BumpMsg_<ContainerAllocator> >::stream(s, "", v);
return s;
}
} // namespace rss_msgs
namespace ros
{
namespace message_traits
{
// BOOLTRAITS {'IsFixedSize': True, 'IsMessage': True, 'HasHeader': False}
// {'std_msgs': ['/opt/ros/hydro/share/std_msgs/cmake/../msg'], 'rss_msgs': ['/home/rss-student/rss-2014-team-3/src/rss_msgs/msg']}
// !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types']
template <class ContainerAllocator>
struct IsFixedSize< ::rss_msgs::BumpMsg_<ContainerAllocator> >
: TrueType
{ };
template <class ContainerAllocator>
struct IsFixedSize< ::rss_msgs::BumpMsg_<ContainerAllocator> const>
: TrueType
{ };
template <class ContainerAllocator>
struct IsMessage< ::rss_msgs::BumpMsg_<ContainerAllocator> >
: TrueType
{ };
template <class ContainerAllocator>
struct IsMessage< ::rss_msgs::BumpMsg_<ContainerAllocator> const>
: TrueType
{ };
template <class ContainerAllocator>
struct HasHeader< ::rss_msgs::BumpMsg_<ContainerAllocator> >
: FalseType
{ };
template <class ContainerAllocator>
struct HasHeader< ::rss_msgs::BumpMsg_<ContainerAllocator> const>
: FalseType
{ };
template<class ContainerAllocator>
struct MD5Sum< ::rss_msgs::BumpMsg_<ContainerAllocator> >
{
static const char* value()
{
return "0544cac0b98e92509d14f758d50cf24b";
}
static const char* value(const ::rss_msgs::BumpMsg_<ContainerAllocator>&) { return value(); }
static const uint64_t static_value1 = 0x0544cac0b98e9250ULL;
static const uint64_t static_value2 = 0x9d14f758d50cf24bULL;
};
template<class ContainerAllocator>
struct DataType< ::rss_msgs::BumpMsg_<ContainerAllocator> >
{
static const char* value()
{
return "rss_msgs/BumpMsg";
}
static const char* value(const ::rss_msgs::BumpMsg_<ContainerAllocator>&) { return value(); }
};
template<class ContainerAllocator>
struct Definition< ::rss_msgs::BumpMsg_<ContainerAllocator> >
{
static const char* value()
{
return "bool left\n\
bool right\n\
";
}
static const char* value(const ::rss_msgs::BumpMsg_<ContainerAllocator>&) { return value(); }
};
} // namespace message_traits
} // namespace ros
namespace ros
{
namespace serialization
{
template<class ContainerAllocator> struct Serializer< ::rss_msgs::BumpMsg_<ContainerAllocator> >
{
template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
{
stream.next(m.left);
stream.next(m.right);
}
ROS_DECLARE_ALLINONE_SERIALIZER;
}; // struct BumpMsg_
} // namespace serialization
} // namespace ros
namespace ros
{
namespace message_operations
{
template<class ContainerAllocator>
struct Printer< ::rss_msgs::BumpMsg_<ContainerAllocator> >
{
template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::rss_msgs::BumpMsg_<ContainerAllocator>& v)
{
s << indent << "left: ";
Printer<uint8_t>::stream(s, indent + " ", v.left);
s << indent << "right: ";
Printer<uint8_t>::stream(s, indent + " ", v.right);
}
};
} // namespace message_operations
} // namespace ros
#endif // RSS_MSGS_MESSAGE_BUMPMSG_H
| [
"rss-student@Turtle.mit.edu"
] | rss-student@Turtle.mit.edu |
e1a32b54920ab9bd7073bfc874108b8b22f072c6 | cf0ddb76f36df263c22fcd13ace6bb16b5f6857f | /CODE/Particle.h | 848563980d499da40886cfb2020f75c4197921ba | [] | no_license | 0NDR/Sword | 573493d1da11155adb9797dc5fe454a41ae61eab | 1e5107aab0d27a2e396ca764eeb54e79b7415a23 | refs/heads/master | 2021-01-13T01:04:24.372397 | 2015-09-29T00:31:41 | 2015-09-29T00:31:41 | 43,334,599 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,455 | h | #ifndef Particle_H_INCLUDED
#define Particle_H_INCLUDED
#include "Physics3D.h"
#include "Model.h"
#include "glTexture.h"
#include "Shader.h"
class Particle: public Physics3D ///Extended class for rendering 3D meshs
{
protected:
private:
Model *renderMesh;
glTexture *renderTexture = NULL;
public:
Particle(){addNewType();TextureScale=glm::vec2(1,1);}
Particle(Object* parent): Physics3D(parent){addNewType();TextureScale=glm::vec2(1,1);}
Particle(std::string name): Physics3D(name){addNewType();TextureScale=glm::vec2(1,1);}
Particle(Object* parent, std::string name): Physics3D(parent,name){addNewType();TextureScale=glm::vec2(1,1);}
virtual void Update();
virtual void Render();
virtual void Render(Shader* shad)
{
setShader(shad);
this->Render();
}
void setMesh(Model *newMesh); ///<Sets the gameObject's mesh
void setTexture(glTexture *texture); ///<Sets the gameObject's texture
void setColor(glm::vec4 pos); ///<Sets the gameObject's color
void setTextureScale(glm::vec2 scale);
glm::vec4 *getColor();
glm::vec2 *getTextureScale();
glm::vec4 Color; ///<The set color
glm::vec2 TextureScale;
virtual int push(lua_State *l)
{
luabridge::push(l,this);
return 1;
}
static std::string TypeID() {return "gameObject";}
virtual std::string type() {return "gameObject";}
/* static void RegisterLua(lua_State *l)
{
if(!GLOBAL::isRegistered(Object3D::TypeID(),l))
{
Object3D::RegisterLua(l);
}
GLOBAL::addRegister(TypeID(),l);
luabridge::getGlobalNamespace(l).deriveClass<gameObject,Object3D>(TypeID().c_str())
.addConstructor<void (*)(std::string)>()
.addFunction("setMesh",&gameObject::setMesh)
.addFunction("setTexture", &gameObject::setTexture)
.addProperty("Color",(glm::vec4* (gameObject::*)()const)&gameObject::getColor,&gameObject::setColor)
.endClass();
} ///<Adds the class definition to a given lua state*/
};
#endif // Particle_H_INCLUDED
| [
"nickdeanroberts@gmail.com"
] | nickdeanroberts@gmail.com |
945a3b1a7515c1f10d9b7077c2e2ba53641cb74e | 21fc7b7acfefe74414a577f32c9bbe3df2382cf4 | /Teensymouse2015/Maze.h | be670d83ea7524844a03b0e971e24b02fa933b8c | [] | no_license | UCSBRoboticsClub/Teensy-Mouse-2015 | 786d559241d9e0e82eee84a0a512cad9b8aa1820 | a91ac6de44bc5a82f2835af06b18a71b9e73a037 | refs/heads/master | 2016-09-05T12:40:51.709481 | 2015-05-17T08:17:34 | 2015-05-17T08:17:34 | 33,518,570 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,764 | h | #ifndef MAZE_HPP
#define MAZE_HPP
#undef min
#undef max
#include <array>
#include <cstdlib>
#include "BitArray2D.h"
/* The get/setCellsWalls functions take and return arrays of booleans
* representing the state of each wall around a cell.
* cw[0] is the wall in the +i direction
* cw[1] is the wall in the +j direction
* cw[2] is the wall in the -i direction
* cw[3] is the wall in the -j direction
* The borders of the maze are assumed to always have walls. Trying to set a
* wall along the border to false will fail, but other walls set in the same
* operation will succeed and the function will return false to signal the
* invalid wall setting.
*
* The maze is drawn using matrix convention for indices and directions:
* +-------+-------+---> j
* | (0,0) | (0,1) |
* +-------+-------+
* | (1,0) | (1,1) |
* +-------+-------+
* |
* v
* i
*/
template<int m, int n>
class Maze
{
public:
Maze();
std::array<bool, 4> getCellWalls(int i, int j) const;
bool setCellWalls(int i, int j, std::array<bool, 4> cw);
void fill();
void clear();
void randomize();
//private:
BitArray2D<m - 1, n> mWalls;
BitArray2D<m, n - 1> nWalls;
};
template<int m, int n>
Maze<m, n>::Maze()
{
clear();
}
template<int m, int n>
std::array<bool, 4> Maze<m, n>::getCellWalls(int i, int j) const
{
if (i < 0 || j < 0 || i >= m || j >= n)
return {false, false, false, false};
std::array<bool, 4> cw = {
(m - 1 == i) || mWalls.get(i, j),
(n - 1 == j) || nWalls.get(i, j),
(0 == i) || mWalls.get(i - 1, j),
(0 == j) || nWalls.get(i, j - 1) };
return cw;
}
template<int m, int n>
bool Maze<m, n>::setCellWalls(int i, int j, std::array<bool, 4> cw)
{
if (i < 0 || j < 0 || i >= m || j >= n)
return false;
bool error = ((m - 1 == i && !cw[0]) ||
(n - 1 == j && !cw[1]) ||
(0 == i && !cw[2]) ||
(0 == j && !cw[3]));
if (i < m - 1)
mWalls.set(i, j, cw[0]);
if (j < n - 1)
nWalls.set(i, j, cw[1]);
if (i > 0)
mWalls.set(i - 1, j, cw[2]);
if (j > 0)
nWalls.set(i, j - 1, cw[3]);
// Returns false if the caller tried to set the boundary walls to false
return !error;
}
template<int m, int n>
void Maze<m, n>::clear()
{
mWalls.setAll(false);
nWalls.setAll(false);
}
template<int m, int n>
void Maze<m, n>::fill()
{
mWalls.setAll(true);
nWalls.setAll(true);
}
template<int m, int n>
void Maze<m, n>::randomize()
{
for (int i = 0; i < mWalls.size(); ++i)
mWalls[i] = std::rand() % 256;
for (int i = 0; i < nWalls.size(); ++i)
nWalls[i] = std::rand() % 256;
}
#endif // MAZE_HPP
| [
"nickolas.clinton1@gmail.com"
] | nickolas.clinton1@gmail.com |
4144d6719e1fa2a4811f1142acd0c3ccde8a8b9d | 946127a03209fd9f85402dc7f7a617c9fdb3fbee | /tests/src/main.cpp | 8ab283715ef086e92e06c960252e7fe2db28b7db | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | masterbulla/imgbrd-grabber | 431abfa53c370963e0e27a7f8245e46605e516a6 | 63251cb5170ac0dc7add391f233e7a0edb2f9094 | refs/heads/master | 2020-03-23T08:59:09.912834 | 2018-06-21T06:52:27 | 2018-06-22T18:23:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 939 | cpp | #include <QTest>
#include <iostream>
#include "custom-network-access-manager.h"
#include "functions.h"
#include "test-suite.h"
int main(int argc, char *argv[])
{
#ifdef HEADLESS
QCoreApplication a(argc, argv);
#else
QGuiApplication a(argc, argv);
#endif
QStringList testSuites;
testSuites.reserve(argc - 1);
for (int i = 1; i < argc; ++i)
testSuites.append(argv[i]);
QMap<QString, int> results;
int failed = 0;
setTestModeEnabled(true);
for (TestSuite *suite : TestSuite::getSuites())
{
if (!testSuites.isEmpty() && !testSuites.contains(suite->metaObject()->className()))
continue;
int result = QTest::qExec(suite);
results.insert(suite->metaObject()->className(), result);
if (result != 0)
{
failed++;
}
}
for (auto it = results.begin(); it != results.end(); ++it)
{
std::cout << '[' << (it.value() != 0 ? "FAIL" : "OK") << "] " << it.key().toStdString() << std::endl;
}
return failed;
}
| [
"bio.nus@hotmail.fr"
] | bio.nus@hotmail.fr |
097a49ee6eec46f3771e97358f7acca90e74535b | 93176e72508a8b04769ee55bece71095d814ec38 | /CMake/otbTestCompileBoost.cxx | 2cdb84ce5a0762c8b8844c93d22a49f04253cb14 | [] | no_license | inglada/OTB | a0171a19be1428c0f3654c48fe5c35442934cf13 | 8b6d8a7df9d54c2b13189e00ba8fcb070e78e916 | refs/heads/master | 2021-01-19T09:23:47.919676 | 2011-06-29T17:29:21 | 2011-06-29T17:29:21 | 1,982,100 | 4 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 132 | cxx | #include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
int
main(int argc, char *argv[])
{
return 1;
}
| [
"thomas.feuvrier@c-s.fr"
] | thomas.feuvrier@c-s.fr |
4ba525b10916a2313ff5c588aa746e6f9570c045 | 8d0d44a4f97dc417e6dd0ec335a4bd644725cd91 | /acm2014/uva11137.cpp | bcbbccf11f8aebbda47441ef137f70cd786d651f | [] | no_license | ddlin0719/pratice | 8cc70d184ae43f2298e8dd0c999274846ee2bde7 | 5ed445995ee95875939af2abdc48afb6fdcdef41 | refs/heads/master | 2023-08-12T02:04:40.974632 | 2021-10-11T10:20:33 | 2021-10-11T10:20:33 | 22,866,975 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 400 | cpp | #include <stdio.h>
#include <string.h>
long long max(long long a,long long b){
if (a<b) a=b;
return a;
}
int main(){
int coin[33],ncoin=21;
int i,j,n;
long long f[10010]={1};
for (i=1;i<=ncoin;i++) coin[i]=i*i*i;
for (j=1;j<=ncoin;j++)
for (i=coin[j];i<=10000;i++)
//f[i]=max(f[i],f[i-coin[j]]+1);
f[i]+=f[i-coin[j]];
while (scanf("%d",&n)!=EOF)
printf("%lld\n",f[n]);
return 0;
}
| [
"654548718@qq.com"
] | 654548718@qq.com |
fe5d2f023366b37136c85fe3b86bd0ca041da892 | c9b9d9e93505e1e42adb61597c885b58c153894f | /source/graphics/brdisplayopengl.cpp | 5faea381b37ebd69fa292c6785b08d25b35eecee | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer",
"Zlib"
] | permissive | Olde-Skuul/burgerlib | a3b860bf00bdbc699086a32a1d4756848866d3dc | 4d9dfa0cd5586d23688978e7ec0fd5881bf75912 | refs/heads/master | 2023-08-30T17:13:52.487215 | 2023-08-18T21:56:27 | 2023-08-18T21:56:27 | 18,419,163 | 163 | 11 | null | null | null | null | UTF-8 | C++ | false | false | 48,919 | cpp | /***************************************
OpenGL manager class
Copyright (c) 1995-2017 by Rebecca Ann Heineman <becky@burgerbecky.com>
It is released under an MIT Open Source license. Please see LICENSE for
license details. Yes, you can use it in a commercial title without paying
anything, just give me a credit.
Please? It's not like I'm asking you for money!
***************************************/
#include "brdisplayopengl.h"
#if defined(BURGER_OPENGL)
#include "brdebug.h"
#include "brimage.h"
#include "brtextureopengl.h"
#include "brvertexbufferopengl.h"
#include "brnumberto.h"
#include "brmemoryfunctions.h"
// Don't include burger.h
#define __BURGER__
#include "brgl.h"
#include "brglext.h"
// Detect if OpenGL or OpenGL ES version 2.0 is available
#if defined(GL_VERSION_2_0) || defined(GL_ES_VERSION_2_0)
#define USE_GL2
#endif
//
// OpenGL is a derived class for Windows
// to allow multiple API support. All other
// OpenGL based platforms, this is a base class
//
#if !defined(BURGER_WINDOWS)
#define DisplayOpenGL Display
#define TextureOpenGL Texture
#define VertexBufferOpenGL VertexBuffer
#else
#if !defined(DOXYGEN)
BURGER_CREATE_STATICRTTI_PARENT(Burger::DisplayOpenGL,Burger::Display);
#endif
#endif
#if !defined(DOXYGEN)
#define CASE(x) { #x,x }
struct MessageLookup_t {
const char *m_pName;
uint_t m_uEnum;
};
// Used by the shader compiler to force a version match
#if defined(BURGER_OPENGL)
static const char g_Version[] = "#version ";
// Defines inserted into the shader for a vertex or fragment shader
static const char g_VertexShader[] =
"#define VERTEX_SHADER\n"
"#define PIPED varying\n"
"#define VERTEX_INPUT attribute\n";
static const char g_VertexShader140[] =
"#define VERTEX_SHADER\n"
"#define PIPED out\n"
"#define VERTEX_INPUT in\n";
static const char g_FragmentShader[] =
"#define FRAGMENT_SHADER\n"
"#define PIPED varying\n"
"#define FRAGCOLOR_USED\n";
static const char g_FragmentShader140[] =
"#define FRAGMENT_SHADER\n"
"#define PIPED in\n"
"#define FRAGCOLOR_USED out vec4 fragColor;\n"
"#define gl_FragColor fragColor\n"
"#define texture1D texture\n"
"#define texture2D texture\n"
"#define texture3D texture\n"
"#define textureCube texture\n"
"#define textureShadow2D texture\n";
static const GLenum s_SourceFunction[] = {
GL_ZERO, // SRCBLEND_ZERO
GL_ONE, // SRCBLEND_ONE
GL_SRC_COLOR, // SRCBLEND_COLOR
GL_ONE_MINUS_SRC_COLOR, // SRCBLEND_ONE_MINUS_COLOR
GL_SRC_ALPHA, // SRCBLEND_SRC_ALPHA
GL_ONE_MINUS_SRC_ALPHA, // SRCBLEND_ONE_MINUS_SRC_ALPHA
GL_DST_ALPHA, // SRCBLEND_DST_ALPHA,
GL_ONE_MINUS_DST_ALPHA, // SRCBLEND_ONE_MINUS_DST_ALPHA
GL_SRC_ALPHA_SATURATE // SRCBLEND_SRC_ALPHA_SATURATE
};
static const GLenum s_DestFunction[] = {
GL_ZERO, // DSTBLEND_ZERO
GL_ONE, // DSTBLEND_ONE
GL_DST_COLOR, // DSTBLEND_COLOR
GL_ONE_MINUS_DST_COLOR, // DSTBLEND_ONE_MINUS_COLOR
GL_DST_ALPHA, // DSTBLEND_DST_ALPHA
GL_ONE_MINUS_DST_ALPHA, // DSTBLEND_ONE_MINUS_DST_ALPHA
GL_SRC_ALPHA, // DSTBLEND_SRC_ALPHA
GL_ONE_MINUS_SRC_ALPHA // DSTBLEND_ONE_MINUS_SRC_ALPHA
};
static const GLenum s_DepthTest[] = {
GL_NEVER, // DEPTHCMP_NEVER
GL_LESS, // DEPTHCMP_LESS
GL_EQUAL, // DEPTHCMP_EQUAL
GL_LEQUAL, // DEPTHCMP_LESSEQUAL
GL_GREATER, // DEPTHCMP_GREATER
GL_NOTEQUAL, // DEPTHCMP_NOTEQUAL
GL_GEQUAL, // DEPTHCMP_GREATEREQUAL
GL_ALWAYS // DEPTHCMP_ALWAYS
};
static const GLenum s_Prims[] = {
GL_POINTS, // PRIM_POINTS
GL_LINES, // PRIM_LINES,
GL_LINE_STRIP, // PRIM_LINESTRIP,
GL_TRIANGLES, // PRIM_TRIANGLES,
GL_TRIANGLE_STRIP, // PRIM_TRIANGLESTRIP,
GL_TRIANGLE_FAN // PRIM_TRIANGLEFAN
};
#endif
#endif
/*! ************************************
\class Burger::DisplayOpenGL
\brief OpenGL screen setup
Base class for instantiating a video display using OpenGL
\sa Burger::RendererBase, Burger::DisplayBase, Burger::Display, Burger::DisplayDirectX9, Burger::DisplayDirectX11
***************************************/
#if !defined(BURGER_OPENGL) || defined(BURGER_LINUX)
/*! ************************************
\brief Initialize OpenGL
Base class for instantiating a video display using OpenGL
\sa Burger::DisplayOpenGL::~DisplayOpenGL()
***************************************/
Burger::DisplayOpenGL::DisplayOpenGL(Burger::GameApp *pGameApp) :
m_pCompressedFormats(NULL),
m_fOpenGLVersion(0.0f),
m_fShadingLanguageVersion(0.0f),
m_uCompressedFormatCount(0),
m_uMaximumVertexAttributes(0),
m_uMaximumColorAttachments(0),
m_uActiveTexture(0)
{
InitDefaults(pGameApp);
}
/*! ************************************
\brief Start up the OpenGL context
Base class for instantiating a video display using OpenGL
\sa Burger::DisplayOpenGL::PostShutdown()
***************************************/
uint_t Burger::DisplayOpenGL::Init(uint_t,uint_t,uint_t,uint_t)
{
return 10;
}
/*! ************************************
\brief Start up the OpenGL context
Shut down OpenGL
\sa Burger::DisplayOpenGL::PostShutdown()
***************************************/
void Burger::DisplayOpenGL::Shutdown(void)
{
}
void Burger::DisplayOpenGL::BeginScene(void)
{
}
/*! ************************************
\brief Update the video display
Calls SwapBuffers() in OpenGL to draw the rendered scene
\sa Burger::DisplayOpenGL::PreBeginScene()
***************************************/
void Burger::DisplayOpenGL::EndScene(void)
{
}
#endif
Burger::Texture *Burger::DisplayOpenGL::CreateTextureObject(void)
{
return new (Alloc(sizeof(TextureOpenGL))) TextureOpenGL;
}
Burger::VertexBuffer *Burger::DisplayOpenGL::CreateVertexBufferObject(void)
{
return new (Alloc(sizeof(VertexBufferOpenGL))) VertexBufferOpenGL;
}
void Burger::DisplayOpenGL::Resize(uint_t uWidth,uint_t uHeight)
{
SetWidthHeight(uWidth,uHeight);
SetViewport(0,0,uWidth,uHeight);
}
void Burger::DisplayOpenGL::SetViewport(uint_t uX,uint_t uY,uint_t uWidth,uint_t uHeight)
{
glViewport(static_cast<GLint>(uX),static_cast<GLint>(uY),static_cast<GLsizei>(uWidth),static_cast<GLsizei>(uHeight));
}
void Burger::DisplayOpenGL::SetScissorRect(uint_t uX,uint_t uY,uint_t uWidth,uint_t uHeight)
{
// Note: Flip the Y for OpenGL
// Also, the starting Y is the BOTTOM of the rect, not the top
glScissor(static_cast<GLint>(uX),static_cast<GLint>(m_uHeight-(uY+uHeight)),static_cast<GLsizei>(uWidth),static_cast<GLsizei>(uHeight));
}
void Burger::DisplayOpenGL::SetClearColor(float fRed,float fGreen,float fBlue,float fAlpha)
{
glClearColor(fRed,fGreen,fBlue,fAlpha);
}
void Burger::DisplayOpenGL::SetClearDepth(float fDepth)
{
glClearDepth(fDepth);
}
void Burger::DisplayOpenGL::Clear(uint_t uMask)
{
GLbitfield uGLMask = 0;
if (uMask&CLEAR_COLOR) {
uGLMask = GL_COLOR_BUFFER_BIT;
}
if (uMask&CLEAR_DEPTH) {
uGLMask |= GL_DEPTH_BUFFER_BIT;
}
if (uMask&CLEAR_STENCIL) {
uGLMask |= GL_STENCIL_BUFFER_BIT;
}
glClear(uGLMask);
}
void Burger::DisplayOpenGL::Bind(Texture *pTexture,uint_t uIndex)
{
BURGER_ASSERT(uIndex<BURGER_ARRAYSIZE(m_pBoundTextures));
m_pBoundTextures[uIndex] = pTexture;
// Switch to the proper texture unit
uIndex += GL_TEXTURE0;
if (uIndex!=m_uActiveTexture) {
m_uActiveTexture = uIndex;
glActiveTexture(uIndex);
}
// Get the texture ID
if (!pTexture) {
glBindTexture(GL_TEXTURE_2D,0);
} else {
pTexture->CheckLoad(this);
}
}
void Burger::DisplayOpenGL::Bind(Effect *pEffect)
{
#if defined(USE_GL2)
if (!pEffect) {
glUseProgram(0);
} else {
pEffect->CheckLoad(this);
glUseProgram(pEffect->GetProgramID());
}
#else
BURGER_UNUSED(pEffect);
#endif
}
void Burger::DisplayOpenGL::SetBlend(uint_t bEnable)
{
if (bEnable) {
glEnable(GL_BLEND);
} else {
glDisable(GL_BLEND);
}
}
void Burger::DisplayOpenGL::SetBlendFunction(eSourceBlendFactor uSourceFactor,eDestinationBlendFactor uDestFactor)
{
BURGER_ASSERT(uSourceFactor<BURGER_ARRAYSIZE(s_SourceFunction));
BURGER_ASSERT(uDestFactor<BURGER_ARRAYSIZE(s_DestFunction));
glBlendFunc(s_SourceFunction[uSourceFactor],s_DestFunction[uDestFactor]);
}
void Burger::DisplayOpenGL::SetLighting(uint_t bEnable)
{
#if !(defined(BURGER_OPENGLES))
if (bEnable) {
glEnable(GL_LIGHTING);
} else {
glDisable(GL_LIGHTING);
}
#else
BURGER_UNUSED(bEnable);
#endif
}
void Burger::DisplayOpenGL::SetZWrite(uint_t bEnable)
{
glDepthMask(bEnable!=0);
}
void Burger::DisplayOpenGL::SetDepthTest(eDepthFunction uDepthFunction)
{
BURGER_ASSERT(uDepthFunction<BURGER_ARRAYSIZE(s_DepthTest));
glDepthFunc(s_DepthTest[uDepthFunction]);
if (uDepthFunction==Display::DEPTHCMP_ALWAYS) {
glDisable(GL_DEPTH_TEST);
} else {
glEnable(GL_DEPTH_TEST);
}
}
void Burger::DisplayOpenGL::SetCullMode(eCullMode uCullMode)
{
if (uCullMode==CULL_NONE) {
glDisable(GL_CULL_FACE);
} else if (uCullMode==CULL_CLOCKWISE) {
glEnable(GL_CULL_FACE);
glFrontFace(GL_CCW);
} else if (uCullMode==CULL_COUNTERCLOCKWISE) {
glEnable(GL_CULL_FACE);
glFrontFace(GL_CW);
}
}
void Burger::DisplayOpenGL::SetScissor(uint_t bEnable)
{
if (bEnable) {
glEnable(GL_SCISSOR_TEST);
} else {
glDisable(GL_SCISSOR_TEST);
}
}
void Burger::DisplayOpenGL::DrawPrimitive(ePrimitiveType uPrimitiveType,VertexBuffer *pVertexBuffer)
{
pVertexBuffer->CheckLoad(this);
#if defined(USE_GL2)
glBindVertexArray(static_cast<VertexBufferOpenGL *>(pVertexBuffer)->GetVertexArrayObject());
glDrawArrays(s_Prims[uPrimitiveType],0,static_cast<GLsizei>(static_cast<VertexBufferOpenGL *>(pVertexBuffer)->GetArrayEntryCount()));
#else
BURGER_UNUSED(uPrimitiveType);
BURGER_UNUSED(pVertexBuffer);
#endif
}
void Burger::DisplayOpenGL::DrawElements(ePrimitiveType uPrimitiveType,VertexBuffer *pVertexBuffer)
{
#if defined(USE_GL2)
pVertexBuffer->CheckLoad(this);
glBindVertexArray(static_cast<VertexBufferOpenGL *>(pVertexBuffer)->GetVertexArrayObject());
glDrawElements(s_Prims[uPrimitiveType],static_cast<GLsizei>(static_cast<VertexBufferOpenGL *>(pVertexBuffer)->GetElementEntryCount()),GL_UNSIGNED_SHORT,0);
#else
BURGER_UNUSED(uPrimitiveType);
BURGER_UNUSED(pVertexBuffer);
#endif
}
/*! ************************************
\fn float Burger::DisplayOpenGL::GetOpenGLVersion(void) const
\brief Return the version of the OpenGL implementation
\note This value is valid AFTER the OpenGL driver has been
started up via a call to InitContext().
\return 0.0f if OpenGL is not started or a valid version number, example: 4.4f.
***************************************/
/*! ************************************
\fn float Burger::DisplayOpenGL::GetShadingLanguageVersion(void) const
\brief Return the version of the OpenGL Shader compiler
\note This value is valid AFTER the OpenGL driver has been
started up via a call to InitContext().
\return 0.0f if OpenGL is not started or a valid version number for the compiler, example: 4.4f.
***************************************/
/*! ************************************
\fn uint_t Burger::DisplayOpenGL::GetCompressedFormatCount(void) const
\brief Return the number of supported compressed texture formats
When OpenGL is started, it's queried for the number of compressed texture
formats it natively supports. This will return the number of formats
and GetCompressedFormats() will be an array of this size
with the supported formats.
\note This value is valid AFTER the OpenGL driver has been
started up via a call to InitContext().
\return 0 if OpenGL is not started or no texture compression is supported.
\sa GetCompressedFormats()
***************************************/
/*! ************************************
\fn const uint_t *Burger::DisplayOpenGL::GetCompressedFormats(void) const
\brief Return the pointer to an array of supported compressed texture formats
When OpenGL is started, it's queried for the number of compressed texture
formats it natively supports and the types are stored in this array.
This array size can be retrieved with a call to GetCompressedFormatCount().
\note This value is valid AFTER the OpenGL driver has been
started up via a call to InitContext().
\return \ref NULL if OpenGL is not started or no texture compression is supported or an array of GetCompressedFormatCount() in size.
\sa GetCompressedFormatCount()
***************************************/
/*! ************************************
\brief Initialize the display for supporting OpenGL
Once OpenGL is started, this function queries the driver for
the supported feature list and sets up the rendering status for
best performance in rendering scenes.
\sa InitContext()
***************************************/
#if defined(BURGER_OPENGL) && defined(_DEBUG) && !defined(DOXYGEN)
// Data and a function to dump the OpenGL driver data
// for debugging
struct GLStringIndex_t {
const char *m_pName; // Printable name of the GL string
GLenum m_eEnum; // OpenGL enumeration to check
};
static const GLStringIndex_t g_StringIndexes[] = {
{"OpenGL version",GL_VERSION},
{"Vendor",GL_VENDOR},
{"Renderer",GL_RENDERER},
{"Extensions",GL_EXTENSIONS}
#if defined(USE_GL2)
,{"Shader Language Version",GL_SHADING_LANGUAGE_VERSION}
#endif
};
static const GLStringIndex_t g_TextureIndexes[] = {
{"GL_COMPRESSED_RGB_S3TC_DXT1_EXT",0x83F0},
{"GL_COMPRESSED_RGBA_S3TC_DXT1_EXT",0x83F1},
{"GL_COMPRESSED_RGBA_S3TC_DXT3_EXT",0x83F2},
{"GL_COMPRESSED_RGBA_S3TC_DXT5_EXT",0x83F3},
{"GL_PALETTE4_RGB8_OES",0x8B90},
{"GL_PALETTE4_RGBA8_OES",0x8B91},
{"GL_PALETTE4_R5_G6_B5_OES",0x8B92},
{"GL_PALETTE4_RGBA4_OES",0x8B93},
{"GL_PALETTE4_RGB5_A1_OES",0x8B94},
{"GL_PALETTE8_RGB8_OES",0x8B95},
{"GL_PALETTE8_RGBA8_OES",0x8B96},
{"GL_PALETTE8_R5_G6_B5_OES",0x8B97},
{"GL_PALETTE8_RGBA4_OES",0x8B98},
{"GL_PALETTE8_RGB5_A1_OES",0x8B99},
{"GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG",0x8C00},
{"GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG",0x8C01},
{"GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",0x8C02},
{"GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",0x8C03},
{"GL_COMPRESSED_R11_EAC",0x9270},
{"GL_COMPRESSED_SIGNED_R11_EAC",0x9271},
{"GL_COMPRESSED_RG11_EAC",0x9272},
{"GL_COMPRESSED_SIGNED_RG11_EAC",0x9273},
{"GL_COMPRESSED_RGB8_ETC2",0x9274},
{"GL_COMPRESSED_SRGB8_ETC2",0x9275},
{"GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",0x9276},
{"GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",0x9277},
{"GL_COMPRESSED_RGBA8_ETC2_EAC",0x9278},
{"GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",0x9279},
{"GL_COMPRESSED_RGBA_ASTC_4x4_KHR",0x93B0},
{"GL_COMPRESSED_RGBA_ASTC_5x4_KHR",0x93B1},
{"GL_COMPRESSED_RGBA_ASTC_5x5_KHR",0x93B2},
{"GL_COMPRESSED_RGBA_ASTC_6x5_KHR",0x93B3},
{"GL_COMPRESSED_RGBA_ASTC_6x6_KHR",0x93B4},
{"GL_COMPRESSED_RGBA_ASTC_8x5_KHR",0x93B5},
{"GL_COMPRESSED_RGBA_ASTC_8x6_KHR",0x93B6},
{"GL_COMPRESSED_RGBA_ASTC_8x8_KHR",0x93B7},
{"GL_COMPRESSED_RGBA_ASTC_10x5_KHR",0x93B8},
{"GL_COMPRESSED_RGBA_ASTC_10x6_KHR",0x93B9},
{"GL_COMPRESSED_RGBA_ASTC_10x8_KHR",0x93BA},
{"GL_COMPRESSED_RGBA_ASTC_10x10_KHR",0x93BB},
{"GL_COMPRESSED_RGBA_ASTC_12x10_KHR",0x93BC},
{"GL_COMPRESSED_RGBA_ASTC_12x12_KHR",0x93BD},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",0x93D0},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",0x93D1},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",0x93D2},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",0x93D3},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",0x93D4},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",0x93D5},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",0x93D6},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",0x93D7},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",0x93D8},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",0x93D9},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",0x93DA},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",0x93DB},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",0x93DC},
{"GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",0x93DD}
};
#endif
void BURGER_API Burger::DisplayOpenGL::SetupOpenGL(void)
{
const char *pString;
#if defined(_DEBUG)
// For debug version, dump out OpenGL strings to the console
// or logfile.txt
{
uintptr_t uCount = BURGER_ARRAYSIZE(g_StringIndexes);
const GLStringIndex_t *pWork = g_StringIndexes;
do {
// Get the string for the enumeration
pString = reinterpret_cast<const char *>(glGetString(pWork->m_eEnum));
// If supported, print it
if (pString) {
Debug::Message("%s = ",pWork->m_pName);
// Use String() because pResult can be long enough to overrun the buffer
Debug::PrintString(pString);
Debug::PrintString("\n");
}
++pWork;
} while (--uCount);
}
#endif
//
// Obtain the version of OpenGL found
//
float fVersion = 0.0f;
pString = reinterpret_cast<const char *>(glGetString(GL_VERSION));
if (pString) {
if (!MemoryCompare("OpenGL ES ",pString,10)) {
pString += 10;
}
fVersion = AsciiToFloat(pString);
}
m_fOpenGLVersion = fVersion;
//
// Obtain the version of the OpenGL shader compiler
//
fVersion = 0.0f;
#if defined(USE_GL2)
pString = reinterpret_cast<const char *>(glGetString(GL_SHADING_LANGUAGE_VERSION));
if (pString) {
if (!MemoryCompare("OpenGL ES GLSL ES ",pString,18)) {
pString += 18;
}
fVersion = AsciiToFloat(pString);
}
#endif
m_fShadingLanguageVersion = fVersion;
//
// Obtain the supported compressed texture types
//
Free(m_pCompressedFormats);
m_pCompressedFormats = NULL;
uint_t uTemp = 0;
GLint iTemp = 0;
glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB,&iTemp);
#if defined(_DEBUG)
Debug::Message("GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = %i\n",iTemp);
#endif
if (iTemp) {
GLint iTemp2 = iTemp;
GLint *pBuffer = static_cast<GLint *>(Alloc(sizeof(GLint)*iTemp2));
if (pBuffer) {
glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS_ARB,pBuffer);
uTemp = static_cast<uint_t>(iTemp);
m_pCompressedFormats = reinterpret_cast<uint_t *>(pBuffer);
// Dump the list on debug builds
#if defined(_DEBUG)
char HexString[16];
HexString[0] = '0';
HexString[1] = 'x';
do {
uint32_t uValue = static_cast<uint32_t>(pBuffer[0]);
const char *pFormatName = HexString;
const GLStringIndex_t *pTextureText = g_TextureIndexes;
do {
if (pTextureText->m_eEnum==uValue) {
pFormatName = pTextureText->m_pName;
break;
}
} while (++pTextureText<&g_TextureIndexes[BURGER_ARRAYSIZE(g_TextureIndexes)]);
if (pFormatName==HexString) {
NumberToAsciiHex(HexString+2,uValue,4);
}
Debug::Message("OpenGL supported compressed format %s\n",pFormatName);
++pBuffer;
} while (--iTemp2);
#endif
}
}
m_uCompressedFormatCount = uTemp;
#if defined(USE_GL2)
GLint iMaxAttributes = 1;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,&iMaxAttributes);
m_uMaximumVertexAttributes = static_cast<uint_t>(iMaxAttributes);
#endif
#if defined(_DEBUG)
Debug::Message("m_uMaximumVertexAttributes = %u\n",m_uMaximumVertexAttributes);
#endif
// If not supported, preflight with 1 attachment
GLint iMaxColorattachments = 1;
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS,&iMaxColorattachments);
m_uMaximumColorAttachments = static_cast<uint_t>(iMaxColorattachments);
#if defined(_DEBUG)
Debug::Message("m_uMaximumColorAttachments = %u\n",m_uMaximumColorAttachments);
#endif
m_uActiveTexture = 0;
}
/*! ************************************
\brief Compile an OpenGL shader
Given a string that has the source to a shader, compile it
with OpenGL's GLSL compiler.
If the source doesn't contain a \#version command as the first line, one
will be inserted with the version of the current shader compiler.
A define of \#define VERTEX_SHADER or \#define FRAGMENT_SHADER will be inserted
into the top of the source to support unified shaders
\code
// Magically inserted code
#if __VERSION__ >=140
#ifdef VERTEX_SHADER
#define PIPED out
#define VERTEX_INPUT in
#else
#define PIPED in
#define VERTEX_INPUT attribute
#define FRAGCOLOR_USED out vec4 fragColor;
#define gl_FragColor fragColor
#define texture2D texture
#endif
#else
#define PIPED varying
#define FRAGCOLOR_USED
#endif
\endcode
If the shader fails compilation, the error returned by OpenGL will be output
to Debug::PrintString()
\param GLEnum OpenGL shader enum GL_VERTEX_SHADER or GL_FRAGMENT_SHADER
\param pShaderCode "C" string of the source code of the shader to compile
\param uShaderCodeLength Length of the source code string. If zero, pShaderCode is assumed to be zero terminated
\return Zero if the code can't be compiled, non-zero is a valid OpenGL shader reference
***************************************/
uint_t BURGER_API Burger::DisplayOpenGL::CompileShader(uint_t GLEnum,const char *pShaderCode,uintptr_t uShaderCodeLength) const
{
// Create a blank shader
GLuint uShader = 0;
#if defined(USE_GL2)
// Valid pointer?
if (pShaderCode) {
// Determine the length of the code
if (!uShaderCodeLength) {
uShaderCodeLength = StringLength(pShaderCode);
}
// Any code to parse?
if (uShaderCodeLength) {
// Create the shader
uShader = glCreateShader(GLEnum);
if (uShader) {
const char *ShaderArray[3]; // Array of shader strings
GLint ShaderLengthArray[3];
char VersionString[64]; // Buffer for the optional "#version xxx\n" string
GLsizei iIndex = 0;
// Get the actual shader compiler version
int32_t iVersion = static_cast<int32_t>(GetShadingLanguageVersion()*100.0f);
// If a version opcode already exists, don't insert one
if ((uShaderCodeLength<8) || MemoryCompare(g_Version,pShaderCode,8)) {
// Since the first line isn't #version, create one
StringCopy(VersionString,g_Version);
NumberToAscii(VersionString+9,iVersion);
uintptr_t uLength = StringLength(VersionString);
// Append with a \n
VersionString[uLength] = '\n';
// Set the string in the array
ShaderArray[0] = VersionString;
ShaderLengthArray[0] = static_cast<GLint>(uLength+1);
iIndex=1;
} else {
// Use the version found in the shader to determine the macros to use
iVersion = AsciiToInteger(pShaderCode+8,iVersion,0,iVersion);
}
// Insert a #define for known shader types so
// unified shaders can compile only what's
// needed
const char *pDefines;
uintptr_t uDefinesLength;
switch (GLEnum) {
case GL_VERTEX_SHADER:
if (iVersion>=140) {
pDefines = g_VertexShader140;
uDefinesLength = sizeof(g_VertexShader140)-1;
} else {
pDefines = g_VertexShader;
uDefinesLength = sizeof(g_VertexShader)-1;
}
break;
case GL_FRAGMENT_SHADER:
if (iVersion>=140) {
pDefines = g_FragmentShader140;
uDefinesLength = sizeof(g_FragmentShader140)-1;
} else {
pDefines = g_FragmentShader;
uDefinesLength = sizeof(g_FragmentShader)-1;
}
break;
default:
pDefines = NULL;
uDefinesLength = 0;
break;
}
if (pDefines) {
ShaderArray[iIndex] = pDefines;
ShaderLengthArray[iIndex] = static_cast<GLint>(uDefinesLength);
++iIndex;
}
// Finally, insert the supplied source code
ShaderArray[iIndex] = pShaderCode;
ShaderLengthArray[iIndex] = static_cast<GLint>(uShaderCodeLength);
// Compile the code
glShaderSource(uShader,iIndex+1,ShaderArray,ShaderLengthArray);
glCompileShader(uShader);
GLint bCompiled = GL_FALSE;
// Did it compile okay?
glGetShaderiv(uShader,GL_COMPILE_STATUS,&bCompiled);
if (bCompiled==GL_FALSE) {
// Dump out what happened so a programmer
// can debug the faulty shader
GLint iLogLength;
glGetShaderiv(uShader,GL_INFO_LOG_LENGTH,&iLogLength);
if (iLogLength > 1) {
// iLogLength includes space for the terminating null at the end of the string
GLchar *pLog = static_cast<GLchar*>(Alloc(static_cast<uintptr_t>(iLogLength)));
glGetShaderInfoLog(uShader,iLogLength,&iLogLength,pLog);
// Note: The log could be so long that it could overflow the
// Debug::Message buffer (Which would assert)
// So use Debug::PrintString() to avoid this
Debug::PrintString("Shader compile log:\n");
Debug::PrintString(pLog);
Debug::PrintString("\n");
Free(pLog);
}
glDeleteShader(uShader);
uShader = 0;
}
}
}
}
#else
BURGER_UNUSED(GLEnum);
BURGER_UNUSED(pShaderCode);
BURGER_UNUSED(uShaderCodeLength);
#endif
return uShader;
}
/*! ************************************
\brief Compile and link a unified OpenGL shader
Given a string that has the source to both a vertex and a
fragment shader, compile them with OpenGL's GLSL compiler
and link them all together.
If the shader fails compilation or linking, the error returned
by OpenGL will be output to Debug::PrintString()
\param pUnifiedShader "C" string of the source code of the shader to compile
\param uLength Length of the source code string. If zero, pProgram is assumed to be zero terminated
\param pPosition Pointer to a "C" string of the label to use to attach to the program the vertex position from the vertex buffer object, set to \ref NULL for no connection.
\param pNormal Pointer to a "C" string of the label to use to attach to the program the vertex normals from the vertex buffer object, set to \ref NULL for no connection.
\param pTexcoord Pointer to a "C" string of the label to use to attach to the program the vertex texture coordinates from the vertex buffer object, set to \ref NULL for no connection.
\return Zero if the code can't be compiled, non-zero is a valid OpenGL shader reference
***************************************/
uint_t BURGER_API Burger::DisplayOpenGL::CompileProgram(const char *pUnifiedShader,uintptr_t uLength,const OpenGLVertexInputs_t *pVertexInputs,const uint_t *pMembers) const
{
return CompileProgram(pUnifiedShader,uLength,pUnifiedShader,uLength,pVertexInputs,pMembers);
}
uint_t BURGER_API Burger::DisplayOpenGL::CompileProgram(const char *pVertexShader,uintptr_t uVSLength,const char *pPixelShader,uintptr_t uPSLength,const OpenGLVertexInputs_t *pVertexInputs,const uint_t *pMembers) const
{
GLuint uProgram = 0;
#if defined(USE_GL2)
// Only if there is source to compile
if (pVertexShader) {
// Create a program object
uProgram = glCreateProgram();
uint_t bSuccess = FALSE; // Assume failure
// If any variable names are passed for position, normal or UVs, bind them
// for linkage to a vertex buffer object
if (pVertexInputs) {
uint_t uIndex = pVertexInputs->m_uIndex;
if (uIndex!=VertexBuffer::USAGE_END) {
if (!pMembers) {
GLuint uGLIndex = 0;
do {
glBindAttribLocation(uProgram,uGLIndex,pVertexInputs->m_pName);
++pVertexInputs;
++uGLIndex;
} while (pVertexInputs->m_uIndex!=VertexBuffer::USAGE_END);
} else {
GLuint uGLIndex = 0;
GLuint uGLIndexUsed;
do {
const uint_t *pTempMembers = pMembers;
uint_t uMember = pTempMembers[0];
uGLIndexUsed = uGLIndex;
if (uMember!=VertexBuffer::USAGE_END) {
do {
if (!((uMember^pVertexInputs->m_uIndex)&VertexBuffer::USAGE_TYPEMASK)) {
uGLIndexUsed = static_cast<GLuint>(pTempMembers-pMembers);
break;
}
++pTempMembers;
uMember = pTempMembers[0];
} while (uMember!=VertexBuffer::USAGE_END);
}
glBindAttribLocation(uProgram,uGLIndexUsed,pVertexInputs->m_pName);
++pVertexInputs;
++uGLIndex;
} while (pVertexInputs->m_uIndex!=VertexBuffer::USAGE_END);
}
}
}
// Compile the vertex shader
GLuint uVertexShader = CompileShader(GL_VERTEX_SHADER,pVertexShader,uVSLength);
if (uVertexShader) {
// Attach the vertex shader to our program
glAttachShader(uProgram,uVertexShader);
// Allow the program to be the sole owner of the shader
glDeleteShader(uVertexShader);
// Compile the fragment shader
GLuint uFragmentShader = CompileShader(GL_FRAGMENT_SHADER,pPixelShader,uPSLength);
if (uFragmentShader) {
// Attach the fragment shader to our program
glAttachShader(uProgram,uFragmentShader);
// Allow the program to be the sole owner of the shader
glDeleteShader(uFragmentShader);
// Link everything together!
glLinkProgram(uProgram);
// Check for link failure
GLint iStatus;
glGetProgramiv(uProgram,GL_LINK_STATUS,&iStatus);
if (iStatus==GL_FALSE) {
Debug::PrintString("Failed to link program\n");
// Print out the log
GLint iLogLength;
glGetProgramiv(uProgram,GL_INFO_LOG_LENGTH,&iLogLength);
if (iLogLength > 1) {
GLchar *pErrorLog = static_cast<GLchar*>(Alloc(static_cast<uintptr_t>(iLogLength)));
glGetProgramInfoLog(uProgram,iLogLength,&iLogLength,pErrorLog);
Debug::PrintString("Program link log:\n");
Debug::PrintString(pErrorLog);
Debug::PrintString("\n");
Free(pErrorLog);
}
} else {
// Verify if it's REALLY okay
glValidateProgram(uProgram);
// Is the all clear signaled?
glGetProgramiv(uProgram,GL_VALIDATE_STATUS,&iStatus);
if (iStatus==GL_FALSE) {
// Dump the log for post link validation failures
GLint iLogLength;
glGetProgramiv(uProgram,GL_INFO_LOG_LENGTH,&iLogLength);
Debug::PrintString("Failed to validate program\n");
if (iLogLength > 1) {
GLchar *pErrorLog = static_cast<GLchar*>(Alloc(static_cast<uintptr_t>(iLogLength)));
glGetProgramInfoLog(uProgram, iLogLength, &iLogLength,pErrorLog);
Debug::PrintString("Program validate log:\n");
Debug::PrintString(pErrorLog);
Debug::PrintString("\n");
Free(pErrorLog);
}
} else {
// All good!!!
bSuccess = TRUE;
}
}
}
}
// On failure, dispose of the program
// to prevent memory leaks
if (!bSuccess) {
glDeleteProgram(uProgram);
uProgram = 0;
}
}
#else
BURGER_UNUSED(pVertexShader);
BURGER_UNUSED(uVSLength);
BURGER_UNUSED(pPixelShader);
BURGER_UNUSED(uPSLength);
BURGER_UNUSED(pVertexInputs);
BURGER_UNUSED(pMembers);
#endif
return uProgram;
}
//
// Create a vertex array object
//
uint_t BURGER_API Burger::DisplayOpenGL::CreateVertexArrayObject(const OpenGLVertexBufferObjectDescription_t *pDescription) const
{
GLuint uVertexArrayObjectID = 0;
#if defined(USE_GL2)
if (pDescription) {
// Create a vertex array object
glGenVertexArrays(1,&uVertexArrayObjectID);
if (uVertexArrayObjectID) {
uint_t bSuccess = TRUE; // Assume success!
glBindVertexArray(uVertexArrayObjectID);
GLuint uBufferID;
//
// Are there vertex positions?
//
if (pDescription->m_uPositionSize) {
// Create a vertex buffer object to store positions
glGenBuffers(1,&uBufferID);
GLuint uPosBufferID = uBufferID;
if (!uPosBufferID) {
bSuccess = FALSE;
} else {
glBindBuffer(GL_ARRAY_BUFFER,uPosBufferID);
// Allocate and load position data into the Vertex Buffer Object
glBufferData(GL_ARRAY_BUFFER,static_cast<GLsizeiptr>(pDescription->m_uPositionSize),pDescription->m_pPositions,static_cast<GLenum>(pDescription->m_pPositions ? GL_STATIC_DRAW : GL_STREAM_DRAW));
// Enable the position attribute for this Vertex Buffer Object
glEnableVertexAttribArray(0);
// Get the size of the position type so we can set the stride properly
uintptr_t uPositionTypeSize = GetGLTypeSize(pDescription->m_ePositionType);
// Set up the description of the position array
glVertexAttribPointer(0,
static_cast<GLint>(pDescription->m_uPositionElementCount),pDescription->m_ePositionType,
GL_FALSE,static_cast<GLsizei>(pDescription->m_uPositionElementCount*uPositionTypeSize),NULL);
}
}
//
// Are there vertex normals?
//
if (pDescription->m_uNormalSize) {
// Create a vertex buffer object to store positions
glGenBuffers(1,&uBufferID);
GLuint uNormalBufferID = uBufferID;
if (!uNormalBufferID) {
bSuccess = FALSE;
} else {
glBindBuffer(GL_ARRAY_BUFFER,uNormalBufferID);
// Allocate and load position data into the Vertex Buffer Object
glBufferData(GL_ARRAY_BUFFER,static_cast<GLsizeiptr>(pDescription->m_uNormalSize),pDescription->m_pNormals,static_cast<GLenum>(pDescription->m_pNormals ? GL_STATIC_DRAW : GL_STREAM_DRAW));
// Enable the normal attribute for this Vertex Buffer Object
glEnableVertexAttribArray(1);
// Get the size of the normal type so we can set the stride properly
uintptr_t uNormalTypeSize = GetGLTypeSize(pDescription->m_eNormalType);
// Set up the description of the normal array
glVertexAttribPointer(1,
static_cast<GLint>(pDescription->m_uNormalElementCount),pDescription->m_eNormalType,
GL_FALSE,static_cast<GLsizei>(pDescription->m_uNormalElementCount*uNormalTypeSize),NULL);
}
}
//
// Are there texture UV coordinates?
//
if (pDescription->m_uTexcoordSize) {
// Create a vertex buffer object to store UV coordinates
glGenBuffers(1,&uBufferID);
GLuint uUVBufferID = uBufferID;
if (!uUVBufferID) {
bSuccess = FALSE;
} else {
glBindBuffer(GL_ARRAY_BUFFER,uUVBufferID);
// Allocate and load UV coordinates into the Vertex Buffer Object
glBufferData(GL_ARRAY_BUFFER,static_cast<GLsizeiptr>(pDescription->m_uTexcoordSize),pDescription->m_pTexcoords,static_cast<GLenum>(pDescription->m_pTexcoords ? GL_STATIC_DRAW : GL_STREAM_DRAW));
// Enable the UV coordinates attribute for this Vertex Buffer Object
glEnableVertexAttribArray(2);
// Get the size of the UV coordinates type so we can set the stride properly
uintptr_t uUVTypeSize = GetGLTypeSize(pDescription->m_eTexcoordType);
// Set up the description of the UV coordinates array
glVertexAttribPointer(2,
static_cast<GLint>(pDescription->m_uTexcoordElementCount),pDescription->m_eTexcoordType,
GL_FALSE,static_cast<GLsizei>(pDescription->m_uTexcoordElementCount*uUVTypeSize),NULL);
}
}
if (pDescription->m_uElementSize) {
// Attach the array of elements to the Vertex Buffer Object
glGenBuffers(1,&uBufferID);
GLuint uElementBufferID = uBufferID;
if (!uElementBufferID) {
bSuccess = FALSE;
} else {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,uElementBufferID);
// Allocate and load vertex array element data into Vertex Buffer Object
glBufferData(GL_ELEMENT_ARRAY_BUFFER,static_cast<GLsizeiptr>(pDescription->m_uElementSize),pDescription->m_pElements,static_cast<GLenum>(pDescription->m_pElements ? GL_STATIC_DRAW : GL_STREAM_DRAW));
}
}
// Was there a failure of one of the generated arrays?
if (!bSuccess) {
DeleteVertexArrayObject(uVertexArrayObjectID);
uVertexArrayObjectID = 0;
}
}
}
#else
BURGER_UNUSED(pDescription);
#endif
return uVertexArrayObjectID;
}
/*! ************************************
\brief Dispose of a vertex array object
Dispose of all the vertex objects (GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)
and the GL_ELEMENT_ARRAY_BUFFER_BINDING object and then
dispose of the vertex array object.
\param uVertexArrayObject OpenGL vertex array object (0 does nothing)
***************************************/
void BURGER_API Burger::DisplayOpenGL::DeleteVertexArrayObject(uint_t uVertexArrayObject) const
{
#if defined(USE_GL2)
if (uVertexArrayObject) {
// Bind the vertex array object so we can get data from it
glBindVertexArray(uVertexArrayObject);
// For every possible attribute set in the vertex array object
GLint iBufferID;
GLuint uBufferID;
GLuint uIndex = 0;
do {
// Get the vertex array object set for that attribute
glGetVertexAttribiv(uIndex,GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING,&iBufferID);
// If there was a vertex array object set...
if (iBufferID) {
//...delete the vertex array object
uBufferID = static_cast<GLuint>(iBufferID);
glDeleteBuffers(1,&uBufferID);
}
} while (++uIndex<m_uMaximumVertexAttributes);
// Get any element array vertex buffer object set in the vertex array object
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING,&iBufferID);
// If there was a element array vertex buffer object set in the vertex array object
if (iBufferID) {
//...delete the VBO
uBufferID = static_cast<GLuint>(iBufferID);
glDeleteBuffers(1,&uBufferID);
}
glBindVertexArray(0);
// Finally, delete the vertex array object
uBufferID = static_cast<GLuint>(uVertexArrayObject);
glDeleteVertexArrays(1,&uBufferID);
}
#else
BURGER_UNUSED(uVertexArrayObject);
#endif
}
/*! ************************************
\brief Create a render target frame buffer
Given a size in pixels, create a texture of a specific bit depth and clamp
type and attach an optional ZBuffer
This frame buffer can be disposed of with a call to DeleteFrameBufferObject(uint_t)
\param uWidth Width of the new frame buffer in pixels
\param uHeight Height of the new frame buffer in pixels
\param uGLDepth OpenGL type for the pixel type of the color buffer, example GL_RGBA
\param uGLClamp OpenGL clamp type for the edge of the frame buffer texture, example GL_CLAMP_TO_EDGE
\param uGLZDepth OpenGL type for the depth buffer, if any. Zero will not generate a depth buffer, GL_DEPTH_COMPONENT16 or equivalent will generate one.
\return Frame buffer ID or zero on failure
\sa DeleteFrameBufferObject(uint_t) const
***************************************/
uint_t BURGER_API Burger::DisplayOpenGL::BuildFrameBufferObject(uint_t uWidth,uint_t uHeight,uint_t uGLDepth,uint_t uGLClamp,uint_t uGLZDepth) const
{
GLuint uFrontBufferObject = 0;
#if defined(USE_GL2)
// Create the front buffer texture
GLuint uColorTextureID;
glGenTextures(1,&uColorTextureID);
glBindTexture(GL_TEXTURE_2D,uColorTextureID);
// Set up filter and wrap modes for this texture object
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,static_cast<GLint>(uGLClamp));
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,static_cast<GLint>(uGLClamp));
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
// OpenGLES sucks rocks on performance, so use GL_LINEAR
#if defined(BURGER_OPENGLES)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
#else
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
#endif
// Create an uninitialized frame buffer for the requested pixel type
glTexImage2D(GL_TEXTURE_2D,0,static_cast<GLint>(uGLDepth),static_cast<GLsizei>(uWidth),static_cast<GLsizei>(uHeight),0,uGLDepth,GL_UNSIGNED_BYTE,NULL);
// Create a depth buffer if needed
GLuint uDepthRenderbuffer = 0;
if (uGLZDepth) {
glGenRenderbuffers(1,&uDepthRenderbuffer);
glBindRenderbuffer(GL_RENDERBUFFER,uDepthRenderbuffer);
glRenderbufferStorage(GL_RENDERBUFFER,uGLZDepth,static_cast<GLsizei>(uWidth),static_cast<GLsizei>(uHeight));
}
// Create the frame buffer
glGenFramebuffers(1,&uFrontBufferObject);
glBindFramebuffer(GL_FRAMEBUFFER,uFrontBufferObject);
// Attach the color texture
glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,uColorTextureID,0);
// Attach the optional depth texture buffer
if (uDepthRenderbuffer) {
glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_DEPTH_ATTACHMENT,GL_RENDERBUFFER,uDepthRenderbuffer);
}
// Is this all kosher? Or are the happy feelings gone?
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
// Dispose everything
DeleteFrameBufferObject(uFrontBufferObject);
uFrontBufferObject = 0;
}
#else
BURGER_UNUSED(uWidth);
BURGER_UNUSED(uHeight);
BURGER_UNUSED(uGLDepth);
BURGER_UNUSED(uGLClamp);
BURGER_UNUSED(uGLZDepth);
#endif
// Exit with the frame buffer or zero
return uFrontBufferObject;
}
/*! ************************************
\brief Dispose of a frame buffer data object's attachment
Given an OpenGL frame buffer attachment like GL_DEPTH_ATTACHMENT, delete
it from the currently bound Framebuffer. It will first query the
attachment to determine if it's a GL_RENDERBUFFER or a GL_TEXTURE
and call the appropriate disposal routine
\param uAttachment OpenGL attachment enumeration
\sa DeleteFrameBufferObject(uint_t) const
***************************************/
void BURGER_API Burger::DisplayOpenGL::DeleteFrameBufferObjectAttachment(uint_t uAttachment)
{
#if defined(USE_GL2)
GLint iObjectID;
// Get the type of frame buffer
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER,uAttachment,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,&iObjectID);
GLuint uObjectID;
// If it's a render buffer, call glDeleteRenderbuffers()
if (GL_RENDERBUFFER == iObjectID) {
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER,uAttachment,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,&iObjectID);
uObjectID = static_cast<GLuint>(iObjectID);
glDeleteRenderbuffers(1,&uObjectID);
// If it's a texture buffer, call glDeleteTextures()
} else if (GL_TEXTURE == iObjectID) {
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER,uAttachment,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,&iObjectID);
uObjectID = static_cast<GLuint>(iObjectID);
glDeleteTextures(1,&uObjectID);
}
#else
BURGER_UNUSED(uAttachment);
#endif
}
/*! ************************************
\brief Dispose of a frame buffer data object
Given an OpenGL frame buffer, dispose of it and everything attached to it.
\param uFrameBufferObject OpenGL frame buffer (Zero does nothing)
\sa BuildFrameBufferObject(uint_t,uint_t,uint_t,uint_t,uint_t) const or DeleteFrameBufferObjectAttachment(uint_t)
***************************************/
void BURGER_API Burger::DisplayOpenGL::DeleteFrameBufferObject(uint_t uFrameBufferObject) const
{
#if defined(USE_GL2)
if (uFrameBufferObject) {
glBindFramebuffer(GL_FRAMEBUFFER,uFrameBufferObject);
uint_t uCount = m_uMaximumColorAttachments;
if (uCount) {
uint_t uColorAttachment = GL_COLOR_ATTACHMENT0;
do {
// For every color buffer attached delete the attachment
DeleteFrameBufferObjectAttachment(uColorAttachment);
++uColorAttachment;
} while (--uCount);
}
// Delete any depth or stencil buffer attached
DeleteFrameBufferObjectAttachment(GL_DEPTH_ATTACHMENT);
DeleteFrameBufferObjectAttachment(GL_STENCIL_ATTACHMENT);
GLuint uObjectID = static_cast<GLuint>(uFrameBufferObject);
glDeleteFramebuffers(1,&uObjectID);
}
#else
BURGER_UNUSED(uFrameBufferObject);
#endif
}
/*! ************************************
\brief Create an OpenGL texture
Given a bit map image, upload it to the OpenGL system while
trying to retain the format as close as possible.
Mip Maps are supported.
\param pImage Pointer to a valid image structure
\param bGenerateMipMap If \ref TRUE and the image is a single image, alert OpenGL to automatically generate mipmaps
\return Zero on failure (OpenGL allocation or Image isn't a format that can be uploaded)
***************************************/
uint_t BURGER_API Burger::DisplayOpenGL::CreateTextureID(const Image *pImage,uint_t bGenerateMipMap)
{
GLuint uTextureID = 0;
Image::ePixelTypes eType = pImage->GetType();
GLenum iType = GL_UNSIGNED_BYTE;
GLenum iFormat = 0;
switch (eType) {
case Image::PIXELTYPE888:
iFormat = GL_RGB;
break;
case Image::PIXELTYPE8888:
iFormat = GL_RGBA;
break;
default:
break;
}
// Is the format supported?
if (iFormat) {
// Start with creating a new texture instance
glGenTextures(1,&uTextureID);
// Got a texture?
if (uTextureID) {
// Bind it
glBindTexture(GL_TEXTURE_2D,uTextureID);
// Set up filter and wrap modes for this texture object
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
GLint iParm = GL_LINEAR;
// Mip mapped?
if (bGenerateMipMap || (pImage->GetMipMapCount()>=2)) {
iParm = GL_LINEAR_MIPMAP_LINEAR;
}
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,iParm);
// Bytes are packed together (Needed for RGB format)
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
// If the bytes in the image are packed together, then
// it's a simple upload, otherwise, do it the hard way
uint_t uMipMap = 0;
do {
uint_t uWidth = pImage->GetWidth(uMipMap);
uint_t uHeight = pImage->GetHeight(uMipMap);
const uint8_t *pSource = pImage->GetImage(uMipMap);
if (uMipMap || (pImage->GetSuggestedStride()==pImage->GetStride())) {
// Allocate and load image data into texture in one go
glTexImage2D(GL_TEXTURE_2D,static_cast<GLint>(uMipMap),static_cast<GLint>(iFormat),static_cast<GLsizei>(uWidth),static_cast<GLsizei>(uHeight),0,iFormat,iType,pSource);
} else {
// Allocate the memory for the texture
glTexImage2D(GL_TEXTURE_2D,0,static_cast<GLint>(iFormat),static_cast<GLsizei>(uWidth),static_cast<GLsizei>(uHeight),0,iFormat,iType,NULL);
// Upload one line at a time to support stride
if (uHeight) {
uint_t uY=0;
uintptr_t uStride = pImage->GetStride(uMipMap);
do {
glTexSubImage2D(GL_TEXTURE_2D,0,0,static_cast<GLsizei>(uY),static_cast<GLsizei>(uWidth),1,iFormat,iType,pSource);
pSource += uStride;
++uY;
} while (--uHeight);
}
}
} while (++uMipMap<pImage->GetMipMapCount());
// If the texture doesn't have a mip map and one is requested, generate it
#if defined(USE_GL2)
if (bGenerateMipMap && (pImage->GetMipMapCount()<2)) {
glGenerateMipmap(GL_TEXTURE_2D);
}
#endif
}
}
return static_cast<uint_t>(uTextureID);
}
/*! ************************************
\brief Convert an OpenGL error enumeration into a string
Given an enum from a call to glGetError(), call this function
convert the number into a string describing the error.
\param uGLErrorEnum OpenGL error enum
\return Pointer to a "C" string with the error message (Don't dispose)
***************************************/
static const MessageLookup_t g_GetErrorString[] = {
CASE(GL_NO_ERROR),
CASE(GL_INVALID_VALUE),
CASE(GL_INVALID_OPERATION),
CASE(GL_STACK_OVERFLOW),
CASE(GL_STACK_UNDERFLOW),
CASE(GL_OUT_OF_MEMORY),
CASE(GL_INVALID_FRAMEBUFFER_OPERATION),
CASE(GL_TABLE_TOO_LARGE),
CASE(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT),
CASE(GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS),
CASE(GL_FRAMEBUFFER_INCOMPLETE_FORMATS),
CASE(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT),
CASE(GL_FRAMEBUFFER_UNSUPPORTED),
CASE(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER),
CASE(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER)
};
const char * BURGER_API Burger::DisplayOpenGL::GetErrorString(uint_t uGLErrorEnum)
{
const char *pResult = "GL_UNKNOWN_ERROR";
uintptr_t uCount = BURGER_ARRAYSIZE(g_GetErrorString);
const MessageLookup_t *pLookup = g_GetErrorString;
do {
if (uGLErrorEnum==pLookup->m_uEnum) {
pResult = pLookup->m_pName;
break;
}
++pLookup;
} while (--uCount);
return pResult;
}
/*! ************************************
\brief Determine an OpenGL type enumeration byte length
Given an OpenGL data type, such as GL_BYTE, GL_SHORT, or GL_FLOAT,
return the number of bytes such a data chunk would occupy
\param uGLTypeEnum OpenGL data type enum
\return Number of bytes for the type or 0 if unknown
***************************************/
uintptr_t BURGER_API Burger::DisplayOpenGL::GetGLTypeSize(uint_t uGLTypeEnum)
{
uintptr_t uResult;
switch (uGLTypeEnum) {
case GL_BYTE:
uResult = sizeof(GLbyte);
break;
case GL_UNSIGNED_BYTE:
uResult = sizeof(GLubyte);
break;
case GL_SHORT:
uResult = sizeof(GLshort);
break;
case GL_UNSIGNED_SHORT:
uResult = sizeof(GLushort);
break;
case GL_INT:
uResult = sizeof(GLint);
break;
case GL_UNSIGNED_INT:
uResult = sizeof(GLuint);
break;
case GL_FLOAT:
uResult = sizeof(GLfloat);
break;
#if defined(GL_2_BYTES)
case GL_2_BYTES:
uResult = 2;
break;
#endif
#if defined(GL_3_BYTES)
case GL_3_BYTES:
uResult = 3;
break;
#endif
#if defined(GL_4_BYTES)
case GL_4_BYTES:
uResult = 4;
break;
#endif
#if defined(GL_DOUBLE)
case GL_DOUBLE:
uResult = sizeof(GLdouble);
break;
#endif
default:
uResult = 0;
}
return uResult;
}
/*! ************************************
\brief Poll OpenGL for errors and print them
Call glGetError(), and if any errors were found,
print them using Debug::Warning().
Used for debugging OpenGL
\param pErrorLocation Pointer to a string that describes where this
error condition could be occurring.
\return \ref TRUE if an error was found, \ref FALSE if not
***************************************/
uint_t BURGER_API Burger::DisplayOpenGL::PrintGLError(const char *pErrorLocation)
{
uint_t uResult = FALSE;
GLenum eError = glGetError();
if (eError != GL_NO_ERROR) {
do {
Debug::Message("GLError %s set in location %s\n",GetErrorString(static_cast<uint_t>(eError)),pErrorLocation);
eError = glGetError();
} while (eError != GL_NO_ERROR);
uResult = TRUE;
}
return uResult;
}
/*! ************************************
\var const Burger::StaticRTTI Burger::DisplayOpenGL::g_StaticRTTI
\brief The global description of the class
This record contains the name of this class and a
reference to the parent (If any)
***************************************/
#endif
| [
"becky@burgerbecky.com"
] | becky@burgerbecky.com |
5c2a62de15860f9f73ca54f73291e92718055a71 | fbbc663c607c9687452fa3192b02933b9eb3656d | /tags/libopenmpt-0.2.7299-beta20.2/mptrack/CleanupSong.cpp | faf4c6c4b96179b9c208a022f8c2ad7347458901 | [
"BSD-3-Clause"
] | permissive | svn2github/OpenMPT | 594837f3adcb28ba92a324e51c6172a8c1e8ea9c | a2943f028d334a8751b9f16b0512a5e0b905596a | refs/heads/master | 2021-07-10T05:07:18.298407 | 2019-01-19T10:27:21 | 2019-01-19T10:27:21 | 106,434,952 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 30,857 | cpp | /*
* CleanupSong.cpp
* ---------------
* Purpose: Dialog for cleaning up modules (rearranging, removing unused items).
* Notes : (currently none)
* Authors: Olivier Lapicque
* OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#include "stdafx.h"
#include "Moddoc.h"
#include "Mainfrm.h"
#include "modsmp_ctrl.h"
#include "CleanupSong.h"
#include "../common/StringFixer.h"
#include "../soundlib/mod_specifications.h"
OPENMPT_NAMESPACE_BEGIN
// Default checkbox state
bool CModCleanupDlg::m_CheckBoxes[kMaxCleanupOptions] =
{
true, false, true, true, // patterns
false, false, // orders
true, false, false, true, // samples
true, false, // instruments
true, false, // plugins
false, true, // misc
};
// Checkbox -> Control ID LUT
WORD const CModCleanupDlg::m_CleanupIDtoDlgID[kMaxCleanupOptions] =
{
// patterns
IDC_CHK_CLEANUP_PATTERNS, IDC_CHK_REMOVE_PATTERNS,
IDC_CHK_REARRANGE_PATTERNS, IDC_CHK_REMOVE_DUPLICATES,
// orders
IDC_CHK_MERGE_SEQUENCES, IDC_CHK_REMOVE_ORDERS,
// samples
IDC_CHK_CLEANUP_SAMPLES, IDC_CHK_REMOVE_SAMPLES,
IDC_CHK_REARRANGE_SAMPLES, IDC_CHK_OPTIMIZE_SAMPLES,
// instruments
IDC_CHK_CLEANUP_INSTRUMENTS, IDC_CHK_REMOVE_INSTRUMENTS,
// plugins
IDC_CHK_CLEANUP_PLUGINS, IDC_CHK_REMOVE_PLUGINS,
// misc
IDC_CHK_RESET_VARIABLES, IDC_CHK_UNUSED_CHANNELS,
};
// Options that are mutually exclusive to each other
CModCleanupDlg::CleanupOptions const CModCleanupDlg::m_MutuallyExclusive[CModCleanupDlg::kMaxCleanupOptions] =
{
// patterns
kRemovePatterns, kCleanupPatterns,
kRemovePatterns, kRemovePatterns,
// orders
kRemoveOrders, kMergeSequences,
// samples
kRemoveSamples, kCleanupSamples,
kRemoveSamples, kRemoveSamples,
// instruments
kRemoveAllInstruments, kCleanupInstruments,
// plugins
kRemoveAllPlugins, kCleanupPlugins,
// misc
kNone, kNone,
};
///////////////////////////////////////////////////////////////////////
// CModCleanupDlg
BEGIN_MESSAGE_MAP(CModCleanupDlg, CDialog)
//{{AFX_MSG_MAP(CModTypeDlg)
ON_COMMAND(IDC_BTN_CLEANUP_SONG, OnPresetCleanupSong)
ON_COMMAND(IDC_BTN_COMPO_CLEANUP, OnPresetCompoCleanup)
ON_COMMAND(IDC_CHK_CLEANUP_PATTERNS, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_REMOVE_PATTERNS, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_REARRANGE_PATTERNS, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_REMOVE_DUPLICATES, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_MERGE_SEQUENCES, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_REMOVE_ORDERS, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_CLEANUP_SAMPLES, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_REMOVE_SAMPLES, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_REARRANGE_SAMPLES, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_OPTIMIZE_SAMPLES, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_CLEANUP_INSTRUMENTS, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_REMOVE_INSTRUMENTS, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_CLEANUP_PLUGINS, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_REMOVE_PLUGINS, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_RESET_VARIABLES, OnVerifyMutualExclusive)
ON_COMMAND(IDC_CHK_UNUSED_CHANNELS, OnVerifyMutualExclusive)
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CModCleanupDlg::OnInitDialog()
//---------------------------------
{
CDialog::OnInitDialog();
for(int i = 0; i < kMaxCleanupOptions; i++)
{
CheckDlgButton(m_CleanupIDtoDlgID[i], (m_CheckBoxes[i]) ? BST_CHECKED : BST_UNCHECKED);
}
CSoundFile &sndFile = modDoc.GetrSoundFile();
GetDlgItem(m_CleanupIDtoDlgID[kMergeSequences])->EnableWindow((sndFile.GetType() & MOD_TYPE_MPT) ? TRUE : FALSE);
GetDlgItem(m_CleanupIDtoDlgID[kRemoveSamples])->EnableWindow((sndFile.GetNumSamples() > 0) ? TRUE : FALSE);
GetDlgItem(m_CleanupIDtoDlgID[kRearrangeSamples])->EnableWindow((sndFile.GetNumSamples() > 1) ? TRUE : FALSE);
GetDlgItem(m_CleanupIDtoDlgID[kCleanupInstruments])->EnableWindow((sndFile.GetNumInstruments() > 0) ? TRUE : FALSE);
GetDlgItem(m_CleanupIDtoDlgID[kRemoveAllInstruments])->EnableWindow((sndFile.GetNumInstruments() > 0) ? TRUE : FALSE);
EnableToolTips(TRUE);
return TRUE;
}
void CModCleanupDlg::OnOK()
//-------------------------
{
ScopedLogCapturer logcapturer(modDoc, "cleanup", this);
for(int i = 0; i < kMaxCleanupOptions; i++)
{
m_CheckBoxes[i] = IsDlgButtonChecked(m_CleanupIDtoDlgID[i]) != BST_UNCHECKED;
}
bool modified = false;
// Orders
if(m_CheckBoxes[kMergeSequences]) modified |= MergeSequences();
if(m_CheckBoxes[kRemoveOrders]) modified |= RemoveAllOrders();
// Patterns
if(m_CheckBoxes[kRemovePatterns]) modified |= RemoveAllPatterns();
if(m_CheckBoxes[kCleanupPatterns]) modified |= RemoveUnusedPatterns();
if(m_CheckBoxes[kRemoveDuplicatePatterns]) modified |= RemoveDuplicatePatterns();
if(m_CheckBoxes[kRearrangePatterns]) modified |= RearrangePatterns();
// Instruments
if(modDoc.GetSoundFile()->m_nInstruments > 0)
{
if(m_CheckBoxes[kRemoveAllInstruments]) modified |= RemoveAllInstruments();
if(m_CheckBoxes[kCleanupInstruments]) modified |= RemoveUnusedInstruments();
}
// Samples
if(m_CheckBoxes[kRemoveSamples]) modified |= RemoveAllSamples();
if(m_CheckBoxes[kCleanupSamples]) modified |= RemoveUnusedSamples();
if(m_CheckBoxes[kOptimizeSamples]) modified |= OptimizeSamples();
if(modDoc.GetSoundFile()->m_nSamples > 1)
{
if(m_CheckBoxes[kRearrangeSamples]) modified |= RearrangeSamples();
}
// Plugins
if(m_CheckBoxes[kRemoveAllPlugins]) modified |= RemoveAllPlugins();
if(m_CheckBoxes[kCleanupPlugins]) modified |= RemoveUnusedPlugins();
// Create samplepack
if(m_CheckBoxes[kResetVariables]) modified |= ResetVariables();
// Remove unused channels
if(m_CheckBoxes[kCleanupChannels]) modified |= RemoveUnusedChannels();
if(modified) modDoc.SetModified();
modDoc.UpdateAllViews(nullptr, UpdateHint().ModType());
logcapturer.ShowLog(true);
CDialog::OnOK();
}
void CModCleanupDlg::OnVerifyMutualExclusive()
//--------------------------------------------
{
HWND hFocus = GetFocus()->m_hWnd;
for(int i = 0; i < kMaxCleanupOptions; i++)
{
// if this item is focussed, we have just (un)checked it.
if(hFocus == GetDlgItem(m_CleanupIDtoDlgID[i])->m_hWnd)
{
// if we just unchecked it, there's nothing to verify.
if(IsDlgButtonChecked(m_CleanupIDtoDlgID[i]) == BST_UNCHECKED)
return;
// now we can disable all elements that are mutually exclusive.
if(m_MutuallyExclusive[i] != kNone)
CheckDlgButton(m_CleanupIDtoDlgID[m_MutuallyExclusive[i]], BST_UNCHECKED);
// find other elements which are mutually exclusive with the selected element.
for(int j = 0; j < kMaxCleanupOptions; j++)
{
if(m_MutuallyExclusive[j] == i)
CheckDlgButton(m_CleanupIDtoDlgID[j], BST_UNCHECKED);
}
return;
}
}
}
void CModCleanupDlg::OnPresetCleanupSong()
//----------------------------------------
{
// patterns
CheckDlgButton(IDC_CHK_CLEANUP_PATTERNS, BST_CHECKED);
CheckDlgButton(IDC_CHK_REMOVE_PATTERNS, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REARRANGE_PATTERNS, BST_CHECKED);
CheckDlgButton(IDC_CHK_REMOVE_DUPLICATES, BST_CHECKED);
// orders
CheckDlgButton(IDC_CHK_MERGE_SEQUENCES, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REMOVE_ORDERS, BST_UNCHECKED);
// samples
CheckDlgButton(IDC_CHK_CLEANUP_SAMPLES, BST_CHECKED);
CheckDlgButton(IDC_CHK_REMOVE_SAMPLES, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REARRANGE_SAMPLES, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_OPTIMIZE_SAMPLES, BST_CHECKED);
// instruments
CheckDlgButton(IDC_CHK_CLEANUP_INSTRUMENTS, BST_CHECKED);
CheckDlgButton(IDC_CHK_REMOVE_INSTRUMENTS, BST_UNCHECKED);
// plugins
CheckDlgButton(IDC_CHK_CLEANUP_PLUGINS, BST_CHECKED);
CheckDlgButton(IDC_CHK_REMOVE_PLUGINS, BST_UNCHECKED);
// misc
CheckDlgButton(IDC_CHK_SAMPLEPACK, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_UNUSED_CHANNELS, BST_CHECKED);
}
void CModCleanupDlg::OnPresetCompoCleanup()
//-----------------------------------------
{
// patterns
CheckDlgButton(IDC_CHK_CLEANUP_PATTERNS, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REMOVE_PATTERNS, BST_CHECKED);
CheckDlgButton(IDC_CHK_REARRANGE_PATTERNS, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REMOVE_DUPLICATES, BST_UNCHECKED);
// orders
CheckDlgButton(IDC_CHK_MERGE_SEQUENCES, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REMOVE_ORDERS, BST_CHECKED);
// samples
CheckDlgButton(IDC_CHK_CLEANUP_SAMPLES, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REMOVE_SAMPLES, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REARRANGE_SAMPLES, BST_CHECKED);
CheckDlgButton(IDC_CHK_OPTIMIZE_SAMPLES, BST_UNCHECKED);
// instruments
CheckDlgButton(IDC_CHK_CLEANUP_INSTRUMENTS, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REMOVE_INSTRUMENTS, BST_CHECKED);
// plugins
CheckDlgButton(IDC_CHK_CLEANUP_PLUGINS, BST_UNCHECKED);
CheckDlgButton(IDC_CHK_REMOVE_PLUGINS, BST_CHECKED);
// misc
CheckDlgButton(IDC_CHK_SAMPLEPACK, BST_CHECKED);
CheckDlgButton(IDC_CHK_UNUSED_CHANNELS, BST_CHECKED);
}
BOOL CModCleanupDlg::OnToolTipNotify(UINT, NMHDR *pNMHDR, LRESULT *)
//------------------------------------------------------------------
{
TOOLTIPTEXT* pTTT = (TOOLTIPTEXTA*)pNMHDR;
UINT_PTR nID = pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
}
switch(nID)
{
// patterns
case IDC_CHK_CLEANUP_PATTERNS:
pTTT->lpszText = _T("Remove all unused patterns and rearrange them.");
break;
case IDC_CHK_REMOVE_PATTERNS:
pTTT->lpszText = _T("Remove all patterns.");
break;
case IDC_CHK_REARRANGE_PATTERNS:
pTTT->lpszText = _T("Number the patterns given by their order in the sequence.");
break;
case IDC_CHK_REMOVE_DUPLICATES:
pTTT->lpszText = _T("Merge patterns with identical content.");
break;
// orders
case IDC_CHK_REMOVE_ORDERS:
pTTT->lpszText = _T("Reset the order list.");
break;
case IDC_CHK_MERGE_SEQUENCES:
pTTT->lpszText = _T("Merge multiple sequences into one.");
break;
// samples
case IDC_CHK_CLEANUP_SAMPLES:
pTTT->lpszText = _T("Remove all unused samples.");
break;
case IDC_CHK_REMOVE_SAMPLES:
pTTT->lpszText = _T("Remove all samples.");
break;
case IDC_CHK_REARRANGE_SAMPLES:
pTTT->lpszText = _T("Reorder sample list by removing empty samples.");
break;
case IDC_CHK_OPTIMIZE_SAMPLES:
pTTT->lpszText = _T("Remove unused data after the sample loop end.");
break;
// instruments
case IDC_CHK_CLEANUP_INSTRUMENTS:
pTTT->lpszText = _T("Remove all unused instruments.");
break;
case IDC_CHK_REMOVE_INSTRUMENTS:
pTTT->lpszText = _T("Remove all instruments and convert them to samples.");
break;
// plugins
case IDC_CHK_CLEANUP_PLUGINS:
pTTT->lpszText = _T("Remove all unused plugins.");
break;
case IDC_CHK_REMOVE_PLUGINS:
pTTT->lpszText = _T("Remove all plugins.");
break;
// misc
case IDC_CHK_SAMPLEPACK:
pTTT->lpszText = _T("Convert the module to .IT and reset song / sample / instrument variables");
break;
case IDC_CHK_UNUSED_CHANNELS:
pTTT->lpszText = _T("Removes all empty pattern channels.");
break;
default:
pTTT->lpszText = _T("");
break;
}
return TRUE;
}
///////////////////////////////////////////////////////////////////////
// Actual cleanup implementations
bool CModCleanupDlg::RemoveDuplicatePatterns()
//-----------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
const PATTERNINDEX numPatterns = sndFile.Patterns.Size();
std::vector<PATTERNINDEX> patternMapping(numPatterns, PATTERNINDEX_INVALID);
BeginWaitCursor();
CriticalSection cs;
PATTERNINDEX foundDupes = 0;
for(PATTERNINDEX pat1 = 0; pat1 < numPatterns; pat1++)
{
if(!sndFile.Patterns.IsValidPat(pat1))
continue;
const CPattern pattern1 = sndFile.Patterns[pat1];
for(PATTERNINDEX pat2 = pat1 + 1; pat2 < numPatterns; pat2++)
{
if(!sndFile.Patterns.IsValidPat(pat2) || patternMapping[pat2] != PATTERNINDEX_INVALID)
continue;
const CPattern pattern2 = sndFile.Patterns[pat2];
if(pattern1.GetNumRows() != pattern2.GetNumRows() || pattern1.GetNumChannels() != pattern2.GetNumChannels())
continue;
size_t i = pattern1.GetNumRows() * pattern1.GetNumChannels();
const ModCommand *m1 = pattern1, *m2 = pattern2;
bool identical = true;
while(i--)
{
if(*m1 != *m2)
{
identical = false;
break;
}
m1++;
m2++;
}
if(identical)
{
modDoc.GetPatternUndo().PrepareUndo(pat2, 0, 0, pattern2.GetNumChannels(), pattern2.GetNumRows(), "Remove Duplicate Patterns", foundDupes != 0, false);
sndFile.Patterns.Remove(pat2);
patternMapping[pat2] = pat1;
foundDupes++;
}
}
}
if(foundDupes != 0)
{
modDoc.AddToLog(mpt::String::Print("%1 duplicate pattern%2 merged.", foundDupes, foundDupes == 1 ? "" : "s"));
// Fix order list
const SEQUENCEINDEX numSequences = sndFile.Order.GetNumSequences();
for(SEQUENCEINDEX seq = 0; seq < numSequences; seq++)
{
for(ORDERINDEX ord = 0; ord < sndFile.Order.GetSequence(seq).GetLength(); ord++)
{
PATTERNINDEX pat = sndFile.Order.GetSequence(seq)[ord];
if(pat < numPatterns && patternMapping[pat] != PATTERNINDEX_INVALID)
{
sndFile.Order.GetSequence(seq)[ord] = patternMapping[pat];
}
}
}
}
EndWaitCursor();
return foundDupes != 0;
}
// Remove unused patterns
bool CModCleanupDlg::RemoveUnusedPatterns()
//-----------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
const SEQUENCEINDEX numSequences = sndFile.Order.GetNumSequences();
const PATTERNINDEX numPatterns = sndFile.Patterns.Size();
std::vector<bool> patternUsed(numPatterns, false);
BeginWaitCursor();
// First, find all used patterns in all sequences.
for(SEQUENCEINDEX seq = 0; seq < numSequences; seq++)
{
for(ORDERINDEX ord = 0; ord < sndFile.Order.GetSequence(seq).GetLength(); ord++)
{
PATTERNINDEX pat = sndFile.Order.GetSequence(seq)[ord];
if(pat < numPatterns)
{
patternUsed[pat] = true;
}
}
}
// Remove all other patterns.
CriticalSection cs;
PATTERNINDEX numRemovedPatterns = 0;
for(PATTERNINDEX pat = 0; pat < numPatterns; pat++)
{
if(!patternUsed[pat] && sndFile.Patterns.IsValidPat(pat))
{
numRemovedPatterns++;
modDoc.GetPatternUndo().PrepareUndo(pat, 0, 0, sndFile.GetNumChannels(), sndFile.Patterns[pat].GetNumRows(), "Remove Unused Patterns", numRemovedPatterns != 0, false);
sndFile.Patterns.Remove(pat);
}
}
EndWaitCursor();
if(numRemovedPatterns)
{
modDoc.AddToLog(mpt::String::Print("%1 pattern%2 removed.", numRemovedPatterns, numRemovedPatterns == 1 ? "" : "s"));
return true;
}
return false;
}
struct OrigPatSettings
{
// This stuff is needed for copying the old pattern properties to the new pattern number
std::string name; // original pattern name
TempoSwing swing; // original pattern tempo swing
ModCommand *data; // original pattern data
ROWINDEX numRows; // original pattern sizes
ROWINDEX rowsPerBeat; // original pattern highlight
ROWINDEX rowsPerMeasure; // original pattern highlight
PATTERNINDEX newIndex; // map old pattern index <-> new pattern index
};
const OrigPatSettings defaultSettings = { "", TempoSwing(), nullptr, 0, 0, 0, PATTERNINDEX_INVALID };
// Rearrange patterns (first pattern in order list = 0, etc...)
bool CModCleanupDlg::RearrangePatterns()
//--------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
const SEQUENCEINDEX numSequences = sndFile.Order.GetNumSequences();
const PATTERNINDEX numPatterns = sndFile.Patterns.Size();
std::vector<OrigPatSettings> patternSettings(numPatterns, defaultSettings);
bool modified = false;
BeginWaitCursor();
CriticalSection cs;
// First, find all used patterns in all sequences.
PATTERNINDEX patOrder = 0;
for(SEQUENCEINDEX seq = 0; seq < numSequences; seq++)
{
for(ORDERINDEX ord = 0; ord < sndFile.Order.GetSequence(seq).GetLength(); ord++)
{
PATTERNINDEX pat = sndFile.Order.GetSequence(seq)[ord];
if(pat < numPatterns)
{
if(patternSettings[pat].newIndex == PATTERNINDEX_INVALID)
{
patternSettings[pat].newIndex = patOrder++;
}
sndFile.Order.GetSequence(seq)[ord] = patternSettings[pat].newIndex;
}
}
}
for(PATTERNINDEX pat = 0; pat < numPatterns; pat++)
{
PATTERNINDEX newIndex = patternSettings[pat].newIndex;
// All unused patterns are moved to the end of the pattern list.
if(newIndex == PATTERNINDEX_INVALID && sndFile.Patterns.IsValidPat(pat))
{
newIndex = patOrder++;
}
// Create old <-> new pattern ID data mapping.
if(newIndex != PATTERNINDEX_INVALID)
{
if(pat != newIndex) modified = true;
patternSettings[newIndex].numRows = sndFile.Patterns[pat].GetNumRows();
patternSettings[newIndex].data = sndFile.Patterns[pat];
if(sndFile.Patterns[pat].GetOverrideSignature())
{
patternSettings[newIndex].rowsPerBeat = sndFile.Patterns[pat].GetRowsPerBeat();
patternSettings[newIndex].rowsPerMeasure = sndFile.Patterns[pat].GetRowsPerMeasure();
}
patternSettings[newIndex].swing = sndFile.Patterns[pat].GetTempoSwing();
patternSettings[newIndex].name = sndFile.Patterns[pat].GetName();
}
}
// Copy old data to new pattern location.
for(PATTERNINDEX pat = 0; pat < numPatterns; pat++)
{
sndFile.Patterns[pat].SetData(patternSettings[pat].data, patternSettings[pat].numRows);
sndFile.Patterns[pat].SetSignature(patternSettings[pat].rowsPerBeat, patternSettings[pat].rowsPerMeasure);
sndFile.Patterns[pat].SetTempoSwing(patternSettings[pat].swing);
sndFile.Patterns[pat].SetName(patternSettings[pat].name);
}
EndWaitCursor();
if(modified)
{
modDoc.GetPatternUndo().ClearUndo();
return true;
}
return false;
}
// Remove unused samples
bool CModCleanupDlg::RemoveUnusedSamples()
//----------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
std::vector<bool> samplesUsed(sndFile.GetNumSamples() + 1, true);
BeginWaitCursor();
// Check if any samples are not referenced in the patterns (sample mode) or by an instrument (instrument mode).
// This doesn't check yet if a sample is referenced by an instrument, but actually unused in the patterns.
for(SAMPLEINDEX smp = 1; smp <= sndFile.GetNumSamples(); smp++) if (sndFile.GetSample(smp).pSample)
{
if(!modDoc.IsSampleUsed(smp))
{
samplesUsed[smp] = false;
}
}
SAMPLEINDEX nRemoved = sndFile.RemoveSelectedSamples(samplesUsed);
const SAMPLEINDEX unusedInsSamples = sndFile.DetectUnusedSamples(samplesUsed);
EndWaitCursor();
TCHAR s[512];
if(unusedInsSamples)
{
// We don't remove an instrument's unused samples in an ITP.
wsprintf(s, _T("OpenMPT detected %u sample%s referenced by an instrument,\n")
_T("but not used in the song. Do you want to remove them?"), unusedInsSamples, (unusedInsSamples == 1) ? _T("") : _T("s"));
if(Reporting::Confirm(s, "Sample Cleanup", false, false, this) == cnfYes)
{
nRemoved += sndFile.RemoveSelectedSamples(samplesUsed);
}
}
if(nRemoved > 0)
{
wsprintf(s, _T("%u unused sample%s removed") , nRemoved, (nRemoved == 1) ? _T("") : _T("s"));
modDoc.AddToLog(s);
}
return (nRemoved > 0);
}
// Check if the stereo channels of a sample contain identical data
template<typename T>
static bool ComapreStereoChannels(SmpLength length, const T *sampleData)
//----------------------------------------------------------------------
{
for(SmpLength i = 0; i < length; i++, sampleData += 2)
{
if(sampleData[0] != sampleData[1])
{
return false;
}
}
return true;
}
// Remove unused sample data
bool CModCleanupDlg::OptimizeSamples()
//------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
SAMPLEINDEX numLoopOpt = 0, numStereoOpt = 0;
std::vector<bool> stereoOptSamples(sndFile.GetNumSamples(), false);
for(SAMPLEINDEX smp = 1; smp <= sndFile.GetNumSamples(); smp++)
{
const ModSample &sample = sndFile.GetSample(smp);
// Determine how much of the sample will be played
SmpLength loopLength = sample.nLength;
if(sample.uFlags[CHN_LOOP])
{
loopLength = sample.nLoopEnd;
if(sample.uFlags[CHN_SUSTAINLOOP])
{
loopLength = std::max(sample.nLoopEnd, sample.nSustainEnd);
}
}
// Check if the sample contains identical stereo channels
if(sample.GetNumChannels() == 2)
{
bool identicalChannels = false;
if(sample.GetElementarySampleSize() == 1)
{
identicalChannels = ComapreStereoChannels(loopLength, sample.pSample8);
} else if(sample.GetElementarySampleSize() == 2)
{
identicalChannels = ComapreStereoChannels(loopLength, sample.pSample16);
}
if(identicalChannels)
{
numStereoOpt++;
stereoOptSamples[smp - 1] = true;
}
}
if(sample.pSample && sample.nLength > loopLength + 2) numLoopOpt++;
}
if(!numLoopOpt && !numStereoOpt) return false;
std::string s;
if(numLoopOpt)
s = mpt::String::Print("%1 sample%2 unused data after the loop end point.\n", numLoopOpt, (numLoopOpt == 1) ? " has" : "s have");
if(numStereoOpt)
s += mpt::String::Print("%1 stereo sample%2 actually mono.\n", numStereoOpt, (numStereoOpt == 1) ? " is" : "s are");
if(numLoopOpt + numStereoOpt == 1)
s += "Do you want to optimize it and remove this unused data?";
else
s += "Do you want to optimize them and remove this unused data?";
if(Reporting::Confirm(s.c_str(), "Sample Optimization", false, false, this) != cnfYes)
{
return false;
}
for(SAMPLEINDEX smp = 1; smp <= sndFile.m_nSamples; smp++)
{
ModSample &sample = sndFile.GetSample(smp);
// Determine how much of the sample will be played
SmpLength loopLength = sample.nLength;
if(sample.uFlags[CHN_LOOP])
{
loopLength = sample.nLoopEnd;
// Sustain loop is played before normal loop, and it can actually be located after the normal loop.
if(sample.uFlags[CHN_SUSTAINLOOP])
{
loopLength = std::max(sample.nLoopEnd, sample.nSustainEnd);
}
}
if(sample.nLength > loopLength && loopLength >= 2)
{
modDoc.GetSampleUndo().PrepareUndo(smp, sundo_delete, "Trim Unused Data", loopLength, sample.nLength);
ctrlSmp::ResizeSample(sample, loopLength, sndFile);
}
// Convert stereo samples with identical channels to mono
if(stereoOptSamples[smp - 1])
{
modDoc.GetSampleUndo().PrepareUndo(smp, sundo_replace, "Mono Conversion");
ctrlSmp::ConvertToMono(sample, sndFile, ctrlSmp::onlyLeft);
}
}
if(numLoopOpt)
{
s = mpt::String::Print("%1 sample loop%2 optimized", numLoopOpt, (numLoopOpt == 1) ? "" : "s");
modDoc.AddToLog(s);
}
if(numStereoOpt)
{
s = mpt::String::Print("%1 sample%2 converted to mono", numStereoOpt, (numStereoOpt == 1) ? "" : "s");
modDoc.AddToLog(s);
}
return true;
}
// Rearrange sample list
bool CModCleanupDlg::RearrangeSamples()
//-------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
if(sndFile.GetNumSamples() < 2)
return false;
std::vector<SAMPLEINDEX> sampleMap;
sampleMap.reserve(sndFile.GetNumSamples());
// First, find out which sample slots are unused and create the new sample map only with used samples
for(SAMPLEINDEX i = 1; i <= sndFile.GetNumSamples(); i++)
{
if(sndFile.GetSample(i).pSample != nullptr)
{
sampleMap.push_back(i);
}
}
// Nothing found to remove...
if(sndFile.GetNumSamples() == sampleMap.size())
{
return false;
}
return (modDoc.ReArrangeSamples(sampleMap) != SAMPLEINDEX_INVALID);
}
// Remove unused instruments
bool CModCleanupDlg::RemoveUnusedInstruments()
//--------------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
if(!sndFile.GetNumInstruments())
return false;
deleteInstrumentSamples removeSamples = doNoDeleteAssociatedSamples;
if(Reporting::Confirm("Remove samples associated with unused instruments?", "Removing unused instruments", false, false, this) == cnfYes)
{
removeSamples = deleteAssociatedSamples;
}
BeginWaitCursor();
std::vector<bool> instrUsed(sndFile.GetNumInstruments());
bool prevUsed = true, reorder = false;
INSTRUMENTINDEX numUsed = 0, lastUsed = 1;
for(INSTRUMENTINDEX i = 0; i < sndFile.GetNumInstruments(); i++)
{
instrUsed[i] = (modDoc.IsInstrumentUsed(i + 1));
if(instrUsed[i])
{
numUsed++;
lastUsed = i;
if(!prevUsed)
{
reorder = true;
}
}
prevUsed = instrUsed[i];
}
EndWaitCursor();
if(reorder && numUsed >= 1)
{
reorder = (Reporting::Confirm("Do you want to reorganize the remaining instruments?", "Removing unused instruments", false, false, this) == cnfYes);
} else
{
reorder = false;
}
const INSTRUMENTINDEX numRemoved = sndFile.GetNumInstruments() - numUsed;
if(numRemoved != 0)
{
BeginWaitCursor();
std::vector<INSTRUMENTINDEX> instrMap;
instrMap.reserve(sndFile.GetNumInstruments());
for(INSTRUMENTINDEX i = 0; i < sndFile.GetNumInstruments(); i++)
{
if(instrUsed[i])
{
instrMap.push_back(i + 1);
} else if(!reorder && i < lastUsed)
{
instrMap.push_back(INSTRUMENTINDEX_INVALID);
}
}
modDoc.ReArrangeInstruments(instrMap, removeSamples);
EndWaitCursor();
TCHAR s[64];
wsprintf(s, _T("%u unused instrument%s removed"), numRemoved, (numRemoved == 1) ? _T("") : _T("s"));
modDoc.AddToLog(s);
return true;
}
return false;
}
// Remove ununsed plugins
bool CModCleanupDlg::RemoveUnusedPlugins()
//----------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
std::vector<bool> usedmap(MAX_MIXPLUGINS, false);
for(PLUGINDEX nPlug = 0; nPlug < MAX_MIXPLUGINS; nPlug++)
{
// Is the plugin assigned to a channel?
for(CHANNELINDEX nChn = 0; nChn < sndFile.GetNumChannels(); nChn++)
{
if (sndFile.ChnSettings[nChn].nMixPlugin == nPlug + 1)
{
usedmap[nPlug] = true;
break;
}
}
// Is the plugin used by an instrument?
for(INSTRUMENTINDEX nIns = 1; nIns <= sndFile.GetNumInstruments(); nIns++)
{
if (sndFile.Instruments[nIns] && (sndFile.Instruments[nIns]->nMixPlug == nPlug + 1))
{
usedmap[nPlug] = true;
break;
}
}
// Is the plugin assigned to master?
if(sndFile.m_MixPlugins[nPlug].IsMasterEffect())
usedmap[nPlug] = true;
// All outputs of used plugins count as used
if(usedmap[nPlug])
{
if(!sndFile.m_MixPlugins[nPlug].IsOutputToMaster())
{
PLUGINDEX output = sndFile.m_MixPlugins[nPlug].GetOutputPlugin();
if(output != PLUGINDEX_INVALID)
{
usedmap[output] = true;
}
}
}
}
PLUGINDEX numRemoved = modDoc.RemovePlugs(usedmap);
if(numRemoved != 0)
{
TCHAR s[64];
wsprintf(s, _T("%u unused plugin%s removed"), numRemoved, (numRemoved == 1) ? _T("") : _T("s"));
modDoc.AddToLog(s);
return true;
}
return false;
}
// Reset variables (convert to IT, reset global/smp/ins vars, etc.)
bool CModCleanupDlg::ResetVariables()
//-----------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
if(Reporting::Confirm(_T("OpenMPT will convert the module to IT format and reset all song, sample and instrument attributes to default values. Continue?"), TEXT("Resetting variables"), false, false, this) == cnfNo)
return false;
// Stop play.
CMainFrame::GetMainFrame()->StopMod(&modDoc);
BeginWaitCursor();
CriticalSection cs;
// Convert to IT...
modDoc.ChangeModType(MOD_TYPE_IT);
sndFile.SetDefaultPlaybackBehaviour(sndFile.GetType());
sndFile.SetMixLevels(mixLevelsCompatible);
sndFile.m_songArtist.clear();
sndFile.m_nTempoMode = tempoModeClassic;
sndFile.m_SongFlags = SONG_LINEARSLIDES;
sndFile.m_MidiCfg.Reset();
// Global vars
sndFile.m_nDefaultTempo.Set(125);
sndFile.m_nDefaultSpeed = 6;
sndFile.m_nDefaultGlobalVolume = MAX_GLOBAL_VOLUME;
sndFile.m_nSamplePreAmp = 48;
sndFile.m_nVSTiVolume = 48;
sndFile.Order.SetRestartPos(0);
// Reset instruments (if there are any)
for(INSTRUMENTINDEX i = 1; i <= sndFile.GetNumInstruments(); i++) if(sndFile.Instruments[i])
{
sndFile.Instruments[i]->nFadeOut = 256;
sndFile.Instruments[i]->nGlobalVol = 64;
sndFile.Instruments[i]->nPan = 128;
sndFile.Instruments[i]->dwFlags.reset(INS_SETPANNING);
sndFile.Instruments[i]->nMixPlug = 0;
sndFile.Instruments[i]->nVolSwing = 0;
sndFile.Instruments[i]->nPanSwing = 0;
sndFile.Instruments[i]->nCutSwing = 0;
sndFile.Instruments[i]->nResSwing = 0;
}
for(CHANNELINDEX chn = 0; chn < sndFile.GetNumChannels(); chn++)
{
sndFile.InitChannel(chn);
}
// reset samples
ctrlSmp::ResetSamples(sndFile, ctrlSmp::SmpResetCompo);
cs.Leave();
EndWaitCursor();
return true;
}
bool CModCleanupDlg::RemoveUnusedChannels()
//-----------------------------------------
{
// Avoid M.K. modules to become xCHN modules if some channels are unused.
if(modDoc.GetModType() == MOD_TYPE_MOD && modDoc.GetNumChannels() == 4)
return false;
std::vector<bool> usedChannels;
modDoc.CheckUsedChannels(usedChannels, modDoc.GetNumChannels() - modDoc.GetrSoundFile().GetModSpecifications().channelsMin);
return modDoc.RemoveChannels(usedChannels);
}
// Remove all patterns
bool CModCleanupDlg::RemoveAllPatterns()
//--------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
if(sndFile.Patterns.Size() == 0) return false;
sndFile.Patterns.Init();
sndFile.Patterns.Insert(0, 64);
sndFile.SetCurrentOrder(0);
return true;
}
// Remove all orders
bool CModCleanupDlg::RemoveAllOrders()
//------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
sndFile.Order.SetSequence(0);
while(sndFile.Order.GetNumSequences() > 1)
{
sndFile.Order.RemoveSequence(1);
}
sndFile.Order.Init();
sndFile.Order[0] = 0;
sndFile.SetCurrentOrder(0);
return true;
}
// Remove all samples
bool CModCleanupDlg::RemoveAllSamples()
//-------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
if (sndFile.GetNumSamples() == 0) return false;
std::vector<bool> keepSamples(sndFile.GetNumSamples() + 1, false);
sndFile.RemoveSelectedSamples(keepSamples);
ctrlSmp::ResetSamples(sndFile, ctrlSmp::SmpResetInit, 1, MAX_SAMPLES - 1);
return true;
}
// Remove all instruments
bool CModCleanupDlg::RemoveAllInstruments()
//-----------------------------------------
{
CSoundFile &sndFile = modDoc.GetrSoundFile();
if(sndFile.GetNumInstruments() == 0) return false;
modDoc.ConvertInstrumentsToSamples();
for(INSTRUMENTINDEX i = 1; i <= sndFile.GetNumInstruments(); i++)
{
sndFile.DestroyInstrument(i, doNoDeleteAssociatedSamples);
}
sndFile.m_nInstruments = 0;
return true;
}
// Remove all plugins
bool CModCleanupDlg::RemoveAllPlugins()
//-------------------------------------
{
std::vector<bool> keepMask(MAX_MIXPLUGINS, false);
modDoc.RemovePlugs(keepMask);
return true;
}
bool CModCleanupDlg::MergeSequences()
//-----------------------------------
{
return modDoc.GetSoundFile()->Order.MergeSequences();
}
OPENMPT_NAMESPACE_END
| [
"manx@56274372-70c3-4bfc-bfc3-4c3a0b034d27"
] | manx@56274372-70c3-4bfc-bfc3-4c3a0b034d27 |
a52341862c7fbc60489e1553126cb999149945f4 | a5701db4a94973e9f63f95d8db6043c30b4ee9b5 | /test/helper.hpp | faaa9aa93ca47c456d92335b0fe843f09f70d2fa | [] | no_license | mlu1109/data_structures | 5b77f19c7874d89890eb52c417aec95729441029 | 938be73fb63a8bc9291409de55e85cdfea424414 | refs/heads/master | 2021-01-10T22:30:00.065090 | 2016-10-21T02:19:52 | 2016-10-21T02:19:52 | 69,478,307 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 919 | hpp | #ifndef DATA_STRUCTURES_HELPER_HPP
#define DATA_STRUCTURES_HELPER_HPP
#include "avl.hpp"
std::unique_ptr<AVL::Node<int>> createNode(int key);
std::unique_ptr<AVL::Node<int>> generateTree();
std::string getTreeString(std::unique_ptr<AVL::Node<int>> &node, int depth);
template<typename T>
int getCalculatedHeight(std::unique_ptr<AVL::Node<T>> &node)
{
if (!node)
return -1;
return 1 + std::max(getCalculatedHeight(node->left), getCalculatedHeight(node->right));
}
template<typename T>
int getCalculatedBalance(std::unique_ptr<AVL::Node<T>> &node)
{
if (!node)
return 0;
return getCalculatedHeight(node->left) - getCalculatedHeight(node->right);
}
template<typename T>
bool isTreeBalanced(std::unique_ptr<AVL::Node<T>> &node)
{
if (!node)
return true;
return std::abs(getCalculatedBalance(node)) < 2 && isTreeBalanced(node->left) && isTreeBalanced(node->right);
}
#endif //DATA_STRUCTURES_HELPER_HPP
| [
"matlu703@student.liu.se"
] | matlu703@student.liu.se |
bc604673b5777d4eb2895dff95c0a06d36591160 | dc81c76a02995eb140d10a62588e3791a8c7de0d | /PortfolioTrading/FastTradeStation/ClientManager.cpp | b26af969e7f065aca50b887127cd0b6665b57ad9 | [] | no_license | xbotuk/cpp-proto-net | ab971a94899da7749b35d6586202bb4c52991461 | d685bee57c8bf0e4ec2db0bfa21d028fa90240fd | refs/heads/master | 2023-08-17T00:52:03.883886 | 2016-08-20T03:40:36 | 2016-08-20T03:40:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,333 | cpp | #include "ClientManager.h"
#include "globalmembers.h"
#include "entity/message.pb.h"
#include "charsetconvert.h"
#include <boost/format.hpp>
#include <boost/bind.hpp>
CClientManager::CClientManager(void)
{
InitializeReqTranslators();
}
CClientManager::~CClientManager(void)
{
}
bool CClientManager::OnConnected( Session* session, const string& clientId, bool attach )
{
boost::recursive_mutex::scoped_lock lock(m_mutClntMap);
if(attach)
{
CClientAgent* pClientAgent = GetClientById(clientId);
assert(pClientAgent != NULL);
if(pClientAgent != NULL)
{
if(pClientAgent->Detached())
{
AttachSession(clientId, session);
logger.Info(boost::str(boost::format("Client(%s) Attached.") % clientId ));
return true;
}
}
}
else
{
std::string info = boost::str(boost::format("Client(%s) connected.") % session->SessionId().c_str());
logger.Info(info);
ClientPtr client(new CClientAgent(clientId));
client->SetSession(session);
m_clients.insert(std::make_pair(session->SessionId(), client));
return true;
}
return false;
}
void CClientManager::OnDisconnected( Session* session )
{
std::string info = boost::str(boost::format("Client(%s) disconnected.") % session->SessionId().c_str());
logger.Info(info);
const string& sessionId = session->SessionId();
CClientAgent* pClntAgent = GetClient(sessionId);
if(pClntAgent != NULL)
{
boost::recursive_mutex::scoped_lock lock(m_mutClntMap);
pClntAgent->SetSession(NULL);
if(!pClntAgent->IsConnected())
m_clients.erase(sessionId);
}
}
void CClientManager::OnError( Session* session, const string& errorMsg )
{
std::string outputErr = boost::str(boost::format("Client(%s) encounter error - %s.")
% session->SessionId().c_str() % errorMsg.c_str());
logger.Info(outputErr);
}
void CClientManager::DispatchPacket( const string& sessionId, const string& method, const string& in_data, string& out_data )
{
CClientAgent* pClntAgent = GetClient(sessionId);
if(pClntAgent != NULL)
{
ReqTranslatorMapIter transIter = m_reqTransMap.find(method);
if(transIter != m_reqTransMap.end())
{
(transIter->second)(pClntAgent, in_data, out_data);
}
}
}
CClientAgent* CClientManager::GetClient( const string& sessionId )
{
boost::recursive_mutex::scoped_lock lock(m_mutClntMap);
ClientMapIter clntIter = m_clients.find(sessionId);
if(clntIter != m_clients.end())
{
return (clntIter->second).get();
}
else
return NULL;
}
CClientAgent* CClientManager::GetClientById( const string& clientId )
{
for (ClientMapIter clntIter = m_clients.begin(); clntIter != m_clients.end(); ++clntIter)
{
const string& currClientId = (clntIter->second)->ClientId();
if(currClientId == clientId)
{
return (clntIter->second).get();
}
}
return NULL;
}
void CClientManager::InitializeReqTranslators()
{
m_reqTransMap.insert(make_pair("QuoteConnect", boost::bind(&CClientManager::QuoteConnect, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("QuoteDisconnect", boost::bind(&CClientManager::QuoteDisconnect, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("QuoteLogin", boost::bind(&CClientManager::QuoteLogin, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("QuoteLogout", boost::bind(&CClientManager::QuoteLogout, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("RegQuote", boost::bind(&CClientManager::RegQuote, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("TradeConnect", boost::bind(&CClientManager::TradeConnect, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("TradeDisconnect", boost::bind(&CClientManager::TradeDisconnect, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("TradeLogin", boost::bind(&CClientManager::TradeLogin, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("TradeLogout", boost::bind(&CClientManager::TradeLogout, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("AddPortf", boost::bind(&CClientManager::AddPorf, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("AddPortfCollection", boost::bind(&CClientManager::AddPortfCollection, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("RemovePortf", boost::bind(&CClientManager::RemovePorf, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("PorfOpenPosition", boost::bind(&CClientManager::PorfOpenPosition, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("PorfClosePosition", boost::bind(&CClientManager::PorfClosePosition, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("SwitchPosition", boost::bind(&CClientManager::SwitchPosition, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("ScalperOpenPosition", boost::bind(&CClientManager::ScalperOpenPosition, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("ClosePosition", boost::bind(&CClientManager::ClosePosition, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("CancelOrder", boost::bind(&CClientManager::CancelOrder, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("ManualCloseOrder", boost::bind(&CClientManager::ManualCloseOrder, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("QuerySymbolInfo", boost::bind(&CClientManager::QuerySymbolInfo, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("PortfChgQuantity", boost::bind(&CClientManager::PortfChgQuantity, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("PortfEnableStrategy", boost::bind(&CClientManager::PortfEnableStrategy, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("PortfSetPreferredLeg", boost::bind(&CClientManager::PortfSetPreferredLeg, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("PortfTurnSwitches", boost::bind(&CClientManager::PortfTurnSwitches, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("ApplyStrategySettings", boost::bind(&CClientManager::ApplyStrategySettings, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("QueryAccountInfo", boost::bind(&CClientManager::QueryAccountInfo, this, _1, _2, _3)));
m_reqTransMap.insert(make_pair("QueryPositionDetails", boost::bind(&CClientManager::QueryPositionDetails, this, _1, _2, _3)));
}
void CClientManager::QuoteConnect( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::ConnectParam connParam;
connParam.ParseFromString(in_data);
boost::tuple<bool, string> ret = pClientAgent->QuoteConnect(connParam.quoteaddress(), connParam.streamfolder());
entity::OperationReturn operRet;
operRet.set_success(boost::get<0>(ret));
operRet.set_errormessage(boost::get<1>(ret));
operRet.SerializeToString(&out_data);
}
void CClientManager::QuoteDisconnect( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
pClientAgent->QuoteDisconnect();
}
void CClientManager::QuoteLogin( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::LoginParam loginParam;
loginParam.ParseFromString(in_data);
boost::tuple<bool, string> ret = pClientAgent->QuoteLogin(
loginParam.brokerid(), loginParam.userid(), loginParam.password());
entity::OperationReturn operRet;
operRet.set_success(boost::get<0>(ret));
operRet.set_errormessage(boost::get<1>(ret));
operRet.SerializeToString(&out_data);
}
void CClientManager::QuoteLogout( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
pClientAgent->QuoteLogout();
}
void CClientManager::TradeConnect( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::ConnectParam connParam;
connParam.ParseFromString(in_data);
boost::tuple<bool, string> ret = pClientAgent->TradeConnect(connParam.quoteaddress(), connParam.streamfolder());
entity::OperationReturn operRet;
operRet.set_success(boost::get<0>(ret));
operRet.set_errormessage(boost::get<1>(ret));
operRet.SerializeToString(&out_data);
}
void CClientManager::TradeDisconnect( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
pClientAgent->TradeDisconnect();
}
void CClientManager::TradeLogin( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::LoginParam loginParam;
loginParam.ParseFromString(in_data);
const entity::AccountSettings* pSettings = NULL;
if(loginParam.has_acctsettings())
{
pSettings = &(loginParam.acctsettings());
}
boost::tuple<bool, string> ret = pClientAgent->TradeLogin(
loginParam.brokerid(), loginParam.userid(), loginParam.password(), pSettings);
entity::OperationReturn operRet;
operRet.set_success(boost::get<0>(ret));
string utf8Msg;
GB2312ToUTF_8(utf8Msg, boost::get<1>(ret).c_str());
operRet.set_errormessage(utf8Msg);
operRet.SerializeToString(&out_data);
}
void CClientManager::TradeLogout( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
pClientAgent->TradeLogout();
}
void CClientManager::RegQuote( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::RegQuoteParam regParam;
regParam.ParseFromString(in_data);
vector<string> regSymbols(regParam.symbols().begin(), regParam.symbols().end());
pClientAgent->RegQuote(regSymbols);
}
void CClientManager::AddPorf( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::PortfolioItem* portfItem = new entity::PortfolioItem;
portfItem->ParseFromString(in_data);
pClientAgent->Add(portfItem);
}
void CClientManager::AddPortfCollection(CClientAgent* pClientAgent, const string& in_data, string& out_data)
{
entity::AddPortfolioParam addPorfParam;
addPorfParam.ParseFromString(in_data);
pClientAgent->AddPortfolios(addPorfParam);
}
void CClientManager::RemovePorf( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::StringParam strParam;
strParam.ParseFromString(in_data);
pClientAgent->Remove(strParam.data());
}
void CClientManager::PorfOpenPosition( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::PorfOpenPosiParam opParam;
opParam.ParseFromString(in_data);
bool isVirtual = opParam.isvirtual();
if(isVirtual)
pClientAgent->VirtualOpenPosition(opParam.portfid(), opParam.quantity());
else
pClientAgent->OpenPosition(opParam.portfid(), opParam.quantity());
}
void CClientManager::SwitchPosition( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::PorfOpenPosiParam opParam;
opParam.ParseFromString(in_data);
//pClientAgent->ChangePosition(opParam.portfid(), opParam.quantity());
}
void CClientManager::ScalperOpenPosition( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::PorfOpenPosiParam opParam;
opParam.ParseFromString(in_data);
pClientAgent->QuickScalpe(opParam.portfid(), opParam.quantity());
}
void CClientManager::PorfClosePosition(CClientAgent* pClientAgent, const string& in_data, string& out_data)
{
entity::PorfOpenPosiParam opParam;
opParam.ParseFromString(in_data);
const string& portfId = opParam.portfid();
int qty = opParam.quantity();
if(qty > 0)
{
bool isVirtual = opParam.isvirtual();
if(isVirtual)
pClientAgent->VirtualClosePosition(portfId, qty);
else
pClientAgent->ClosePosition(portfId, qty, trade::SR_Manual);
}
else
pClientAgent->SimpleCloseOrderPosition(portfId, trade::SR_Manual);
}
void CClientManager::ClosePosition( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::ClosePositionParam cpParam;
cpParam.ParseFromString(in_data);
const trade::MultiLegOrder& openMlOrder = cpParam.multilegorder();
string message;
pClientAgent->ClosePosition(openMlOrder, cpParam.legordref(), trade::SR_Manual, message);
entity::StringParam retParam;
retParam.set_data(message);
retParam.SerializeToString(&out_data);
}
void CClientManager::QueryAccountInfo( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
pClientAgent->QueryAccountInfo(&out_data);
}
void CClientManager::ApplyStrategySettings( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::ModifyStrategyParam modifyParam;
modifyParam.ParseFromString(in_data);
pClientAgent->ApplyStrategySetting(modifyParam);
}
void CClientManager::PortfSetPreferredLeg( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::ModifyPortfolioPreferredLegParam legParam;
legParam.ParseFromString(in_data);
pClientAgent->SetPorfPreferredLeg(legParam);
}
void CClientManager::PortfTurnSwitches( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::ModifyPortfolioSwitchParam switchesParam;
switchesParam.ParseFromString(in_data);
pClientAgent->TurnPortfSwitches(switchesParam);
}
void CClientManager::PortfEnableStrategy( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::ModifyRunningStatusParam runningParam;
runningParam.ParseFromString(in_data);
pClientAgent->EnableStrategy(runningParam);
}
void CClientManager::CancelOrder( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::CancelOrderParam cancelParam;
cancelParam.ParseFromString(in_data);
pClientAgent->CancelOrder(cancelParam);
}
void CClientManager::QueryPositionDetails( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::StringParam stringParam;
stringParam.ParseFromString(in_data);
pClientAgent->QueryPositionDetails(stringParam.data());
}
void CClientManager::ManualCloseOrder( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::ManualCloseOrderParam closeOrdParam;
closeOrdParam.ParseFromString(in_data);
boost::tuple<bool, string> ret = pClientAgent->ManualCloseOrder(
closeOrdParam.symbol(), closeOrdParam.direction(), closeOrdParam.opendate(), closeOrdParam.quantity());
entity::OperationReturn operRet;
operRet.set_success(boost::get<0>(ret));
operRet.set_errormessage(boost::get<1>(ret));
operRet.SerializeToString(&out_data);
}
void CClientManager::QuerySymbolInfo( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::RegQuoteParam symbolParam;
symbolParam.ParseFromString(in_data);
int count = symbolParam.symbols_size();
if(count > 0)
{
const string& symbol = symbolParam.symbols(0);
entity::SymbolInfo* pRetSymbInfo = NULL;
pClientAgent->QuerySymbolInfo(symbol, &pRetSymbInfo);
if(pRetSymbInfo != NULL)
{
pRetSymbInfo->SerializeToString(&out_data);
}
}
}
void CClientManager::PortfChgQuantity( CClientAgent* pClientAgent, const string& in_data, string& out_data )
{
entity::ModifyPortfolioQtyParam qtyParam;
qtyParam.ParseFromString(in_data);
pClientAgent->SetPortfolioQuantity(qtyParam.portfid(), qtyParam.onceqty(), qtyParam.maxqty());
}
bool CClientManager::VerifyClient( const string& username, const string& password, bool* clientExisting )
{
boost::recursive_mutex::scoped_lock lock(m_mutClntMap);
*clientExisting = false;
logger.Info(boost::str(boost::format("Verifying client:%s") % username));
CClientAgent* pClient = GetClientById(username);
if(pClient == NULL)
{
logger.Info("Verification succeeded. This is new client");
return true;
}
else
{
logger.Info(boost::str(boost::format("Client(%s) already exists, try to reconnect") % username));
*clientExisting = true;
if(pClient->Detached())
{
logger.Info(boost::str(boost::format("Client(%s) gets reconnected") % username));
return true;
}
logger.Warning(boost::str(boost::format("Client(%s) reconnect FAILED") % username));
return false;
}
}
void CClientManager::AttachSession( const string& clientId, Session* session )
{
boost::recursive_mutex::scoped_lock lock(m_mutClntMap);
ClientPtr targetClient;
bool found = false;
for (ClientMapIter clntIter = m_clients.begin(); clntIter != m_clients.end(); ++clntIter)
{
const string& currClientId = (clntIter->second)->ClientId();
if(currClientId == clientId)
{
targetClient = (clntIter->second);
found = true;
m_clients.erase(clntIter);
break;
}
}
if(found)
{
targetClient->SetSession(session);
m_clients.insert(std::make_pair(session->SessionId(), targetClient));
}
}
| [
"zxiaoyong@163.com"
] | zxiaoyong@163.com |
4e5872b1f383e5e4313d350780a0cf6c5edfc53b | cc687366dfa1c3bb57263f15c2a0dd2e3a68a2d8 | /ChartCtrl_source/ChartGanttSerie.cpp | d54d498aeee8d2f30689425abf5446f1c0dbbf10 | [] | no_license | hb-lee/MFCVideo | 60a2e133c3a27f8ca06d038fc5c542de30ca4936 | d1e82e805c4c83d82bd4657c5337ba9c69e67a93 | refs/heads/master | 2020-05-03T08:55:34.750085 | 2019-05-04T08:34:52 | 2019-05-04T08:34:52 | 178,540,060 | 0 | 0 | null | null | null | null | IBM852 | C++ | false | false | 5,699 | cpp | /*
*
* ChartGanttSerie.cpp
*
* Written by CÚdric Moonen (cedric_moonen@hotmail.com)
*
*
*
* This code may be used for any non-commercial and commercial purposes in a compiled form.
* The code may be redistributed as long as it remains unmodified and providing that the
* author name and this disclaimer remain intact. The sources can be modified WITH the author
* consent only.
*
* This code is provided without any garanties. I cannot be held responsible for the damage or
* the loss of time it causes. Use it at your own risks
*
* An e-mail to notify me that you are using this code is appreciated also.
*
*
*/
#include "stdafx.h"
#include "ChartGanttSerie.h"
#include "ChartCtrl.h"
CChartGanttSerie::CChartGanttSerie(CChartCtrl* pParent)
: CChartSerieBase<SChartGanttPoint>(pParent), m_iBarWidth(10), m_iBorderWidth(1),
m_BorderColor(RGB(0,0,0)), m_bGradient(true),
m_GradientColor(RGB(255,255,255)), m_GradientType(gtHorizontalDouble)
{
m_bShadow = true;
this->SetSeriesOrdering(poYOrdering);
}
CChartGanttSerie::~CChartGanttSerie()
{
}
void CChartGanttSerie::AddPoint(double StartTime, double EndTime, double YValue)
{
SChartGanttPoint newPoint(StartTime, EndTime, YValue);
CChartSerieBase<SChartGanttPoint>::AddPoint(newPoint);
}
bool CChartGanttSerie::IsPointOnSerie(const CPoint& screenPoint,
unsigned& uIndex) const
{
uIndex = INVALID_POINT;
if (!m_bIsVisible)
return false;
unsigned uFirst=0, uLast=0;
if (!GetVisiblePoints(uFirst,uLast))
return false;
if (uFirst>0)
uFirst--;
if (uLast<GetPointsCount()-1)
uLast++;
bool bResult = false;
for (unsigned i=uFirst ; i <= uLast ; i++)
{
CRect BarRect = GetBarRectangle(i);
if (BarRect.PtInRect(screenPoint))
{
bResult = true;
uIndex = i;
break;
}
}
return bResult;
}
void CChartGanttSerie::DrawLegend(CDC* pDC, const CRect& rectBitmap) const
{
if (m_strSerieName == _T(""))
return;
if (!pDC->GetSafeHdc())
return;
//Draw bar:
CBrush BorderBrush(m_BorderColor);
pDC->FillRect(rectBitmap,&BorderBrush);
CRect FillRect(rectBitmap);
CBrush FillBrush(m_SerieColor);
FillRect.DeflateRect(m_iBorderWidth,m_iBorderWidth);
if (m_bGradient)
{
CChartGradient::DrawGradient(pDC,FillRect,m_SerieColor,m_GradientColor,m_GradientType);
}
else
{
pDC->FillRect(FillRect,&FillBrush);
}
}
void CChartGanttSerie::Draw(CDC* pDC)
{
if (!m_bIsVisible)
return;
if (!pDC->GetSafeHdc())
return;
unsigned uFirst=0, uLast=0;
if (!GetVisiblePoints(uFirst,uLast))
return;
CRect TempClipRect(m_PlottingRect);
TempClipRect.DeflateRect(1,1);
pDC->SetBkMode(TRANSPARENT);
pDC->IntersectClipRect(TempClipRect);
CBrush BorderBrush(m_BorderColor);
CBrush FillBrush(m_SerieColor);
//Draw all points that haven't been drawn yet
for (m_uLastDrawnPoint;m_uLastDrawnPoint<(int)GetPointsCount();m_uLastDrawnPoint++)
{
CRect BarRect = GetBarRectangle(m_uLastDrawnPoint);
DrawBar(pDC, &FillBrush, &BorderBrush, BarRect);
}
pDC->SelectClipRgn(NULL);
DeleteObject(BorderBrush);
DeleteObject(FillBrush);
}
void CChartGanttSerie::DrawAlert(CDC *pDC)
{
MessageBox(NULL, "╬┤╩Á¤Í", "hello", MB_OK);
}
void CChartGanttSerie::DrawAll(CDC *pDC)
{
if (!m_bIsVisible)
return;
if (!pDC->GetSafeHdc())
return;
unsigned uFirst=0, uLast=0;
if (!GetVisiblePoints(uFirst,uLast))
return;
CRect TempClipRect(m_PlottingRect);
TempClipRect.DeflateRect(1,1);
if (uFirst>0)
uFirst--;
if (uLast<GetPointsCount()-1)
uLast++;
pDC->SetBkMode(TRANSPARENT);
pDC->IntersectClipRect(TempClipRect);
CBrush BorderBrush(m_BorderColor);
CBrush FillBrush(m_SerieColor);
for (m_uLastDrawnPoint=uFirst;m_uLastDrawnPoint<=uLast;m_uLastDrawnPoint++)
{
CRect BarRect = GetBarRectangle(m_uLastDrawnPoint);
DrawBar(pDC, &FillBrush, &BorderBrush, BarRect);
}
pDC->SelectClipRgn(NULL);
DeleteObject(BorderBrush);
DeleteObject(FillBrush);
}
void CChartGanttSerie::SetBorderColor(COLORREF BorderColor)
{
m_BorderColor = BorderColor;
m_pParentCtrl->RefreshCtrl();
}
void CChartGanttSerie::SetBorderWidth(int Width)
{
m_iBorderWidth = Width;
m_pParentCtrl->RefreshCtrl();
}
void CChartGanttSerie::SetBarWidth(int Width)
{
m_iBarWidth = Width;
m_pParentCtrl->RefreshCtrl();
}
void CChartGanttSerie::ShowGradient(bool bShow)
{
m_bGradient = bShow;
m_pParentCtrl->RefreshCtrl();
}
void CChartGanttSerie::SetGradient(COLORREF GradientColor, EGradientType GradientType)
{
m_GradientColor = GradientColor;
m_GradientType = GradientType;
m_pParentCtrl->RefreshCtrl();
}
CRect CChartGanttSerie::GetBarRectangle(unsigned uPointIndex) const
{
SChartGanttPoint point = GetPoint(uPointIndex);
int PointXStart = m_pHorizontalAxis->ValueToScreen(point.StartTime);
int PointXEnd = m_pHorizontalAxis->ValueToScreen(point.EndTime);
int YVal = m_pVerticalAxis->ValueToScreen(point.YValue);
int PointYStart = YVal - m_iBarWidth;
int PointYEnd = YVal + m_iBarWidth;
CRect PointRect(min(PointXStart, PointXEnd), min(PointYStart, PointYEnd),
max(PointXStart, PointXEnd), max(PointYStart, PointYEnd) );
return PointRect;
}
void CChartGanttSerie::DrawBar(CDC* pDC, CBrush* pFillBrush, CBrush* pBorderBrush,
CRect BarRect)
{
if (m_bShadow)
{
CBrush ShadowBrush(m_ShadowColor);
CRect ShadowRect(BarRect);
ShadowRect.OffsetRect(m_iShadowDepth,m_iShadowDepth);
pDC->FillRect(ShadowRect,&ShadowBrush);
}
pDC->FillRect(BarRect,pBorderBrush);
CRect FillRect(BarRect);
FillRect.DeflateRect(m_iBorderWidth,m_iBorderWidth);
if (m_bGradient)
{
CChartGradient::DrawGradient(pDC,FillRect,m_SerieColor,m_GradientColor,
m_GradientType);
}
else
{
pDC->FillRect(FillRect,pFillBrush);
}
} | [
"lihb2113@outlook.com"
] | lihb2113@outlook.com |
48aa35f254812ac5303699a666498aa389b4effb | f530f0335149d0d69a5728b498d88f9d5e4c3894 | /frameworks/base/component/SpriteRenderer.cpp | 2b12fa989cd7cb93b30098710dfe8f61a42ab38b | [
"MIT"
] | permissive | kevinnewkevin/BWEngine | 900a69e06827890ffa7fb3d1c5b41bb846c9d237 | 80a5d7afb6caa9c96328fa3e86d5056281e0a6aa | refs/heads/master | 2021-01-18T22:18:43.597906 | 2015-11-22T07:32:01 | 2015-11-22T07:32:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,660 | cpp | #include "base/component/SpriteRenderer.h"
#include "base/GameObject.h"
#include "renderer/GLProgramCache.h"
#include "renderer/Texture.h"
#include "renderer/Renderer.h"
#include "base/ResourceManager.h"
#include "utils/FileUtils.h"
SpriteRenderer::SpriteRenderer(GameObject* _gameObject/* = nullptr*/)
: BaseComponent(_gameObject)
{
}
SpriteRenderer::~SpriteRenderer()
{
}
void SpriteRenderer::Awake()
{
_mesh._positions.assign({
Vec3(), Vec3(),
Vec3(), Vec3(),
});
_mesh._texCoords.assign({
Vec2(0, 0), Vec2(1, 0),
Vec2(1, 1), Vec2(0, 1),
});
_mesh._indices.assign({ 0, 1, 2, 0, 2, 3 });
}
void SpriteRenderer::Start()
{
//texture = ResourceManager::getInstance()->addTexture("img2_2.png");
texture = ResourceManager::getInstance()->addTexture("BigGlow3.bmp");
material = MeshMaterial::create();
material->texture = texture;
material->positions = &_mesh._positions;
material->texCoords = &_mesh._texCoords;
material->indices = &_mesh._indices;
_textureRect = Rect(Vec2(0, 0), texture->getSize());
_isDirty = true;
_textureRect = Rect(Vec2(30, 30), Size(50, 50));
}
void SpriteRenderer::OnEnable()
{
}
void SpriteRenderer::OnDisable()
{
}
void SpriteRenderer::OnDestroy()
{
}
void SpriteRenderer::Update(float dt)
{
BaseComponent::Update(dt);
updateTexture();
}
void SpriteRenderer::OnGUI()
{
_cmd.init(material, &gameObject->mvpMatrix);
Renderer::getInstance()->addCommand(&_cmd);
}
void SpriteRenderer::updateTexture()
{
if (!_isDirty) return;
_isDirty = false;
float origionWidth = texture->getSize().width;
float origionHeight = texture->getSize().height;
float x = _textureRect.x, y = _textureRect.y;
float width = _textureRect.width, height = _textureRect.height;
_mesh._positions[0].x = x, _mesh._positions[0].y = y;
_mesh._positions[1].x = x + width, _mesh._positions[1].y = y;
_mesh._positions[2].x = x + width, _mesh._positions[2].y = y + height;
_mesh._positions[3].x = 0, _mesh._positions[3].y = y + height;
_mesh._texCoords[0].x = _mesh._positions[0].x / origionWidth, _mesh._texCoords[0].y = _mesh._positions[0].y / origionHeight;
_mesh._texCoords[1].x = _mesh._positions[1].x / origionWidth, _mesh._texCoords[1].y = _mesh._positions[1].y / origionHeight;
_mesh._texCoords[2].x = _mesh._positions[2].x / origionWidth, _mesh._texCoords[2].y = _mesh._positions[2].y / origionHeight;
_mesh._texCoords[3].x = _mesh._positions[3].x / origionWidth, _mesh._texCoords[3].y = _mesh._positions[3].y / origionHeight;
}
void SpriteRenderer::setTextureRect(Rect & rect)
{
_textureRect = rect;
}
| [
"miyubai@gmail.com"
] | miyubai@gmail.com |
4cac83cd1dbe582b36fc05b7fa36ef0865bc68de | dc83a45a0eddf594934d0cea748123d39a958510 | /src/mmu.h | 71ddddf0d7298d180066c0ecb7efa5693b94ae4a | [] | no_license | samjijina/macsim | 957758848a666c8409130aa27e127a54aadcaf6c | 1e2f12c6aef8809d4a0eeefb6dda3d2ab77dcdc1 | refs/heads/master | 2022-08-24T23:36:43.169284 | 2020-05-21T01:40:20 | 2020-05-21T01:40:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,455 | h | /*
Copyright (c) <2012>, <Georgia Institute of Technology> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.
Neither the name of the <Georgia Institue of Technology> nor the names of its contributors
may be used to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/**********************************************************************************************
* File : mmu.h
* Author : HPArch Research Group
* Date : 1/30/2019
* Description : Memory Management Unit
*********************************************************************************************/
#ifndef MMU_H_INCLUDED
#define MMU_H_INCLUDED
#include <cstdlib>
#include <cmath>
#include <map>
#include <unordered_map>
#include <memory>
#include <utility>
#include <tuple>
#include <set>
#include <unordered_set>
#include "macsim.h"
#include "uop.h"
#include "tlb.h"
class MMU // Memory Management Unit
{
private:
class PageDescriptor
{
public:
PageDescriptor(Addr _frame_number) : frame_number(_frame_number) {}
PageDescriptor() {}
Addr frame_number;
};
class ReplacementUnit
{
public:
ReplacementUnit(macsim_c *simBase, long max_entries)
: m_simBase(simBase), m_max_entries(max_entries)
{
m_entries = new Entry[m_max_entries];
for (long i = 0; i < m_max_entries; ++i)
m_free_entries.push_back(m_entries + i);
m_head = new Entry;
m_tail = new Entry;
m_head->prev = NULL;
m_head->next = m_tail;
m_tail->next = NULL;
m_tail->prev = m_head;
}
~ReplacementUnit()
{
delete m_head;
delete m_tail;
delete[] m_entries;
}
void insert(Addr page_number);
void update(Addr page_number);
Addr getVictim();
private:
struct Entry
{
Addr page_number;
Entry *prev;
Entry *next;
};
void detach(Entry *node)
{
node->prev->next = node->next;
node->next->prev = node->prev;
}
void attach(Entry *node)
{
node->next = m_head->next;
node->prev = m_head;
m_head->next = node;
node->next->prev = node;
}
unordered_map<Addr, Entry *> m_table;
vector<Entry *> m_free_entries;
Entry *m_head;
Entry *m_tail;
Entry *m_entries;
long m_max_entries;
macsim_c* m_simBase;
};
public:
MMU() {}
~MMU() {}
void initialize(macsim_c *simBase);
void finalize();
void run_a_cycle(bool);
bool translate(uop_c *cur_uop);
void handle_page_faults();
private:
void do_page_table_walks(uop_c *cur_uop);
void begin_batch_processing();
bool do_batch_processing();
Addr get_page_number(Addr addr) { return addr >> m_offset_bits; }
Addr get_page_offset(Addr addr) { return addr & (m_page_size - 1); }
macsim_c* m_simBase;
Counter m_cycle;
Addr m_frame_to_allocate;
unordered_map<Addr, PageDescriptor> m_page_table;
long m_page_size;
long m_memory_size;
long m_offset_bits;
long m_free_frames_remaining;
vector<bool> m_free_frames;
unique_ptr<TLB> m_TLB;
unique_ptr<ReplacementUnit> m_replacement_unit;
long m_walk_latency;
long m_fault_latency;
long m_eviction_latency;
map<Counter, list<Addr>> m_walk_queue_cycle; // indexed by cycle
// e.g., cycle t - page A, B, C
unordered_map<Addr, list<uop_c *>> m_walk_queue_page; // indexed by page number
// e.g., page A - uop 1, 2
// e.g., page B - uop 3, 4, 5, 6
list<uop_c*> m_retry_queue;
list<uop_c*> m_fault_retry_queue;
long m_fault_buffer_size;
unordered_set<Addr> m_fault_buffer;
unordered_map<Addr, list<uop_c *>> m_fault_uops;
list<Addr> m_fault_buffer_processing;
unordered_map<Addr, list<uop_c *>> m_fault_uops_processing;
bool m_batch_processing;
bool m_batch_processing_first_transfer_started;
long m_batch_processing_overhead;
Counter m_batch_processing_start_cycle;
Counter m_batch_processing_transfer_start_cycle;
Counter m_batch_processing_next_event_cycle;
unordered_set<Addr> m_unique_pages;
};
#endif //MMU_H_INCLUDED
| [
"hyojong.kim@gatech.edu"
] | hyojong.kim@gatech.edu |
81acad9a3657acabcce4a6946926e34ef2a749a5 | cdf878b3ee164117b8d7024ba9c2b972e7c4e907 | /ServerStart/GameEngineBase/KDTREE.h | a7f7d659e5dcdbdece2b4436c1d8de68121bde22 | [] | no_license | woojun8/JWJ_Project | 667c4852efe7ccec33bcfaaa819cfe77c661949f | 3260c920f88baa1c1f25d4316d64c51fa9a01af3 | refs/heads/main | 2023-08-14T02:12:55.644268 | 2021-09-18T06:11:57 | 2021-09-18T06:11:57 | 407,757,752 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 4,711 | h | #pragma once
#include "GEMath.h"
#include <vector>
#include <algorithm>
#include <numeric> // 정수 특정한 알고리짐을 사용할수 있게 하는 확장 알고리즘
#include <exception> // 곧 알게 될겁니다.
// using KDTreeKey = float4;
template<typename KDTreeKey>
class KDTree
{
public:
// std::vector<KDNode> PoolNode = std::vector<KDNode>(10000);
private:
class KDNode
{
public:
//KDTreeKey
int idx;
// 0 왼쪽 자식
// 1 오른쪽 자식
KDNode* next[2];
int axis; // 차원 x[0] y[1] z[2]
public:
KDNode() : next{nullptr, nullptr}
{
}
};
int DIM;
KDNode* Root;
const std::vector<KDTreeKey>* PointVector;
public:
KDNode* BuildNodes(int* _ArrIndex, int _MaxSize, int _Depth)
{
if (_MaxSize <= 0)
{
return nullptr;
}
// 차원축 x y
const int axis = _Depth % DIM;
const int mid = (_MaxSize - 1)/ 2;
// _ArrIndex
// PointVector
// 이녀석의 크기에 따라서 _ArrIndex를 변경하려는
std::nth_element(_ArrIndex, _ArrIndex + mid, _ArrIndex + _MaxSize, [&](int _Left, int _Right)
{
return (*PointVector)[_Left][axis] < (*PointVector)[_Right][axis];
}
);
KDNode* Node = new KDNode();
Node->idx = _ArrIndex[mid];
Node->axis = axis;
// 0~ 49
Node->next[0] = BuildNodes(_ArrIndex, mid, _Depth + 1);
// 50~99
// 그중에서 다음 자기 부모를 정하는 녀석ㅇ비니다.
Node->next[1] = BuildNodes(_ArrIndex + mid + 1, _MaxSize - mid - 1, _Depth + 1);
return Node;
}
// 이미 여기서 원충돌을 해주는것
// kd트리의 궁극적인 의미는 1000 * 1000을
// 1 * 10 이런식으로 극단적으로 줄여줄수 있다는것이다.
float Distance(const KDTreeKey& _Left, const KDTreeKey& _Right)
{
float Dist = 0;
for (int i = 0; i < DIM; i++)
{
Dist += (_Left[i] - _Right[i]) * (_Left[i] - _Right[i]);
}
return sqrtf(Dist);
}
void RadiusSearchRecursive(const KDTreeKey& _Pivot, KDNode* _Node, std::vector<int>& _Result, float radius)
{
if (nullptr == _Node)
{
return;
}
const KDTreeKey& CheckKey = (*PointVector)[_Node->idx];
float Dis = Distance(_Pivot, CheckKey);
if (Dis < radius)
{
_Result.push_back(_Node->idx);
}
const int axis = _Node->axis;
const int Dir = _Pivot[axis] < CheckKey[axis] ? 0 : 1;
// 왼쪽일수도 있고 오른쪽일수도 있는것
RadiusSearchRecursive(_Pivot, _Node->next[Dir], _Result, radius);
//
const float OutRangeCheck = static_cast<float>(fabs((double)(_Pivot[axis] - CheckKey[axis])));
// 그 반대죠?
if (OutRangeCheck < radius)
{
RadiusSearchRecursive(_Pivot, _Node->next[!Dir], _Result, radius);
}
}
public:
std::vector<int> RadiusSearch(const KDTreeKey& _Pivot, float radius)
{
std::vector<int> indices;
RadiusSearchRecursive(_Pivot, Root, indices, radius);
return indices;
}
void Build(const std::vector<KDTreeKey>* _Points)
{
// 기존에 kd트리가 있었다고 하더라도 파괴하고 다시 만들기 시작합니다.
Clear();
if (nullptr == _Points)
{
return;
}
PointVector = _Points;
// 이러면 리사이즈죠?
std::vector<int> indices(_Points->size());
std::iota(std::begin(indices), std::end(indices), 0);
// 첫번째 포인터를 줍니다.
Root = BuildNodes(indices.data(), static_cast<int>(_Points->size()), 0);
//for (int i = 0; i < _Points->size(); i++)
//{
// indices[i] = i;
//}
}
void Clear()
{
ClearNode(Root);
// Clear
Root = nullptr;
PointVector = nullptr;
}
private:
void ClearNode(KDNode* _Node)
{
if (nullptr == _Node)
{
return;
}
ClearNode(_Node->next[0]);
ClearNode(_Node->next[1]);
delete _Node;
}
public:
KDTree(int _Dim = 2) : Root(nullptr), PointVector(nullptr), DIM(_Dim)
{}
// 포인터로 받도록 하겠습니다.
KDTree(const std::vector<KDTreeKey>* _PointVector, int _Dim = 2) : Root(nullptr), PointVector(nullptr), DIM(_Dim)
{
Build(_PointVector);
}
~KDTree()
{
Clear();
}
}; | [
"woojun2010@naver.com"
] | woojun2010@naver.com |
a037d8b67c6837081a9d360e742a8dcc1b22a9fb | 19dcd7fbcdb01d99c9c921a8a8401bfc8d2baf97 | /App/build-Juntos-Desktop_Qt_5_3_MinGW_32bit-Debug/ui_uitestunitaire.h | ab0b8e462a53c5d451bf622b434872e7b04d4e47 | [] | no_license | workspacerg/Juntos | 696dce5f188c1cdcad028d480a8dcb741e88e857 | 58328bad8da58d21b4090efae4e76b71c04efc92 | refs/heads/master | 2021-01-18T14:06:12.239724 | 2014-07-15T23:25:21 | 2014-07-15T23:25:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,455 | h | /********************************************************************************
** Form generated from reading UI file 'uitestunitaire.ui'
**
** Created by: Qt User Interface Compiler version 5.3.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_UITESTUNITAIRE_H
#define UI_UITESTUNITAIRE_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QDialog>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPlainTextEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QTableWidget>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_UiTestUnitaire
{
public:
QVBoxLayout *verticalLayout_6;
QHBoxLayout *horizontalLayout_7;
QSpacerItem *horizontalSpacer_7;
QLineEdit *lineEdit;
QSpacerItem *horizontalSpacer_8;
QHBoxLayout *horizontalLayout;
QSpacerItem *horizontalSpacer_2;
QCheckBox *ok;
QCheckBox *failed;
QSpacerItem *horizontalSpacer;
QTableWidget *tableWidgetTest;
QWidget *updBox;
QVBoxLayout *verticalLayout_4;
QHBoxLayout *horizontalLayout_6;
QVBoxLayout *verticalLayout_3;
QGridLayout *gridLayout;
QLineEdit *TitreLine_upd;
QLineEdit *pOutLine_upd;
QLabel *label_5;
QLabel *label_6;
QLineEdit *pInline_upd;
QLabel *label_7;
QCheckBox *valid;
QSpacerItem *verticalSpacer;
QPlainTextEdit *DescrTPL_upd;
QPushButton *save_test_upd;
QWidget *addBox;
QVBoxLayout *verticalLayout_5;
QHBoxLayout *horizontalLayout_5;
QVBoxLayout *verticalLayout_2;
QGridLayout *gridLayout_2;
QLabel *label_2;
QLineEdit *TitreLine;
QLabel *label_3;
QLineEdit *pInline;
QLabel *label_4;
QLineEdit *pOutLine;
QSpacerItem *verticalSpacer_2;
QHBoxLayout *horizontalLayout_4;
QPushButton *save_test;
QPlainTextEdit *DescrTPL;
QWidget *delBox;
QVBoxLayout *verticalLayout;
QLabel *label;
QHBoxLayout *horizontalLayout_3;
QSpacerItem *horizontalSpacer_5;
QLineEdit *delLine;
QPushButton *confirmDel;
QSpacerItem *horizontalSpacer_6;
QHBoxLayout *horizontalLayout_2;
QSpacerItem *horizontalSpacer_3;
QPushButton *addTest;
QPushButton *DelTest;
QSpacerItem *horizontalSpacer_4;
void setupUi(QDialog *UiTestUnitaire)
{
if (UiTestUnitaire->objectName().isEmpty())
UiTestUnitaire->setObjectName(QStringLiteral("UiTestUnitaire"));
UiTestUnitaire->resize(1125, 1070);
verticalLayout_6 = new QVBoxLayout(UiTestUnitaire);
verticalLayout_6->setObjectName(QStringLiteral("verticalLayout_6"));
horizontalLayout_7 = new QHBoxLayout();
horizontalLayout_7->setObjectName(QStringLiteral("horizontalLayout_7"));
horizontalSpacer_7 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_7->addItem(horizontalSpacer_7);
lineEdit = new QLineEdit(UiTestUnitaire);
lineEdit->setObjectName(QStringLiteral("lineEdit"));
lineEdit->setMinimumSize(QSize(500, 35));
lineEdit->setMaximumSize(QSize(500, 16777215));
horizontalLayout_7->addWidget(lineEdit);
horizontalSpacer_8 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_7->addItem(horizontalSpacer_8);
verticalLayout_6->addLayout(horizontalLayout_7);
horizontalLayout = new QHBoxLayout();
horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout->addItem(horizontalSpacer_2);
ok = new QCheckBox(UiTestUnitaire);
ok->setObjectName(QStringLiteral("ok"));
ok->setMinimumSize(QSize(25, 25));
QFont font;
font.setPointSize(13);
ok->setFont(font);
horizontalLayout->addWidget(ok);
failed = new QCheckBox(UiTestUnitaire);
failed->setObjectName(QStringLiteral("failed"));
failed->setMinimumSize(QSize(25, 25));
failed->setFont(font);
horizontalLayout->addWidget(failed);
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout->addItem(horizontalSpacer);
verticalLayout_6->addLayout(horizontalLayout);
tableWidgetTest = new QTableWidget(UiTestUnitaire);
tableWidgetTest->setObjectName(QStringLiteral("tableWidgetTest"));
tableWidgetTest->setEditTriggers(QAbstractItemView::NoEditTriggers);
tableWidgetTest->setAlternatingRowColors(true);
tableWidgetTest->setSelectionBehavior(QAbstractItemView::SelectRows);
tableWidgetTest->setShowGrid(false);
tableWidgetTest->setSortingEnabled(true);
verticalLayout_6->addWidget(tableWidgetTest);
updBox = new QWidget(UiTestUnitaire);
updBox->setObjectName(QStringLiteral("updBox"));
verticalLayout_4 = new QVBoxLayout(updBox);
verticalLayout_4->setObjectName(QStringLiteral("verticalLayout_4"));
horizontalLayout_6 = new QHBoxLayout();
horizontalLayout_6->setObjectName(QStringLiteral("horizontalLayout_6"));
verticalLayout_3 = new QVBoxLayout();
verticalLayout_3->setSpacing(0);
verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3"));
gridLayout = new QGridLayout();
gridLayout->setObjectName(QStringLiteral("gridLayout"));
gridLayout->setVerticalSpacing(8);
gridLayout->setContentsMargins(-1, -1, -1, 0);
TitreLine_upd = new QLineEdit(updBox);
TitreLine_upd->setObjectName(QStringLiteral("TitreLine_upd"));
TitreLine_upd->setMinimumSize(QSize(150, 30));
TitreLine_upd->setMaximumSize(QSize(150, 30));
gridLayout->addWidget(TitreLine_upd, 1, 1, 1, 1);
pOutLine_upd = new QLineEdit(updBox);
pOutLine_upd->setObjectName(QStringLiteral("pOutLine_upd"));
pOutLine_upd->setMinimumSize(QSize(150, 30));
pOutLine_upd->setMaximumSize(QSize(150, 30));
gridLayout->addWidget(pOutLine_upd, 3, 1, 1, 1);
label_5 = new QLabel(updBox);
label_5->setObjectName(QStringLiteral("label_5"));
label_5->setMinimumSize(QSize(170, 30));
label_5->setMaximumSize(QSize(170, 30));
label_5->setFont(font);
gridLayout->addWidget(label_5, 1, 0, 1, 1);
label_6 = new QLabel(updBox);
label_6->setObjectName(QStringLiteral("label_6"));
label_6->setMinimumSize(QSize(170, 30));
label_6->setMaximumSize(QSize(170, 30));
label_6->setFont(font);
gridLayout->addWidget(label_6, 2, 0, 1, 1);
pInline_upd = new QLineEdit(updBox);
pInline_upd->setObjectName(QStringLiteral("pInline_upd"));
pInline_upd->setMinimumSize(QSize(150, 30));
pInline_upd->setMaximumSize(QSize(150, 30));
gridLayout->addWidget(pInline_upd, 2, 1, 1, 1);
label_7 = new QLabel(updBox);
label_7->setObjectName(QStringLiteral("label_7"));
label_7->setMinimumSize(QSize(170, 30));
label_7->setMaximumSize(QSize(170, 30));
label_7->setFont(font);
gridLayout->addWidget(label_7, 3, 0, 1, 1);
valid = new QCheckBox(updBox);
valid->setObjectName(QStringLiteral("valid"));
QFont font1;
font1.setPointSize(15);
valid->setFont(font1);
gridLayout->addWidget(valid, 4, 0, 1, 1);
verticalLayout_3->addLayout(gridLayout);
verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
verticalLayout_3->addItem(verticalSpacer);
horizontalLayout_6->addLayout(verticalLayout_3);
DescrTPL_upd = new QPlainTextEdit(updBox);
DescrTPL_upd->setObjectName(QStringLiteral("DescrTPL_upd"));
DescrTPL_upd->setMinimumSize(QSize(0, 200));
DescrTPL_upd->setMaximumSize(QSize(16777215, 1000));
horizontalLayout_6->addWidget(DescrTPL_upd);
verticalLayout_4->addLayout(horizontalLayout_6);
save_test_upd = new QPushButton(updBox);
save_test_upd->setObjectName(QStringLiteral("save_test_upd"));
QIcon icon;
icon.addFile(QStringLiteral(":/new/MenuInterface/Ressouces/available_updates-512.png"), QSize(), QIcon::Normal, QIcon::Off);
save_test_upd->setIcon(icon);
save_test_upd->setIconSize(QSize(25, 25));
save_test_upd->setAutoDefault(false);
save_test_upd->setFlat(true);
verticalLayout_4->addWidget(save_test_upd);
verticalLayout_6->addWidget(updBox);
addBox = new QWidget(UiTestUnitaire);
addBox->setObjectName(QStringLiteral("addBox"));
verticalLayout_5 = new QVBoxLayout(addBox);
verticalLayout_5->setObjectName(QStringLiteral("verticalLayout_5"));
horizontalLayout_5 = new QHBoxLayout();
horizontalLayout_5->setObjectName(QStringLiteral("horizontalLayout_5"));
verticalLayout_2 = new QVBoxLayout();
verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2"));
verticalLayout_2->setSizeConstraint(QLayout::SetMaximumSize);
gridLayout_2 = new QGridLayout();
gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
label_2 = new QLabel(addBox);
label_2->setObjectName(QStringLiteral("label_2"));
label_2->setMinimumSize(QSize(170, 30));
label_2->setMaximumSize(QSize(170, 30));
label_2->setFont(font);
gridLayout_2->addWidget(label_2, 0, 0, 1, 1);
TitreLine = new QLineEdit(addBox);
TitreLine->setObjectName(QStringLiteral("TitreLine"));
TitreLine->setMinimumSize(QSize(150, 30));
TitreLine->setMaximumSize(QSize(150, 30));
gridLayout_2->addWidget(TitreLine, 0, 1, 1, 1);
label_3 = new QLabel(addBox);
label_3->setObjectName(QStringLiteral("label_3"));
label_3->setMinimumSize(QSize(170, 30));
label_3->setMaximumSize(QSize(170, 30));
label_3->setFont(font);
gridLayout_2->addWidget(label_3, 1, 0, 1, 1);
pInline = new QLineEdit(addBox);
pInline->setObjectName(QStringLiteral("pInline"));
pInline->setMinimumSize(QSize(150, 30));
pInline->setMaximumSize(QSize(150, 30));
gridLayout_2->addWidget(pInline, 1, 1, 1, 1);
label_4 = new QLabel(addBox);
label_4->setObjectName(QStringLiteral("label_4"));
label_4->setMinimumSize(QSize(170, 30));
label_4->setMaximumSize(QSize(170, 30));
label_4->setFont(font);
gridLayout_2->addWidget(label_4, 2, 0, 1, 1);
pOutLine = new QLineEdit(addBox);
pOutLine->setObjectName(QStringLiteral("pOutLine"));
pOutLine->setMinimumSize(QSize(150, 30));
pOutLine->setMaximumSize(QSize(150, 30));
gridLayout_2->addWidget(pOutLine, 2, 1, 1, 1);
verticalLayout_2->addLayout(gridLayout_2);
verticalSpacer_2 = new QSpacerItem(20, 18, QSizePolicy::Minimum, QSizePolicy::Expanding);
verticalLayout_2->addItem(verticalSpacer_2);
horizontalLayout_4 = new QHBoxLayout();
horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4"));
save_test = new QPushButton(addBox);
save_test->setObjectName(QStringLiteral("save_test"));
QIcon icon1;
icon1.addFile(QStringLiteral(":/new/MenuInterface/Ressouces/add_database-512.png"), QSize(), QIcon::Normal, QIcon::Off);
save_test->setIcon(icon1);
save_test->setIconSize(QSize(25, 25));
save_test->setAutoDefault(false);
save_test->setFlat(true);
horizontalLayout_4->addWidget(save_test);
verticalLayout_2->addLayout(horizontalLayout_4);
horizontalLayout_5->addLayout(verticalLayout_2);
DescrTPL = new QPlainTextEdit(addBox);
DescrTPL->setObjectName(QStringLiteral("DescrTPL"));
DescrTPL->setMinimumSize(QSize(0, 250));
DescrTPL->setMaximumSize(QSize(16777215, 1000));
horizontalLayout_5->addWidget(DescrTPL);
verticalLayout_5->addLayout(horizontalLayout_5);
verticalLayout_6->addWidget(addBox);
delBox = new QWidget(UiTestUnitaire);
delBox->setObjectName(QStringLiteral("delBox"));
verticalLayout = new QVBoxLayout(delBox);
verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
label = new QLabel(delBox);
label->setObjectName(QStringLiteral("label"));
label->setMinimumSize(QSize(0, 40));
QFont font2;
font2.setPointSize(12);
label->setFont(font2);
label->setAlignment(Qt::AlignCenter);
verticalLayout->addWidget(label);
horizontalLayout_3 = new QHBoxLayout();
horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3"));
horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_3->addItem(horizontalSpacer_5);
delLine = new QLineEdit(delBox);
delLine->setObjectName(QStringLiteral("delLine"));
delLine->setMinimumSize(QSize(300, 60));
delLine->setMaximumSize(QSize(300, 60));
delLine->setFont(font);
horizontalLayout_3->addWidget(delLine);
confirmDel = new QPushButton(delBox);
confirmDel->setObjectName(QStringLiteral("confirmDel"));
QIcon icon2;
icon2.addFile(QStringLiteral(":/new/MenuInterface/Ressouces/dnd-512.png"), QSize(), QIcon::Normal, QIcon::Off);
confirmDel->setIcon(icon2);
confirmDel->setIconSize(QSize(40, 40));
confirmDel->setFlat(true);
horizontalLayout_3->addWidget(confirmDel);
horizontalSpacer_6 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_3->addItem(horizontalSpacer_6);
verticalLayout->addLayout(horizontalLayout_3);
verticalLayout_6->addWidget(delBox);
horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_2->addItem(horizontalSpacer_3);
addTest = new QPushButton(UiTestUnitaire);
addTest->setObjectName(QStringLiteral("addTest"));
QIcon icon3;
icon3.addFile(QStringLiteral(":/new/MenuInterface/Ressouces/box-plus@2x.png"), QSize(), QIcon::Normal, QIcon::Off);
addTest->setIcon(icon3);
addTest->setIconSize(QSize(40, 40));
addTest->setFlat(true);
horizontalLayout_2->addWidget(addTest);
DelTest = new QPushButton(UiTestUnitaire);
DelTest->setObjectName(QStringLiteral("DelTest"));
QIcon icon4;
icon4.addFile(QStringLiteral(":/new/MenuInterface/Ressouces/box-minus@2x.png"), QSize(), QIcon::Normal, QIcon::Off);
DelTest->setIcon(icon4);
DelTest->setIconSize(QSize(40, 40));
DelTest->setFlat(true);
horizontalLayout_2->addWidget(DelTest);
horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_2->addItem(horizontalSpacer_4);
verticalLayout_6->addLayout(horizontalLayout_2);
retranslateUi(UiTestUnitaire);
QMetaObject::connectSlotsByName(UiTestUnitaire);
} // setupUi
void retranslateUi(QDialog *UiTestUnitaire)
{
UiTestUnitaire->setWindowTitle(QApplication::translate("UiTestUnitaire", "Dialog", 0));
lineEdit->setPlaceholderText(QApplication::translate("UiTestUnitaire", "Recherche ...", 0));
ok->setText(QApplication::translate("UiTestUnitaire", "Passed", 0));
failed->setText(QApplication::translate("UiTestUnitaire", "Failed", 0));
label_5->setText(QApplication::translate("UiTestUnitaire", "Titre : ", 0));
label_6->setText(QApplication::translate("UiTestUnitaire", "Param\303\250tre d'entr\303\251 :", 0));
label_7->setText(QApplication::translate("UiTestUnitaire", "Param\303\250tre de sortie :", 0));
valid->setText(QApplication::translate("UiTestUnitaire", "Valider", 0));
save_test_upd->setText(QString());
label_2->setText(QApplication::translate("UiTestUnitaire", "Titre : ", 0));
label_3->setText(QApplication::translate("UiTestUnitaire", "Param\303\250tre d'entr\303\251 :", 0));
label_4->setText(QApplication::translate("UiTestUnitaire", "Param\303\250tre de sortie :", 0));
save_test->setText(QString());
label->setText(QApplication::translate("UiTestUnitaire", "Pour supprimer la t\303\242ches, \303\251crivez SUPPRIMER ci-dessous.", 0));
confirmDel->setText(QString());
addTest->setText(QString());
DelTest->setText(QString());
} // retranslateUi
};
namespace Ui {
class UiTestUnitaire: public Ui_UiTestUnitaire {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_UITESTUNITAIRE_H
| [
"rayane.rahmani@hotmail.fr"
] | rayane.rahmani@hotmail.fr |
4022ea164d425c233400e0cba7cb2a7a419556a7 | 12459d4936cb4af2618e5ef91f2ec62118c158ba | /jni/recv-jni.cpp | 705a87c08d40aaaf658b2d06bf6abd394e01655b | [
"BSD-3-Clause"
] | permissive | mwojciechowski1990/ABL | b354e48803126a44cf3c630d87560123ac5a8a29 | dc99d60cf60bae974fb30252459c74bdb2c28993 | refs/heads/master | 2020-05-17T03:10:17.274063 | 2014-06-01T11:43:59 | 2014-06-01T11:43:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,908 | cpp | #include <string.h>
#include <jni.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
extern "C" {
JNIEXPORT jstring JNICALL
Java_com_ul_upnpbl_LightActivity_recvFromJNI
(JNIEnv *env, jobject obj, jstring jip)
{
const char *ip = env->GetStringUTFChars(jip, NULL) ;
struct sockaddr_in localSock;
struct ip_mreq group;
int sd;
int datalen;
int outPort = 0;
char databuf[1024] { 0 };
char ipStrArr[16] = { 0 };
char *ipStr = ipStrArr;
char resp[1050] = { 0 }; //all plus 2 ; as delimiters plus 8 for port
struct sockaddr_in remaddr; /* remote address */
if(ip == (const char *)0 ) {
return env->NewStringUTF("err");
}
socklen_t addrlen = sizeof(remaddr); /* length of addresses */
sd = socket(AF_INET, SOCK_DGRAM, 0);
if(sd < 0)
{
env->ReleaseStringUTFChars(jip, ip);
return env->NewStringUTF("err");
}
else
printf("Opening datagram socket....OK.\n");
/* Enable SO_REUSEADDR to allow multiple instances of this */
/* application to receive copies of the multicast datagrams. */
{
int reuse = 1;
if(setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(reuse)) < 0)
{
perror("Setting SO_REUSEADDR error");
close(sd);
env->ReleaseStringUTFChars(jip, ip);
return env->NewStringUTF("err");
}
else
printf("Setting SO_REUSEADDR...OK.\n");
}
/* Bind to the proper port number with the IP address */
/* specified as INADDR_ANY. */
memset((char *) &localSock, 0, sizeof(localSock));
localSock.sin_family = AF_INET;
localSock.sin_port = htons(1900);
localSock.sin_addr.s_addr = INADDR_ANY;
if(bind(sd, (struct sockaddr*)&localSock, sizeof(localSock)))
{
perror("Binding datagram socket error");
close(sd);
env->ReleaseStringUTFChars(jip, ip);
return env->NewStringUTF("err");
}
else
printf("Binding datagram socket...OK.\n");
group.imr_multiaddr.s_addr = inet_addr("239.255.255.250");
group.imr_interface.s_addr = inet_addr(ip);
env->ReleaseStringUTFChars(jip, ip);
if(setsockopt(sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&group, sizeof(group)) < 0)
{
perror("Adding multicast group error");
int err = errno;
close(sd);
return env->NewStringUTF("err");
}
else
printf("Adding multicast group...OK.\n");
/* Read from the socket. */
datalen = sizeof(databuf);
if(recvfrom(sd, databuf, datalen, 0, (struct sockaddr *)&remaddr, &addrlen) < 0)
{
perror("Reading datagram message error");
close(sd);
return env->NewStringUTF("err");
}
else
{
printf("Reading datagram message...OK.\n");
printf("The message from multicast server is: \"%s\"\n", databuf);
}
ipStr = inet_ntoa(remaddr.sin_addr);
outPort = ntohs(remaddr.sin_port);
sprintf(resp, "%s;%d;%s", ipStr, outPort, databuf);
return env->NewStringUTF((const char *) resp); //yes, yes I know it is c style cast :D
}
}
| [
"mwojciechowski1990@gmail.com"
] | mwojciechowski1990@gmail.com |
6a23262314777124af8988f9b34928ff9491d335 | a35b30a7c345a988e15d376a4ff5c389a6e8b23a | /boost/parameter/name.hpp | 4408d8b5a5662c9b134c4689b4259da3ebfd04d2 | [] | no_license | huahang/thirdparty | 55d4cc1c8a34eff1805ba90fcbe6b99eb59a7f0b | 07a5d64111a55dda631b7e8d34878ca5e5de05ab | refs/heads/master | 2021-01-15T14:29:26.968553 | 2014-02-06T07:35:22 | 2014-02-06T07:35:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 60 | hpp | #include "thirdparty/boost_1_55_0/boost/parameter/name.hpp"
| [
"liuhuahang@xiaomi.com"
] | liuhuahang@xiaomi.com |
90c69ffe39a6666f8975b22aaf7a33f132741e49 | 8380720af359c4f06c55cbe28434ea60870040aa | /main.cpp | 23891413113e9e75ab9b096092404a6d20a918d1 | [
"MIT"
] | permissive | jurplel/DataStruct | 9ba0f41d635f3a1b9e613adb10ee10e0c87abdb0 | d15eecb440f78718d27a0648b812678848d9d421 | refs/heads/master | 2023-01-23T05:16:52.807677 | 2020-12-09T18:07:15 | 2020-12-09T18:07:15 | 299,991,763 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,345 | cpp | #include "project.h"
#include "teamoptimizer.h"
#include "datamodel.h"
#include "treemodel.h"
#include "searchtree.h"
#include <iostream>
void display_main_menu()
{
std::string message = "Select a project:\n \
[1] Team Optimizer (game dev team)\n \
[2] Data Model (usb devices)\n \
[3] Tree Model (planets)\n \
[4] Search Trees (interstellar scenario/final)\n \
[e] Exit program\n";
std::vector<char> accepted_values = {'1', '2', '3', '4', 'e'};
bool exit = false;
while (!exit)
{
char input_char = wait_for_valid_char(message, accepted_values);
switch (input_char) {
case '1': {
TeamOptimizer team_optimizer;
team_optimizer.run();
break;
}
case '2': {
DataModel data_model;
data_model.run();
break;
}
case '3': {
TreeModel tree_model;
tree_model.run();
break;
}
case '4': {
SearchTree search_tree;
search_tree.run();
break;
}
case 'e': {
exit = true;
break;
}
}
}
}
int main()
{
display_main_menu();
}
| [
"jeep70cp@gmail.com"
] | jeep70cp@gmail.com |
a1bb143f3dc54aeec828dd2e43b1cee39e27aab9 | a50c2554a9c6ef68857cc8cbcb72aa694e9a9e00 | /CodeSupp/TabCtrlEx.cpp | 2fd5517cb853774daa670828fdcfd67f751d802f | [] | no_license | stratician/codewars | 7fad1907d58bebd8bb4bf799f2a59d4c125d558e | e270a3081c85c883194af3e9026023b5360e5575 | refs/heads/main | 2023-07-17T01:29:02.012632 | 2021-08-22T21:19:31 | 2021-08-22T21:19:31 | 394,363,349 | 0 | 0 | null | 2021-08-14T00:14:45 | 2021-08-09T16:25:51 | C++ | UTF-8 | C++ | false | false | 9,661 | cpp | // TabCtrlEx.cpp : implementation file
//
#include "Build.h"
#include "stdafx.h"
#include "GameApp.h"
#include "GameAppView.h"
#include "TabCtrlEx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTabCtrlEx
CTabCtrlEx::CTabCtrlEx()
{
m_pParent = NULL;
m_SelectedTabN = 0;
m_crSelected = 0;
m_crDisabled = 0;
m_crNormal = 0;
m_crMouseOver = 0;
m_crTab = 0;
m_crTabSelected = 0;
m_bColorSelected = FALSE;
m_bColorDisabled = FALSE;
m_bColorNormal = FALSE;
m_bColorMouseOver = FALSE;
m_bColorTab = FALSE;
m_bColorTabSelected = FALSE;
m_iIndexMouseOver = -1;
m_bMouseOver = FALSE;
m_bSetPaddingSize = FALSE;
m_padSize = CSize(0, 0);
m_tabTotalRect = CRect(0,0,0,0);
m_created = FALSE;
m_bSelChanged = FALSE;
}
CTabCtrlEx::~CTabCtrlEx()
{
}
void CTabCtrlEx::PassParent(CWnd *pParent)
{
m_pParent = pParent;
}
BEGIN_MESSAGE_MAP(CTabCtrlEx, CTabCtrl)
//{{AFX_MSG_MAP(CTabCtrlEx)
ON_WM_CREATE()
ON_WM_DESTROY()
ON_WM_ERASEBKGND()
ON_WM_MOVE()
//}}AFX_MSG_MAP
ON_NOTIFY_REFLECT(TCN_SELCHANGE, OnSelchange)
ON_NOTIFY_REFLECT(TCN_SELCHANGING, OnSelchanging)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTabCtrlEx message handlers
int CTabCtrlEx::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CTabCtrl::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
m_totalItems = 0;
m_totalColumns = 0;
m_maxItems = 0;
m_columnHeight = 0;
m_cornerPtTabs = CPoint(4, 28);
m_SelectedTabN = 0;
m_bSelChanged = FALSE;
if(m_bSetPaddingSize)
SetPadding(m_padSize);
//int tabs = GetItemCount()
//int m_rowCount = GetRowCount()
//CSize size = CSize(5, 5);
//SetPadding(size);
// override colours
//m_bColorNormal = TRUE;
//m_crNormal = RGB(0, 0, 0);
//m_bColorSelected = TRUE;
//m_crSelected = RGB(0, 0, 255);
SetCurSel(0); // always select first tab #0
//this->ModifyStyle(WS_BORDER, 0);
//this->ModifyStyle(WS_DLGFRAME|WS_EX_STATICEDGE|WS_THICKFRAME, WS_BORDER);
return 0;
}
void CTabCtrlEx::OnDestroy()
{
CTabCtrl::OnDestroy();
// TODO: Add your message handler code here
}
// Note: must call this function before Create(... is called - important! Otherwise will have no effect.
void CTabCtrlEx::SetPaddingSize(CSize padSize)
{
m_bSetPaddingSize = true;
m_padSize.cx = padSize.cx;
m_padSize.cy = padSize.cy;
}
void CTabCtrlEx::SetCornerPointTabs(CPoint pt)
{
m_cornerPtTabs.x = pt.x;
m_cornerPtTabs.y = pt.y;
}
void CTabCtrlEx::SetMouseOverColor(COLORREF cr)
{
m_bColorMouseOver = TRUE;
m_crMouseOver = cr;
}
void CTabCtrlEx::SetDisabledColor(COLORREF cr)
{
m_bColorDisabled = TRUE;
m_crDisabled = cr;
}
void CTabCtrlEx::SetSelectedColor(COLORREF cr)
{
m_bColorSelected = TRUE;
m_crSelected = cr;
}
void CTabCtrlEx::SetNormalColor(COLORREF cr)
{
m_bColorNormal = TRUE;
m_crNormal = cr;
}
void CTabCtrlEx::SetTabColor(COLORREF cr)
{
m_bColorTab = TRUE;
m_crTab = cr;
}
void CTabCtrlEx::SetTabSelectedColor(COLORREF cr)
{
m_bColorTabSelected = TRUE;
m_crTabSelected = cr;
}
void CTabCtrlEx::CreateItem(int n, LPTSTR lpszCaption, CWnd* pWnd)
{
TCITEM item;
item.mask = TCIF_TEXT|TCIF_PARAM|TCIF_IMAGE;
item.lParam = (LPARAM) pWnd;
item.pszText = lpszCaption;
item.iImage = n;
InsertItem(m_totalItems, &item);
pWnd->SetWindowPos(NULL, m_cornerPtTabs.x, m_cornerPtTabs.y , 0, 0,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOZORDER);
if(n == 0) pWnd->ShowWindow(SW_SHOW);
else pWnd->ShowWindow(SW_HIDE);
m_totalItems++;
}
void CTabCtrlEx::DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct )
{
CRect rect = lpDrawItemStruct->rcItem;
rect.top += ::GetSystemMetrics(SM_CYEDGE);
int nTabIndex = lpDrawItemStruct->itemID;
if (nTabIndex < 0) return;
BOOL bSelected = (nTabIndex == GetCurSel());
// *NEW - to make non-selected tabs same size as selected ones
if(!bSelected)
rect.InflateRect(4,4);
COLORREF crSelected = m_bColorSelected ? m_crSelected : GetSysColor(COLOR_BTNTEXT);
COLORREF crNormal = m_bColorNormal ? m_crNormal : GetSysColor(COLOR_BTNTEXT);
COLORREF crDisabled = m_bColorDisabled ? m_crDisabled : GetSysColor(COLOR_GRAYTEXT);
COLORREF crTab = m_bColorTab ? m_crTab : GetSysColor(COLOR_BTNFACE);
COLORREF crTabSelected = m_bColorTabSelected ? m_crTabSelected : GetSysColor(COLOR_BTNFACE);
char label[64];
TC_ITEM item;
item.mask = TCIF_TEXT|TCIF_IMAGE;
item.pszText = label;
item.cchTextMax = 63;
if (!GetItem(nTabIndex, &item))
return;
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
if (!pDC)
return;
int nSavedDC = pDC->SaveDC();
CRect rectItem;
POINT pt;
GetItemRect(nTabIndex, &rectItem);
GetCursorPos(&pt);
ScreenToClient(&pt);
if (rectItem.PtInRect(pt))
m_iIndexMouseOver = nTabIndex;
pDC->SetBkMode(TRANSPARENT);
// Tabs main rectangle area color
if (bSelected)
{
pDC->FillSolidRect(rect, crTabSelected);
/* CPen pen(PS_SOLID, 5, RGB(0,0,0));
CBrush brush(crTabSelected);//RGB(20,20,20));
CPen *oldPen = pDC->SelectObject(&pen);
CBrush *oldBrush = pDC->SelectObject(&brush);
pDC->Rectangle(rect);//( 0, 0, m_cx, 100+1);
pDC->SelectObject(oldPen);
pDC->SelectObject(oldBrush);*/
}
else
{
pDC->FillSolidRect(rect, crTab);
/* CPen pen(PS_SOLID, 5, RGB(0,0,0));
CBrush brush(crTabSelected);//RGB(20,20,20));
CPen *oldPen = pDC->SelectObject(&pen);
CBrush *oldBrush = pDC->SelectObject(&brush);
pDC->Rectangle(rect);//( 0, 0, m_cx, 100+1);
pDC->SelectObject(oldPen);
pDC->SelectObject(oldBrush);*/
}
//** Draw the image
CImageList* pImageList = GetImageList();
if (pImageList && item.iImage >= 0)
{
rect.left += pDC->GetTextExtent(_T(" ")).cx;
IMAGEINFO info;
pImageList->GetImageInfo(item.iImage, &info);
CRect ImageRect(info.rcImage);
int nYpos = rect.top;
pImageList->Draw(pDC, item.iImage, CPoint(rect.left, nYpos), ILD_TRANSPARENT);
rect.left += ImageRect.Width();
}
// check for invalid tab range
if(nTabIndex > m_totalItems || nTabIndex < 0)
{
pDC->SetTextColor(crDisabled);
rect.top -= ::GetSystemMetrics(SM_CYEDGE);
pDC->DrawText(label, rect, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
}
else
{
//** selected item -----
if (bSelected)
pDC->SetTextColor(crSelected);
else //** other item ---
{
//if (m_bColorMouseOver && nTabIndex == m_iIndexMouseOver)
//{
// pDC->SetTextColor(m_crMouseOver);
//}
//else
//{
pDC->SetTextColor(crNormal);
//}
}
rect.top -= ::GetSystemMetrics(SM_CYEDGE);
pDC->DrawText(label, rect, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
}
pDC->RestoreDC(nSavedDC);
}
void CTabCtrlEx::OnSelchange(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
int iNewTab = GetCurSel();
m_bSelChanged = TRUE;
// check for valid tab range
if(iNewTab > m_totalItems || iNewTab < 0)
{
SetCurSel(m_SelectedTabN);
}
else
{
TCITEM item;
CWnd* pWnd;
item.mask = TCIF_PARAM;
// hide current tab
GetItem(m_SelectedTabN, &item);
pWnd = reinterpret_cast<CWnd*> (item.lParam);
ASSERT_VALID(pWnd);
pWnd->ShowWindow(SW_HIDE);
// show selected tab
GetItem(iNewTab, &item);
pWnd = reinterpret_cast<CWnd*> (item.lParam);
ASSERT_VALID(pWnd);
pWnd->ShowWindow(SW_SHOW);
//m_pParent->UpdateWindow();
//m_pParent->ShowWindow(SW_SHOW);
m_pParent->Invalidate();
}
*pResult = 0;
}
void CTabCtrlEx::OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
m_SelectedTabN = GetCurSel();
*pResult = 0;
}
/*
void CTabCtrlEx::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
POINT pt;
GetCursorPos(&pt);
CRect rectItem, rectScreen;
GetItemRect(m_iIndexMouseOver, rectItem);
rectScreen = rectItem;
ClientToScreen(rectScreen);
// If mouse leaves, show normal
if (!rectScreen.PtInRect(pt))
{
KillTimer (1);
m_bMouseOver = false;
m_iIndexMouseOver = -1;
InvalidateRect(rectItem);
}
CTabCtrl::OnTimer(nIDEvent);
}
void CTabCtrlEx::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
//** if we should change the color of the tab ctrl ---
if (m_bColorMouseOver)
{
SetTimer(1,10,NULL);
if (m_iIndexMouseOver != -1)
{
CRect rectItem;
GetItemRect(m_iIndexMouseOver, rectItem);
if (!rectItem.PtInRect(point))
{
CRect rectOldItem;
GetItemRect(m_iIndexMouseOver, rectOldItem);
m_iIndexMouseOver = -1;
InvalidateRect(rectOldItem);
return;
}
}
if (!m_bMouseOver)
{
TCHITTESTINFO hitTest;
m_bMouseOver = true;
hitTest.pt = point;
int iItem = HitTest(&hitTest);
if (iItem != -1 && m_arrayStatusTab[iItem])
{
RECT rectItem;
GetItemRect(iItem, &rectItem);
InvalidateRect(&rectItem);
}
}
}
CTabCtrl::OnMouseMove(nFlags, point);
}
*/
BOOL CTabCtrlEx::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
return 0;
//return CTabCtrl::OnEraseBkgnd(pDC);
}
CRect CTabCtrlEx::GetTabTotalRect(void)
{
CRect tabRect;
CSize tabSize;
CRect tabTotalRect = CRect(0,0,0,0);
int tabCount = GetItemCount();
for(int n=0;n<tabCount;n++)
{
GetItemRect(n, &tabRect);
if(n==0) tabTotalRect = tabRect;
else
{
tabSize = tabRect.Size();
tabTotalRect.right += tabSize.cx;
}
}
m_tabTotalRect = tabTotalRect;
//tabSize = tabTotalRect.Size();
return tabTotalRect;
}
void CTabCtrlEx::OnMove(int x, int y)
{
CTabCtrl::OnMove(x, y);
}
| [
"brandon.phillips@gmail.com"
] | brandon.phillips@gmail.com |
2ffc06e8ff7cfac244ea440f6cfb62aeb2709da0 | 694f1063b4aefe932127e341e325395762e9cb7f | /Binary Search Tree Homework/BinarySearchTree.cpp | 4a13d47927b8aff308b3e397df6762519639aac9 | [] | no_license | canberkkeles/data_structures | 764dfefbd78a824781beb3aa3a44a630bed3e5f4 | 36a196bab65dba767365564d9f8a752cf522c44a | refs/heads/master | 2022-09-05T03:40:46.819765 | 2020-05-30T12:06:33 | 2020-05-30T12:06:33 | 268,071,167 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,763 | cpp | #include "BinarySearchTree.h"
#include <iostream>
/*
CONSTRUCT THE TREE
*/
template<class Object>
BinaryWordTree<Object>::BinaryWordTree(const Object & notFound):ITEM_NOT_FOUND(notFound),root(nullptr){}
/*
INTERNAL METHOD
RETURN TRANSLATION IF FOUND,
ELSE RETURN NOT_FOUND ITEM
*/
template<class Object>
const Object & BinaryWordTree<Object>::elementAt(treeNode<Object> * t) const{
return t == nullptr ? ITEM_NOT_FOUND : t->translation;
}
/*
RETURN THE TRANSLATION OF GIVEN WORD
*/
template<class Object>
const Object & BinaryWordTree<Object>::translate(const Object & word) const{
return elementAt(find(word,root));
}
/*
INTERNAL METHOD
FIND THE WORD
*/
template<class Object>
treeNode<Object> * BinaryWordTree<Object>::find(const Object & word,treeNode<Object> * t) const{
if(t == nullptr)return nullptr;
else if(word < t->word) return find(word,t->leftChild);
else if(word > t->word) return find(word,t->rightChild);
else return t;
}
/*
INSERT THE WORD AND ITS TRANSLATION INTO THE TREE
*/
template<class Object>
void BinaryWordTree<Object>::insert(const Object & word, const Object & translation){
insert(word,translation,root);
}
/*
INSERTS THE WORD AND TRANSLATION, HELPER METHOD
*/
template <class Object>
void BinaryWordTree<Object>::insert(const Object & word, const Object & translation, treeNode<Object> * & t){
if(t == nullptr) t = new treeNode<Object>(nullptr,nullptr,word,translation);
else if(word < t->word) insert(word,translation,t->leftChild);
else if(word > t->word) insert(word,translation,t->rightChild);
else addTranslation(word,translation,t);
}
/*
ADDS TRANSLATION
*/
template <class Object>
bool BinaryWordTree<Object>::addTranslation(const Object & word,const Object & translation,treeNode<Object> * t){
treeNode<Object> * wordNode = find(word,root);
if(wordNode != nullptr){
wordNode->translation = wordNode -> translation + ", " + translation;
return true;
}
return false;
}
/*
HELPER FOR DESTRUCTOR
*/
template <class Object>
void BinaryWordTree<Object>::makeEmpty(){
makeEmpty(root);
}
/*
HELPER FOR DESTRUCTOR
*/
template<class Object>
void BinaryWordTree<Object>::makeEmpty(treeNode<Object>* & t) const{
if(t != nullptr){
makeEmpty(t->leftChild);
makeEmpty(t->rightChild);
delete t;
}
t = nullptr;
}
/*
JUST FOR MY DEBUG PURPOSES
*/
template<class Object>
void BinaryWordTree<Object>::printTree() const{
if(root != nullptr){
printTree(root);
}
}
/*
DESTRUCTOR
*/
template<class Object>
BinaryWordTree<Object>::~BinaryWordTree(){
makeEmpty();
}
/*
JUST FOR MY DEBUG PURPOSES
*/
template <class Object>
void BinaryWordTree<Object>::printTree(treeNode<Object> * t) const{
if(t != nullptr){
printTree(t->leftChild);
std::cout << t -> word << std::endl;
printTree(t->rightChild);
}
}
| [
"cscanberkkeles@gmail.com"
] | cscanberkkeles@gmail.com |
0a227e0d33c8f2f5b12ae2a6498b9dcfc614f7c5 | 2f58f7f7834d6f16b0f22d77fc55042f5ede0b0f | /kglt/generic/any/utility.h | baeffa2d644fa401cdb5a6ef788e78dce3c75855 | [
"BSD-2-Clause"
] | permissive | Nuos/KGLT | 1da0c1e0a4ad49b3e2c5855bf0de8419366eb159 | b172ca304577a0a2df194757ad2ef328ddf3078d | refs/heads/master | 2021-01-12T13:28:04.918040 | 2016-09-27T20:21:52 | 2016-09-27T20:21:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,979 | h | #ifndef CORE_UTILITY_HPP
#define CORE_UTILITY_HPP
#include <functional>
#include <cstddef>
#include "type_traits.h"
namespace kglt {
inline namespace v1 {
namespace impl {
template <class T, T... I> struct integer_sequence {
static_assert(
::std::is_integral<T>::value,
"integer_sequence must use an integral type"
);
template <T N> using append = integer_sequence<T, I..., N>;
static constexpr ::std::size_t size () noexcept { return sizeof...(I); }
using next = append<size()>;
using type = T;
};
template <class T, T Index, ::std::size_t N>
struct sequence_generator {
static_assert(Index >= 0, "Index cannot be negative");
using type = typename sequence_generator<T, Index - 1, N - 1>::type::next;
};
template <class T, T Index>
struct sequence_generator<T, Index, 0ul> { using type = integer_sequence<T>; };
template < ::std::size_t Index, class T, class U, class... Types>
struct typelist_index {
using type = typename typelist_index<Index + 1, T, Types...>::type;
static constexpr ::std::size_t value = Index;
};
template < ::std::size_t Index, class T, class... Types>
struct typelist_index<Index, T, T, Types...> {
using type = typelist_index;
static constexpr ::std::size_t value = Index;
};
} /* namespace impl */
template <class T>
constexpr T&& forward (remove_reference_t<T>& t) noexcept {
return static_cast<T&&>(t);
}
template <class T>
constexpr T&& forward (remove_reference_t<T>&& t) noexcept {
return static_cast<T&&>(t);
}
template <class T>
constexpr auto move (T&& t) noexcept -> decltype(
static_cast<remove_reference_t<T>&&>(t)
) { return static_cast<remove_reference_t<T>&&>(t); }
template <class T, T... I>
using integer_sequence = impl::integer_sequence<T, I...>;
template < ::std::size_t... I>
using index_sequence = integer_sequence< ::std::size_t, I...>;
template <class T, T N>
using make_integer_sequence = typename impl::sequence_generator<T, N, N>::type;
template < ::std::size_t N>
using make_index_sequence = make_integer_sequence< ::std::size_t, N>;
template <class T, class... Ts>
using typelist_index = ::std::integral_constant<
::std::size_t,
impl::typelist_index<0ul, T, Ts...>::type::value
>;
/* N3761 (with some additions) */
template < ::std::size_t N, class T, class... Ts>
struct type_at { using type = typename type_at<N - 1, Ts...>::type; };
template <class T, class... Ts>
struct type_at<0ul, T, Ts...> { using type = T; };
template < ::std::size_t N, class... Ts>
using type_at_t = typename type_at<N, Ts...>::type;
template < ::std::size_t N, class T, class... Ts>
constexpr auto value_at (T&& value, Ts&&...) -> enable_if_t<
N == 0 and N < (sizeof...(Ts) + 1),
decltype(::kglt::forward<T>(value))
> { return ::kglt::forward<T>(value); }
template < ::std::size_t N, class T, class... Ts>
constexpr auto value_at (T&&, Ts&&... values) -> enable_if_t<
N != 0 and N < (sizeof...(Ts) + 1),
type_at_t<N, T, Ts...>
> { return value_at<N - 1, Ts...>(::kglt::forward<Ts>(values)...); }
template <class Callable>
struct scope_guard final {
static_assert(
::std::is_nothrow_move_constructible<Callable>::value,
"Given type must be nothrow move constructible"
);
explicit scope_guard (Callable callable) noexcept :
callable { ::kglt::move(callable) },
dismissed { false }
{ }
scope_guard (scope_guard const&) = delete;
scope_guard (scope_guard&&) = default;
scope_guard () = delete;
~scope_guard () noexcept { if (not this->dismissed) { callable(); } }
scope_guard& operator = (scope_guard const&) = delete;
scope_guard& operator = (scope_guard&&) = default;
void dismiss () noexcept { this->dismissed = true; }
private:
Callable callable;
bool dismissed;
};
template <class Callable>
auto make_scope_guard(Callable&& callable) -> scope_guard<decay_t<Callable>> {
return scope_guard<decay_t<Callable>> {
::kglt::forward<Callable>(callable)
};
}
}} /* namespace core::v1 */
#endif /* CORE_UTILITY_HPP */
| [
"kazade@gmail.com"
] | kazade@gmail.com |
b29ea61ce1f3ac3ebb81ff7a88aa00962c7f4af2 | f445059e4cb75456f69b1a5a0f25ee71c8d5e70f | /src/hmi/uimount.h | 7d1f50cf99658c3e7d0feab0fc024141b42c2679 | [] | no_license | reddomon/Bilye-Goto-Telescope-Mount | c715316683f9af2a349e5d2f44a3b15764637033 | 25d54b7e0bb8731ca1ef594196c8c06046d387d2 | refs/heads/master | 2023-06-08T00:15:25.322057 | 2023-06-01T09:54:21 | 2023-06-01T09:54:21 | 146,276,254 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,768 | h | // Uimount class.h
#pragma once
#include "arduino.h"
#include "config.h"
#include "Wire.h"
#include "../nextion/Nextion.h"
//#include "TimeLib.h"
class UImount
{
protected:
public:
void init();
void printerHalted();
void UIstart();
void Finished();
void Started();
//datareceive secreen setters
void dataReceivingStarted();
void dataReceivingFinished();
void setFan(char * inSpeed,int fan);
void setFanStatus(int fan,bool status);
void setWifiMode(char* wifimode);
void setIpName(char* ip);
void setStatusText(char * status);
void setWifiMode(int mode);
void setPage(int page);
int getPage();
void resetPageChanged();
bool pageChanged();
//page 2 observation
void setObservationPageVariables(const char* name,
const char* type,
const char* info,
const char* ra,
const char* dec,
const char* lha,
const char* gmt,
const char* lt,
const char*gmst,
const char* lmst);//,const char* lha,const char* mountStatus,const char * gmt,
//const char* lt,const char*gmst,const char* lmst);
//objectLHA.setText(lha);
//objectGMT.setText(gmt);
//objectLT.setText(lt);
//objectGMST.setText(gmst);
//objectLMST.setText(lmst);
void setPower(bool status);
void setCaseLight(bool status);
void setMessage(const char * inStr);
//void setTime(int year, int month, int day, int hour, int minute);
void setTime();
void setFilelist(String [],String [],int);
void setWifilist(String[],int);
private:
char _x[7], _y[7], _z[7];
char _et[4], _fan[4], _bt[4];
uint8_t _ba, _ea;
int _page = 0;
bool _pageChanged;
bool _caseLight, _power = 0;
bool _isPrinting = false;
bool _isHomed = false;
bool _startup = false;
//globals
//data receiving?
NexVariable datareceive= NexVariable(1,26,"datareceive");
NexNumber ext1status= NexNumber(5,16,"working.ext1");
NexNumber ext2status= NexNumber(5,27,"working.ext2");
NexNumber bedstatus = NexNumber(5,28,"working.bed");
NexNumber fan1status= NexNumber(5,29,"working.fan1");
NexNumber fan2status= NexNumber(5,30,"working.fan2");
NexPage pageError = NexPage(12,0,"error");
NexPage pageMain = NexPage(1,0,"mainpage");
NexPage pageFinished = NexPage(15,0,"finished");
NexPage pageDatareceive = NexPage(14,0,"datareceive");
NexPage pageWorking = NexPage(5,0,"working");
//page 0
//page 1
//ip and mode info (global can be read from any page)
NexText tMode = NexText(1, 6, "mainpage.modetext");
NexText tIp = NexText(1, 7, "mainpage.iptext");
//page 2 observation
NexText objectName = NexText(2,1,"name");
NexText objectType = NexText(2,2,"type");
NexText objectInfo = NexText(2,3,"info");
NexText objectRA = NexText(2,4,"ra");
NexText objectDEC = NexText(2,5,"dec");
NexText objectLHA = NexText(2,6,"lha");
NexText date = NexText(2,18,"date");
NexText objectGMT = NexText(2,7,"gmt");
NexText objectLT = NexText(2,8,"lt");
NexText objectGMST = NexText(2,9,"gmst");
NexText objectLMST = NexText(2,10,"lmst");
NexText mountLat = NexText(2,11,"lat");
NexText mountLon = NexText(2,12,"lon");
NexText mountAlt = NexText(2,13,"alt");
//status
NexText tracktype = NexText(2,20,"tracktype");
//lat, lon alt,
//page 3
//page 4 catalogs
NexText file1 = NexText(2, 2, "t1");
NexText file2 = NexText(2, 3, "t2");
NexText file3 = NexText(2, 4, "t3");
NexText file4 = NexText(2, 5, "t4");
NexText file5 = NexText(2, 6, "t5");
NexText file6 = NexText(2, 7, "t6");
NexText file7 = NexText(2, 8, "t7");
NexText file8 = NexText(2, 9, "t8");
NexText file9 = NexText(2, 10, "t9");
NexVariable maxFilePageCount = NexVariable(2, 32, "h0");
NexVariable shortfile1 = NexVariable(2, 18, "ts1");
NexVariable shortfile2 = NexVariable(2, 19, "ts2");
NexVariable shortfile3 = NexVariable(2, 20, "ts3");
NexVariable shortfile4 = NexVariable(2, 21, "ts4");
NexVariable shortfile5 = NexVariable(2, 22, "ts5");
NexVariable shortfile6 = NexVariable(2, 23, "ts6");
NexVariable shortfile7 = NexVariable(2, 24, "ts7");
NexVariable shortfile8 = NexVariable(2, 25, "ts8");
NexVariable shortfile9 = NexVariable(2, 26, "ts9");
//page 5
//page 6
//page 7 wifi
NexText wifiText0 = NexText(7, 17, "wifi0");
NexText wifiText1 = NexText(7, 18, "wifi1");
NexText wifiText2 = NexText(7, 19, "wifi2");
NexText wifiText3 = NexText(7, 20, "wifi3");
NexText wifiText4 = NexText(7, 21, "wifi4");
NexText wifiText5 = NexText(7, 22, "wifi5");
NexText wifiText6 = NexText(7, 23, "wifi6");
NexVariable maxWifiPageCount = NexVariable(7, 3, "wifipagecount");
//current status variable
NexText statusText = NexText(7,24,"status");
//wifi mode variable
NexVariable wifimode = NexVariable(7, 2, "wifimode");
//page 9 temperature
//temperature settings
NexNumber tExt1 = NexNumber(9,11,"tExt1");
NexNumber tExt2 = NexNumber(9,14,"tExt2");
NexNumber tBed = NexNumber(9,16,"tBed");
NexNumber fanSpeed1 = NexNumber(9,18,"fanSpeed1");
NexNumber fanSpeed2 = NexNumber(9,20,"fanSpeed2");
//page 12
//error page
//
//datareceive
NexDSButton btPower = NexDSButton(2, 5, "MainMenu.btPower");
NexDSButton btLight = NexDSButton(2, 6, "MainMenu.btLight");
NexPicture pPower = NexPicture(1, 29, "MainPage.pPower");
NexPicture pLight = NexPicture(1, 30, "MainPage.pLight");
NexVariable vaPower = NexVariable(2, 8, "MainMenu.vaPower");
NexVariable vaLight = NexVariable(2, 9, "MainMenu.vaLight");
NexPicture pHome = NexPicture(1, 35, "MainPage.pHome");
NexPicture pExtruding = NexPicture(1, 34, "MainPage.pExtruding");
NexTimer tmSS = NexTimer(1, 37, "tmSS");
NexVariable vaCounter = NexVariable(1, 38, "vaCounter");
NexVariable tTime = NexVariable(1, 39, "MainPage.tTime");
char ext[10];
int _minutes;
};
| [
"reddomon@gmail.com"
] | reddomon@gmail.com |
ea37475f7472dc1962ea16baf99f7c58159860d1 | 573a66e4f4753cc0f145de8d60340b4dd6206607 | /JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/362764/shogun-2.1.0/shogun-2.1.0/examples/undocumented/libshogun/classifier_conjugateindex.cpp | bfb51eef62fe4bb2080229e59bbeb0783fd7a5b2 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | mkaouer/Code-Smells-Detection-in-JavaScript | 3919ec0d445637a7f7c5f570c724082d42248e1b | 7130351703e19347884f95ce6d6ab1fb4f5cfbff | refs/heads/master | 2023-03-09T18:04:26.971934 | 2022-03-23T22:04:28 | 2022-03-23T22:04:28 | 73,915,037 | 8 | 3 | null | 2023-02-28T23:00:07 | 2016-11-16T11:47:44 | null | UTF-8 | C++ | false | false | 995 | cpp | #include <shogun/labels/MulticlassLabels.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/multiclass/ConjugateIndex.h>
#include <shogun/base/init.h>
#include <shogun/lib/common.h>
#include <shogun/io/SGIO.h>
using namespace shogun;
int main(int argc, char** argv)
{
init_shogun_with_defaults();
// create some data
SGMatrix<float64_t> matrix(2,3);
for (int32_t i=0; i<6; i++)
matrix.matrix[i]=i;
// create three 2-dimensional vectors
// shogun will now own the matrix created
CDenseFeatures<float64_t>* features= new CDenseFeatures<float64_t>(matrix);
// create three labels
CMulticlassLabels* labels=new CMulticlassLabels(3);
labels->set_label(0, 0);
labels->set_label(1, +1);
labels->set_label(2, 0);
CConjugateIndex* ci = new CConjugateIndex(features,labels);
ci->train();
// classify on training examples
for (int32_t i=0; i<3; i++)
SG_SPRINT("output[%d]=%f\n", i, ci->apply_one(i));
// free up memory
SG_UNREF(ci);
exit_shogun();
return 0;
}
| [
"mmkaouer@umich.edu"
] | mmkaouer@umich.edu |
0cfe5b2318060cdbd76c6fefd35299d8eac8454a | 31ac07ecd9225639bee0d08d00f037bd511e9552 | /externals/OCCTLib/inc/Handle_WNT_ClassDefinitionError.hxx | 660f0a1739cf91a2f97a1a5eb68de39c482200c8 | [] | no_license | litao1009/SimpleRoom | 4520e0034e4f90b81b922657b27f201842e68e8e | 287de738c10b86ff8f61b15e3b8afdfedbcb2211 | refs/heads/master | 2021-01-20T19:56:39.507899 | 2016-07-29T08:01:57 | 2016-07-29T08:01:57 | 64,462,604 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 846 | hxx | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _Handle_WNT_ClassDefinitionError_HeaderFile
#define _Handle_WNT_ClassDefinitionError_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_Standard_ConstructionError_HeaderFile
#include <Handle_Standard_ConstructionError.hxx>
#endif
class Standard_Transient;
class Handle(Standard_Type);
class Handle(Standard_ConstructionError);
class WNT_ClassDefinitionError;
DEFINE_STANDARD_HANDLE(WNT_ClassDefinitionError,Standard_ConstructionError)
#endif
| [
"litao1009@gmail.com"
] | litao1009@gmail.com |
c06e8606d828981b7ed07479f3bdee55089f2725 | 9a264fc1e8ea9a183107d5e5eebee79c6e1fb6c1 | /depth_localisation/src/localmap.cpp | de42d1e933a714de7ea91a4f89acdb0eef3e44f9 | [] | no_license | mfkiwl/DepthLocalisation | a6ddc7ab58674687f85a19a248a570e4b871a5e8 | 425d15e2c394103166d7002bc646a364d8744ce0 | refs/heads/master | 2023-03-19T02:39:20.701364 | 2020-05-13T10:12:39 | 2020-05-13T10:12:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,827 | cpp | #include <iostream>
#include "ros/ros.h"
#include "sensor_msgs/PointCloud2.h"
#include <pcl/io/pcd_io.h>
#include <pcl_conversions/pcl_conversions.h>
#include <bits/stdc++.h>
#include <pcl/point_types.h>
#include <pcl/registration/icp.h>
#include <pcl/console/parse.h>
#include <pcl/common/transforms.h>
#include <pcl/PCLPointCloud2.h>
#include <pcl/conversions.h>
#include <pcl_ros/transforms.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/point_cloud.h>
#include <pcl/octree/octree_search.h>
#define resolution 2.0f
using namespace std;
pcl::octree::OctreePointCloudSearch<pcl::PointXYZ> octree(resolution);
float dist(pcl::PointXYZ a, pcl::PointXYZ b)
{
return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) + (a.z - b.z) * (a.z - b.z);
}
int i = 0;
pcl::PointCloud<pcl::PointXYZ>::Ptr globalmap(new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZ>::Ptr localmap(new pcl::PointCloud<pcl::PointXYZ>);
pcl::PCLPointCloud2 in_cloud;
// void pc2_to_pcl(const boost::shared_ptr<const sensor_msgs::PointCloud2> &input)
// {
// pcl_conversions::toPCL(*input, in_cloud);
// pcl::fromPCLPointCloud2(in_cloud, *globalmap);
// }
void extract_local_map(float X, float Y, float Z, float radius)
{
pcl::PointXYZ searchPoint;
searchPoint.x = X;
searchPoint.y = Y;
searchPoint.z = Z;
std::vector<int> pointIdxRadiusSearch;
std::vector<float> pointRadiusSquaredDistance;
// std::cout << "Neighbors within radius search at (" << searchPoint.x
// << " " << searchPoint.y
// << " " << searchPoint.z
// << ") with radius=" << radius << std::endl;
if (octree.radiusSearch(searchPoint, radius, pointIdxRadiusSearch, pointRadiusSquaredDistance) > 0)
{
// Generate pointcloud data
localmap->width = pointIdxRadiusSearch.size();
localmap->height = 1;
localmap->points.resize (localmap->width * localmap->height);
for (std::size_t i = 0; i < pointIdxRadiusSearch.size(); ++i)
{
localmap->points[i] = globalmap->points[pointIdxRadiusSearch[i]];
}
}
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "edge_pub");
// ros::package::getPath('PKG_NAME')
pcl::io::loadPCDFile<pcl::PointXYZ> ("/media/shreyanshdarshan/New Volume/vision/PCL/XYZ2PCD/build/pepsi_down.pcd", *globalmap);
ros::NodeHandle n;
// ros::Subscriber sub = n.subscribe("/velodyne_points", 1000, pc2_to_pcl);
ros::Publisher map_pub = n.advertise<sensor_msgs::PointCloud2>("/local_map", 1000);
sensor_msgs::PointCloud2 localmap_msg;
octree.setInputCloud(globalmap);
octree.addPointsFromInputCloud();
float x=0, y=0, z=0;
while (ros::ok())
{
x+=0.01;
extract_local_map (x, y, z, 20);
pcl::toROSMsg(*localmap.get(), localmap_msg);
localmap_msg.header.frame_id = "odom";
map_pub.publish(localmap_msg);
//cout<<object_msg;
ros::spinOnce();
// break;
}
return 0;
} | [
"shreyanshdarshan1@gmail.com"
] | shreyanshdarshan1@gmail.com |
c080b2e6906835a231c09fa412e12b2ff48451a0 | f0b7bcc41298354b471a72a7eeafe349aa8655bf | /codebase/apps/Radx/src/RadxCov2Mom/Args.cc | 71dd9d3259aeba5aa47f8da16f93aec7169cba4d | [
"BSD-3-Clause"
] | permissive | NCAR/lrose-core | 23abeb4e4f1b287725dc659fb566a293aba70069 | be0d059240ca442883ae2993b6aa112011755688 | refs/heads/master | 2023-09-01T04:01:36.030960 | 2023-08-25T00:41:16 | 2023-08-25T00:41:16 | 51,408,988 | 90 | 53 | NOASSERTION | 2023-08-18T21:59:40 | 2016-02-09T23:36:25 | C++ | UTF-8 | C++ | false | false | 6,312 | cc | // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
// ** Copyright UCAR (c) 1990 - 2016
// ** University Corporation for Atmospheric Research (UCAR)
// ** National Center for Atmospheric Research (NCAR)
// ** Boulder, Colorado, USA
// ** BSD licence applies - redistribution and use in source and binary
// ** forms, with or without modification, are permitted provided that
// ** the following conditions are met:
// ** 1) If the software is modified to produce derivative works,
// ** such modified software should be clearly marked, so as not
// ** to confuse it with the version available from UCAR.
// ** 2) Redistributions of source code must retain the above copyright
// ** notice, this list of conditions and the following disclaimer.
// ** 3) Redistributions in binary form must reproduce the above copyright
// ** notice, this list of conditions and the following disclaimer in the
// ** documentation and/or other materials provided with the distribution.
// ** 4) Neither the name of UCAR nor the names of its contributors,
// ** if any, may be used to endorse or promote products derived from
// ** this software without specific prior written permission.
// ** DISCLAIMER: THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS
// ** OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
// ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
//////////////////////////////////////////////////////////
// Args.cc : command line args
//
// Mike Dixon, RAP, NCAR, P.O.Box 3000, Boulder, CO, 80307-3000, USA
//
// July 2011
//
//////////////////////////////////////////////////////////
#include "Args.hh"
#include "Params.hh"
#include <string>
#include <iostream>
#include <Radx/RadxTime.hh>
using namespace std;
// Constructor
Args::Args ()
{
TDRP_init_override(&override);
startTime = 0;
endTime = 0;
}
// Destructor
Args::~Args ()
{
TDRP_free_override(&override);
}
// parse the command line
//
// returns 0 on success, -1 on failure
int Args::parse (int argc, char **argv, string &prog_name)
{
_progName = prog_name;
char tmp_str[BUFSIZ];
bool OK = true;
// loop through args
for (int i = 1; i < argc; i++) {
if (!strcmp(argv[i], "--") ||
!strcmp(argv[i], "-h") ||
!strcmp(argv[i], "-help") ||
!strcmp(argv[i], "-man")) {
_usage(cout);
exit (0);
} else if (!strcmp(argv[i], "-d") ||
!strcmp(argv[i], "-debug")) {
sprintf(tmp_str, "debug = DEBUG_NORM;");
TDRP_add_override(&override, tmp_str);
} else if (!strcmp(argv[i], "-v") ||
!strcmp(argv[i], "-verbose")) {
sprintf(tmp_str, "debug = DEBUG_VERBOSE;");
TDRP_add_override(&override, tmp_str);
} else if (!strcmp(argv[i], "-vv") ||
!strcmp(argv[i], "-extra")) {
sprintf(tmp_str, "debug = DEBUG_EXTRA;");
TDRP_add_override(&override, tmp_str);
} else if (!strcmp(argv[i], "-instance")) {
if (i < argc - 1) {
sprintf(tmp_str, "instance = %s;", argv[i+1]);
TDRP_add_override(&override, tmp_str);
}
} else if (!strcmp(argv[i], "-start")) {
if (i < argc - 1) {
startTime = RadxTime::parseDateTime(argv[++i]);
if (startTime == RadxTime::NEVER) {
OK = false;
} else {
sprintf(tmp_str, "mode = ARCHIVE;");
TDRP_add_override(&override, tmp_str);
}
} else {
OK = false;
}
} else if (!strcmp(argv[i], "-end")) {
if (i < argc - 1) {
endTime = RadxTime::parseDateTime(argv[++i]);
if (endTime == RadxTime::NEVER) {
OK = false;
} else {
sprintf(tmp_str, "mode = ARCHIVE;");
TDRP_add_override(&override, tmp_str);
}
} else {
OK = false;
}
} else if (!strcmp(argv[i], "-path") || !strcmp(argv[i], "-f")) {
if (i < argc - 1) {
// load up file list vector. Break at next arg which
// start with -
for (int j = i + 1; j < argc; j++) {
if (argv[j][0] == '-') {
break;
} else {
inputFileList.push_back(argv[j]);
}
}
sprintf(tmp_str, "mode = FILELIST;");
TDRP_add_override(&override, tmp_str);
} else {
OK = false;
}
} else if (!strcmp(argv[i], "-outdir")) {
if (i < argc - 1) {
sprintf(tmp_str, "output_dir = \"%s\";", argv[++i]);
TDRP_add_override(&override, tmp_str);
} else {
OK = false;
}
} else if (!strcmp(argv[i], "-outname")) {
if (i < argc - 1) {
sprintf(tmp_str, "output_filename = \"%s\";", argv[++i]);
TDRP_add_override(&override, tmp_str);
sprintf(tmp_str, "output_filename_mode = SPECIFY_FILE_NAME;");
TDRP_add_override(&override, tmp_str);
} else {
OK = false;
}
}
} // i
// set fields if specified
if (!OK) {
_usage(cerr);
return -1;
}
return 0;
}
void Args::_usage(ostream &out)
{
out << "Usage: " << _progName << " [args as below]\n"
<< "Options:\n"
<< "\n"
<< " [ -h ] produce this list.\n"
<< "\n"
<< " [ -d, -debug ] print debug messages\n"
<< "\n"
<< " [ -end \"yyyy mm dd hh mm ss\"] end time\n"
<< " Sets mode to ARCHIVE\n"
<< "\n"
<< " [ -f, -paths ? ] set file paths\n"
<< " Sets mode to FILELIST\n"
<< "\n"
<< " [ -instance ?] specify the instance\n"
<< "\n"
<< " [ -outdir ? ] set output directory\n"
<< "\n"
<< " [ -outname ? ] specify output file name\n"
<< " file of this name will be written to outdir\n"
<< "\n"
<< " [ -start \"yyyy mm dd hh mm ss\"] start time\n"
<< " Sets mode to ARCHIVE\n"
<< "\n"
<< " [ -v, -verbose ] print verbose debug messages\n"
<< "\n"
<< " [ -vv, -extra ] print extra verbose debug messages\n"
<< "\n"
<< endl;
Params::usage(out);
}
| [
"dixon@ucar.edu"
] | dixon@ucar.edu |
55b8fc7e6f624a73810913a3c1efecdd8d99a7f2 | 76f56e2dbb4afcc673cb5d79d90d27d1c062a81f | /OOP3200-F2020-Lesson3c/GameObject.cpp | ad6888df7c7759e5934d8b9f61677b4bf3a0cb58 | [] | no_license | MuzhdaEhsan/OOP3200-F2020-ICE6 | f83474f5cea93cf17736b81fc9f93c4be8dcbb5a | 545261a152d30449fb03336cacee9e002ac96cee | refs/heads/master | 2023-01-01T06:18:13.202908 | 2020-10-21T20:00:34 | 2020-10-21T20:00:34 | 306,064,438 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,218 | cpp | /*
Name: Muzhda Ehsan
Program Name: ICE6
Date: 21-Oct-2020
*/
#include "GameObject.h"
#include <utility>
GameObject::GameObject(): m_id(0), m_name("not set"), m_position(Vector2D<float>())
{
}
GameObject::GameObject(const int id, const float x, const float y)
{
SetID(id);
SetName("not set");
SetPosition(x, y);
}
GameObject::GameObject(const int id, const Vector2D<float>& position)
{
SetID(id);
SetName("not set");
SetPosition(position);
}
GameObject::GameObject(std::string name, int id, const Vector2D<float>& position)
{
SetID(id);
SetName(name);
SetPosition(position);
}
GameObject::GameObject(const std::string& name, const int id, const float x, const float y)
{
SetID(id);
SetName(name);
SetPosition(x, y);
}
/*GameObject::GameObject(const std::string& name, int id, const Vector2D<float>& position)
{
}
GameObject::GameObject(std::string name, const int id, const float x, const float y)
:m_id(id), m_name(std::move(name)), m_position(Vector2D<float>(x,y))
{
}*/
GameObject::~GameObject()
= default;
GameObject::GameObject(const GameObject& other_object)
{
SetID(other_object.m_id);
SetPosition(other_object.m_position);
}
GameObject& GameObject::operator=(const GameObject& other_object)
{
SetID(other_object.m_id);
SetPosition(other_object.m_position);
return (*this);
}
Vector2D<float> GameObject::GetPosition() const
{
return m_position;
}
int GameObject::GetID() const
{
return m_id;
}
std::string GameObject::GetName() const
{
return m_name;
}
void GameObject::SetID(const int id)
{
m_id = id;
}
void GameObject::SetName(const std::string& name)
{
m_name = name;
}
void GameObject::SetPosition(const float x, const float y)
{
m_position.Set(x, y);
}
void GameObject::SetPosition(const Vector2D<float>& new_position)
{
m_position = new_position;
}
std::string GameObject::ToString() const
{
std::string output_string;
output_string += "ID : " + std::to_string(GetID()) + "\n";
output_string += "Name : " + GetName() + "\n";
output_string += "Position : " + GetPosition().ToString() + "\n";
return output_string;
}
std::string GameObject::ToFile() const
{
return std::to_string(GetID()) + " " + GetName() + " " + GetPosition().ToString();
}
| [
"muzhda.ehsan@outlook.com"
] | muzhda.ehsan@outlook.com |
518a1e8c2a88bc36795c99b4839ff347c17317dc | bcf10cabb18f3530d0f460418afb16534ea04472 | /Model.hpp | 52e9016551005368773c6906c00a745a52cc61ba | [
"MIT"
] | permissive | raven91/self_replicating_colloidal_clusters_movie | 7c0438e454dae2d649f04cf9d1f3b3334c96242b | 15bcf178cda945eec5786e7002e21a122489117f | refs/heads/master | 2023-03-19T21:44:17.128945 | 2021-03-22T16:48:49 | 2021-03-22T16:48:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,609 | hpp | //
// Created by Nikita Kruk on 01.03.20.
//
#ifndef SELFREPLICATINGCOLLOIDALCLUSTERSMOVIE_MODEL_HPP
#define SELFREPLICATINGCOLLOIDALCLUSTERSMOVIE_MODEL_HPP
#include "Definitions.hpp"
#include <vector>
#include <fstream>
#include <unordered_map>
#include <string>
#include <map>
const int kNumberOfPeriodicColloidSubtypes = 2;
enum class ParticleSubtype
{
// the same as in dissipative particle dynamics (DPD) simulations
kB = 0, kC,
kA, kBStar, kCStar,
kAPrime, kBPrime, kCPrime, kBStarPrime, kCStarPrime,
k0
};
const std::map<ParticleSubtype, ParticleSubtype> kComplementarySubtype =
{
{ParticleSubtype::kA, ParticleSubtype::kAPrime},
{ParticleSubtype::kB, ParticleSubtype::kBPrime},
{ParticleSubtype::kC, ParticleSubtype::kCPrime},
{ParticleSubtype::kBStar, ParticleSubtype::kBStarPrime},
{ParticleSubtype::kCStar, ParticleSubtype::kCStarPrime},
{ParticleSubtype::kAPrime, ParticleSubtype::kA},
{ParticleSubtype::kBPrime, ParticleSubtype::kB},
{ParticleSubtype::kCPrime, ParticleSubtype::kC},
{ParticleSubtype::kBStarPrime, ParticleSubtype::kBStar},
{ParticleSubtype::kCStarPrime, ParticleSubtype::kCStar}
};
class Model
{
public:
Model();
~Model();
void ReadNewState(Real &t);
void SkipTimeUnits(int t, Real delta_t);
std::vector<Real> &GetColloidalParticles();
const std::vector<Real> &GetSolventParticles();
std::vector<int> &GetColloidalParticleSubtypes();
void SetColloidalParticleSubtype(int index, ParticleSubtype subtype);
int GetNumberOfColloidalParticles() const;
int GetNumberOfSolventParticles() const;
int GetNumberOfAllParticles() const;
int GetNumberOfStateVariables() const;
Real GetColloidDiameter() const;
Real GetSolventDiameter() const;
Real GetXSize() const;
void SetXSize(Real x_size);
Real GetYSize() const;
void SetYSize(Real y_size);
Real GetZSize() const;
void SetZSize(Real z_size);
void ApplyPeriodicBoundaryConditions(Real box_size);
void AddNewColloidalParticle(Real x, Real y, Real z, int subtype);
ParticleSubtype GetNewPeriodicSubtype();
int new_periodic_subtype_;
private:
std::unordered_map<std::string, Real> parameters_dictionary_;
int number_of_state_variables_;
std::vector<Real> colloidal_particles_;
std::vector<Real> solvent_particles_;
std::vector<int> colloidal_particle_subtypes_;
std::ifstream data_file_for_colloidal_particles_;
std::ifstream data_file_for_solvent_particles_;
std::ifstream file_with_particle_subtypes_;
};
#endif //SELFREPLICATINGCOLLOIDALCLUSTERSMOVIE_MODEL_HPP
| [
"kruk.nikita@gmail.com"
] | kruk.nikita@gmail.com |
f0f4cca3745424de495e55a36f07a964624acaab | 03429cdeba6002028e60d12e49620678364a0599 | /Src/Library/NetConnection.h | cf1572d0a507297b928abb93c6fb2d76b9c98040 | [] | no_license | zhangf911/mir_server | d5b29a38406b9049179ccbc6e5fda629b3cd2498 | 35167d0dee453f1b31c20f66dd41ef08b7e28f4f | refs/heads/master | 2021-01-10T01:44:45.771574 | 2015-08-12T11:33:00 | 2015-08-12T11:33:00 | 36,706,465 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,590 | h | #ifndef LIBRARY_NETCONNECTION_H
#define LIBRARY_NETCONNECTION_H
#include "Type.h"
#include "NetPacket.h"
class NetServer;
//#include <memory>
//using std::shared_ptr;
#include <boost/shared_ptr.hpp>
using boost::shared_ptr;
#include <boost/asio.hpp>
#include <boost/aligned_storage.hpp>
#include <boost/system/error_code.hpp>
#include <boost/enable_shared_from_this.hpp>
using boost::enable_shared_from_this;
#include <mutex>
class NetConnection : public boost::enable_shared_from_this<NetConnection>
{
public:
typedef deque<SendPacket> SendPacketDeque;
typedef deque<ReceivedPacket> ReceivedPacketDeque;
typedef boost::shared_ptr<boost::asio::ip::tcp::socket> SocketPtr;
public:
NetConnection(NetServer& INnetServer, SocketPtr INpSocket, UInt32 INconnectionID);
~NetConnection();
public:
// �ͻ���IP
const char* GetIP();
public:
// �����������
void Start();
// ����
void Update();
// �ر���������
void Stop();
//�����Ͽ�����
void Close();
// ��ȡ������Ϣ����
void GetReceivedPacketDeque(ReceivedPacketDeque& OUTpacketDeque);
// ������Ϣ
void Send(SendPacket& INsendPacket);
public:
// ��ȡ����ȡ���������
UInt32 GetReceivedPacketCount(){return m_receivePacketCount;}
// ��ȡ����ID
UInt32 GetConnectionID(){return m_connectionID;};
private:
// �����ͷ��ȡ
void DoReadPacketHead();
// ��������ȡ
void DoReadPacketBody();
// ����������Ϣ
void DoWrite();
// ��ͷ��ȡ��ɴ���
void OnReadPacketHeaderComplete(boost::system::error_code ec);
// �����ȡ��ɴ���
void OnReadPacketBodyComplete(boost::system::error_code ec);
private:
// ���ӱ��
UInt32 m_connectionID;
// ����
SocketPtr m_socket;
// ���հ�
ReceivedPacket m_receivePacket;
// ���մ��
ReceivedPacket m_receiveBigPacket;
// ������Ϣ������
ReceivedPacketDeque m_receivedPacketDeque;
// ������Ϣ��������
std::mutex m_receiveDequeMutex;
// ���Ͱ�����
SendPacketDeque m_sendPacketDeque;
// ���Ͷ��л�����
std::mutex m_sendDequeMutex;
// ������
NetServer& m_netServer;
// ���ջ���
// boost::aligned_storage<1024 * 4> m_receiveBuffer;
// �������ݶ�ȡλ��
UInt32 m_receivePacketCount;
};
typedef boost::shared_ptr<NetConnection> NetConnectionPtr;
#endif | [
"zhangf911@gmail.com"
] | zhangf911@gmail.com |
4e7e84c1d58695517f5afd8cd528a47fd59cd8ed | 5622e71e5bfb3f448bdd579cdc5779c6f112a01f | /MarioOzawa/MenuSence.cpp | bc2e4694222339bf3d1eea0fa5942eb2e6fa75a5 | [] | no_license | nionguyen/Mario-Ozawa-Game | d029c9d4f8572af508b0e3b83e3a107e52d4d82f | a121d6c63f6b26d47394b732a56716ac389e65b6 | refs/heads/master | 2021-01-06T20:45:23.883630 | 2015-01-23T10:46:38 | 2015-01-23T10:46:38 | 28,554,629 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,993 | cpp | #include "MenuSence.h"
#include "PlaySence.h"
#include "OptionSence.h"
#include "SoundManager.h"
#include "ZoomSence.h"
#include "SelectWorldSence.h"
int MenuSence::_curSelect = 0;
MenuSence::MenuSence(Game* game, int timeAni)
:GameSence(game, timeAni)
{
//_curSelect = 0;
}
MenuSence::~MenuSence(void)
{
}
void MenuSence::_Load()
{
GLKeyBoard->Acquire();
_sprMarioHead = new Sprite(ResourceMng::GetInst()->GetTexture("image/imgMarioHead.png"), 1500);
}
// nhan 1 lan
void MenuSence::_OnKeyDown(int keyCode){
// control game //////////////////////////////////////////////////////////////////////////////////////////////////
switch(keyCode){
case DIK_RETURN:
if(_curSelect == 0){ //play
//stop sound
//SoundManager::GetInst()->StopBgSound(SOUND_B_MENU);
//SoundManager::GetInst()->PlayEffSound(SOUND_E_PIPE);
//goto game
//PlaySence* pl = new PlaySence(_game, 0);
//_state = TransOff;
SelectWorldSence* pl = new SelectWorldSence(_game, 0);
ZoomSence* zs = new ZoomSence(_game, 500, this, pl);
_game->AddSence(pl);
this->_state = TransOff;
}else if(_curSelect == 1){ //option
//do not stop sound
SoundManager::GetInst()->PlayEffSound(SOUND_E_SLIDE);
//goto option
OptionSence* ot= new OptionSence(_game, 100);
_game->AddSence(ot);
_state = TransOff;
}else if(_curSelect == 2){ //exit
SoundManager::GetInst()->PlayEffSound(SOUND_E_DEATH);
ZoomSence* zs = new ZoomSence(_game, 1700, this, NULL);
_game->AddSence(zs);
}
break;
case DIK_UP:
if(_curSelect > 0){
_curSelect--;
SoundManager::GetInst()->PlayEffSound(SOUND_E_CLICK);
}
break;
case DIK_DOWN:
if(_curSelect < MAX_MENU - 1){
_curSelect++;
SoundManager::GetInst()->PlayEffSound(SOUND_E_CLICK);
}
break;
}
}
void MenuSence::_OnKeyUp(int keyCode)
{
}
// nhan va giu
void MenuSence::_ProcessInput()
{
}
void MenuSence::_UpdateRender(int t)
{
//--------------------------------------------UPDATE------------------------------
if(_sprMarioHead->_index == 1 && _sprMarioHead->_timeLocal >= _sprMarioHead->_timeAni/7)
_sprMarioHead->SelectIndex(0);
_sprMarioHead->Update(t);
//--------------------------------------------RENDER------------------------------
RECT destRect = GL_WndSize;
destRect.top = GL_Height - _alpha * GL_Height;
ResourceMng::GetInst()->GetSurface("image/imgBgMenu.png")->Render(&destRect, &destRect);
if(true){
GLSpriteHandler->Begin(D3DXSPRITE_ALPHABLEND);
ResourceMng::GetInst()->GetTexture("image/imgItemPlay.png")->Render(627, 307);
ResourceMng::GetInst()->GetTexture("image/imgItemOption.png")->Render(606, 342);
ResourceMng::GetInst()->GetTexture("image/imgItemQuit.png")->Render(638, 378);
switch(_curSelect)
{
case 0:
_sprMarioHead->Render(545, 293);
break;
case 1:
_sprMarioHead->Render(545, 328);
break;
case 2:
_sprMarioHead->Render(545, 363);
break;
}
GLSpriteHandler->End();
}
}
| [
"huynguyen.uit@gmail.com"
] | huynguyen.uit@gmail.com |
96ce0e90b1ad593120c5cbe6c9b61ae7b1fe525e | 4d6bf26f4d9a43082f87e177c1a2ac6c9662c288 | /Chapter 20/Programming Challenge/6/main.cpp | 056f4754a203f13971b4cf844cd70948d7ac4109 | [] | no_license | Miao4382/Starting-Out-with-Cplusplus | 08d13d75fdb741be59a398b76275c5ee394840ca | dd3a1eadcf403ae57a68183987fc24fbfac0517f | refs/heads/master | 2020-05-24T23:22:49.978761 | 2019-05-20T18:40:01 | 2019-05-20T18:40:01 | 187,513,299 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 397 | cpp | #include <iostream>
#include "binary_search_tree_template.h"
int main()
{
BinarySearchTree<int> tre;
tre.Add(12);
tre.Add(7);
tre.Add(9);
tre.Add(10);
tre.Add(22);
tre.Add(24);
tre.Add(30);
tre.Add(18);
tre.Add(3);
tre.Add(14);
tre.Add(20);
BinarySearchTree<int> tre2;
tre2 = tre;
std::cout << "tre2.Height(): " << tre2.Height() << "\n";
return 0;
} | [
"33183267+Miao4382@users.noreply.github.com"
] | 33183267+Miao4382@users.noreply.github.com |
1a4e68ece77487157d26ec537c6c7789f38d68e3 | 0a70aab526d092a1825885aaeae0071703ba878f | /facebapp/src/main.cpp | 1653fa750254d07dde547c0476171781a41639db | [] | no_license | o-micron/facebapp | 6b6174c95428003a5cdf2956af7a5ca3372a94a9 | 04e3d7b927c4078dc744ddc1bb453b44af0d5345 | refs/heads/master | 2023-04-30T10:03:17.899876 | 2021-05-13T01:39:46 | 2021-05-13T01:39:46 | 366,897,554 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 34,318 | cpp | // This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level
// directory of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2018-2019 Intel Corporation
#include <opencv2/opencv_modules.hpp>
#if defined(HAVE_OPENCV_GAPI)
#include <opencv2/gapi.hpp>
#include <opencv2/gapi/core.hpp>
#include <opencv2/gapi/cpu/gcpukernel.hpp>
#include <opencv2/gapi/fluid/core.hpp>
#include <opencv2/gapi/imgproc.hpp>
#include <opencv2/gapi/infer.hpp>
#include <opencv2/gapi/infer/ie.hpp>
#include <opencv2/gapi/streaming/cap.hpp>
#include <opencv2/highgui.hpp> // windows
namespace config {
constexpr char kWinFaceBeautification[] = "FaceBeautificator";
constexpr char kWinInput[] = "Input";
constexpr char kParserAbout[] = "Use this script to run the face beautification algorithm with G-API.";
constexpr char kParserOptions[] =
"{ help h || print the help message. }"
"{ facepath f || a path to a Face detection model file (.xml).}"
"{ facedevice |GPU| the face detection computation device.}"
"{ landmpath l || a path to a Landmarks detection model file (.xml).}"
"{ landmdevice |CPU| the landmarks detection computation device.}"
"{ input i || a path to an input. Skip to capture from a camera.}"
"{ boxes b |false| set true to draw face Boxes in the \"Input\" window.}"
"{ landmarks m |false| set true to draw landMarks in the \"Input\" window.}"
"{ streaming s |true| set false to disable stream pipelining.}"
"{ performance p |false| set true to disable output displaying.}";
const cv::Scalar kClrWhite(255, 255, 255);
const cv::Scalar kClrGreen(0, 255, 0);
const cv::Scalar kClrYellow(0, 255, 255);
constexpr float kConfThresh = 0.7f;
const cv::Size kGKernelSize(5, 5);
constexpr double kGSigma = 0.0;
constexpr int kBSize = 9;
constexpr double kBSigmaCol = 30.0;
constexpr double kBSigmaSp = 30.0;
constexpr int kUnshSigma = 3;
constexpr float kUnshStrength = 0.7f;
constexpr int kAngDelta = 1;
constexpr bool kClosedLine = true;
} // namespace config
namespace {
//! [vec_ROI]
using VectorROI = std::vector<cv::Rect>;
//! [vec_ROI]
using GArrayROI = cv::GArray<cv::Rect>;
using Contour = std::vector<cv::Point>;
using Landmarks = std::vector<cv::Point>;
// Wrapper function
template<typename Tp>
inline int
toIntRounded(const Tp x)
{
return static_cast<int>(std::lround(x));
}
//! [toDbl]
template<typename Tp>
inline double
toDouble(const Tp x)
{
return static_cast<double>(x);
}
//! [toDbl]
struct Avg
{
struct Elapsed
{
explicit Elapsed(double ms)
: ss(ms / 1000.)
, mm(toIntRounded(ss / 60))
{}
const double ss;
const int mm;
};
using MS = std::chrono::duration<double, std::ratio<1, 1000>>;
using TS = std::chrono::time_point<std::chrono::high_resolution_clock>;
TS started;
void start() { started = now(); }
TS now() const { return std::chrono::high_resolution_clock::now(); }
double tick() const { return std::chrono::duration_cast<MS>(now() - started).count(); }
Elapsed elapsed() const { return Elapsed{ tick() }; }
double fps(std::size_t n) const { return static_cast<double>(n) / (tick() / 1000.); }
};
std::ostream&
operator<<(std::ostream& os, const Avg::Elapsed& e)
{
os << e.mm << ':' << (e.ss - 60 * e.mm);
return os;
}
std::string
getWeightsPath(const std::string& mdlXMLPath) // mdlXMLPath =
// "The/Full/Path.xml"
{
size_t size = mdlXMLPath.size();
CV_Assert(mdlXMLPath.substr(size - 4, size) // The last 4 symbols
== ".xml"); // must be ".xml"
std::string mdlBinPath(mdlXMLPath);
return mdlBinPath.replace(size - 3, 3, "bin"); // return
// "The/Full/Path.bin"
}
} // anonymous namespace
namespace custom {
using TplPtsFaceElements_Jaw = std::tuple<cv::GArray<Landmarks>, cv::GArray<Contour>>;
// Wrapper-functions
inline int
getLineInclinationAngleDegrees(const cv::Point& ptLeft, const cv::Point& ptRight);
inline Contour
getForeheadEllipse(const cv::Point& ptJawLeft, const cv::Point& ptJawRight, const cv::Point& ptJawMiddle);
inline Contour
getEyeEllipse(const cv::Point& ptLeft, const cv::Point& ptRight);
inline Contour
getPatchedEllipse(const cv::Point& ptLeft, const cv::Point& ptRight, const cv::Point& ptUp, const cv::Point& ptDown);
// Networks
//! [net_decl]
G_API_NET(FaceDetector, <cv::GMat(cv::GMat)>, "face_detector");
G_API_NET(LandmDetector, <cv::GMat(cv::GMat)>, "landm_detector");
//! [net_decl]
// Function kernels
G_TYPED_KERNEL(GBilatFilter, <cv::GMat(cv::GMat, int, double, double)>, "custom.faceb12n.bilateralFilter"){
static cv::GMatDesc outMeta(cv::GMatDesc in, int, double, double){ return in;
}
}
;
G_TYPED_KERNEL(GLaplacian, <cv::GMat(cv::GMat, int)>, "custom.faceb12n.Laplacian"){
static cv::GMatDesc outMeta(cv::GMatDesc in, int){ return in;
}
}
;
G_TYPED_KERNEL(GFillPolyGContours, <cv::GMat(cv::GMat, cv::GArray<Contour>)>, "custom.faceb12n.fillPolyGContours"){
static cv::GMatDesc outMeta(cv::GMatDesc in, cv::GArrayDesc){ return in.withType(CV_8U, 1);
}
}
;
G_TYPED_KERNEL(GPolyLines, <cv::GMat(cv::GMat, cv::GArray<Contour>, bool, cv::Scalar)>, "custom.faceb12n.polyLines"){
static cv::GMatDesc outMeta(cv::GMatDesc in, cv::GArrayDesc, bool, cv::Scalar){ return in;
}
}
;
G_TYPED_KERNEL(GRectangle, <cv::GMat(cv::GMat, GArrayROI, cv::Scalar)>, "custom.faceb12n.rectangle"){
static cv::GMatDesc outMeta(cv::GMatDesc in, cv::GArrayDesc, cv::Scalar){ return in;
}
}
;
G_TYPED_KERNEL(GFacePostProc, <GArrayROI(cv::GMat, cv::GMat, float)>, "custom.faceb12n.faceDetectPostProc"){
static cv::GArrayDesc outMeta(const cv::GMatDesc&, const cv::GMatDesc&, float){ return cv::empty_array_desc();
}
}
;
G_TYPED_KERNEL_M(GLandmPostProc,
<TplPtsFaceElements_Jaw(cv::GArray<cv::GMat>, GArrayROI)>,
"custom.faceb12n.landmDetectPostProc"){
static std::tuple<cv::GArrayDesc, cv::GArrayDesc> outMeta(const cv::GArrayDesc&, const cv::GArrayDesc&){
return std::make_tuple(cv::empty_array_desc(), cv::empty_array_desc());
}
}
;
//! [kern_m_decl]
using TplFaces_FaceElements = std::tuple<cv::GArray<Contour>, cv::GArray<Contour>>;
G_TYPED_KERNEL_M(GGetContours,
<TplFaces_FaceElements(cv::GArray<Landmarks>, cv::GArray<Contour>)>,
"custom.faceb12n.getContours"){
static std::tuple<cv::GArrayDesc, cv::GArrayDesc> outMeta(const cv::GArrayDesc&, const cv::GArrayDesc&){
return std::make_tuple(cv::empty_array_desc(), cv::empty_array_desc());
}
}
;
//! [kern_m_decl]
// OCV_Kernels
// This kernel applies Bilateral filter to an input src with default
// "cv::bilateralFilter" border argument
GAPI_OCV_KERNEL(GCPUBilateralFilter, custom::GBilatFilter){
static void run(const cv::Mat& src, const int diameter, const double sigmaColor, const double sigmaSpace, cv::Mat& out){
cv::bilateralFilter(src, out, diameter, sigmaColor, sigmaSpace);
}
}
;
// This kernel applies Laplace operator to an input src with default
// "cv::Laplacian" arguments
GAPI_OCV_KERNEL(GCPULaplacian, custom::GLaplacian){
static void run(const cv::Mat& src, const int ddepth, cv::Mat& out){ cv::Laplacian(src, out, ddepth);
}
}
;
// This kernel draws given white filled contours "cnts" on a clear Mat "out"
// (defined by a Scalar(0)) with standard "cv::fillPoly" arguments.
// It should be used to create a mask.
// The input Mat seems unused inside the function "run", but it is used deeper
// in the kernel to define an output size.
GAPI_OCV_KERNEL(GCPUFillPolyGContours, custom::GFillPolyGContours){
static void run(const cv::Mat&, const std::vector<Contour>& cnts, cv::Mat& out){ out = cv::Scalar(0);
cv::fillPoly(out, cnts, config::kClrWhite);
}
}
;
// This kernel draws given contours on an input src with default "cv::polylines"
// arguments
GAPI_OCV_KERNEL(GCPUPolyLines, custom::GPolyLines){ static void run(const cv::Mat& src,
const std::vector<Contour>& cnts,
const bool isClosed,
const cv::Scalar& color,
cv::Mat& out){ src.copyTo(out);
cv::polylines(out, cnts, isClosed, color);
}
}
;
// This kernel draws given rectangles on an input src with default
// "cv::rectangle" arguments
GAPI_OCV_KERNEL(GCPURectangle, custom::GRectangle){
static void run(const cv::Mat& src, const VectorROI& vctFaceBoxes, const cv::Scalar& color, cv::Mat& out){ src.copyTo(out);
for (const cv::Rect& box : vctFaceBoxes) { cv::rectangle(out, box, color); }
}
}
;
// A face detector outputs a blob with the shape: [1, 1, N, 7], where N is
// the number of detected bounding boxes. Structure of an output for every
// detected face is the following:
// [image_id, label, conf, x_min, y_min, x_max, y_max], all the seven elements
// are floating point. For more details please visit:
// https://github.com/opencv/open_model_zoo/blob/master/intel_models/face-detection-adas-0001
// This kernel is the face detection output blob parsing that returns a vector
// of detected faces' rects:
//! [fd_pp]
GAPI_OCV_KERNEL(GCPUFacePostProc, GFacePostProc){
static void run(const cv::Mat& inDetectResult, const cv::Mat& inFrame, const float faceConfThreshold, VectorROI& outFaces){
const int kObjectSize = 7;
const int imgCols = inFrame.size().width;
const int imgRows = inFrame.size().height;
const cv::Rect borders({ 0, 0 }, inFrame.size());
outFaces.clear();
const int numOfDetections = inDetectResult.size[2];
const float* data = inDetectResult.ptr<float>();
for (int i = 0; i < numOfDetections; i++) {
const float faceId = data[i * kObjectSize + 0];
if (faceId < 0.f) // indicates the end of detections
{
break;
}
const float faceConfidence = data[i * kObjectSize + 2];
// We can cut detections by the `conf` field
// to avoid mistakes of the detector.
if (faceConfidence > faceConfThreshold) {
const float left = data[i * kObjectSize + 3];
const float top = data[i * kObjectSize + 4];
const float right = data[i * kObjectSize + 5];
const float bottom = data[i * kObjectSize + 6];
// These are normalized coordinates and are between 0 and 1;
// to get the real pixel coordinates we should multiply it by
// the image sizes respectively to the directions:
cv::Point tl(toIntRounded(left * imgCols), toIntRounded(top * imgRows));
cv::Point br(toIntRounded(right * imgCols), toIntRounded(bottom * imgRows));
outFaces.push_back(cv::Rect(tl, br) & borders);
}
}
}
}
;
//! [fd_pp]
// This kernel is the facial landmarks detection output Mat parsing for every
// detected face; returns a tuple containing a vector of vectors of
// face elements' Points and a vector of vectors of jaw's Points:
// There are 35 landmarks given by the default detector for each face
// in a frame; the first 18 of them are face elements (eyes, eyebrows,
// a nose, a mouth) and the last 17 - a jaw contour. The detector gives
// floating point values for landmarks' normed coordinates relatively
// to an input ROI (not the original frame).
// For more details please visit:
// https://github.com/opencv/open_model_zoo/blob/master/intel_models/facial-landmarks-35-adas-0002
GAPI_OCV_KERNEL(GCPULandmPostProc,
GLandmPostProc){ static void run(const std::vector<cv::Mat>& vctDetectResults,
const VectorROI& vctRects,
std::vector<Landmarks>& vctPtsFaceElems,
std::vector<Contour>& vctCntJaw){ static constexpr int kNumFaceElems = 18;
static constexpr int kNumTotal = 35;
const size_t numFaces = vctRects.size();
CV_Assert(vctPtsFaceElems.size() == 0ul);
CV_Assert(vctCntJaw.size() == 0ul);
vctPtsFaceElems.reserve(numFaces);
vctCntJaw.reserve(numFaces);
Landmarks ptsFaceElems;
Contour cntJaw;
ptsFaceElems.reserve(kNumFaceElems);
cntJaw.reserve(kNumTotal - kNumFaceElems);
for (size_t i = 0; i < numFaces; i++) {
const float* data = vctDetectResults[i].ptr<float>();
// The face elements points:
ptsFaceElems.clear();
for (int j = 0; j < kNumFaceElems * 2; j += 2) {
cv::Point pt =
cv::Point(toIntRounded(data[j] * vctRects[i].width), toIntRounded(data[j + 1] * vctRects[i].height)) + vctRects[i].tl();
ptsFaceElems.push_back(pt);
}
vctPtsFaceElems.push_back(ptsFaceElems);
// The jaw contour points:
cntJaw.clear();
for (int j = kNumFaceElems * 2; j < kNumTotal * 2; j += 2) {
cv::Point pt =
cv::Point(toIntRounded(data[j] * vctRects[i].width), toIntRounded(data[j + 1] * vctRects[i].height)) + vctRects[i].tl();
cntJaw.push_back(pt);
}
vctCntJaw.push_back(cntJaw);
}
}
}
;
// This kernel is the facial landmarks detection post-processing for every face
// detected before; output is a tuple of vectors of detected face contours and
// facial elements contours:
//! [ld_pp_cnts]
//! [kern_m_impl]
GAPI_OCV_KERNEL(GCPUGetContours, GGetContours){
static void run(const std::vector<Landmarks>& vctPtsFaceElems, // 18 landmarks of the facial elements
const std::vector<Contour>& vctCntJaw, // 17 landmarks of a jaw
std::vector<Contour>& vctElemsContours,
std::vector<Contour>& vctFaceContours){ //! [kern_m_impl]
size_t numFaces = vctCntJaw.size();
CV_Assert(numFaces == vctPtsFaceElems.size());
CV_Assert(vctElemsContours.size() == 0ul);
CV_Assert(vctFaceContours.size() == 0ul);
// vctFaceElemsContours will store all the face elements' contours found
// in an input image, namely 4 elements (two eyes, nose, mouth) for every detected face:
vctElemsContours.reserve(numFaces * 4);
// vctFaceElemsContours will store all the faces' contours found in an input image:
vctFaceContours.reserve(numFaces);
Contour cntFace, cntLeftEye, cntRightEye, cntNose, cntMouth;
cntNose.reserve(4);
for (size_t i = 0ul; i < numFaces; i++) {
// The face elements contours
// A left eye:
// Approximating the lower eye contour by half-ellipse (using eye points) and storing in cntLeftEye:
cntLeftEye = getEyeEllipse(vctPtsFaceElems[i][1], vctPtsFaceElems[i][0]);
// Pushing the left eyebrow clock-wise:
cntLeftEye.insert(cntLeftEye.end(), { vctPtsFaceElems[i][12], vctPtsFaceElems[i][13], vctPtsFaceElems[i][14] });
// A right eye:
// Approximating the lower eye contour by half-ellipse (using eye points) and storing in vctRightEye:
cntRightEye = getEyeEllipse(vctPtsFaceElems[i][2], vctPtsFaceElems[i][3]);
// Pushing the right eyebrow clock-wise:
cntRightEye.insert(cntRightEye.end(), { vctPtsFaceElems[i][15], vctPtsFaceElems[i][16], vctPtsFaceElems[i][17] });
// A nose:
// Storing the nose points clock-wise
cntNose.clear();
cntNose.insert(cntNose.end(), { vctPtsFaceElems[i][4], vctPtsFaceElems[i][7], vctPtsFaceElems[i][5], vctPtsFaceElems[i][6] });
// A mouth:
// Approximating the mouth contour by two half-ellipses (using mouth points) and storing in vctMouth:
cntMouth = getPatchedEllipse(vctPtsFaceElems[i][8], vctPtsFaceElems[i][9], vctPtsFaceElems[i][10], vctPtsFaceElems[i][11]);
// Storing all the elements in a vector:
vctElemsContours.insert(vctElemsContours.end(), { cntLeftEye, cntRightEye, cntNose, cntMouth });
// The face contour:
// Approximating the forehead contour by half-ellipse (using jaw points) and storing in vctFace:
cntFace = getForeheadEllipse(vctCntJaw[i][0], vctCntJaw[i][16], vctCntJaw[i][8]);
// The ellipse is drawn clock-wise, but jaw contour points goes vice versa, so it's necessary to push
// cntJaw from the end to the begin using a reverse iterator:
std::copy(vctCntJaw[i].crbegin(), vctCntJaw[i].crend(), std::back_inserter(cntFace));
// Storing the face contour in another vector:
vctFaceContours.push_back(cntFace);
}
}
}
;
//! [ld_pp_cnts]
// GAPI subgraph functions
inline cv::GMat
unsharpMask(const cv::GMat& src, const int sigma, const float strength);
inline cv::GMat
mask3C(const cv::GMat& src, const cv::GMat& mask);
} // namespace custom
// Functions implementation:
// Returns an angle (in degrees) between a line given by two Points and
// the horison. Note that the result depends on the arguments order:
//! [ld_pp_incl]
inline int
custom::getLineInclinationAngleDegrees(const cv::Point& ptLeft, const cv::Point& ptRight)
{
const cv::Point residual = ptRight - ptLeft;
if (residual.y == 0 && residual.x == 0)
return 0;
else
return toIntRounded(atan2(toDouble(residual.y), toDouble(residual.x)) * 180.0 / CV_PI);
}
//! [ld_pp_incl]
// Approximates a forehead by half-ellipse using jaw points and some geometry
// and then returns points of the contour; "capacity" is used to reserve enough
// memory as there will be other points inserted.
//! [ld_pp_fhd]
inline Contour
custom::getForeheadEllipse(const cv::Point& ptJawLeft, const cv::Point& ptJawRight, const cv::Point& ptJawLower)
{
Contour cntForehead;
// The point amid the top two points of a jaw:
const cv::Point ptFaceCenter((ptJawLeft + ptJawRight) / 2);
// This will be the center of the ellipse.
// The angle between the jaw and the vertical:
const int angFace = getLineInclinationAngleDegrees(ptJawLeft, ptJawRight);
// This will be the inclination of the ellipse
// Counting the half-axis of the ellipse:
const double jawWidth = cv::norm(ptJawLeft - ptJawRight);
// A forehead width equals the jaw width, and we need a half-axis:
const int axisX = toIntRounded(jawWidth / 2.0);
const double jawHeight = cv::norm(ptFaceCenter - ptJawLower);
// According to research, in average a forehead is approximately 2/3 of
// a jaw:
const int axisY = toIntRounded(jawHeight * 2 / 3.0);
// We need the upper part of an ellipse:
static constexpr int kAngForeheadStart = 180;
static constexpr int kAngForeheadEnd = 360;
cv::ellipse2Poly(
ptFaceCenter, cv::Size(axisX, axisY), angFace, kAngForeheadStart, kAngForeheadEnd, config::kAngDelta, cntForehead);
return cntForehead;
}
//! [ld_pp_fhd]
// Approximates the lower eye contour by half-ellipse using eye points and some
// geometry and then returns points of the contour.
//! [ld_pp_eye]
inline Contour
custom::getEyeEllipse(const cv::Point& ptLeft, const cv::Point& ptRight)
{
Contour cntEyeBottom;
const cv::Point ptEyeCenter((ptRight + ptLeft) / 2);
const int angle = getLineInclinationAngleDegrees(ptLeft, ptRight);
const int axisX = toIntRounded(cv::norm(ptRight - ptLeft) / 2.0);
// According to research, in average a Y axis of an eye is approximately
// 1/3 of an X one.
const int axisY = axisX / 3;
// We need the lower part of an ellipse:
static constexpr int kAngEyeStart = 0;
static constexpr int kAngEyeEnd = 180;
cv::ellipse2Poly(ptEyeCenter, cv::Size(axisX, axisY), angle, kAngEyeStart, kAngEyeEnd, config::kAngDelta, cntEyeBottom);
return cntEyeBottom;
}
//! [ld_pp_eye]
// This function approximates an object (a mouth) by two half-ellipses using
// 4 points of the axes' ends and then returns points of the contour:
inline Contour
custom::getPatchedEllipse(const cv::Point& ptLeft, const cv::Point& ptRight, const cv::Point& ptUp, const cv::Point& ptDown)
{
// Shared characteristics for both half-ellipses:
const cv::Point ptMouthCenter((ptLeft + ptRight) / 2);
const int angMouth = getLineInclinationAngleDegrees(ptLeft, ptRight);
const int axisX = toIntRounded(cv::norm(ptRight - ptLeft) / 2.0);
// The top half-ellipse:
Contour cntMouthTop;
const int axisYTop = toIntRounded(cv::norm(ptMouthCenter - ptUp));
// We need the upper part of an ellipse:
static constexpr int angTopStart = 180;
static constexpr int angTopEnd = 360;
cv::ellipse2Poly(ptMouthCenter, cv::Size(axisX, axisYTop), angMouth, angTopStart, angTopEnd, config::kAngDelta, cntMouthTop);
// The bottom half-ellipse:
Contour cntMouth;
const int axisYBot = toIntRounded(cv::norm(ptMouthCenter - ptDown));
// We need the lower part of an ellipse:
static constexpr int angBotStart = 0;
static constexpr int angBotEnd = 180;
cv::ellipse2Poly(ptMouthCenter, cv::Size(axisX, axisYBot), angMouth, angBotStart, angBotEnd, config::kAngDelta, cntMouth);
// Pushing the upper part to vctOut
std::copy(cntMouthTop.cbegin(), cntMouthTop.cend(), std::back_inserter(cntMouth));
return cntMouth;
}
//! [unsh]
inline cv::GMat
custom::unsharpMask(const cv::GMat& src, const int sigma, const float strength)
{
cv::GMat blurred = cv::gapi::medianBlur(src, sigma);
cv::GMat laplacian = custom::GLaplacian::on(blurred, CV_8U);
return (src - (laplacian * strength));
}
//! [unsh]
inline cv::GMat
custom::mask3C(const cv::GMat& src, const cv::GMat& mask)
{
std::tuple<cv::GMat, cv::GMat, cv::GMat> tplIn = cv::gapi::split3(src);
cv::GMat masked0 = cv::gapi::mask(std::get<0>(tplIn), mask);
cv::GMat masked1 = cv::gapi::mask(std::get<1>(tplIn), mask);
cv::GMat masked2 = cv::gapi::mask(std::get<2>(tplIn), mask);
return cv::gapi::merge3(masked0, masked1, masked2);
}
int
main(int argc, char** argv)
{
cv::namedWindow(config::kWinFaceBeautification, cv::WINDOW_NORMAL);
cv::namedWindow(config::kWinInput, cv::WINDOW_NORMAL);
cv::CommandLineParser parser(argc, argv, config::kParserOptions);
parser.about(config::kParserAbout);
if (argc == 1 || parser.has("help")) {
parser.printMessage();
return 0;
}
// Parsing input arguments
const std::string faceXmlPath = parser.get<std::string>("facepath");
const std::string faceBinPath = getWeightsPath(faceXmlPath);
const std::string faceDevice = parser.get<std::string>("facedevice");
const std::string landmXmlPath = parser.get<std::string>("landmpath");
const std::string landmBinPath = getWeightsPath(landmXmlPath);
const std::string landmDevice = parser.get<std::string>("landmdevice");
// Declaring a graph
// The version of a pipeline expression with a lambda-based
// constructor is used to keep all temporary objects in a dedicated scope.
//! [ppl]
cv::GComputation pipeline([=]() {
//! [net_usg_fd]
cv::GMat gimgIn; // input
cv::GMat faceOut = cv::gapi::infer<custom::FaceDetector>(gimgIn);
//! [net_usg_fd]
GArrayROI garRects = custom::GFacePostProc::on(faceOut, gimgIn, config::kConfThresh); // post-proc
//! [net_usg_ld]
cv::GArray<cv::GMat> landmOut = cv::gapi::infer<custom::LandmDetector>(garRects, gimgIn);
//! [net_usg_ld]
cv::GArray<Landmarks> garElems; // |
cv::GArray<Contour> garJaws; // |output arrays
std::tie(garElems, garJaws) = custom::GLandmPostProc::on(landmOut, garRects); // post-proc
cv::GArray<Contour> garElsConts; // face elements
cv::GArray<Contour> garFaceConts; // whole faces
std::tie(garElsConts, garFaceConts) = custom::GGetContours::on(garElems, garJaws); // interpolation
//! [msk_ppline]
cv::GMat mskSharp = custom::GFillPolyGContours::on(gimgIn, garElsConts); // |
cv::GMat mskSharpG = cv::gapi::gaussianBlur(mskSharp,
config::kGKernelSize, // |
config::kGSigma); // |
cv::GMat mskBlur = custom::GFillPolyGContours::on(gimgIn, garFaceConts); // |
cv::GMat mskBlurG = cv::gapi::gaussianBlur(mskBlur,
config::kGKernelSize, // |
config::kGSigma); // |draw masks
// The first argument in mask() is Blur as we want to subtract from // |
// BlurG the next step: // |
cv::GMat mskBlurFinal = mskBlurG - cv::gapi::mask(mskBlurG, mskSharpG); // |
cv::GMat mskFacesGaussed = mskBlurFinal + mskSharpG; // |
cv::GMat mskFacesWhite = cv::gapi::threshold(mskFacesGaussed, 0, 255, cv::THRESH_BINARY); // |
cv::GMat mskNoFaces = cv::gapi::bitwise_not(mskFacesWhite); // |
//! [msk_ppline]
cv::GMat gimgBilat = custom::GBilatFilter::on(gimgIn, config::kBSize, config::kBSigmaCol, config::kBSigmaSp);
cv::GMat gimgSharp = custom::unsharpMask(gimgIn, config::kUnshSigma, config::kUnshStrength);
// Applying the masks
// Custom function mask3C() should be used instead of just gapi::mask()
// as mask() provides CV_8UC1 source only (and we have CV_8U3C)
cv::GMat gimgBilatMasked = custom::mask3C(gimgBilat, mskBlurFinal);
cv::GMat gimgSharpMasked = custom::mask3C(gimgSharp, mskSharpG);
cv::GMat gimgInMasked = custom::mask3C(gimgIn, mskNoFaces);
cv::GMat gimgBeautif = gimgBilatMasked + gimgSharpMasked + gimgInMasked;
return cv::GComputation(cv::GIn(gimgIn),
cv::GOut(gimgBeautif, cv::gapi::copy(gimgIn), garFaceConts, garElsConts, garRects));
});
//! [ppl]
// Declaring IE params for networks
//! [net_param]
auto faceParams = cv::gapi::ie::Params<custom::FaceDetector>{ /*std::string*/ faceXmlPath,
/*std::string*/ faceBinPath,
/*std::string*/ faceDevice };
auto landmParams = cv::gapi::ie::Params<custom::LandmDetector>{ /*std::string*/ landmXmlPath,
/*std::string*/ landmBinPath,
/*std::string*/ landmDevice };
//! [net_param]
//! [netw]
auto networks = cv::gapi::networks(faceParams, landmParams);
//! [netw]
// Declaring custom and fluid kernels have been used:
//! [kern_pass_1]
auto customKernels = cv::gapi::kernels<custom::GCPUBilateralFilter,
custom::GCPULaplacian,
custom::GCPUFillPolyGContours,
custom::GCPUPolyLines,
custom::GCPURectangle,
custom::GCPUFacePostProc,
custom::GCPULandmPostProc,
custom::GCPUGetContours>();
auto kernels = cv::gapi::combine(cv::gapi::core::fluid::kernels(), customKernels);
//! [kern_pass_1]
Avg avg;
size_t frames = 0;
// The flags for drawing/not drawing face boxes or/and landmarks in the
// \"Input\" window:
const bool flgBoxes = parser.get<bool>("boxes");
const bool flgLandmarks = parser.get<bool>("landmarks");
// The flag to involve stream pipelining:
const bool flgStreaming = parser.get<bool>("streaming");
// The flag to display the output images or not:
const bool flgPerformance = parser.get<bool>("performance");
// Now we are ready to compile the pipeline to a stream with specified
// kernels, networks and image format expected to process
if (flgStreaming == true) {
//! [str_comp]
cv::GStreamingCompiled stream = pipeline.compileStreaming(cv::compile_args(kernels, networks));
//! [str_comp]
// Setting the source for the stream:
//! [str_src]
if (parser.has("input")) {
stream.setSource(cv::gapi::wip::make_src<cv::gapi::wip::GCaptureSource>(parser.get<cv::String>("input")));
}
//! [str_src]
else {
stream.setSource(cv::gapi::wip::make_src<cv::gapi::wip::GCaptureSource>(0));
}
// Declaring output variables
// Streaming:
cv::Mat imgShow;
cv::Mat imgBeautif;
std::vector<Contour> vctFaceConts, vctElsConts;
VectorROI vctRects;
if (flgPerformance == true) {
auto out_vector = cv::gout(imgBeautif, imgShow, vctFaceConts, vctElsConts, vctRects);
stream.start();
avg.start();
while (stream.running()) {
stream.pull(std::move(out_vector));
frames++;
}
} else // flgPerformance == false
{
//! [str_loop]
auto out_vector = cv::gout(imgBeautif, imgShow, vctFaceConts, vctElsConts, vctRects);
stream.start();
avg.start();
while (stream.running()) {
if (!stream.try_pull(std::move(out_vector))) {
// Use a try_pull() to obtain data.
// If there's no data, let UI refresh (and handle keypress)
if (cv::waitKey(1) >= 0)
break;
else
continue;
}
frames++;
// Drawing face boxes and landmarks if necessary:
if (flgLandmarks == true) {
cv::polylines(imgShow, vctFaceConts, config::kClosedLine, config::kClrYellow);
cv::polylines(imgShow, vctElsConts, config::kClosedLine, config::kClrYellow);
}
if (flgBoxes == true)
for (auto rect : vctRects) cv::rectangle(imgShow, rect, config::kClrGreen);
cv::imshow(config::kWinInput, imgShow);
cv::imshow(config::kWinFaceBeautification, imgBeautif);
}
//! [str_loop]
}
std::cout << "Processed " << frames << " frames in " << avg.elapsed() << " (" << avg.fps(frames) << " FPS)" << std::endl;
} else // serial mode:
{
//! [bef_cap]
#include <opencv2/videoio.hpp>
cv::GCompiled cc;
cv::VideoCapture cap;
if (parser.has("input")) {
cap.open(parser.get<cv::String>("input"));
}
//! [bef_cap]
else if (!cap.open(0)) {
std::cout << "No input available" << std::endl;
return 1;
}
if (flgPerformance == true) {
while (true) {
cv::Mat img;
cv::Mat imgShow;
cv::Mat imgBeautif;
std::vector<Contour> vctFaceConts, vctElsConts;
VectorROI vctRects;
cap >> img;
if (img.empty()) { break; }
frames++;
if (!cc) {
cc = pipeline.compile(cv::descr_of(img), cv::compile_args(kernels, networks));
avg.start();
}
cc(cv::gin(img), cv::gout(imgBeautif, imgShow, vctFaceConts, vctElsConts, vctRects));
}
} else // flgPerformance == false
{
//! [bef_loop]
while (cv::waitKey(1) < 0) {
cv::Mat img;
cv::Mat imgShow;
cv::Mat imgBeautif;
std::vector<Contour> vctFaceConts, vctElsConts;
VectorROI vctRects;
cap >> img;
if (img.empty()) {
cv::waitKey();
break;
}
frames++;
//! [apply]
pipeline.apply(cv::gin(img),
cv::gout(imgBeautif, imgShow, vctFaceConts, vctElsConts, vctRects),
cv::compile_args(kernels, networks));
//! [apply]
if (frames == 1) {
// Start timer only after 1st frame processed -- compilation
// happens on-the-fly here
avg.start();
}
// Drawing face boxes and landmarks if necessary:
if (flgLandmarks == true) {
cv::polylines(imgShow, vctFaceConts, config::kClosedLine, config::kClrYellow);
cv::polylines(imgShow, vctElsConts, config::kClosedLine, config::kClrYellow);
}
if (flgBoxes == true)
for (auto rect : vctRects) cv::rectangle(imgShow, rect, config::kClrGreen);
cv::imshow(config::kWinInput, imgShow);
cv::imshow(config::kWinFaceBeautification, imgBeautif);
}
}
//! [bef_loop]
std::cout << "Processed " << frames << " frames in " << avg.elapsed() << " (" << avg.fps(frames) << " FPS)" << std::endl;
}
return 0;
}
#else
#include <iostream>
int
main()
{
std::cerr << "This tutorial code requires G-API module "
"with Inference Engine backend to run"
<< std::endl;
return 1;
}
#endif // HAVE_OPECV_GAPI | [
"omarsheriffathy@hotmail.com"
] | omarsheriffathy@hotmail.com |
ad84c7719064daf99cf088cb43985d5ae93797e4 | 8567438779e6af0754620a25d379c348e4cd5a5d | /printing/pdf_render_settings.h | 545def02da780bf21da2cbe61cea0dccc45ad0c0 | [
"BSD-3-Clause"
] | permissive | thngkaiyuan/chromium | c389ac4b50ccba28ee077cbf6115c41b547955ae | dab56a4a71f87f64ecc0044e97b4a8f247787a68 | refs/heads/master | 2022-11-10T02:50:29.326119 | 2017-04-08T12:28:57 | 2017-04-08T12:28:57 | 84,073,924 | 0 | 1 | BSD-3-Clause | 2022-10-25T19:47:15 | 2017-03-06T13:04:15 | null | UTF-8 | C++ | false | false | 1,396 | h | // Copyright (c) 2011 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 PRINTING_PDF_RENDER_SETTINGS_H_
#define PRINTING_PDF_RENDER_SETTINGS_H_
#include <stdint.h>
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_param_traits.h"
#include "printing/printing_export.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/ipc/geometry/gfx_param_traits.h"
#include "ui/gfx/ipc/skia/gfx_skia_param_traits.h"
namespace printing {
// Defining PDF rendering settings.
struct PdfRenderSettings {
enum Mode {
NORMAL = 0,
#if defined(OS_WIN)
GDI_TEXT,
POSTSCRIPT_LEVEL2,
POSTSCRIPT_LEVEL3,
LAST = POSTSCRIPT_LEVEL3,
#else
LAST = NORMAL,
#endif
};
PdfRenderSettings() : dpi(0), autorotate(false), mode(Mode::NORMAL) {}
PdfRenderSettings(gfx::Rect area,
gfx::Point offsets,
int dpi,
bool autorotate,
Mode mode)
: area(area),
offsets(offsets),
dpi(dpi),
autorotate(autorotate),
mode(mode) {}
~PdfRenderSettings() {}
gfx::Rect area;
gfx::Point offsets;
int dpi;
bool autorotate;
Mode mode;
};
} // namespace printing
#endif // PRINTING_PDF_RENDER_SETTINGS_H_
| [
"hedonist.ky@gmail.com"
] | hedonist.ky@gmail.com |
71cae033a829aac34a26d3d17dc85e0b87c6dfd2 | f6536d397dd72bf390dae3fdf3816b95fd9eb5af | /Sandbox/src/SandboxApp.cpp | 866ad6b62d2816ec34dbab7a8d5b907677dfc746 | [
"Apache-2.0"
] | permissive | 13269351120/Enginesth | 34ac61a1fad6edef2551ceae06f2daa477e2c6f3 | 2c22b15ce4e033cd66b767fad94327e57708327d | refs/heads/master | 2020-04-03T09:22:36.046656 | 2018-11-17T04:07:44 | 2018-11-17T04:07:44 | 155,162,992 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 205 | cpp | #include <Enginesth.h>
class Sandbox : public Enginesth::Application
{
public :
Sandbox()
{
}
~Sandbox()
{
}
};
Enginesth::Application* Enginesth::CreateApplication()
{
return new Sandbox();
} | [
"422619603@qq.com"
] | 422619603@qq.com |
08bca19c1de724d2c963cefa09770ea7856c672c | 5870bb19b53c61508c2e57499ab6f10252200dee | /designpatterns/solid/main0.cpp | ef8ca4c8498bc14b0197b4da77cea3649df55c47 | [] | no_license | blockspacer/test-cpp | 40371c04864fd632e78e9e4da2dea6c80b307d2f | d70e8f77d1d8129266afd7e9a2c4c4c051068af1 | refs/heads/master | 2020-07-05T20:02:09.661427 | 2019-08-02T07:50:39 | 2019-08-02T07:50:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,067 | cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <fstream>
#include <boost/lexical_cast.hpp>
using namespace std;
using namespace boost;
struct Journal {
string title;
vector<string> entries;
Journal(string const& title) : title(title) {}
void add_entry(string const& entry) {
static int count = 1;
entries.push_back(lexical_cast<string>(count++) + ": "+ entry);
}
// persistence
void save(string const& filename) {
ofstream ofs(filename);
for (auto& e : entries)
ofs << e << endl;
}
};
struct PersistenceManager {
static void save(Journal const& j, string const& filename) {
ofstream ofs(filename);
for (auto & e: j.entries) {
ofs << e << endl;
}
}
};
int main() {
// getchar();
Journal journal {"Dear Diary"};
journal.add_entry(" I ate a bug");
journal.add_entry(" I cried today");
journal.save("diary.txt");
PersistenceManager::save(journal, "diary1.txt");
return 0;
}
| [
"vdkhristenko1991@gmail.com"
] | vdkhristenko1991@gmail.com |
57d7e90c174c511822d0236a646126d5155d4151 | b3c6a4233bc9c1260b54272e4b39ec10b3d3f12e | /test/sort/quicksort/quicksort_suite.cpp | aa872b14d916358d392f98f6c0f4f7b224ec5f02 | [
"MIT"
] | permissive | SergeyIvanov87/AlgorithmExersizes | a8a42925287bf4202033520f6ba5871372c1fd20 | 25929d518c5cd603ba0bb27afed7f6656ec5925d | refs/heads/main | 2023-07-27T00:22:58.851394 | 2021-06-20T20:08:57 | 2021-06-20T20:08:57 | 352,424,493 | 0 | 0 | MIT | 2021-06-20T20:08:57 | 2021-03-28T19:52:23 | C++ | UTF-8 | C++ | false | false | 2,761 | cpp | #include <iostream>
#include <gtest/gtest.h>
#include "utils/tracer.hpp"
#include "sort/quicksort/quicksort.hpp"
namespace sort
{
using array_t = std::vector<int>;
using p_index_t = size_t;
using r_index_t = size_t;
using q_index = size_t;
using expected_tuple_t = std::tuple<q_index, array_t>;
using PartitionTestParams = std::tuple<array_t, p_index_t, r_index_t, expected_tuple_t>;
auto printer_a = [](const array_t& A, size_t pivot_index, std::initializer_list<size_t> highlight_indices = {})
{
if (A.size() > pivot_index)
{
std::cout << "\npivot " << ::utils::bold_on << "A[" << pivot_index << "]: " << A[pivot_index] << ::utils::bold_off << ", A.size: " << A.size() << std::endl;
}
else
{
return;
}
::utils::print_array_with_indices(std::cout, A, highlight_indices);
};
template<class IndicesContainer>
auto printer_range = [](const array_t& A, size_t pivot_index, size_t cur_index, IndicesContainer highlight_indices = {})
{
if (A.size() > pivot_index)
{
std::cout << "\npivot " << ::utils::bold_on << "A[" << pivot_index << "]: " << A[pivot_index] << ::utils::bold_off << ", A.size: " << A.size() << std::endl;
}
else
{
return;
}
if(cur_index < A.size())
{
auto it = highlight_indices.find(cur_index);
if (it == highlight_indices.end())
{
highlight_indices[cur_index] = {"<", ">"};
}
}
::utils::print_array_with_indices(std::cout, A, highlight_indices);
};
class PartitionFixture : public testing::TestWithParam<PartitionTestParams> {};
TEST_P(PartitionFixture, empty)
{
array_t array = std::get<0>(GetParam());
p_index_t p = std::get<1>(GetParam());
r_index_t r = std::get<2>(GetParam());
expected_tuple_t expected = std::get<3>(GetParam());
::utils::LambdaTracer tracer {printer_range<::utils::highlighter_table_t>, printer_a};
size_t q_got = details::partition(array, p, r, tracer);
ASSERT_EQ(q_got, std::get<0>(expected)) << "Partition index 'q' is unexpected";
}
INSTANTIATE_TEST_SUITE_P(PartitionGroup, PartitionFixture,
testing::Values(
PartitionTestParams{
{1,2,3,4,5,6,7}, 0, 6,
{6, {1,2,3,4,5,6,7}}},
PartitionTestParams{
{7,6,5,4,3,2,1}, 0, 6,
{0, {1,6,5,4,3,2,7}}},
PartitionTestParams{
{5,8,10,4,3,11,7}, 0, 6,
{3, {5,4,3,7,8,10,11}}}
));
}
| [
"noreply@github.com"
] | noreply@github.com |
196901de321ed58e93f491aac56eeae193ec127c | 77c953c68485c075f706b45c52bbd80c759b00b1 | /C++/Algorithms/final_001851144/q5/main.cpp | 9874aef3ec2f59d35c7820c13d608e7b41d40964 | [] | no_license | jerbriven/Coding-Projects | 736fe307fd2bee31d4dfc23bc8c9a6280ca8a06a | 1a82f6946c1fcc1d6606aeb00d827944d3712b45 | refs/heads/master | 2021-08-16T01:44:47.382016 | 2020-10-07T20:29:01 | 2020-10-07T20:29:01 | 227,228,014 | 0 | 0 | null | 2019-12-10T22:37:03 | 2019-12-10T22:30:33 | null | UTF-8 | C++ | false | false | 773 | cpp | #include<iostream>
#include "AdjacencyMatrix.h"
using namespace std;
int main() {
AdjacencyMatrix<int> simpleGraph;
// Create graph
simpleGraph.add(0, 1, 2);
simpleGraph.add(0, 2, 4);
simpleGraph.add(0, 3, 6);
simpleGraph.add(1, 2, 5);
simpleGraph.add(1, 4, 3);
simpleGraph.add(2, 3, 2);
simpleGraph.add(2, 4, 2);
simpleGraph.add(3, 2, 1);
simpleGraph.add(3, 5, 3);
simpleGraph.add(3, 4, 5);
simpleGraph.add(4, 2, 3);
simpleGraph.add(4, 5, 5);
simpleGraph.add(4, 6, 1);
simpleGraph.add(5, 4, 1);
simpleGraph.add(6, 5, 2);
// Print matrix
simpleGraph.printMatrix();
// Find shortest path between 0 and 6
cout << "Shortest path between 0 and 6 is: " << simpleGraph.shortestPath(0, 6);
} | [
"jeremyvenne@yahoo.com"
] | jeremyvenne@yahoo.com |
783a406406a6a9b9c631369daf62b52a59aae27d | 8ac1b220c3d534b8a1b5f10449c535cfefac9160 | /src/cpotrf.cpp | 41325b683ad227074a5a68fc568ed09bafbec3df | [] | no_license | soulsheng/magma | aa83eea749c5108c607f4710f2905a8a1deb235e | 465fd5817498319db4cbce52cded86fd49b65274 | refs/heads/master | 2020-12-01T13:05:11.511847 | 2013-09-04T00:18:03 | 2013-09-04T00:18:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,418 | cpp | /*
-- MAGMA (version 1.4.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
August 2013
@author Stan Tomov
@generated c Tue Aug 13 16:44:07 2013
*/
#include "common_magma.h"
// === Define what BLAS to use ============================================
#define PRECISION_c
#if defined(PRECISION_s) || defined(PRECISION_d)
#define magma_ctrsm magmablas_ctrsm
#endif
// === End defining what BLAS to use ======================================
#define A(i, j) (a +(j)*lda + (i))
#define dA(i, j) (work+(j)*ldda + (i))
extern "C" magma_int_t
magma_cpotrf(char uplo, magma_int_t n,
magmaFloatComplex *a, magma_int_t lda, magma_int_t *info)
{
/* -- MAGMA (version 1.4.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
August 2013
Purpose
=======
CPOTRF computes the Cholesky factorization of a complex Hermitian
positive definite matrix A. This version does not require work
space on the GPU passed as input. GPU memory is allocated in the
routine.
The factorization has the form
A = U**H * U, if UPLO = 'U', or
A = L * L**H, if UPLO = 'L',
where U is an upper triangular matrix and L is lower triangular.
This is the block version of the algorithm, calling Level 3 BLAS.
If the current stream is NULL, this version replaces it with user defined
stream to overlap computation with communication.
Arguments
=========
UPLO (input) CHARACTER*1
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
N (input) INTEGER
The order of the matrix A. N >= 0.
A (input/output) COMPLEX array, dimension (LDA,N)
On entry, the Hermitian matrix A. If UPLO = 'U', the leading
N-by-N upper triangular part of A contains the upper
triangular part of the matrix A, and the strictly lower
triangular part of A is not referenced. If UPLO = 'L', the
leading N-by-N lower triangular part of A contains the lower
triangular part of the matrix A, and the strictly upper
triangular part of A is not referenced.
On exit, if INFO = 0, the factor U or L from the Cholesky
factorization A = U**H * U or A = L * L**H.
Higher performance is achieved if A is in pinned memory, e.g.
allocated using magma_malloc_pinned.
LDA (input) INTEGER
The leading dimension of the array A. LDA >= max(1,N).
INFO (output) INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
or another error occured, such as memory allocation failed.
> 0: if INFO = i, the leading minor of order i is not
positive definite, and the factorization could not be
completed.
===================================================================== */
/* Local variables */
char uplo_[2] = {uplo, 0};
magma_int_t ldda, nb;
magma_int_t j, jb;
magmaFloatComplex c_one = MAGMA_C_ONE;
magmaFloatComplex c_neg_one = MAGMA_C_NEG_ONE;
magmaFloatComplex *work;
float d_one = 1.0;
float d_neg_one = -1.0;
int upper = lapackf77_lsame(uplo_, "U");
*info = 0;
if ((! upper) && (! lapackf77_lsame(uplo_, "L"))) {
*info = -1;
} else if (n < 0) {
*info = -2;
} else if (lda < max(1,n)) {
*info = -4;
}
if (*info != 0) {
magma_xerbla( __func__, -(*info) );
return *info;
}
/* Quick return */
if ( n == 0 )
return *info;
magma_int_t num_gpus = magma_num_gpus();
if( num_gpus > 1 ) {
/* call multiple-GPU interface */
return magma_cpotrf_m(num_gpus, uplo, n, a, lda, info);
}
ldda = ((n+31)/32)*32;
if (MAGMA_SUCCESS != magma_cmalloc( &work, (n)*ldda )) {
/* alloc failed so call the non-GPU-resident version */
return magma_cpotrf_m(num_gpus, uplo, n, a, lda, info);
}
/* Define user stream if current stream is NULL */
cudaStream_t stream[3], current_stream;
magmablasGetKernelStream(¤t_stream);
magma_queue_create( &stream[0] );
magma_queue_create( &stream[2] );
if (current_stream == NULL) {
magma_queue_create( &stream[1] );
magmablasSetKernelStream(stream[1]);
}
else
stream[1] = current_stream;
nb = magma_get_cpotrf_nb(n);
if (nb <= 1 || nb >= n) {
lapackf77_cpotrf(uplo_, &n, a, &lda, info);
} else {
/* Use hybrid blocked code. */
if (upper) {
/* Compute the Cholesky factorization A = U'*U. */
for (j=0; j<n; j += nb) {
/* Update and factorize the current diagonal block and test
for non-positive-definiteness. Computing MIN */
jb = min(nb, (n-j));
magma_csetmatrix_async( jb, (n-j), A(j, j), lda, dA(j, j), ldda, stream[1]);
magma_cherk(MagmaUpper, MagmaConjTrans, jb, j,
d_neg_one, dA(0, j), ldda,
d_one, dA(j, j), ldda);
magma_queue_sync( stream[1] );
magma_cgetmatrix_async( jb, jb,
dA(j, j), ldda,
A(j, j), lda, stream[0] );
if ( (j+jb) < n) {
magma_cgemm(MagmaConjTrans, MagmaNoTrans,
jb, (n-j-jb), j,
c_neg_one, dA(0, j ), ldda,
dA(0, j+jb), ldda,
c_one, dA(j, j+jb), ldda);
}
magma_cgetmatrix_async( j, jb,
dA(0, j), ldda,
A (0, j), lda, stream[2] );
magma_queue_sync( stream[0] );
lapackf77_cpotrf(MagmaUpperStr, &jb, A(j, j), &lda, info);
if (*info != 0) {
*info = *info + j;
break;
}
magma_csetmatrix_async( jb, jb,
A(j, j), lda,
dA(j, j), ldda, stream[0] );
magma_queue_sync( stream[0] );
if ( (j+jb) < n ) {
magma_ctrsm(MagmaLeft, MagmaUpper, MagmaConjTrans, MagmaNonUnit,
jb, (n-j-jb),
c_one, dA(j, j ), ldda,
dA(j, j+jb), ldda);
}
}
}
else {
//=========================================================
// Compute the Cholesky factorization A = L*L'.
for (j=0; j<n; j+=nb) {
// Update and factorize the current diagonal block and test
// for non-positive-definiteness. Computing MIN
jb = min(nb, (n-j));
magma_csetmatrix_async( (n-j), jb, A(j, j), lda, dA(j, j), ldda, stream[1]);
magma_cherk(MagmaLower, MagmaNoTrans, jb, j,
d_neg_one, dA(j, 0), ldda,
d_one, dA(j, j), ldda);
magma_queue_sync( stream[1] );
magma_cgetmatrix_async( jb, jb,
dA(j,j), ldda,
A(j,j), lda, stream[0] );
if ( (j+jb) < n) {
magma_cgemm( MagmaNoTrans, MagmaConjTrans,
(n-j-jb), jb, j,
c_neg_one, dA(j+jb, 0), ldda,
dA(j, 0), ldda,
c_one, dA(j+jb, j), ldda);
}
magma_cgetmatrix_async( jb, j,
dA(j, 0), ldda,
A(j, 0), lda, stream[2] );
magma_queue_sync( stream[0] );
lapackf77_cpotrf(MagmaLowerStr, &jb, A(j, j), &lda, info);
if (*info != 0){
*info = *info + j;
break;
}
magma_csetmatrix_async( jb, jb,
A(j, j), lda,
dA(j, j), ldda, stream[0] );
magma_queue_sync( stream[0] );
if ( (j+jb) < n) {
magma_ctrsm(MagmaRight, MagmaLower, MagmaConjTrans, MagmaNonUnit,
(n-j-jb), jb,
c_one, dA(j, j), ldda,
dA(j+jb, j), ldda);
}
}
}
}
magma_queue_destroy( stream[0] );
magma_queue_destroy( stream[2] );
if (current_stream == NULL) {
magma_queue_destroy( stream[1] );
magmablasSetKernelStream(NULL);
}
magma_free( work );
return *info;
} /* magma_cpotrf */
| [
"maxhutch@gmail.com"
] | maxhutch@gmail.com |
8da6ca1d74f070204d2ba6c51bb0a1910f115ac6 | a421a6bbe1c46e63635186f45b8f0432f9e2f15e | /acmicpc/16235.cpp | 1a540a2aa0ccf5566a86109c7f1d796e8e735875 | [] | no_license | KimSeonBin/algo_practice | 4f5e7b7948b9385c6a9fa8123ba0302ec9aeb7f1 | 8279e0654ce1db50f047d8a3e51e4505491ed580 | refs/heads/master | 2021-07-19T15:25:55.190087 | 2018-11-19T13:44:36 | 2018-11-19T13:44:36 | 95,439,345 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,558 | cpp | #include <cstdio>
#include <deque>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct tree{
int x, y, age;
bool operator<(tree a){
if(age == a.age){
if(y == a.y)
return x < a.x;
return y < a.y;
}
return age > a.age;
}
};
int ground[11][11] = {0};
int bonus[11][11] = {0};
int deleteindex[11][11] = {0};
deque<tree> dq[11][11];
vector<tree> v;
int dirr[8][2] = {{-1,-1}, {-1,0}, {-1,1}, {0,-1}, {0, 1}, {1,-1}, {1,0}, {1, 1}};
void doSpring(int n){
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
int dqsize = dq[i][j].size();
for(int k = dqsize-1; k >= 0; k--){
if(ground[i][j] - dq[i][j][k].age >= 0){
ground[i][j] -= dq[i][j][k].age;
dq[i][j][k].age++;
}
else{
deleteindex[i][j] = k + 1;
break;
}
}
}
}
}
void doSummber(int n){
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
while(deleteindex[i][j] > 0){
tree temp = dq[i][j].front();
dq[i][j].pop_front();
ground[i][j] += temp.age / 2;
deleteindex[i][j]--;
}
}
}
}
void doFall(int n){
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
for(int q = 0; q < dq[i][j].size(); q++){
if(dq[i][j][q].age % 5 != 0)
continue;
for(int k = 0; k < 8; k++){
int nx = i + dirr[k][0], ny = j + dirr[k][1];
if(nx < 1 || ny < 1 || nx > n || ny > n)
continue;
tree newtree;
newtree.x = nx; newtree.y = ny; newtree.age = 1;
dq[nx][ny].push_back(newtree);
}
}
}
}
}
void doWinter(int n){
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
ground[i][j] += bonus[i][j];
}
}
}
int getAnswer(int n){
int result = 0;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
result += dq[i][j].size();
}
}
return result;
}
int main(){
int n = 0, m = 0, k = 0;
scanf("%d %d %d", &n, &m, &k);
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
ground[i][j] = 5;
scanf("%d", &bonus[i][j]);
}
}
for(int i = 0; i < m; i++){
tree temp;
scanf("%d %d %d", &temp.x, &temp.y, &temp.age);
v.push_back(temp);
}
sort(v.begin(), v.end());
for(int i = 0; i < m; i++){
dq[v[i].x][v[i].y].push_back(v[i]);
}
for(int i = 0; i < k; i++){
doSpring(n);
doSummber(n);
doFall(n);
doWinter(n);
}
printf("%d\n", getAnswer(n));
return 0;
}
| [
"zzz898989@ajou.ac.kr"
] | zzz898989@ajou.ac.kr |
d9af073707de25788dd93ebbfc2ad4a9dc364601 | 6cda82951a8bda992fa7d5fc5140b2cd426d91e5 | /cg1_ex1/context.cpp | be6815f6d88ae0dc989bce850d116a7402fb3106 | [] | no_license | ptrv/tu_cg1 | 73448f07812e0e2f0a3dbf26ab39cafced675df0 | bbd0df80f51257dc2ba58d5c584d37bed0d20a31 | refs/heads/master | 2021-01-22T19:22:26.579150 | 2012-11-07T23:22:34 | 2012-11-07T23:22:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,484 | cpp | /* ----------------------------------------------------------------
name: context.cpp
purpose: GL context declarations and prototypes of GLUT callbacks
version: SKELETON CODE
TODO: menu, keyPressed, idle(optional)
author: katrin lang
computer graphics
tu berlin
------------------------------------------------------------- */
#include <iostream>
#ifdef __APPLE__
#include <GLUT/glut.h>
#elif _WIN32
#include "win32/glut.h"
#else
#include <GL/glut.h>
#endif
#include <math.h>
#include "scenegraph.h"
#include "context.h"
#include <limits>
#include <sys/time.h>
// a bunch of variables
// window dimensions
int Context::width, Context::height;
// initial window position
int Context::x, Context::y;
// window title
string Context::title;
// field of view (in degrees)
GLfloat Context::fov;
// camera position
GLfloat Context::cameraZ;
// near and far plane
GLfloat Context::nearPlane, Context::farPlane;
// left mouse button pressed?
bool Context::leftButton;
// mouse position in previous frame
int Context::mouseX, Context::mouseY;
bool Context::isAnimation = false;
float angleCamera = 0.0;
int Context::lastTime;
// set parameters to your own liking
// (or leave them as they are)
// light and material
GLfloat Context::materialAmbient[]= {0.5, 0.5, 0.5, 1.0};
GLfloat Context::materialSpecular[]= {0.3, 0.3, 0.3, 1.0};
GLfloat Context::materialShininess[]= { 3.0 };
GLfloat Context::lightModelAmbient[]= { 0.3, 0.3, 0.3 };
GLfloat Context::lightPosition[]= { 5.0, 5.0, 5.0, 0.0 };
void Context::config(){
// window size and position
width= 600;
height= 600;
x= 100;
y= 100;
title= "cg1 assignment 1 - robot scenegraph";
// camera setup
fov= 40.0;
cameraZ= (height/2) / tan(fov/180.0);
nearPlane= cameraZ/10.0;
farPlane= cameraZ*10.0;
}
void Context::init(int argc, char **argv){
// configurate contexts
config();
// create window with glut
glutInit(&argc, argv);
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );
glutInitWindowSize(width, height);
glutInitWindowPosition(x, y);
glutCreateWindow(title.c_str());
// light and material
glMaterialfv(GL_FRONT, GL_AMBIENT, materialAmbient);
glMaterialfv(GL_FRONT, GL_SPECULAR, materialSpecular);
glMaterialfv(GL_FRONT, GL_SHININESS, materialShininess);
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lightModelAmbient);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
// shading
glShadeModel(GL_FLAT);
// clear background to black and clear depth buffer
glClearColor(0.0,0.0,0.0,1.0);
// enable depth test (z-buffer)
glDepthFunc(GL_LESS);
glEnable(GL_DEPTH_TEST);
// enable normalization of vertex normals
glEnable(GL_NORMALIZE);
// initial view definitions
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// perspective projection
gluPerspective(fov, width/height, nearPlane, farPlane);
registerCallbacks();
lastTime = glutGet(GLUT_ELAPSED_TIME);
// some output to console
cout << "--------------------------------------------\n";
cout << " cg1_ex1 opengl robot scenegraph \n";
cout << " \n";
cout << " keyboard: \n";
cout << " arrow keys: select node \n";
cout << " x/X,y/Y,z/Z: rotate node \n";
cout << " r: reset all rotations \n";
cout << " q/Q: quit program \n";
cout << " \n";
cout << " mouse: \n";
cout << " right click: config menu \n";
cout << " left click+drag: rotate selected node \n";
cout << "--------------------------------------------\n";
}
// display callback for GLUT
void Context::display(void){
// clear color and depth buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// switch to opengl modelview matrix
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// position the camera at (0,0,cameraZ) looking down the
// negative z-axis at (0,0,0)
// gluLookAt(0.0, 0.0, cameraZ, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
gluLookAt(cameraZ * sin(angleCamera), 0.0f, cameraZ * cos(angleCamera),
0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
// draw the scenegraph
sceneGraph->traverse();
// display back buffer
glutSwapBuffers();
}
// reshape-Callback for GLUT
void Context::reshape(int w, int h){
width=w;
height=h;
// reshaped window aspect ratio
float aspect = (float) w / (float) h;
// viewport
glViewport(0,0, (GLsizei) w, (GLsizei) h);
// restore view definition after window reshape
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// perspective projection
gluPerspective(fov, aspect, nearPlane, farPlane);
display();
}
// keyboard callback
void Context::keyPressed(unsigned char key, int /*x*/, int /*y*/){
float step= 2.0;
// rotate selected node around
// x,y and z axes with keypresses
switch(key){
case 'q':
case 'Q': exit(0);
case 'x':
sceneGraph->rotate(step, 0, 0);
display();
break;
case 'X':
sceneGraph->rotate(-step, 0, 0);
display();
break;
case 'y':
sceneGraph->rotate(0, step, 0);
display();
break;
case 'Y' :
sceneGraph->rotate(0, -step, 0);
display();
break;
case 'z':
sceneGraph->rotate(0, 0, step);
display();
break;
case 'Z':
sceneGraph->rotate(0, 0, -step);
display();
break;
// XXX: reset rotations
// INSERT YOUR CODE HERE
case 'r':
sceneGraph->reset();
angleCamera = 0.0;
display();
break;
// END XXX
default:
break;
}
}
// keyboard callback for special keys
// (arrow keys for node selection)
void Context::specialKeys(int key, int /*x*/, int /*y*/){
// rotate selected node around
// x,y and z axes with keypresses
switch(key) {
case GLUT_KEY_UP:
sceneGraph->up();
display();
break;
case GLUT_KEY_DOWN:
sceneGraph->down();
display();
break;
case GLUT_KEY_LEFT:
sceneGraph->left();
display();
break;
case GLUT_KEY_RIGHT:
sceneGraph->right();
display();
break;
default:
break;
}
}
// the right button mouse menu
// TODO: add a reset option
// for all rotations
// see also registerCallbacks
// you may also add config options
// like selection of different
// animations here (optional)
// XXX: NEEDS TO BE IMPLEMENTED
void Context::menu(int id){
switch (id) {
case 1:
delete sceneGraph;
exit(0);
// XXX: reset rotations
// INSERT YOUR CODE HERE
case 2:
sceneGraph->reset();
display();
break;
// END XXX
// XXX: add more options (optional)
// INSERT YOUR CODE HERE
case 3:
isAnimation = !isAnimation;
break;
// END XXX
default:
break;
}
}
// mouse motion
void Context::mouseMoved(int x, int y){
// rotate selected node when left mouse button is pressed
if (leftButton) {
sceneGraph->rotate((float) (y-mouseY), (float) (x-mouseX), 0);
mouseX = x;
mouseY = y;
display();
}
}
// mouse callback
void Context::mousePressed(int button, int state, int x, int y){
if (button == GLUT_LEFT) {
if (state == GLUT_UP) {
leftButton= false;
}
else if (state == GLUT_DOWN) {
leftButton= true;
mouseX = x;
mouseY = y;
select(x, height-y);
display();
}
}
}
// playground (not registered)
void Context::idle(void)
{
// calculate time difference from last frame
int timeNow = glutGet(GLUT_ELAPSED_TIME);
int timeDiff = (timeNow - lastTime);
lastTime = timeNow;
if(isAnimation)
{
angleCamera += (timeDiff/1000.0);
}
glutPostRedisplay();
}
void Context::select(int x, int y)
{
GLuint buff[256] = {0};
GLint hits, view[4];
// int id;
// This choose the buffer where store the values for the selection data
glSelectBuffer(256, buff);
//This retrieve info about the viewport
glGetIntegerv(GL_VIEWPORT, view);
//Switching in selecton mode
glRenderMode(GL_SELECT);
//Clearing the name's stack
//This stack contains all the info about the objects
glInitNames();
//Now fill the stack with one element (or glLoadName will generate an error)
glPushName(0);
//Now modify the vieving volume, restricting selection area around the cursor
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
//restrict the draw to an area around the cursor
gluPickMatrix(x, y, 1.0, 1.0, view);
gluPerspective(fov, width/height, nearPlane, farPlane);
//Draw the objects onto the screen
glMatrixMode(GL_MODELVIEW);
//draw only the names in the stack, and fill the array
glutSwapBuffers();
display();
//Do you remeber? We do pushMatrix in PROJECTION mode
glMatrixMode(GL_PROJECTION);
glPopMatrix();
//get number of objects drawed in that area
//and return to render mode
hits = glRenderMode(GL_RENDER);
//Print a list of the objects
listHits(hits, buff);
glMatrixMode(GL_MODELVIEW);
}
void Context::listHits(GLint hits, GLuint *names)
{
//For each hit in the buffer are allocated 4 bytes:
//1. Number of hits selected (always one,
// beacuse when we draw each object
// we use glLoadName, so we replace the
// prevous name in the stack)
//2. Min Z
//3. Max Z
//4. Name of the hit (glLoadName)
if(hits == 1)
{
sceneGraph->selectName(names[3]);
return;
}
unsigned int minZ = std::numeric_limits<unsigned int>::max();
int indexToSelect = -1;
for (int i = 0; i < hits; i++)
{
// cout << "Number: " << names[i * 4] << endl;
// cout << "Min Z: " << names[i * 4 + 1] << endl;
// cout << "Max Z: " << names[i * 4 + 2] << endl;
// cout << "Name on stack: " << names[i * 4 + 3] << endl;
if(names[i * 4 + 1] < minZ)
{
minZ = names[i * 4 + 1];
indexToSelect = (unsigned)names[i * 4 + 3];
}
}
if(hits > 1)
{
sceneGraph->selectName(indexToSelect);
}
}
// register callbacks with GLUT
void Context::registerCallbacks(void){
glutDisplayFunc(display);
glutKeyboardFunc(keyPressed);
glutSpecialFunc(specialKeys);
glutReshapeFunc(reshape);
glutMotionFunc(mouseMoved);
glutMouseFunc(mousePressed);
glutIdleFunc(idle);
glutCreateMenu(menu);
glutAddMenuEntry("quit",1);
// XXX: add reset option
// INSERT YOUR CODE HERE
glutAddMenuEntry("reset",2);
// END XXX
// XXX: add more options (optional)
// INSERT YOUR CODE HERE
glutAddMenuEntry("animation", 3);
// END XXX
glutAttachMenu(GLUT_RIGHT_BUTTON);
return;
}
| [
"mail@petervasil.net"
] | mail@petervasil.net |
f6d24b295076ce7b0c1705d5cadb926d72878b55 | f3f0ee4c2cb3d9cfd23c48a40f0fc96e51f8ed5c | /Public/ComManager/Entity/IEntityID.h | 649b5602b7dbc8e1cc1e98e374fc8b1f5eda0a0c | [] | no_license | cr19891215/VR-SV | 88b959ce55f68b90321ca264d4a36dd236fd2331 | b34cdf4fac6695ce98d06ef74dfcdff2468bd12c | refs/heads/master | 2021-12-29T09:49:40.612250 | 2017-04-06T10:01:49 | 2017-04-06T10:01:49 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 847 | h | /************************************************************************/
/* 作者: LJ */
/* 用途: 实体ID接口 */
/* 时间: 2015-12-01 */
/* 修改时间: */
/************************************************************************/
#ifndef _PUBLIC_IENTITYID_H_
#define _PUBLIC_IENTITYID_H_
namespace VR_Soft
{
class VRSOFT_DLL IEntityID
{
public:
// 析构函数
virtual ~IEntityID(void) { }
// 设置ID
virtual void SetEntityID(const uint64_t uID) = 0;
// 获得ID
virtual const uint64_t GetEntityID(void) const = 0;
// 获得对应实体
virtual IEntityBase* GetEntity(void) const = 0;
};
}
#endif | [
"1405590994@qq.com"
] | 1405590994@qq.com |
aad2a76eec32e4b3418102e99369d43dc6ad1fe8 | 4f4ddc396fa1dfc874780895ca9b8ee4f7714222 | /src/xtp/Samples/Utilities/CommandBarsDesigner/CommandBarsDesigner.h | f247abdbe3fb567c2c4cfec515a502904c2fb018 | [] | no_license | UtsavChokshiCNU/GenSym-Test2 | 3214145186d032a6b5a7486003cef40787786ba0 | a48c806df56297019cfcb22862dd64609fdd8711 | refs/heads/master | 2021-01-23T23:14:03.559378 | 2017-09-09T14:20:09 | 2017-09-09T14:20:09 | 102,960,203 | 3 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 3,626 | h | // CommandBarsDesigner.h : main header file for the COMMANDBARSDESIGNER application
//
// This file is a part of the XTREME TOOLKIT PRO MFC class library.
// (c)1998-2011 Codejock Software, All Rights Reserved.
//
// THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
// RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
// CONSENT OF CODEJOCK SOFTWARE.
//
// THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
// IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
// YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
// SINGLE COMPUTER.
//
// CONTACT INFORMATION:
// support@codejock.com
// http://www.codejock.com
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_COMMANDBARSDESIGNER_H__3D7EA821_8D9C_4378_944E_9FAFC5ADF727__INCLUDED_)
#define AFX_COMMANDBARSDESIGNER_H__3D7EA821_8D9C_4378_944E_9FAFC5ADF727__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
const LPCTSTR lpTypes[] = {NULL, _T("xtpControlButton"), _T("xtpControlPopup"), _T("xtpControlButtonPopup"), _T("xtpControlSplitButtonPopup"), _T("xtpControlComboBox"),
_T("xtpControlEdit"), NULL, _T("xtpControlLabel"), _T("xtpControlCheckBox"), _T("xtpControlGallery"), _T("xtpControlRadioButton") };
/////////////////////////////////////////////////////////////////////////////
// CCommandBarsDesignerApp:
// See CommandBarsDesigner.cpp for the implementation of this class
//
class CCommandBarsDesignerApp : public CWinApp
{
public:
CCommandBarsDesignerApp();
void OnFileNewBlank();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCommandBarsDesignerApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
CMultiDocTemplate* m_pDocTemplate;
BOOL m_bRunAutomated;
BOOL m_bNewBlank;
// Implementation
COleTemplateServer m_server;
// Server object for document creation
//{{AFX_MSG(CCommandBarsDesignerApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
extern CString StripChars(CString str);
extern void XTPStringRemove(CString& str, TCHAR chRemove);
extern int XTPStringDelete(CString& str, int nIndex, int nCount = 1);
extern COLORREF GetStaticFrameColor();
extern BOOL IsRunAutomated();
AFX_INLINE BOOL IsXMLEngineAvailable()
{
static BOOL bAvailable = (BOOL)-1;
if (bAvailable == (BOOL)-1)
{
CXTPDOMDocumentPtr xmlDocPtr;
bAvailable = SUCCEEDED(xmlDocPtr.CreateInstance(CLSID_XTPDOMDocument));
}
return bAvailable;
}
class CPaneHolder : public CWnd
{
public:
virtual CObject* RefreshPropertyGrid(CXTPPropertyGrid* pPropertyGrid)
{
UNREFERENCED_PARAMETER(pPropertyGrid);
return NULL;
}
virtual BOOL OnPropertyGridValueChanged(CObject* pActiveObject, CXTPPropertyGridItem* pItem)
{
UNREFERENCED_PARAMETER(pActiveObject);
UNREFERENCED_PARAMETER(pItem);
return FALSE;
}
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_COMMANDBARSDESIGNER_H__3D7EA821_8D9C_4378_944E_9FAFC5ADF727__INCLUDED_)
| [
"utsavchokshi@Utsavs-MacBook-Pro.local"
] | utsavchokshi@Utsavs-MacBook-Pro.local |
9968d6c244b95e8519dfa900085ca88135afdc92 | e7d7377b40fc431ef2cf8dfa259a611f6acc2c67 | /SampleDump/Cpp/SDK/BP_MaleEyebrow01_classes.h | 8c27d12a383c3d16863e68c80241b2d52de31b3f | [] | no_license | liner0211/uSDK_Generator | ac90211e005c5f744e4f718cd5c8118aab3f8a18 | 9ef122944349d2bad7c0abe5b183534f5b189bd7 | refs/heads/main | 2023-09-02T16:37:22.932365 | 2021-10-31T17:38:03 | 2021-10-31T17:38:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 729 | h | #pragma once
// Name: Mordhau, Version: Patch23
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass BP_MaleEyebrow01.BP_MaleEyebrow01_C
// 0x0000 (FullSize[0x0078] - InheritedSize[0x0078])
class UBP_MaleEyebrow01_C : public UCharacterHair
{
public:
static UClass* StaticClass()
{
static UClass* ptr = UObject::FindClass("BlueprintGeneratedClass BP_MaleEyebrow01.BP_MaleEyebrow01_C");
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"talon_hq@outlook.com"
] | talon_hq@outlook.com |
40f881404a1058df4c4aa3b990488b81a21380a2 | 8fbbbb515fefb94a0b4507ad7254146d7e9ce5d6 | /src/app/FileSearchDialogItemWidgetQt.cpp | 01a3eddbdcc87860904f6d77bf933b05c25f3cd7 | [] | no_license | fapablazacl/XenoideQt5 | e2903909bd06c6423bb28fbce504204382c69875 | 9c136ba1a892c553ed1cf2b49cf9df2071f98173 | refs/heads/master | 2023-07-17T15:44:24.532918 | 2021-08-28T21:10:21 | 2021-08-28T21:10:21 | 400,897,636 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 614 | cpp |
#include <Xenoide/Gui/Qt5/FileSearchDialogItemWidgetQt.hpp>
#include <QLabel>
#include <QHBoxLayout>
namespace Xenoide {
FileSearchDialogItemWidgetQt::FileSearchDialogItemWidgetQt(QWidget *parent, const QString &fileTitle, const QString &fileFolder, const QString &filePath) : QWidget(parent) {
auto fileTitleLabel = new QLabel(fileTitle);
auto filePathLabel = new QLabel(fileFolder);
auto layout = new QHBoxLayout();
layout->addWidget(fileTitleLabel);
layout->addWidget(filePathLabel);
this->setLayout(layout);
this->filePath = filePath;
}
}
| [
"ing.apablaza@gmail.com"
] | ing.apablaza@gmail.com |
6961ff47642a72761ab0686a963b43fd9cb4eb3c | bd0492bbe69985b39cd55c625c5646142bc99577 | /vector_digit.cpp | 6c80f78ffde6fb6db543131b8de9eedf43da15b6 | [] | no_license | wafemand/big_integer_optimized | d33966e0f70434fc0d3932f0c1349732cd90851a | d57e664e539e6834cb5b7f2fbb023554f3f840f5 | refs/heads/master | 2021-06-11T22:41:15.300554 | 2019-09-09T18:26:59 | 2019-09-09T18:26:59 | 135,904,911 | 0 | 1 | null | 2018-06-16T22:06:45 | 2018-06-03T13:07:23 | C++ | UTF-8 | C++ | false | false | 2,885 | cpp | //
// Created by andrey on 25.05.18.
//
#include <algorithm>
#include <cassert>
#include <iostream>
#include "vector_digit.h"
typedef uint64_t digit;
size_t next_pow_2(size_t x) {
while ((x & (x - 1)) != 0) {
x &= (x - 1);
}
return x * 2;
}
void vector_digit::move_memory(size_t new_capacity) {
assert(new_capacity >= SMALL_SIZE);
auto new_storage = dynamic_storage(new_capacity);
std::copy(cur_data_pointer, cur_data_pointer + std::min(size(), new_capacity), new_storage.ptr);
reset_to_big(new_storage);
}
void vector_digit::prepare_change() {
if (!is_small() && !storage.dynamic.unique()) {
move_memory(storage.dynamic.capacity);
}
}
void vector_digit::reset_to_small(inplace_storage const &other) {
if (!is_small()) {
storage.dynamic.~dynamic_storage();
}
storage.inplace = other;
cur_data_pointer = storage.inplace.data;
}
void vector_digit::reset_to_big(dynamic_storage const &other) {
if (is_small()) {
new(&storage.dynamic) dynamic_storage();
}
storage.dynamic = other;
cur_data_pointer = storage.dynamic.ptr;
}
bool vector_digit::is_small() const {
return cur_data_pointer == storage.inplace.data;
}
void vector_digit::fix_capacity() {
if (size() >= capacity()) {
move_memory(2 * capacity());
} else if (size() < capacity() / 4 && capacity() > SMALL_SIZE) {
move_memory(capacity() / 2);
}
}
vector_digit::vector_digit()
: sign(PLUS),
cur_data_pointer(storage.inplace.data),
_size(0)
{}
vector_digit::vector_digit(vector_digit const &other) : vector_digit() {
*this = other;
}
vector_digit &vector_digit::operator=(vector_digit const &other) {
if (other.is_small()) {
reset_to_small(other.storage.inplace);
} else {
reset_to_big(other.storage.dynamic);
}
sign = other.sign;
_size = other._size;
return *this;
}
vector_digit::~vector_digit() {
if (!is_small()) {
storage.dynamic.~dynamic_storage();
}
}
void vector_digit::push_back(digit d) {
fix_capacity();
_size++;
begin()[_size - 1] = d;
}
void vector_digit::pop_back() {
fix_capacity();
_size--;
}
void vector_digit::resize(size_t size) {
resize(size, leading());
}
void vector_digit::resize(size_t new_size, digit default_value) {
if (new_size > SMALL_SIZE) {
move_memory(next_pow_2(new_size));
}
size_t old_size = _size;
_size = new_size;
if (old_size < _size) {
prepare_change();
while (old_size < _size) {
cur_data_pointer[old_size] = default_value;
old_size++;
}
}
}
vector_digit::digit vector_digit::back() const {
return *(cend() - 1);
}
bool vector_digit::is_negative() const {
return sign;
}
void vector_digit::set_sign(bool new_sign) {
sign = new_sign;
}
| [
"andrey150399@mail.ru"
] | andrey150399@mail.ru |
acb15afa783705e1197bb6e21c580d4d2aed8c9a | 2eb3b66b421a1f4a18bcb72b69023a3166273ca1 | /HackerRank/infinitum-jul14/ajob-subsequence/main.cc | 56b1cae581534b477e47a7bafdbc3ebcea3bf35c | [] | no_license | johnathan79717/competitive-programming | e1d62016e8b25d8bcb3d003bba6b1d4dc858a62f | 3c8471b7ebb516147705bbbc4316a511f0fe4dc0 | refs/heads/master | 2022-05-07T20:34:21.959511 | 2022-03-31T15:20:28 | 2022-03-31T15:20:28 | 55,674,796 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 3,257 | cc | #include <string>
#include <vector>
#include <climits>
#include <cstring>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <stack>
#include <deque>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <cassert>
using namespace std;
#define FOR(i,c) for(auto &i: c)
#define SZ size()
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,a,b) for(int i=(a);i<=(b);i++)
#define REPL(i,x) for(int i=0;x[i];i++)
#define PER(i,n) for(int i=(n)-1;i>=0;i--)
#define PER1(i,a,b) for(int i=(a);i>=(b);i--)
#define RI(x) scanf("%d",&x)
#define RL(x) scanf("%lld",&x)
#define DRI(x) int x;RI(x)
#define DRL(x) LL x;RL(x)
#define RII(x,y) scanf("%d%d",&x,&y)
#define DRII(x,y) int x,y;RII(x,y)
#define RIII(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define DRIII(x,y,z) int x,y,z;RIII(x,y,z)
#define RS(x) scanf("%s",x)
#define PI(x) printf("%d\n",x)
#define PL(x) printf("%lld\n",x)
#define PIS(x) printf("%d ",x)
#define MP make_pair
#define PB push_back
#define PQ priority_queue
#define E emplace
#define EB emplace_back
#define MS0(x) memset(x,0,sizeof(x))
#define MS1(x) memset(x,-1,sizeof(x))
#define SEP(x) ((x)?'\n':' ')
#define F first
#define S second
#define V(x) vector<x >
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef long long LL;
typedef unsigned long long ULL;
const int INF = 2000000000;
int MOD = 1005060097;
struct Z {
int i;
Z():i(0) {}
Z(int i): i(i >= 0 ? i : i + MOD) {}
void operator +=(const Z& z) { i += z.i; if(i >= MOD) i -= MOD; }
void operator -=(const Z& z) { i -= z.i; if(i < 0) i += MOD; }
void operator *=(const Z& z) { i = (LL) i * z.i % MOD; }
void operator /=(const Z& z) { (*this) *= z.inverse(); }
Z operator +(const Z& z) const { Z ret(i); ret += z; return ret; }
Z operator -(const Z& z) const { Z ret(i); ret -= z; return ret; }
Z operator *(const Z& z) const { Z ret(i); ret *= z; return ret; }
Z operator /(const Z& z) const { return (*this) * z.inverse(); }
// Z operator -() const { return Z(-i); }
Z inverse() const {
int a = i, d = MOD, x = 0, s = 1;
while(a) {
int q = d / a, r = d % a, t = x - q * s;
d = a, a = r, x = s, s = t;
}
if (d != 1) return -1;
return x < 0 ? x + MOD : x;
}
Z pow(int b) {
Z x=1,y=*this; // ll is taken to avoid overflow of intermediate results
while(b > 0){
if(b%2 == 1)
x *= y;
y *= y; // squaring the base
b /= 2;
}
return x;
}
};
vector<Z> factorial(1, 1), inv_factorial(1, 1);
Z inv_fact(int n) {
while(inv_factorial.size() <= n)
inv_factorial.push_back(inv_factorial.back() / inv_factorial.size());
return inv_factorial.at(n);
}
Z fact(int n) {
while(factorial.size() <= n)
factorial.push_back(factorial.back() * factorial.size());
return factorial.at(n);
}
Z choose(int n, int k) {
if(n < k) return 0;
return fact(n) * (inv_fact(k) * inv_fact(n-k));
}
int main() {
DRI(T);
while(T--) {
DRL(N);
DRL(K);
RI(MOD);
factorial = inv_factorial = V(Z)(1, 1);
N++; K++;
Z ans = 1;
while(N) {
ans *= choose(N%MOD, K%MOD);
N /= MOD;
K /= MOD;
}
PI(ans.i);
}
return 0;
} | [
"johnathan79717@gmail.com"
] | johnathan79717@gmail.com |
c3817a50df182942831d15cfa17671531ac24c44 | 721ecafc8ab45066f3661cbde2257f6016f5b3a8 | /spoj/heapulm.cpp | 95ca3e92ea1362fe3c7d5e3d250e9503ac419492 | [] | no_license | dr0pdb/competitive | 8651ba9722ec260aeb40ef4faf5698e6ebd75d4b | fd0d17d96f934d1724069c4e737fee37a5874887 | refs/heads/master | 2022-04-08T02:14:39.203196 | 2020-02-15T19:05:38 | 2020-02-15T19:05:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,144 | cpp | #include<bits/stdc++.h>
#define FOR(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++)
#define RFOR(i,a,b) for(long long i = (long long)(a); i >= (long long)(b); i--)
#define MIN3(a,b,c) (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c))
#define MAX(a,b) (a)>(b)?(a):(b)
#define MIN2(a,b) (a)<(b)?(a):(b)
using namespace std;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef long long ll;
#define ull unsigned long long
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll,ll> lll;
#define deb(x ) cerr << #x << " here "<< x << endl;
#define endl "\n"
#define printCase() "Case #" << caseNum << ": "
inline bool is_palindrome(const string& s){ return std::equal(s.begin(), s.end(), s.rbegin()); }
const ll MOD = 1000000007;
const ll INF = 1e9+5;
const double eps = 1e-7;
const double PI = acos(-1.0);
#define coud(a,d) cout << fixed << showpoint << setprecision(d) << a;
inline void debug_vi(vi a) {FOR(i, 0, a.size()) cout<<a[i]<<" ";}
inline void debug_vll(vll a) {FOR(i, 0, a.size()) cout<<a[i]<<" ";}
#define ff first
#define ss second
/*----------------------------------------------------------------------*/
const int N = 50001;
int n;
pair<string,int> arr[N];
int arr2[N];
struct SegmentTreeNode {
int maxm, maxi;
//assign the leaf with the value.
void assignLeaf(int value, int idx) {
maxm = value;
maxi = idx;
}
//do the merge option here.
void merge(SegmentTreeNode& left, SegmentTreeNode& right) {
if(left.maxm >= right.maxm) {
maxm = left.maxm;
maxi = left.maxi;
} else {
maxm = right.maxm;
maxi = right.maxi;
}
}
//return the output.
int getValue() {
return maxi;
}
};
//T is the input array type and V is the output type.
template<class T, class V>
class SegmentTree {
SegmentTreeNode* nodes;
int N; // tree size.
public:
SegmentTree(T arr[], int N) {
this->N = N;
nodes = new SegmentTreeNode[getSegmentTreeSize(N)];
buildTree(arr, 1, 0, N-1);
}
~SegmentTree() {
delete[] nodes;
}
V getValue(int lo, int hi) {
SegmentTreeNode result = getValue(1, 0, N-1, lo, hi);
return result.getValue();
}
void update(int index, T value) {
update(1, 0, N-1, index, value);
}
private:
void buildTree(T arr[], int stIndex, int lo, int hi) {
if (lo == hi) {
nodes[stIndex].assignLeaf(arr[lo], lo);
return;
}
int left = 2 * stIndex, right = left + 1, mid = lo + (hi - lo) / 2;
buildTree(arr, left, lo, mid);
buildTree(arr, right, mid + 1, hi);
nodes[stIndex].merge(nodes[left], nodes[right]);
}
SegmentTreeNode getValue(int stIndex, int left, int right, int lo, int hi) {
if (left == lo && right == hi)
return nodes[stIndex];
int mid = (left + right) / 2;
if (lo > mid)
return getValue(2*stIndex+1, mid+1, right, lo, hi);
if (hi <= mid)
return getValue(2*stIndex, left, mid, lo, hi);
SegmentTreeNode leftResult = getValue(2*stIndex, left, mid, lo, mid);
SegmentTreeNode rightResult = getValue(2*stIndex+1, mid+1, right, mid+1, hi);
SegmentTreeNode result;
result.merge(leftResult, rightResult);
return result;
}
int getSegmentTreeSize(int N) {
return 4*N;
}
};
void recurse(SegmentTree<int, int> &st, int lo, int hi) {
if(lo > hi) return;
if(lo == hi) {
cout<<"("<<arr[lo].ff<<"/"<<arr[hi].ss<<")";
return;
}
int maxmi = st.getValue(lo, hi);
cout<<"(";
recurse(st, lo, maxmi-1);
cout<<arr[maxmi].ff<<"/"<<arr[maxmi].ss;
recurse(st, maxmi+1, hi);
cout<<")";
}
int main(){
std::ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
string s;
while(cin>>n && n) {
FOR(i, 0, n) {
cin>>s;
int tmp = 0, val;
FOR(j, 0, s.size()) {
if(s[j] == '/') break;
tmp++;
}
int sz = s.size();
sz -= tmp + 1;
val = stoi(s.substr(tmp + 1, sz));
arr[i] = {s.substr(0, tmp), val};
}
sort(arr, arr+n);
FOR(i, 0, n) arr2[i] = arr[i].ss;
SegmentTree<int, int> st(arr2, n);
recurse(st, 0, n-1);
cout<<endl;
}
return 0;
} | [
"srv.twry@gmail.com"
] | srv.twry@gmail.com |
741300fc4c598c4997b48863dd8a9bf72229bae1 | af9b24ad17b616094c449f30e608d8e3b37d17f1 | /program/includes/reqestAndResponseUtils.hpp | 9721d6512f4d8a8d9113ab79b092e5800353f9d1 | [] | no_license | LidiaGr/Webserver | 10ff94d2bc28e788f00ef518804681b97c81aab3 | dbea3439ac93fd154b3e7e4218e673c8606013c4 | refs/heads/main | 2023-05-06T16:50:50.169789 | 2021-05-30T11:10:10 | 2021-05-30T11:10:10 | 347,743,045 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 755 | hpp | //
// reqestAndResponseUtils.hpp
// webserv
//
// Created by Temple Tarsha on 3/29/21.
// Copyright © 2021 Temple Tarsha. All rights reserved.
//
#ifndef reqestAndResponseUtils_hpp
#define reqestAndResponseUtils_hpp
#include "main.hpp"
std::string createBasicResponseHeaders();
std::string createAllowMethodsStr(Location* src);
bool isLocationExists(std::string target, Client *client, std::vector<std::string> request);
Location* rightLocation(std::vector<Location*> locations, std::string target);
std::string createPath(Location* src, std::string target, std::vector<std::string> request);
std::string cutTarget(Location* src, std::string target);
char* allocateResponse(std::string response);
#endif /* reqestAndResponseUtils_hpp */
| [
"lidia.ls16@gmail.com"
] | lidia.ls16@gmail.com |
9066bf061dfbca652863a6f282f5e4731d488b00 | cb05df7f89e957de7c7e48f53499c5aa7c225b9a | /Simulation/src/input/EventInput.cpp | 1bb99fd1be3e2397721961792cd06c04c770f511 | [
"Apache-2.0"
] | permissive | fg-netzwerksicherheit/EvolutionaryNetworkOptimizer | fce16f8e66e977c67377d388d139e702695ccc02 | fdca004ba33a0d891f7d82f32999ec7d07a041f9 | refs/heads/master | 2021-01-01T18:20:45.005595 | 2017-07-26T09:34:44 | 2017-07-26T09:34:44 | 98,313,624 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,081 | cpp | /*
* EventInput.cpp
*
* Created on: Apr 6, 2017
* Author: Quang Pham, Kiet Vo
*/
#include "EventInput.h"
#include "../components/Node.h"
#include "../simulation/events/TcpAppEvent.h"
#include "../simulation/events/UdpAppEvent.h"
#include "../simulation/events/UdpTestEvent.h"
#include "../simulation/Simulation.h"
namespace simul {
EventInput::EventInput() {
}
EventInput::~EventInput() {
}
enum EventType {
TCPTYPE_EVENT, UDPTYPE_EVENT, UDPTESTTYPE_EVENT
};
vector<weak_ptr<Event>> EventInput::ReadEvent(string path, SimulationPtr si) {
AnyEventListPtr list_of_event = make_shared<anygraph::AnyEventList>();
if (path.find(".json") != string::npos) {
list_of_event->read_json_event(path);
}
if (path.find(".xml") != string::npos) {
list_of_event->read_xml_event(path);
}
weak_ptr<Event> event;
NodePtr sourceNode;
NodePtr destNode;
vector<weak_ptr<Event>> event_list;
string start;
string data;
EventType eventType = UDPTESTTYPE_EVENT;
//cout << "total events: " << list_of_event->get_number_of_event() << endl;
for (int j = 0; j < list_of_event->get_number_of_event(); ++j) {
for (int i = 0; i < list_of_event->get_event_at(j).get_attribute_size(); ++i) {
if (list_of_event->get_event_at(j).get_attribute_name_at(i) == "src") {
string sourceID = list_of_event->get_event_at(j).get_attribute_data_at(i);
sourceNode = si->GetNode(sourceID);
if (sourceNode == nullptr)
sourceNode = make_shared<Node>(sourceID);
}
if (list_of_event->get_event_at(j).get_attribute_name_at(i) == "dst") {
string destID = list_of_event->get_event_at(j).get_attribute_data_at(i);
destNode = si->GetNode(destID);
if (destNode == nullptr)
destNode = make_shared<Node>(destID);
}
if (list_of_event->get_event_at(j).get_attribute_name_at(i) == "protocol") {
if (list_of_event->get_event_at(j).get_attribute_data_at(i) == "tcp")
eventType = TCPTYPE_EVENT;
else if (list_of_event->get_event_at(j).get_attribute_data_at(i) == "udp")
eventType = UDPTYPE_EVENT;
else if (list_of_event->get_event_at(j).get_attribute_data_at(i) == "udptest")
eventType = UDPTESTTYPE_EVENT;
}
if (list_of_event->get_event_at(j).get_attribute_name_at(i) == "datatransfer")
data = list_of_event->get_event_at(j).get_attribute_data_at(i);
if (list_of_event->get_event_at(j).get_attribute_name_at(i) == "start")
start = list_of_event->get_event_at(j).get_attribute_data_at(i);
}
double startTime = atof(start.c_str());
uint32_t bytes = atoi(data.c_str());
switch (eventType) {
case (UDPTESTTYPE_EVENT):
event = si->CreateEvent<UdpTestEvent>(sourceNode, destNode);
break;
case (TCPTYPE_EVENT):
event = si->CreateEvent<TcpAppEvent>(sourceNode, destNode, bytes);
break;
case (UDPTYPE_EVENT):
event = si->CreateEvent<UdpAppEvent>(sourceNode, destNode, bytes);
break;
default:
event = si->CreateEvent<UdpTestEvent>(sourceNode, destNode);
}
event.lock()->SetStartTime(startTime);
event_list.push_back(event);
}
return event_list;
}
}
/* namespace std */
| [
"mueller-bady@fb2.fra-uas.de"
] | mueller-bady@fb2.fra-uas.de |
35401c6095262235ca8f526e26272427595ea73a | f0ea407fe6d477f4dff501a986715fac93b212d2 | /mobileDeviceConfig/src/main.cpp | 703a9b8416f3bf71be54e15fdc997310a8f3d9a5 | [] | no_license | Breno0809/Application | 8909ea08e4f86e591766598b95cdb8795cc52eeb | cc7c267e24fbf6a31aa35bd0c18447ac6f02ffa1 | refs/heads/main | 2023-08-21T05:38:54.822542 | 2021-10-14T16:46:44 | 2021-10-14T16:46:44 | 383,177,709 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 356 | cpp | #include <Arduino.h>
#include <Wire.h>
// #include "MAX30100_PulseOximeter.h"
#define LED_BUILTIN 2
#define reportingPeriodMs 1000
// PulseOximeter pox;
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
// digitalWrite(LED_BUILTIN, LOW);
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH);
delay(2000);
digitalWrite(LED_BUILTIN, LOW);
delay(2000);
} | [
"bbreno08@gmail.com"
] | bbreno08@gmail.com |
0ae94abd3a1b6e836f7b23abd8991b504ab5a0ee | 489eee20c8e036d4ae2b09c29d3d0f56537f2785 | /BackJoon's Problem/상범빌딩.cpp | 32d7f2ca929e134ce635883b7efa84025aa6c958 | [] | no_license | JoHoYoung/Algorithm | d7220089d2153f82d6c90716f278c8c2af5142af | 315d0c0a8d1b14c8fe49a8e8e7807e6f4a30620f | refs/heads/master | 2021-06-04T15:19:23.347558 | 2020-05-01T09:44:11 | 2020-05-01T09:44:11 | 134,406,811 | 2 | 0 | null | null | null | null | UHC | C++ | false | false | 1,945 | cpp | #include<iostream>
#include<cstring>
#include<vector>
#include<set>
#include<algorithm>
#include<cmath>
#include<queue>
#define MAXN 5000001
using namespace std;
//using P = pair<int, int>;
typedef struct P {
int k, i, j, depth;
};
P S, E;
int L, R, C;
char board[31][31][31];
bool visited[31][31][31];
// 북 동 남 서 하 상
int Di[6] = {-1, 0, 1, 0, 0, 0};
int Dj[6] = {0, 1, 0, -1, 0, 0};
int Dk[6] = {0, 0, 0, 0, -1, 1};
queue<P> Q;
int result = MAXN;
bool isFind = false;
int min(int a, int b) {
if (a > b) return b;
return a;
}
void bfs() {
while (!Q.empty()) {
P now = Q.front();
Q.pop();
//cout<<now.k<<" "<<now.i<<" "<<now.j<<endl;
if (now.k == E.k && now.i == E.i && now.j == E.j) {
isFind = true;
// cout<<"VISIT "<<E.k<<" "<<E.i<<" "<<E.j<<endl;
result = min(result, now.depth);
}
for (int d = 0; d < 6; d++) {
int nk = now.k + Dk[d];
int ni = now.i + Di[d];
int nj = now.j + Dj[d];
if (nk < 0 || nk > L - 1 || ni < 0 || ni > R - 1 || nj < 0 || nj > C - 1 || visited[nk][ni][nj] || board[nk][ni][nj] == '#') continue;
visited[nk][ni][nj] = true;
//cout<<"VISIT "<<nk<<" "<<ni<<" "<<nj<<endl;
Q.push({nk, ni, nj, now.depth + 1});
}
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
while(1){
cin >>L >>R >> C;
if(L==0 && R==0 && C==0)return 0;
isFind = false;
result = MAXN;
while(!Q.empty()) Q.pop();
memset(visited, false, sizeof(visited));
for (int k = 0; k < L; k++) {
for (int i = 0; i < R; i++) {
for (int j = 0; j < C; j++) {
cin >> board[k][i][j];
if (board[k][i][j] == 'S') S = {k, i, j};
if (board[k][i][j] == 'E') E = {k, i, j};
}
}
}
Q.push({S.k, S.i, S.j, 0});
bfs();
if(isFind){
cout<<"Escaped in "<<result<<" minute(s).\n";
}else{
cout<<"Trapped!\n";
}
}
return 0;
}
| [
"whghdud17@naver.com"
] | whghdud17@naver.com |
651c2e82c7b99ef0a23c7d5e14ae5d6d306097aa | 1d4293fb707c97e7f9f9bb5ca033da7db276f9de | /LE1/SDK_HEADERS/SFXOnlineFoundation_f_structs.h | b61c76a12874fb736f493cf481e7314d1de8e001 | [] | no_license | d00telemental/LExSDK | 37f0d502617e475fbf64c248626364a59d171950 | ee2294127d79631f0c1581e1fad3244c3ac20537 | refs/heads/main | 2023-08-18T15:41:45.495754 | 2021-09-12T19:30:54 | 2021-09-12T19:30:54 | 384,050,207 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 318,118 | h | /*
#############################################################################################
# Mass Effect 1 (Legendary Edition) (2.0.0.48602) SDK
# Generated with TheFeckless UE3 SDK Generator v1.4_Beta-Rev.53-MELE
# ========================================================================================= #
# File: SFXOnlineFoundation_f_structs.h
# ========================================================================================= #
# Credits: uNrEaL, Tamimego, SystemFiles, R00T88, _silencer, the1domo, K@N@VEL
# Thanks: HOOAH07, lowHertz
# Forums: www.uc-forum.com, www.gamedeception.net
#############################################################################################
*/
#pragma once
#include <Windows.h>
#include <cstdio>
#include "../SdkInitializer.h"
#ifdef _MSC_VER
#pragma pack ( push, 0x4 )
#endif
/*
# ========================================================================================= #
# Function Structs
# ========================================================================================= #
*/
// Function SFXOnlineFoundation.SFXOnlineEvent.Update
// [0x00020400] ( FUNC_Native )
struct USFXOnlineEvent_execUpdate_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.IsComplete
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execIsComplete_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.IsPending
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execIsPending_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.CompleteAndSucceeded
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execCompleteAndSucceeded_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.HasTimedOut
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execHasTimedOut_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.IsTimeoutEnabled
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execIsTimeoutEnabled_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.DisableTimeout
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execDisableTimeout_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineEvent.EnableTimeout
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execEnableTimeout_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineEvent.SetTimeout
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execSetTimeout_Parms
{
float fEventTimeout; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.GetTimeout
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execGetTimeout_Parms
{
float ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.SetErrorString
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execSetErrorString_Parms
{
struct FString sMessage; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.GetErrorString
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execGetErrorString_Parms
{
struct FString ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.SetErrorCode
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execSetErrorCode_Parms
{
int nCode; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.GetErrorCode
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execGetErrorCode_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.SetStatus
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execSetStatus_Parms
{
unsigned char eNewStatus; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.GetStatus
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execGetStatus_Parms
{
unsigned char ReturnValue; // 0x0000 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.SetOutcome
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execSetOutcome_Parms
{
unsigned char eStatusFinished; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.GetOutcome
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execGetOutcome_Parms
{
unsigned char ReturnValue; // 0x0000 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.SetEventId
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execSetEventId_Parms
{
int nNewEventId; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.GetEventId
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execGetEventId_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.SetEventType
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execSetEventType_Parms
{
unsigned char eNewEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent.GetEventType
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_execGetEventType_Parms
{
unsigned char ReturnValue; // 0x0000 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent_Integer.SetInteger
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_Integer_execSetInteger_Parms
{
int nInteger; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent_Integer.GetInteger
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_Integer_execGetInteger_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent_String.SetStringData
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_String_execSetStringData_Parms
{
struct FString sStringData; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineEvent_String.GetStringData
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_String_execGetStringData_Parms
{
struct FString ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineEvent_Notification.SetPriority
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_Notification_execSetPriority_Parms
{
int nPriority; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent_Notification.GetPriority
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_Notification_execGetPriority_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEvent_Notification.SetImageName
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_Notification_execSetImageName_Parms
{
struct FString sImageName; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineEvent_Notification.GetImageName
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEvent_Notification_execGetImageName_Parms
{
struct FString ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineEventList.GetNextTimedOutEvent
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEventList_execGetNextTimedOutEvent_Parms
{
class USFXOnlineEvent* ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEventList.RemoveEvent
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEventList_execRemoveEvent_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEventList.FindEventByType
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEventList_execFindEventByType_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nEventId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEventList.FindEvent
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEventList_execFindEvent_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEventList.GetEventAtIndex
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEventList_execGetEventAtIndex_Parms
{
int nEventIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
class USFXOnlineEvent* ReturnValue; // 0x0004 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEventList.GetEvent
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEventList_execGetEvent_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
class USFXOnlineEvent* ReturnValue; // 0x0008 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineEventList.AddEvent
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineEventList_execAddEvent_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponent.GetAPIName
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponent_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponent.OnRelease
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponent_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponent.OnInitialize
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponent_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentAPI.Idle
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentAPI_execIdle_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentAchievement.GetTitleAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct UISFXOnlineComponentAchievement_execGetTitleAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentAchievement.GetPlatformAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct UISFXOnlineComponentAchievement_execGetPlatformAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentAchievement.IsGranted
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentAchievement_execIsGranted_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentAchievement.Grant
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentAchievement_execGrant_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.GetConnectMode
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execGetConnectMode_Parms
{
unsigned char ReturnValue; // 0x0000 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.GetUIState
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execGetUIState_Parms
{
unsigned char ReturnValue; // 0x0000 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.CanShowPresenceInformation
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execCanShowPresenceInformation_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char ReturnValue; // 0x0004 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.CanViewPlayerProfiles
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execCanViewPlayerProfiles_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char ReturnValue; // 0x0004 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.CanPurchaseContent
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execCanPurchaseContent_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char ReturnValue; // 0x0004 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.CanDownloadUserContent
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execCanDownloadUserContent_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char ReturnValue; // 0x0004 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.CanCommunicate
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execCanCommunicate_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char ReturnValue; // 0x0004 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.CanPlayOnline
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execCanPlayOnline_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char ReturnValue; // 0x0004 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.EnterCDKey
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execEnterCDKey_Parms
{
struct FString sKey; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.OnDownloadOffersUICompleted
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execOnDownloadOffersUICompleted_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.OnDLCInfoLoaded
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execOnDLCInfoLoaded_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.OpenCerberusUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execOpenCerberusUI_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.CheckEntitlement
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execCheckEntitlement_Parms
{
struct FString sGroup; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sTag; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0020 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.IsCerberusMember
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execIsCerberusMember_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.DisablePersona
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execDisablePersona_Parms
{
struct FString sPersonaNonGrata; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.CreatePersona
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execCreatePersona_Parms
{
struct FString sPersonaName; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SelectPersona
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSelectPersona_Parms
{
struct FString sPersonaName; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.AcceptTOS
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execAcceptTOS_Parms
{
unsigned long bAccepted; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.Disconnect
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execDisconnect_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitStore
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitStore_Parms
{
struct TArray<int> aiChosen; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitCreateNucleusAccountEx
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitCreateNucleusAccountEx_Parms
{
struct FString sEmail; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sPassword; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bEAProducts; // 0x0020 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bThirdParty; // 0x0024 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bBioWareProducts; // 0x0028 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString i_sCountryCode; // 0x002C (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
int BirthDay; // 0x003C (0x0004) [0x0000000000000080] ( CPF_Parm )
int BirthMonth; // 0x0040 (0x0004) [0x0000000000000080] ( CPF_Parm )
int BirthYear; // 0x0044 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString i_sLanguageCode; // 0x0048 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bSubmit; // 0x0058 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitEmailPasswordMismatch
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitEmailPasswordMismatch_Parms
{
struct FString Email; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Password; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
int eReturnCode; // 0x0020 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitMessageBox
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitMessageBox_Parms
{
int eReturnCode; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitRedeemCode
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitRedeemCode_Parms
{
unsigned long bContinue; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString i_sCode; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitCerberusWelcomeMessage
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitCerberusWelcomeMessage_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitCerberusIntro
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitCerberusIntro_Parms
{
int eReturnCode; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitNucleusWelcomeMessage
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitNucleusWelcomeMessage_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitCreateNucleusAccount
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitCreateNucleusAccount_Parms
{
struct FString sEmail; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sPassword; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bEAProducts; // 0x0020 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bThirdParty; // 0x0024 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bBioWareProducts; // 0x0028 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bSubmit; // 0x002C (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitParentEmail
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitParentEmail_Parms
{
unsigned long bContinue; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString ParentEmail; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitNucleusLogin
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitNucleusLogin_Parms
{
struct FString Email; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Password; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char eReturnCode; // 0x0020 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SubmitIntroPage
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSubmitIntroPage_Parms
{
unsigned long bContinue; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bSimulated; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.Connect
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execConnect_Parms
{
unsigned char connectMode; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.GoBackInUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execGoBackInUI_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.Cancel
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execCancel_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.GetUserId
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execGetUserId_Parms
{
struct FUniqueNetId ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.GetPersonaName
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execGetPersonaName_Parms
{
struct FString ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.HasInternetConnection
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execHasInternetConnection_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.IsConnectedTo3rdPartyOnlineService
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execIsConnectedTo3rdPartyOnlineService_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.HasAccountFor3rdPartyOnlineService
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execHasAccountFor3rdPartyOnlineService_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.IsSignedIn
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execIsSignedIn_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.IsConnected
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execIsConnected_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.SwitchActiveUserIndex
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execSwitchActiveUserIndex_Parms
{
int nNewIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.GetActiveUserIndex
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execGetActiveUserIndex_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentLogin.GetLoginStatus
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentLogin_execGetLoginStatus_Parms
{
unsigned char ReturnValue; // 0x0000 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.GetTargetOfferInfo
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execGetTargetOfferInfo_Parms
{
unsigned char nSource; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FSFXOnlineTargetOfferInfo ReturnValue; // 0x0004 (0x0020) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.HasUserPurchasedAnOffer
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execHasUserPurchasedAnOffer_Parms
{
struct FSFXOnline_OfferID aOfferId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0008 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.DownloadOffers
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execDownloadOffers_Parms
{
struct TArray<struct FSFXOnline_OfferID> aOfferIds; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0010 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.GetOfferKeyIfEntitled
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execGetOfferKeyIfEntitled_Parms
{
int internalId; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString ReturnValue; // 0x0004 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.GetGrantingOffers
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execGetGrantingOffers_Parms
{
struct TArray<struct FSFXOfferDescriptor> ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.GetEntitledDLCInfo
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execGetEntitledDLCInfo_Parms
{
struct TArray<struct FSFXOfferDescriptor> ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.RefreshEntitlementFlags
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execRefreshEntitlementFlags_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.GetEntitlementGroups
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execGetEntitlementGroups_Parms
{
struct TArray<struct FSFXOnlineEntitlementGroupInfo> ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.GetDaysSinceCerberusRegistration
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execGetDaysSinceCerberusRegistration_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.IsCalendarUnlockEarned
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execIsCalendarUnlockEarned_Parms
{
int nDay; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.RequestServerInfo
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execRequestServerInfo_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentNotification.RequestData
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentNotification_execRequestData_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.GetRebootUserData
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execGetRebootUserData_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.WasRebootedFromOSCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execWasRebootedFromOSCodeRedemptionUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.ShowCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execShowCodeRedemptionUI_Parms
{
int UserData; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.ShowStoreUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execShowStoreUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.GetOnlineXuid
// [0x00420400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execGetOnlineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oUserXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.GetOfflineXuid
// [0x00420400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execGetOfflineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oUserXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.AddRecentPlayer
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execAddRecentPlayer_Parms
{
struct FUniqueNetId oPlayerId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString sDescription; // 0x0008 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0018 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.ShowKeyboardUI
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execShowKeyboardUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString sTitleText; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sDescriptionText; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char nKeyboardType; // 0x0024 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldValidate; // 0x0028 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bRouteThroughConsole; // 0x002C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString sDefaultText; // 0x0030 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
int nMaxResultLength; // 0x0040 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0044 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.ShowAchievementsUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execShowAchievementsUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.ShowFeedbackUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execShowFeedbackUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.ShowGamerCardUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execShowGamerCardUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.ShowFriendsInviteUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execShowFriendsInviteUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.ShowFriendsUI
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execShowFriendsUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.CanShowPresenceInformation
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execCanShowPresenceInformation_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.CanViewPlayerProfiles
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execCanViewPlayerProfiles_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.CanPurchaseContent
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execCanPurchaseContent_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.CanDownloadUserContent
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execCanDownloadUserContent_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.CanCommunicate
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execCanCommunicate_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.CanPlayOnline
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execCanPlayOnline_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.SetRichPresence
// [0x00420400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execSetRichPresence_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nPresenceMode; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FLocalizedStringSetting> aLocalizedStringSettings; // 0x0008 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
struct TArray<struct FSettingsProperty> aProperties; // 0x0018 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.ShowLoginUI
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execShowLoginUI_Parms
{
unsigned long bShowOnlineOnly; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentPlatform.GetLoginStatus
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentPlatform_execGetLoginStatus_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentTelemetry.Flush
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentTelemetry_execFlush_Parms
{
unsigned char Channel; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentTelemetry.RegisterConnectionDelegates
// [0x00020000]
struct UISFXOnlineComponentTelemetry_execRegisterConnectionDelegates_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentTelemetry.OnDisconnect
// [0x00120000]
struct UISFXOnlineComponentTelemetry_execOnDisconnect_Parms
{
int Error; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString SessionId; // 0x0004 (0x0010) [0x0000000000400082] ( CPF_Const | CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentTelemetry.OnAuthenticate
// [0x00120000]
struct UISFXOnlineComponentTelemetry_execOnAuthenticate_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentTelemetry.CanCollect
// [0x00120000]
struct UISFXOnlineComponentTelemetry_execCanCollect_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowStore
// [0x00020800] ( FUNC_Event )
struct UISFXOnlineComponentUserInterface_eventShowStore_Parms
{
struct TArray<struct FSFXOfferDescriptor> aOffers; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.HasCerberusDLC
// [0x00020800] ( FUNC_Event )
struct UISFXOnlineComponentUserInterface_eventHasCerberusDLC_Parms
{
unsigned long bVal; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.OnDisplayNotification
// [0x00020800] ( FUNC_Event )
struct UISFXOnlineComponentUserInterface_eventOnDisplayNotification_Parms
{
unsigned char Type; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString MessageData; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Title; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Image; // 0x0024 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ClearNotifications
// [0x00020800] ( FUNC_Event )
struct UISFXOnlineComponentUserInterface_eventClearNotifications_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.CloseEANetworking
// [0x00020800] ( FUNC_Event )
struct UISFXOnlineComponentUserInterface_eventCloseEANetworking_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.SetState
// [0x00020800] ( FUNC_Event )
struct UISFXOnlineComponentUserInterface_eventSetState_Parms
{
unsigned char eState; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowEmailPasswordMismatch
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowEmailPasswordMismatch_Parms
{
struct FString Email; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Password; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowMessageBoxWait
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowMessageBoxWait_Parms
{
int srMessage; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int srButton1Text; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
int srButton2Text; // 0x0008 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowMessageBox
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowMessageBox_Parms
{
struct FString sTitle; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sMessage; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sButton1Text; // 0x0020 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
struct FString sButton2Text; // 0x0030 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
struct FString sButton3Text; // 0x0040 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowCreateNucleusAccountEx
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowCreateNucleusAccountEx_Parms
{
struct FString sEmail; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sPassword; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bEAProducts; // 0x0020 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bThirdParty; // 0x0024 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bBioWareProducts; // 0x0028 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString i_sCountryCode; // 0x002C (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
int BirthDay; // 0x003C (0x0004) [0x0000000000000080] ( CPF_Parm )
int BirthMonth; // 0x0040 (0x0004) [0x0000000000000080] ( CPF_Parm )
int BirthYear; // 0x0044 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString i_sLanguageCode; // 0x0048 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct TArray<struct FString> m_CountryCodeList; // 0x0058 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct TArray<struct FString> m_CountryDisplayList; // 0x0068 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowCerberusWelcomeMessage
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowCerberusWelcomeMessage_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowRedeemCode
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowRedeemCode_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowCerberusIntro
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowCerberusIntro_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowNucleusWelcomeMessage
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowNucleusWelcomeMessage_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowCreateNucleusAccount
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowCreateNucleusAccount_Parms
{
struct FString sEmail; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sPassword; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bEAProducts; // 0x0020 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bThirdParty; // 0x0024 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bRegisterProduct; // 0x0028 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bBioWareProducts; // 0x002C (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bUnderage; // 0x0030 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowParentEmail
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowParentEmail_Parms
{
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowAccountDemographics
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowAccountDemographics_Parms
{
struct TArray<struct FString> m_CountryCodeList; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct TArray<struct FString> m_CountryDisplayList; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowTermsOfService
// [0x00024400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowTermsOfService_Parms
{
struct FString i_sTermsOfService; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bTOSChanged; // 0x0010 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowNucleusLogin
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowNucleusLogin_Parms
{
struct FString Email; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Password; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
int eScreenState; // 0x0020 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.ISFXOnlineComponentUserInterface.ShowIntroPage
// [0x00020400] ( FUNC_Native )
struct UISFXOnlineComponentUserInterface_execShowIntroPage_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponent.IsXbox360
// [0x00020802] ( FUNC_Event )
struct USFXOnlineComponent_eventIsXbox360_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.IsPS3
// [0x00020802] ( FUNC_Event )
struct USFXOnlineComponent_eventIsPS3_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.IsConsole
// [0x00020802] ( FUNC_Event )
struct USFXOnlineComponent_eventIsConsole_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.IsEventPending
// [0x00024401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execIsEventPending_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nEventId; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.GetEvent
// [0x00024401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execGetEvent_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nEventId; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
class USFXOnlineEvent* ReturnValue; // 0x0008 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.WaitingForWorkSetObject
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execWaitingForWorkSetObject_Parms
{
struct TArray<class USFXOnlineEvent*> aOnlineEventSet; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FScriptDelegate fnWorkComplete; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.WaitingForWorkSetType
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execWaitingForWorkSetType_Parms
{
struct TArray<unsigned char> aWorkUnits; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FScriptDelegate fnWorkComplete; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.WaitingForWorkObject
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execWaitingForWorkObject_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate fnWorkComplete; // 0x0008 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.WaitingForWorkType
// [0x00024401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execWaitingForWorkType_Parms
{
unsigned char eWork; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate fnWorkComplete; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
int nEventId; // 0x0014 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.NotifyWorkFinishedObject
// [0x00024401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execNotifyWorkFinishedObject_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned char eStatusFinished; // 0x0008 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.NotifyWorkFinishedType
// [0x00024401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execNotifyWorkFinishedType_Parms
{
unsigned char eWork; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char eStatusFinished; // 0x0001 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
int nEventId; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.NotifyWorkStartedObject
// [0x00024401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execNotifyWorkStartedObject_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned char eEventType; // 0x0008 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.NotifyWorkStartedType
// [0x00024401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execNotifyWorkStartedType_Parms
{
unsigned char eWork; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nEventId; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
float fTimeOut; // 0x0008 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.NotifyEventObject
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execNotifyEventObject_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.NotifyEventType
// [0x00024401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execNotifyEventType_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char eStatus; // 0x0001 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char eOutcome; // 0x0002 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.StopWaitingForAllWork
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execStopWaitingForAllWork_Parms
{
class UObject* oCallbackTarget; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.UnsubscribeFromAllEvents
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execUnsubscribeFromAllEvents_Parms
{
class UObject* oCallbackTarget; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.UnsubscribeFromEvent
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execUnsubscribeFromEvent_Parms
{
unsigned char oEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate fnEventCallback; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.SubscribeToEvent
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execSubscribeToEvent_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate fnEventCallback; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.OnEvent
// [0x00120000]
struct USFXOnlineComponent_execOnEvent_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponent_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponent_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponent.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponent_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponent.SubscribeToEvents
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponent_execSubscribeToEvents_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentOrigin.OnTick
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentOrigin_execOnTick_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentOrigin.RefreshServerAchievements_ASync
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentOrigin_execRefreshServerAchievements_ASync_Parms
{
struct FSFXCachedAchievements cached; // 0x0000 (0x0024) [0x0000000000400180] ( CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0024 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentOrigin.SetRichPresence
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentOrigin_execSetRichPresence_Parms
{
struct FString presence; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString gamePresence; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0020 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentOrigin.RequestProfile
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentOrigin_execRequestProfile_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentOrigin.StartService
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentOrigin_execStartService_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentOrigin.EnsureSignedIn
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentOrigin_execEnsureSignedIn_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentOrigin.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentOrigin_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentOrigin.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentOrigin_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentOrigin.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentOrigin_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearUnlockAchievementCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearUnlockAchievementCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate UnlockAchievementCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddUnlockAchievementCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddUnlockAchievementCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate UnlockAchievementCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnUnlockAchievementComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnUnlockAchievementComplete_Parms
{
unsigned long bWasSuccessful; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.UnlockAchievement
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execUnlockAchievement_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetAchievements
// [0x00424400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execGetAchievements_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FAchievementDetails> Achievements; // 0x0004 (0x0010) [0x0000000000400180] ( CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
int TitleId; // 0x0014 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
int SetIndex; // 0x0018 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char ReturnValue; // 0x001C (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearReadAchievementsCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearReadAchievementsCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadAchievementsCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddReadAchievementsCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddReadAchievementsCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadAchievementsCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnReadAchievementsComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnReadAchievementsComplete_Parms
{
int TitleId; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ReadAchievements
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execReadAchievements_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int TitleId; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldReadText; // 0x0008 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldReadImages; // 0x000C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0010 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.DeleteMessage
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execDeleteMessage_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int MessageIndex; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearFriendMessageReceivedDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execClearFriendMessageReceivedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate MessageDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddFriendMessageReceivedDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAddFriendMessageReceivedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate MessageDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnFriendMessageReceived
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnFriendMessageReceived_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId SendingPlayer; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString SendingNick; // 0x000C (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Message; // 0x001C (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetFriendMessages
// [0x00420000]
struct USFXOnlineComponentUnrealPlayer_execGetFriendMessages_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FOnlineFriendMessage> FriendMessages; // 0x0004 (0x0010) [0x0000000000400180] ( CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearJoinFriendGameCompleteDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execClearJoinFriendGameCompleteDelegate_Parms
{
struct FScriptDelegate JoinFriendGameCompleteDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddJoinFriendGameCompleteDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAddJoinFriendGameCompleteDelegate_Parms
{
struct FScriptDelegate JoinFriendGameCompleteDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnJoinFriendGameComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnJoinFriendGameComplete_Parms
{
unsigned long bWasSuccessful; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.JoinFriendGame
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execJoinFriendGame_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId Friend; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearReceivedGameInviteDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execClearReceivedGameInviteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReceivedGameInviteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddReceivedGameInviteDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAddReceivedGameInviteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReceivedGameInviteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnReceivedGameInvite
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnReceivedGameInvite_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString InviterName; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.SendGameInviteToFriends
// [0x00024000]
struct USFXOnlineComponentUnrealPlayer_execSendGameInviteToFriends_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FUniqueNetId> Friends; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Text; // 0x0014 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0024 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.SendGameInviteToFriend
// [0x00024000]
struct USFXOnlineComponentUnrealPlayer_execSendGameInviteToFriend_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId Friend; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString Text; // 0x000C (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x001C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.SendMessageToFriend
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execSendMessageToFriend_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId Friend; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString Message; // 0x000C (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x001C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearFriendInviteReceivedDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execClearFriendInviteReceivedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate InviteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddFriendInviteReceivedDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAddFriendInviteReceivedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate InviteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnFriendInviteReceived
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnFriendInviteReceived_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId RequestingPlayer; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString RequestingNick; // 0x000C (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Message; // 0x001C (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.RemoveFriend
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execRemoveFriend_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId FormerFriend; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.DenyFriendInvite
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execDenyFriendInvite_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId RequestingPlayer; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AcceptFriendInvite
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAcceptFriendInvite_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId RequestingPlayer; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearAddFriendByNameCompleteDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execClearAddFriendByNameCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate FriendDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddAddFriendByNameCompleteDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAddAddFriendByNameCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate FriendDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnAddFriendByNameComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnAddFriendByNameComplete_Parms
{
unsigned long bWasSuccessful; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddFriendByName
// [0x00024000]
struct USFXOnlineComponentUnrealPlayer_execAddFriendByName_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString FriendName; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Message; // 0x0014 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0024 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddFriend
// [0x00024000]
struct USFXOnlineComponentUnrealPlayer_execAddFriend_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId NewFriend; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString Message; // 0x000C (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x001C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetKeyboardInputResults
// [0x00420000]
struct USFXOnlineComponentUnrealPlayer_execGetKeyboardInputResults_Parms
{
unsigned char bWasCanceled; // 0x0000 (0x0001) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
struct FString ReturnValue; // 0x0004 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearKeyboardInputDoneDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execClearKeyboardInputDoneDelegate_Parms
{
struct FScriptDelegate InputDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddKeyboardInputDoneDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAddKeyboardInputDoneDelegate_Parms
{
struct FScriptDelegate InputDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnKeyboardInputComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnKeyboardInputComplete_Parms
{
unsigned long bWasSuccessful; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ShowKeyboardUI
// [0x00024000]
struct USFXOnlineComponentUnrealPlayer_execShowKeyboardUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString TitleText; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString DescriptionText; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bIsPassword; // 0x0024 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldValidate; // 0x0028 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString DefaultText; // 0x002C (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
int MaxResultLength; // 0x003C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0040 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.SetOnlineStatus
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execSetOnlineStatus_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int StatusId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FLocalizedStringSetting> LocalizedStringSettings; // 0x0008 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
struct TArray<struct FSettingsProperty> Properties; // 0x0018 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetFriendsList
// [0x00424000]
struct USFXOnlineComponentUnrealPlayer_execGetFriendsList_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FOnlineFriend> Friends; // 0x0004 (0x0010) [0x0000000000400180] ( CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
int Count; // 0x0014 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
int StartingAt; // 0x0018 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char ReturnValue; // 0x001C (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearReadFriendsCompleteDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execClearReadFriendsCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadFriendsCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddReadFriendsCompleteDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAddReadFriendsCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadFriendsCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnReadFriendsComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnReadFriendsComplete_Parms
{
unsigned long bWasSuccessful; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ReadFriendsList
// [0x00024000]
struct USFXOnlineComponentUnrealPlayer_execReadFriendsList_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int Count; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
int StartingAt; // 0x0008 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearWritePlayerStorageCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearWritePlayerStorageCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate WritePlayerStorageCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddWritePlayerStorageCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddWritePlayerStorageCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate WritePlayerStorageCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnWritePlayerStorageComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnWritePlayerStorageComplete_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long bWasSuccessful; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.WritePlayerStorage
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execWritePlayerStorage_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
class UOnlinePlayerStorage* PlayerStorage; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetPlayerStorage
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execGetPlayerStorage_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
class UOnlinePlayerStorage* ReturnValue; // 0x0004 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearReadPlayerStorageForNetIdCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearReadPlayerStorageForNetIdCompleteDelegate_Parms
{
struct FUniqueNetId NetId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadPlayerStorageForNetIdCompleteDelegate; // 0x0008 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0018 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddReadPlayerStorageForNetIdCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddReadPlayerStorageForNetIdCompleteDelegate_Parms
{
struct FUniqueNetId NetId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadPlayerStorageForNetIdCompleteDelegate; // 0x0008 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnReadPlayerStorageForNetIdComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnReadPlayerStorageForNetIdComplete_Parms
{
struct FUniqueNetId NetId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long bWasSuccessful; // 0x0008 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ReadPlayerStorageForNetId
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execReadPlayerStorageForNetId_Parms
{
struct FUniqueNetId NetId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
class UOnlinePlayerStorage* PlayerStorage; // 0x0008 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0010 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearReadPlayerStorageCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearReadPlayerStorageCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadPlayerStorageCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddReadPlayerStorageCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddReadPlayerStorageCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadPlayerStorageCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnReadPlayerStorageComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnReadPlayerStorageComplete_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long bWasSuccessful; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ReadPlayerStorage
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execReadPlayerStorage_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
class UOnlinePlayerStorage* PlayerStorage; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearWriteProfileSettingsCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearWriteProfileSettingsCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate WriteProfileSettingsCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddWriteProfileSettingsCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddWriteProfileSettingsCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate WriteProfileSettingsCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnWriteProfileSettingsComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnWriteProfileSettingsComplete_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long bWasSuccessful; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.WriteProfileSettings
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execWriteProfileSettings_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
class UOnlineProfileSettings* ProfileSettings; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long bIsTrilogyProfile; // 0x000C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0010 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetProfileSettings
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execGetProfileSettings_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
class UOnlineProfileSettings* ReturnValue; // 0x0004 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearReadProfileSettingsCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearReadProfileSettingsCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadProfileSettingsCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddReadProfileSettingsCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddReadProfileSettingsCompleteDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ReadProfileSettingsCompleteDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnReadProfileSettingsComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnReadProfileSettingsComplete_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long bWasSuccessful; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ReadProfileSettings
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execReadProfileSettings_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
class UOnlineProfileSettings* ProfileSettings; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long bIsTrilogyProfile; // 0x000C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0010 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearFriendsChangeDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execClearFriendsChangeDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate FriendsDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddFriendsChangeDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAddFriendsChangeDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate FriendsDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearMutingChangeDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execClearMutingChangeDelegate_Parms
{
struct FScriptDelegate MutingDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddMutingChangeDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execAddMutingChangeDelegate_Parms
{
struct FScriptDelegate MutingDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearLoginCancelledDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearLoginCancelledDelegate_Parms
{
struct FScriptDelegate CancelledDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddLoginCancelledDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddLoginCancelledDelegate_Parms
{
struct FScriptDelegate CancelledDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearLoginStatusChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearLoginStatusChangeDelegate_Parms
{
struct FScriptDelegate LoginStatusDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char LocalUserNum; // 0x0010 (0x0001) [0x0000000000000080] ( CPF_Parm )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddLoginStatusChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddLoginStatusChangeDelegate_Parms
{
struct FScriptDelegate LoginStatusDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char LocalUserNum; // 0x0010 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnLoginStatusChange
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnLoginStatusChange_Parms
{
unsigned char NewStatus; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId NewId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearLoginChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearLoginChangeDelegate_Parms
{
struct FScriptDelegate LoginDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddLoginChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddLoginChangeDelegate_Parms
{
struct FScriptDelegate LoginDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ShowFriendsUI
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execShowFriendsUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.IsMuted
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execIsMuted_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId PlayerID; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AreAnyFriends
// [0x00420000]
struct USFXOnlineComponentUnrealPlayer_execAreAnyFriends_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FFriendsQuery> Query; // 0x0004 (0x0010) [0x0000000000400180] ( CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0014 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.IsFriend
// [0x00020000]
struct USFXOnlineComponentUnrealPlayer_execIsFriend_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId PlayerID; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.CanShowPresenceInformation
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execCanShowPresenceInformation_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.CanViewPlayerProfiles
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execCanViewPlayerProfiles_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.CanPurchaseContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execCanPurchaseContent_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.CanDownloadUserContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execCanDownloadUserContent_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.CanCommunicate
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execCanCommunicate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.CanPlayOnline
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execCanPlayOnline_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.IsLocalLogin
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execIsLocalLogin_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.IsGuestLogin
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execIsGuestLogin_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetPlayerNickname
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execGetPlayerNickname_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString ReturnValue; // 0x0004 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetUniquePlayerId
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execGetUniquePlayerId_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId PlayerID; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetLoginStatus
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execGetLoginStatus_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
// class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0004 (0x0008) [0x0000000000000000]
// unsigned char ELoginStatus; // 0x000C (0x0001) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearLogoutCompletedDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearLogoutCompletedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate LogoutDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddLogoutCompletedDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddLogoutCompletedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate LogoutDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnLogoutCompleted
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnLogoutCompleted_Parms
{
unsigned long bWasSuccessful; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.Logout
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execLogout_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ClearLoginFailedDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execClearLoginFailedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate LoginDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AddLoginFailedDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayer_execAddLoginFailedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate LoginDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnLoginFailed
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnLoginFailed_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ErrorCode; // 0x0001 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.AutoLogin
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execAutoLogin_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.Login
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execLogin_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString LoginName; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Password; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bWantsLocalOnly; // 0x0024 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0028 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.ShowLoginUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execShowLoginUI_Parms
{
unsigned long bShowOnlineOnly; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnFriendsChange
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnFriendsChange_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnMutingChange
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnMutingChange_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnLoginCancelled
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnLoginCancelled_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnLoginChange
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnLoginChange_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnProfileDataChanged
// [0x00120000]
struct USFXOnlineComponentUnrealPlayer_execOnProfileDataChanged_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.CreateProfileName
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execCreateProfileName_Parms
{
unsigned long bIsTrilogyProfile; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString ReturnValue; // 0x0004 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.DoesProfileExist
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execDoesProfileExist_Parms
{
unsigned long bIsTrilogyProfile; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnTick
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execOnTick_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayer.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayer_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowCustomPlayersUI
// [0x00420000]
struct USFXOnlineComponentUnrealPlayerEx_execShowCustomPlayersUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FUniqueNetId> Players; // 0x0004 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
struct FString Title; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString Description; // 0x0024 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0034 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowPlayersUI
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execShowPlayersUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowFriendsInviteUI
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execShowFriendsInviteUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId PlayerID; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ClearProfileDataChangedDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execClearProfileDataChangedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ProfileDataChangedDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.AddProfileDataChangedDelegate
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execAddProfileDataChangedDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate ProfileDataChangedDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.OnProfileDataChanged
// [0x00120000]
struct USFXOnlineComponentUnrealPlayerEx_execOnProfileDataChanged_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.UnlockGamerPicture
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execUnlockGamerPicture_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int PictureId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.IsDeviceValid
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayerEx_execIsDeviceValid_Parms
{
int DeviceID; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SizeNeeded; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.GetDeviceSelectionResults
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayerEx_execGetDeviceSelectionResults_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString DeviceName; // 0x0004 (0x0010) [0x0000000000400180] ( CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
int ReturnValue; // 0x0014 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ClearDeviceSelectionDoneDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayerEx_execClearDeviceSelectionDoneDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate DeviceDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.AddDeviceSelectionDoneDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealPlayerEx_execAddDeviceSelectionDoneDelegate_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate DeviceDelegate; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int AddIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.OnDeviceSelectionComplete
// [0x00120000]
struct USFXOnlineComponentUnrealPlayerEx_execOnDeviceSelectionComplete_Parms
{
unsigned long bWasSuccessful; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowDeviceSelectionUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayerEx_execShowDeviceSelectionUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int SizeNeeded; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bForceShowUI; // 0x0008 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bManageStorage; // 0x000C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0010 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowMembershipMarketplaceUI
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execShowMembershipMarketplaceUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowContentMarketplaceUI
// [0x00024000]
struct USFXOnlineComponentUnrealPlayerEx_execShowContentMarketplaceUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int CategoryMask; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
int OfferId; // 0x0008 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowInviteUI
// [0x00024000]
struct USFXOnlineComponentUnrealPlayerEx_execShowInviteUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString InviteText; // 0x0004 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0014 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowAchievementsUI
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execShowAchievementsUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowMessagesUI
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execShowMessagesUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowGamerCardUI
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execShowGamerCardUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId PlayerID; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.ShowFeedbackUI
// [0x00020000]
struct USFXOnlineComponentUnrealPlayerEx_execShowFeedbackUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId PlayerID; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.OnTick
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentUnrealPlayerEx_execOnTick_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayerEx_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayerEx_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealPlayerEx.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealPlayerEx_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.GetTitleFileState
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execGetTitleFileState_Parms
{
struct FString Filename; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char ReturnValue; // 0x0010 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
// int FileIndex; // 0x0014 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.GetTitleFileContents
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentUnrealSystem_execGetTitleFileContents_Parms
{
struct FString Filename; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct TArray<unsigned char> FileContents; // 0x0010 (0x0010) [0x0000000000400180] ( CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0020 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.ClearReadTitleFileCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execClearReadTitleFileCompleteDelegate_Parms
{
struct FScriptDelegate ReadTitleFileCompleteDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.AddReadTitleFileCompleteDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execAddReadTitleFileCompleteDelegate_Parms
{
struct FScriptDelegate ReadTitleFileCompleteDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.ReadTitleFile
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealSystem_execReadTitleFile_Parms
{
struct FString FileToRead; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0010 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.OnReadTitleFileComplete
// [0x00120000]
struct USFXOnlineComponentUnrealSystem_execOnReadTitleFileComplete_Parms
{
unsigned long bWasSuccessful; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString Filename; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.ClearStorageDeviceChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execClearStorageDeviceChangeDelegate_Parms
{
struct FScriptDelegate StorageDeviceChangeDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.AddStorageDeviceChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execAddStorageDeviceChangeDelegate_Parms
{
struct FScriptDelegate StorageDeviceChangeDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.OnStorageDeviceChange
// [0x00120000]
struct USFXOnlineComponentUnrealSystem_execOnStorageDeviceChange_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.GetNATType
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execGetNATType_Parms
{
unsigned char ReturnValue; // 0x0000 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.ClearConnectionStatusChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execClearConnectionStatusChangeDelegate_Parms
{
struct FScriptDelegate ConnectionStatusDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.AddConnectionStatusChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execAddConnectionStatusChangeDelegate_Parms
{
struct FScriptDelegate ConnectionStatusDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int AddIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.OnConnectionStatusChange
// [0x00120000]
struct USFXOnlineComponentUnrealSystem_execOnConnectionStatusChange_Parms
{
unsigned char ConnectionStatus; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.IsControllerConnected
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealSystem_execIsControllerConnected_Parms
{
int ControllerId; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.ClearControllerChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execClearControllerChangeDelegate_Parms
{
struct FScriptDelegate ControllerChangeDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.AddControllerChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execAddControllerChangeDelegate_Parms
{
struct FScriptDelegate ControllerChangeDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int AddIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.OnControllerChange
// [0x00120000]
struct USFXOnlineComponentUnrealSystem_execOnControllerChange_Parms
{
int ControllerId; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bIsConnected; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.SetNetworkNotificationPosition
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealSystem_execSetNetworkNotificationPosition_Parms
{
unsigned char NewPos; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.GetNetworkNotificationPosition
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execGetNetworkNotificationPosition_Parms
{
unsigned char ReturnValue; // 0x0000 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.ProcessExternalUINotification
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentUnrealSystem_execProcessExternalUINotification_Parms
{
unsigned long bOpening; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.ClearExternalUIChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execClearExternalUIChangeDelegate_Parms
{
struct FScriptDelegate ExternalUIDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.AddExternalUIChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execAddExternalUIChangeDelegate_Parms
{
struct FScriptDelegate ExternalUIDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int AddIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.OnExternalUIChange
// [0x00120000]
struct USFXOnlineComponentUnrealSystem_execOnExternalUIChange_Parms
{
unsigned long bIsOpening; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.ClearLinkStatusChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execClearLinkStatusChangeDelegate_Parms
{
struct FScriptDelegate LinkStatusDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int RemoveIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.AddLinkStatusChangeDelegate
// [0x00020002]
struct USFXOnlineComponentUnrealSystem_execAddLinkStatusChangeDelegate_Parms
{
struct FScriptDelegate LinkStatusDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
// int AddIndex; // 0x0010 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.OnLinkStatusChange
// [0x00120000]
struct USFXOnlineComponentUnrealSystem_execOnLinkStatusChange_Parms
{
unsigned long bIsConnected; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.HasLinkConnection
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealSystem_execHasLinkConnection_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealSystem_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealSystem_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentUnrealSystem.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentUnrealSystem_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.GetAPIName
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentCoordinator_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.OnRelease
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentCoordinator_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.OnInitialize
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentCoordinator_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.StopWaitingForAllWork
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execStopWaitingForAllWork_Parms
{
class UObject* oCallbackTarget; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.WaitingForWorkSetObject
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execWaitingForWorkSetObject_Parms
{
struct TArray<class USFXOnlineEvent*> aEventObjects; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FScriptDelegate fnWorkComplete; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.WaitingForWorkSetType
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execWaitingForWorkSetType_Parms
{
struct TArray<unsigned char> aEventTypes; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FScriptDelegate fnWorkComplete; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct TArray<int> aWorkEventIds; // 0x0020 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.WaitingForWorkObject
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execWaitingForWorkObject_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate fnWorkComplete; // 0x0008 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.WaitingForWorkType
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execWaitingForWorkType_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate fnWorkComplete; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
int nEventId; // 0x0014 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.IsEventPending
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execIsEventPending_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nEventId; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.GetEvent
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execGetEvent_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nEventId; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
class USFXOnlineEvent* ReturnValue; // 0x0008 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.UnsubscribeFromAllEvents
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execUnsubscribeFromAllEvents_Parms
{
class UObject* oCallbackTarget; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.UnsubscribeFromEvent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execUnsubscribeFromEvent_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate fnEventCallback; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.SubscribeToEvent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execSubscribeToEvent_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FScriptDelegate fnEventCallback; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.NotifyWorkFinishedObject
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execNotifyWorkFinishedObject_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned char eStatusFinished; // 0x0008 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.NotifyWorkFinishedType
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execNotifyWorkFinishedType_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char eStatusFinished; // 0x0001 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nEventId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.NotifyWorkStartedObject
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execNotifyWorkStartedObject_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned char eEventType; // 0x0008 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.NotifyWorkStartedType
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execNotifyWorkStartedType_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nEventId; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
float fTimeOut; // 0x0008 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.NotifyEventObject
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execNotifyEventObject_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.NotifyEventType
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentCoordinator_execNotifyEventType_Parms
{
unsigned char eEventType; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char eStatus; // 0x0001 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned char eOutcome; // 0x0002 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.OnTick
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentCoordinator_execOnTick_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentCoordinator.OnEvent
// [0x00120000]
struct USFXOnlineComponentCoordinator_execOnEvent_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.Exit
// [0x00020C00] ( FUNC_Event | FUNC_Native )
struct USFXOnlineSubsystem_eventExit_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.ShowConsoleRoutedKeyboardUI
// [0x00024102]
struct USFXOnlineSubsystem_execShowConsoleRoutedKeyboardUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString sTitleText; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sDescriptionText; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bIsPassword; // 0x0024 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldValidate; // 0x0028 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString sDefaultText; // 0x002C (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
int nMaxResultLength; // 0x003C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0040 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.ShowKeyboardUI
// [0x00024002]
struct USFXOnlineSubsystem_execShowKeyboardUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString sTitleText; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sDescriptionText; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long bIsPassword; // 0x0024 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldValidate; // 0x0028 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString sDefaultText; // 0x002C (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
int nMaxResultLength; // 0x003C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0040 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.FormatTime
// [0x00044401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execFormatTime_Parms
{
float fInSeconds; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long bShowHours; // 0x0004 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShowMins; // 0x0008 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString ReturnValue; // 0x000C (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.CheckEntitlement
// [0x00020002]
struct USFXOnlineSubsystem_execCheckEntitlement_Parms
{
struct FString sGroup; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sTag; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0020 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.IsCerberusMember
// [0x00020002]
struct USFXOnlineSubsystem_execIsCerberusMember_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetUniqueIdFromConnection
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetUniqueIdFromConnection_Parms
{
class APlayerReplicationInfo* oPRI; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId ReturnValue; // 0x0008 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.MD5HashString
// [0x00020400] ( FUNC_Native )
struct USFXOnlineSubsystem_execMD5HashString_Parms
{
struct FString InStr; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString ReturnValue; // 0x0010 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetProjectID
// [0x00020400] ( FUNC_Native )
struct USFXOnlineSubsystem_execGetProjectID_Parms
{
struct FString ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetCDKey
// [0x00020400] ( FUNC_Native )
struct USFXOnlineSubsystem_execGetCDKey_Parms
{
struct FString ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetLanguage
// [0x00020400] ( FUNC_Native )
struct USFXOnlineSubsystem_execGetLanguage_Parms
{
struct FString ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetPlatform
// [0x00020400] ( FUNC_Native )
struct USFXOnlineSubsystem_execGetPlatform_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.ShutDown
// [0x00020C00] ( FUNC_Event | FUNC_Native )
struct USFXOnlineSubsystem_eventShutDown_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.NativeInit
// [0x00020400] ( FUNC_Native )
struct USFXOnlineSubsystem_execNativeInit_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetGameListenPort
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetGameListenPort_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetReserveTimeout
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetReserveTimeout_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetMaxObserverCount
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetMaxObserverCount_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetMaxPlayerCount
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetMaxPlayerCount_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.SetMaxPlayerCount
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execSetMaxPlayerCount_Parms
{
int nMaxPlayers; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetGameProtocolVersion
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetGameProtocolVersion_Parms
{
struct FString ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentOrigin
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentOrigin_Parms
{
class USFXOnlineComponentOrigin* ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentUnrealPlayerEx
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentUnrealPlayerEx_Parms
{
class USFXOnlineComponentUnrealPlayerEx* ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentUnrealPlayer
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentUnrealPlayer_Parms
{
class USFXOnlineComponentUnrealPlayer* ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentUnrealSystem
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentUnrealSystem_Parms
{
class USFXOnlineComponentUnrealSystem* ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetCoordinator
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetCoordinator_Parms
{
class USFXOnlineComponentCoordinator* ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentTelemetry
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentTelemetry_Parms
{
class UISFXOnlineComponentTelemetry* ReturnValue; // 0x0000 (0x0010) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentNotification
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentNotification_Parms
{
class UISFXOnlineComponentNotification* ReturnValue; // 0x0000 (0x0010) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentUserInterface
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentUserInterface_Parms
{
class UISFXOnlineComponentUserInterface* ReturnValue; // 0x0000 (0x0010) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentLogin
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentLogin_Parms
{
class UISFXOnlineComponentLogin* ReturnValue; // 0x0000 (0x0010) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentAPI
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentAPI_Parms
{
class UISFXOnlineComponentAPI* ReturnValue; // 0x0000 (0x0010) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentAchievement
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentAchievement_Parms
{
class UISFXOnlineComponentAchievement* ReturnValue; // 0x0000 (0x0010) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetComponentPlatform
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineSubsystem_execGetComponentPlatform_Parms
{
class UISFXOnlineComponentPlatform* ReturnValue; // 0x0000 (0x0010) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetOnlineSubsystem
// [0x00022400] ( FUNC_Native )
struct USFXOnlineSubsystem_execGetOnlineSubsystem_Parms
{
class USFXOnlineSubsystem* ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.StripBadPWCharacters
// [0x00080002]
struct USFXOnlineSubsystem_execStripBadPWCharacters_Parms
{
struct FString sPassword; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString ReturnValue; // 0x0010 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
// struct FString sStrippedPassword; // 0x0020 (0x0010) [0x0000000000400000] ( CPF_NeedCtorLink )
// int nIndex; // 0x0030 (0x0004) [0x0000000000000000]
// struct FString sBuffer; // 0x0034 (0x0010) [0x0000000000400000] ( CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetURL
// [0x00020902] ( FUNC_Event )
struct USFXOnlineSubsystem_eventGetURL_Parms
{
struct FString ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
// struct FString sURL; // 0x0010 (0x0010) [0x0000000000400000] ( CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.SetUnrealInterfaces
// [0x00040003] ( FUNC_Final )
struct USFXOnlineSubsystem_execSetUnrealInterfaces_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.CreateComponents
// [0x00040003] ( FUNC_Final )
struct USFXOnlineSubsystem_execCreateComponents_Parms
{
// struct FName nmPlatformName; // 0x0000 (0x0008) [0x0000000000000000]
// int nComponentIndex; // 0x0008 (0x0004) [0x0000000000000000]
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.InitGameProtocolVersion
// [0x00040001] ( FUNC_Final )
struct USFXOnlineSubsystem_execInitGameProtocolVersion_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.Init
// [0x00020802] ( FUNC_Event )
struct USFXOnlineSubsystem_eventInit_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineSubsystem.GetAchievementList
// [0x00020002]
struct USFXOnlineSubsystem_execGetAchievementList_Parms
{
struct TArray<struct FSFXOnlineAchievement> ReturnValue; // 0x0000 (0x0010) [0x0000000000400580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPC.GetTitleAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementPC_execGetTitleAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPC.GetPlatformAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementPC_execGetPlatformAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPC.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementPC_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPC.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementPC_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPC.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementPC_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPC.IsGranted
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementPC_execIsGranted_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPC.Grant
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementPC_execGrant_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.GetRebootUserData
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execGetRebootUserData_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.WasRebootedFromOSCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execWasRebootedFromOSCodeRedemptionUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.ShowCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execShowCodeRedemptionUI_Parms
{
int UserData; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.ShowStoreUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execShowStoreUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.GetOnlineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execGetOnlineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.GetOfflineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execGetOfflineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.ShowKeyboardUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execShowKeyboardUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString sTitleText; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sDescriptionText; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char nKeyboardType; // 0x0024 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldValidate; // 0x0028 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bRouteThroughConsole; // 0x002C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString sDefaultText; // 0x0030 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
int nMaxResultLength; // 0x0040 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0044 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.ShowFriendsInviteUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execShowFriendsInviteUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.ShowFriendsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execShowFriendsUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.ShowAchievementsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execShowAchievementsUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.ShowFeedbackUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execShowFeedbackUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.ShowGamerCardUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execShowGamerCardUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.CanShowPresenceInformation
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execCanShowPresenceInformation_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.CanViewPlayerProfiles
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execCanViewPlayerProfiles_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.CanPurchaseContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execCanPurchaseContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.CanDownloadUserContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execCanDownloadUserContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.CanCommunicate
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execCanCommunicate_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.CanPlayOnline
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execCanPlayOnline_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.SetRichPresence
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execSetRichPresence_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nPresenceMode; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FLocalizedStringSetting> aLocalizedStringSettings; // 0x0008 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
struct TArray<struct FSettingsProperty> aProperties; // 0x0018 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.ShowLoginUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execShowLoginUI_Parms
{
unsigned long bShowOnlineOnly; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.GetLoginStatus
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execGetLoginStatus_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.AddRecentPlayer
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execAddRecentPlayer_Parms
{
struct FUniqueNetId oPlayerId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString sDescription; // 0x0008 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0018 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPC.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPC_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementXenon.GetTitleAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementXenon_execGetTitleAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementXenon.GetPlatformAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementXenon_execGetPlatformAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementXenon.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementXenon_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementXenon.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementXenon_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementXenon.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementXenon_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementXenon.IsGranted
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementXenon_execIsGranted_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementXenon.Grant
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementXenon_execGrant_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.GetRebootUserData
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execGetRebootUserData_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.WasRebootedFromOSCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execWasRebootedFromOSCodeRedemptionUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.ShowCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execShowCodeRedemptionUI_Parms
{
int UserData; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.ShowStoreUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execShowStoreUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.GetOnlineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execGetOnlineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.GetOfflineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execGetOfflineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.ShowKeyboardUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execShowKeyboardUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString sTitleText; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sDescriptionText; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char nKeyboardType; // 0x0024 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldValidate; // 0x0028 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bRouteThroughConsole; // 0x002C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString sDefaultText; // 0x0030 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
int nMaxResultLength; // 0x0040 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0044 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.ShowFriendsInviteUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execShowFriendsInviteUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.ShowFriendsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execShowFriendsUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.ShowAchievementsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execShowAchievementsUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.ShowFeedbackUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execShowFeedbackUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.ShowGamerCardUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execShowGamerCardUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.CanShowPresenceInformation
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execCanShowPresenceInformation_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.CanViewPlayerProfiles
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execCanViewPlayerProfiles_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.CanPurchaseContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execCanPurchaseContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.CanDownloadUserContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execCanDownloadUserContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.CanCommunicate
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execCanCommunicate_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.CanPlayOnline
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execCanPlayOnline_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.SetRichPresence
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execSetRichPresence_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nPresenceMode; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FLocalizedStringSetting> aLocalizedStringSettings; // 0x0008 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
struct TArray<struct FSettingsProperty> aProperties; // 0x0018 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.ShowLoginUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execShowLoginUI_Parms
{
unsigned long bShowOnlineOnly; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.GetLoginStatus
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execGetLoginStatus_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.TickAsyncTasks
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execTickAsyncTasks_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.OnTick
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execOnTick_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.AddRecentPlayer
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execAddRecentPlayer_Parms
{
struct FUniqueNetId oPlayerId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString sDescription; // 0x0008 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0018 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformXenon.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformXenon_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPS3.GetTitleAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementPS3_execGetTitleAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPS3.GetPlatformAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementPS3_execGetPlatformAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPS3.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementPS3_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPS3.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementPS3_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPS3.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementPS3_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPS3.IsGranted
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementPS3_execIsGranted_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementPS3.Grant
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementPS3_execGrant_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowLoginUIEx
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowLoginUIEx_Parms
{
struct FScriptDelegate funcSignInComplete; // 0x0000 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0010 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.OnSignInComplete
// [0x00120000]
struct USFXOnlineComponentPlatformPS3_execOnSignInComplete_Parms
{
unsigned long bSignedIn; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.GetRebootUserData
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execGetRebootUserData_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.WasRebootedFromOSCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execWasRebootedFromOSCodeRedemptionUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowCodeRedemptionUI_Parms
{
int UserData; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowStoreUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowStoreUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.GetOnlineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execGetOnlineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.GetOfflineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execGetOfflineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowKeyboardUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowKeyboardUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString sTitleText; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sDescriptionText; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char nKeyboardType; // 0x0024 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldValidate; // 0x0028 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bRouteThroughConsole; // 0x002C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString sDefaultText; // 0x0030 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
int nMaxResultLength; // 0x0040 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0044 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowFriendsInviteUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowFriendsInviteUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowFriendsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowFriendsUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowAchievementsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowAchievementsUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowFeedbackUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowFeedbackUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowGamerCardUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowGamerCardUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.CanShowPresenceInformation
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execCanShowPresenceInformation_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.CanViewPlayerProfiles
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execCanViewPlayerProfiles_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.CanPurchaseContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execCanPurchaseContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.CanDownloadUserContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execCanDownloadUserContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.CanCommunicate
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execCanCommunicate_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.CanPlayOnline
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execCanPlayOnline_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.SetRichPresence
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execSetRichPresence_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nPresenceMode; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FLocalizedStringSetting> aLocalizedStringSettings; // 0x0008 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
struct TArray<struct FSettingsProperty> aProperties; // 0x0018 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.ShowLoginUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execShowLoginUI_Parms
{
unsigned long bShowOnlineOnly; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.GetLoginStatus
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execGetLoginStatus_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.AddRecentPlayer
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execAddRecentPlayer_Parms
{
struct FUniqueNetId oPlayerId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString sDescription; // 0x0008 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0018 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.OnKeyboardUI
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execOnKeyboardUI_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.OnTick
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execOnTick_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformPS3.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformPS3_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementDingo.GetTitleAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementDingo_execGetTitleAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementDingo.GetPlatformAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementDingo_execGetPlatformAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementDingo.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementDingo_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementDingo.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementDingo_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementDingo.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementDingo_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementDingo.IsGranted
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementDingo_execIsGranted_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementDingo.Grant
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementDingo_execGrant_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.OnTick
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execOnTick_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.OnKeyboardUIClosed
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execOnKeyboardUIClosed_Parms
{
unsigned long Success; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString InputBuffer; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.GetRebootUserData
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execGetRebootUserData_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.WasRebootedFromOSCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execWasRebootedFromOSCodeRedemptionUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.ShowCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execShowCodeRedemptionUI_Parms
{
int UserData; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.ShowStoreUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execShowStoreUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.GetOnlineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execGetOnlineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.GetOfflineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execGetOfflineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.ShowKeyboardUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execShowKeyboardUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString sTitleText; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sDescriptionText; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char nKeyboardType; // 0x0024 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldValidate; // 0x0028 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bRouteThroughConsole; // 0x002C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString sDefaultText; // 0x0030 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
int nMaxResultLength; // 0x0040 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0044 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.ShowFriendsInviteUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execShowFriendsInviteUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.ShowFriendsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execShowFriendsUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.ShowAchievementsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execShowAchievementsUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.ShowFeedbackUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execShowFeedbackUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.ShowGamerCardUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execShowGamerCardUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.CanShowPresenceInformation
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execCanShowPresenceInformation_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.CanViewPlayerProfiles
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execCanViewPlayerProfiles_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.CanPurchaseContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execCanPurchaseContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.CanDownloadUserContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execCanDownloadUserContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.CanCommunicate
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execCanCommunicate_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.CanPlayOnline
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execCanPlayOnline_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.SetRichPresence
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execSetRichPresence_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nPresenceMode; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FLocalizedStringSetting> aLocalizedStringSettings; // 0x0008 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
struct TArray<struct FSettingsProperty> aProperties; // 0x0018 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.ShowLoginUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execShowLoginUI_Parms
{
unsigned long bShowOnlineOnly; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.GetLoginStatus
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execGetLoginStatus_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.AddRecentPlayer
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execAddRecentPlayer_Parms
{
struct FUniqueNetId oPlayerId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString sDescription; // 0x0008 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0018 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformDingo.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformDingo_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementOrbis.GetTitleAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementOrbis_execGetTitleAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementOrbis.GetPlatformAchievementID
// [0x00420401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementOrbis_execGetPlatformAchievementID_Parms
{
int Index; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
int SetIndex; // 0x0004 (0x0004) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
int ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementOrbis.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementOrbis_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementOrbis.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementOrbis_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementOrbis.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentAchievementOrbis_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementOrbis.IsGranted
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementOrbis_execIsGranted_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0008 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentAchievementOrbis.Grant
// [0x00020401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentAchievementOrbis_execGrant_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int AchievementId; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.OnKeyboardUIClosed
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execOnKeyboardUIClosed_Parms
{
unsigned long Success; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString InputBuffer; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.GetRebootUserData
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execGetRebootUserData_Parms
{
int ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.WasRebootedFromOSCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execWasRebootedFromOSCodeRedemptionUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.ShowCodeRedemptionUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execShowCodeRedemptionUI_Parms
{
int UserData; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.ShowStoreUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execShowStoreUI_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.GetOnlineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execGetOnlineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.GetOfflineXuid
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execGetOfflineXuid_Parms
{
int nUserIndex; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000180] ( CPF_Parm | CPF_OutParm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.ShowKeyboardUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execShowKeyboardUI_Parms
{
unsigned char LocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FString sTitleText; // 0x0004 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FString sDescriptionText; // 0x0014 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
unsigned char nKeyboardType; // 0x0024 (0x0001) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bShouldValidate; // 0x0028 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long bRouteThroughConsole; // 0x002C (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
struct FString sDefaultText; // 0x0030 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
int nMaxResultLength; // 0x0040 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0044 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.ShowFriendsInviteUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execShowFriendsInviteUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerXuid; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.ShowFriendsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execShowFriendsUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.ShowAchievementsUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execShowAchievementsUI_Parms
{
unsigned char byLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.ShowFeedbackUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execShowFeedbackUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.ShowGamerCardUI
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execShowGamerCardUI_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
struct FUniqueNetId oPlayerId; // 0x0004 (0x0008) [0x0000000000000080] ( CPF_Parm )
unsigned long ReturnValue; // 0x000C (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.CanShowPresenceInformation
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execCanShowPresenceInformation_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.CanViewPlayerProfiles
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execCanViewPlayerProfiles_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.CanPurchaseContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execCanPurchaseContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.CanDownloadUserContent
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execCanDownloadUserContent_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.CanCommunicate
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execCanCommunicate_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.CanPlayOnline
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execCanPlayOnline_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.SetRichPresence
// [0x00420400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execSetRichPresence_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
int nPresenceMode; // 0x0004 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct TArray<struct FLocalizedStringSetting> aLocalizedStringSettings; // 0x0008 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
struct TArray<struct FSettingsProperty> aProperties; // 0x0018 (0x0010) [0x0000000000400182] ( CPF_Const | CPF_Parm | CPF_OutParm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.ShowLoginUI
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execShowLoginUI_Parms
{
unsigned long bShowOnlineOnly; // 0x0000 (0x0004) [0x0000000000000090] ( CPF_OptionalParm | CPF_Parm )
unsigned long ReturnValue; // 0x0004 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.GetLoginStatus
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execGetLoginStatus_Parms
{
unsigned char eLocalUserNum; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
unsigned char ReturnValue; // 0x0001 (0x0001) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.AddRecentPlayer
// [0x00024400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execAddRecentPlayer_Parms
{
struct FUniqueNetId oPlayerId; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
struct FString sDescription; // 0x0008 (0x0010) [0x0000000000400090] ( CPF_OptionalParm | CPF_Parm | CPF_NeedCtorLink )
unsigned long ReturnValue; // 0x0018 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentPlatformOrbis.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentPlatformOrbis_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentTelemetrySystem.OnTick
// [0x00040401] ( FUNC_Final | FUNC_Native )
struct USFXOnlineComponentTelemetrySystem_execOnTick_Parms
{
class USFXOnlineEvent* oEvent; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentTelemetrySystem.Flush
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentTelemetrySystem_execFlush_Parms
{
unsigned char Channel; // 0x0000 (0x0001) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentTelemetrySystem.GetAPIName
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentTelemetrySystem_execGetAPIName_Parms
{
struct FName ReturnValue; // 0x0000 (0x0008) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentTelemetrySystem.OnRelease
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentTelemetrySystem_execOnRelease_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentTelemetrySystem.OnInitialize
// [0x00020400] ( FUNC_Native )
struct USFXOnlineComponentTelemetrySystem_execOnInitialize_Parms
{
class USFXOnlineSubsystem* oOnlineSubsystem; // 0x0000 (0x0008) [0x0000000000000080] ( CPF_Parm )
};
// Function SFXOnlineFoundation.SFXOnlineComponentTelemetrySystem.RegisterConnectionDelegates
// [0x00020003] ( FUNC_Final )
struct USFXOnlineComponentTelemetrySystem_execRegisterConnectionDelegates_Parms
{
struct FScriptDelegate CollectDelegate; // 0x0000 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FScriptDelegate AuthenticateDelegate; // 0x0010 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
struct FScriptDelegate DisconnectDelegate; // 0x0020 (0x0010) [0x0000000000400080] ( CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentTelemetrySystem.OnDisconnect
// [0x00120000]
struct USFXOnlineComponentTelemetrySystem_execOnDisconnect_Parms
{
int Error; // 0x0000 (0x0004) [0x0000000000000080] ( CPF_Parm )
struct FString SessionId; // 0x0004 (0x0010) [0x0000000000400082] ( CPF_Const | CPF_Parm | CPF_NeedCtorLink )
};
// Function SFXOnlineFoundation.SFXOnlineComponentTelemetrySystem.OnAuthenticate
// [0x00120000]
struct USFXOnlineComponentTelemetrySystem_execOnAuthenticate_Parms
{
};
// Function SFXOnlineFoundation.SFXOnlineComponentTelemetrySystem.CanCollect
// [0x00120000]
struct USFXOnlineComponentTelemetrySystem_execCanCollect_Parms
{
unsigned long ReturnValue; // 0x0000 (0x0004) [0x0000000000000580] ( CPF_Parm | CPF_OutParm | CPF_ReturnParm )
};
#ifdef _MSC_VER
#pragma pack ( pop )
#endif | [
"4rterius@gmail.com"
] | 4rterius@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.