blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
b62787af52b5f5d24d66623c6b59aca7855a7097
c8b037a2161ea136b95dac0f5039a92fa6d686e3
/lab 1/Número par o impar.cpp
8113285eb79dc08a8a5f5f885400b1d770c720fb
[]
no_license
kaiser4900/Lenguaje-de-programaci-n-1
1967249ec68b6105c01526e4479b0d7a1dcdcc63
50dca7d5715618d6fbf83182b0dca89d448b2e22
refs/heads/master
2020-04-03T00:06:21.993615
2018-12-08T08:59:46
2018-12-08T08:59:46
154,888,727
0
0
null
null
null
null
UTF-8
C++
false
false
303
cpp
#include <iostream> using namespace std; int main () { int num1, num2; cout << "ingresa un numero: "; cin >> num1; num2 = num1% 2; if (num2 == 0) cout << "\nEl numero " << num1 << " es par \n"; else cout << "El numero " << num1 << " es impar \n"; return 0; }
[ "galemanz@ulasalle.edu.pe" ]
galemanz@ulasalle.edu.pe
d446c75651741997a9e8890558f4f1b791aacf46
210d48e8331fae0b25e3c0f2950fa4ac76769af9
/include/interface/event_pool.h
4e9d33ff6767273460313e26bbb0f2d1e96cac2f
[ "MIT" ]
permissive
avdosev/async-library-arduino
86acf3918139fd7cb1ba9d1b999aa2c34fb6ccc2
3f90eaf4cccc221a4c9badf4e2119bfc19d45dce
refs/heads/master
2020-06-24T14:00:34.833062
2020-06-16T09:30:45
2020-06-16T09:30:45
198,981,360
2
0
null
null
null
null
UTF-8
C++
false
false
380
h
#pragma once #include "event_define.h" #include "event.h" class IEventPool { public: virtual ~IEventPool() { } virtual bool hasReadyEvent() = 0; virtual event_pair getReadyEvent() = 0; virtual event_t getEvent(event_id_t id) = 0; virtual event_id_t addEvent(event_t event) = 0; virtual void removeEvent(event_id_t id) = 0; };
[ "avdosev1@yandex.ru" ]
avdosev1@yandex.ru
6337f873d09d92e320c68a03fd822ea9cdccf35b
2a0b85f1a8d1966ee5db4fe6ea5b686f5b7a3a17
/345-w7/SongCollection.h
7a2073bd813139f3b0e65be721d5049c373fb557
[]
no_license
ulianarozz/OOP345
e33671878c8dc6e37ecf8b61126160fddab34c99
69bf477fe0d4fabed80c99d591b9ee1d37ce68ad
refs/heads/master
2023-02-13T01:10:46.162095
2021-01-14T01:44:26
2021-01-14T01:44:26
329,469,607
1
1
null
null
null
null
UTF-8
C++
false
false
992
h
/*Uliana Rozzhyvaikina 132294190 urozzhyvaikina@myseneca.ca Workshop 7*/ //I have done all the coding by myself and only copied the code that my professor provided to complete my workshops and assignments. #ifndef _SDDS_SONGCOLLECTION_H_ #define _SDDS_SONGCOLLECTION_H_ #include <iostream> #include <string> #include <fstream> #include <sstream> #include <vector> #include <iomanip> #include <list> #include <algorithm> #include<numeric> using namespace std; namespace sdds { struct Song { string artist, title, album; double m_price =0 ; int year = 0, length= 0 ; }; class SongCollection { vector<sdds::Song> m_song; public: string& trim(string& ); SongCollection(string); void display(ostream&) const; void sort(string); void cleanAlbum(); bool inCollection(string) const; list<Song> getSongsForArtist(string) const; }; ostream& operator<<(ostream&, const Song&); } #endif
[ "ulianarozz@gmail.com" ]
ulianarozz@gmail.com
773b3e25ee434943b77fe45d52e0a697ac3590a5
53a024896a3739b3e40eec3ce87f0c30c7992563
/SimpleMathComponent/Generated Files/winrt/Windows.Devices.Sensors.h
6f2809c0e708406fa4666a460708c21099a52a0f
[]
no_license
angelazhangmsft/e2esamplecswinrt
9eac774038f7366105708ad6745d34726f06b7c0
736e826ba5753f3f37307b89f238c9bdbe2f20c8
refs/heads/main
2022-12-25T19:41:09.441642
2020-10-07T21:09:00
2020-10-07T21:09:00
302,160,615
0
0
null
null
null
null
UTF-8
C++
false
false
313,956
h
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.200703.9 #ifndef WINRT_Windows_Devices_Sensors_H #define WINRT_Windows_Devices_Sensors_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.200703.9"), "Mismatched C++/WinRT headers."); #include "winrt/Windows.Devices.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Graphics.Display.2.h" #include "winrt/impl/Windows.Devices.Sensors.2.h" namespace winrt::impl { template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::AccelerometerReading) consume_Windows_Devices_Sensors_IAccelerometer<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer)->GetCurrentReading(&value)); return Windows::Devices::Sensors::AccelerometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IAccelerometer<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAccelerometer<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IAccelerometer<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IAccelerometer<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Accelerometer, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IAccelerometer<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IAccelerometer<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Accelerometer, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAccelerometer<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IAccelerometer<D>::Shaken(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Accelerometer, Windows::Devices::Sensors::AccelerometerShakenEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer)->add_Shaken(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IAccelerometer<D>::Shaken_revoker consume_Windows_Devices_Sensors_IAccelerometer<D>::Shaken(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Accelerometer, Windows::Devices::Sensors::AccelerometerShakenEventArgs> const& handler) const { return impl::make_event_revoker<D, Shaken_revoker>(this, Shaken(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAccelerometer<D>::Shaken(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer)->remove_Shaken(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAccelerometer2<D>::ReadingTransform(Windows::Graphics::Display::DisplayOrientations const& value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer2)->put_ReadingTransform(static_cast<uint32_t>(value))); } template <typename D> WINRT_IMPL_AUTO(Windows::Graphics::Display::DisplayOrientations) consume_Windows_Devices_Sensors_IAccelerometer2<D>::ReadingTransform() const { Windows::Graphics::Display::DisplayOrientations value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer2)->get_ReadingTransform(reinterpret_cast<uint32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAccelerometer3<D>::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer3)->put_ReportLatency(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IAccelerometer3<D>::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer3)->get_ReportLatency(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IAccelerometer3<D>::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer3)->get_MaxBatchSize(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::AccelerometerReadingType) consume_Windows_Devices_Sensors_IAccelerometer4<D>::ReadingType() const { Windows::Devices::Sensors::AccelerometerReadingType type{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer4)->get_ReadingType(reinterpret_cast<int32_t*>(&type))); return type; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::AccelerometerDataThreshold) consume_Windows_Devices_Sensors_IAccelerometer5<D>::ReportThreshold() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometer5)->get_ReportThreshold(&value)); return Windows::Devices::Sensors::AccelerometerDataThreshold{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IAccelerometerDataThreshold<D>::XAxisInGForce() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerDataThreshold)->get_XAxisInGForce(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAccelerometerDataThreshold<D>::XAxisInGForce(double value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerDataThreshold)->put_XAxisInGForce(value)); } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IAccelerometerDataThreshold<D>::YAxisInGForce() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerDataThreshold)->get_YAxisInGForce(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAccelerometerDataThreshold<D>::YAxisInGForce(double value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerDataThreshold)->put_YAxisInGForce(value)); } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IAccelerometerDataThreshold<D>::ZAxisInGForce() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerDataThreshold)->get_ZAxisInGForce(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAccelerometerDataThreshold<D>::ZAxisInGForce(double value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerDataThreshold)->put_ZAxisInGForce(value)); } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IAccelerometerDeviceId<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerDeviceId)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IAccelerometerReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IAccelerometerReading<D>::AccelerationX() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerReading)->get_AccelerationX(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IAccelerometerReading<D>::AccelerationY() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerReading)->get_AccelerationY(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IAccelerometerReading<D>::AccelerationZ() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerReading)->get_AccelerationZ(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<Windows::Foundation::TimeSpan>) consume_Windows_Devices_Sensors_IAccelerometerReading2<D>::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerReading2)->get_PerformanceCount(&value)); return Windows::Foundation::IReference<Windows::Foundation::TimeSpan>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_IAccelerometerReading2<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerReading2)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::AccelerometerReading) consume_Windows_Devices_Sensors_IAccelerometerReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::AccelerometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IAccelerometerShakenEventArgs<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerShakenEventArgs)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Accelerometer) consume_Windows_Devices_Sensors_IAccelerometerStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerStatics)->GetDefault(&result)); return Windows::Devices::Sensors::Accelerometer{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Accelerometer) consume_Windows_Devices_Sensors_IAccelerometerStatics2<D>::GetDefault(Windows::Devices::Sensors::AccelerometerReadingType const& readingType) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerStatics2)->GetDefaultWithAccelerometerReadingType(static_cast<int32_t>(readingType), &result)); return Windows::Devices::Sensors::Accelerometer{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Accelerometer>) consume_Windows_Devices_Sensors_IAccelerometerStatics3<D>::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerStatics3)->FromIdAsync(*(void**)(&deviceId), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Accelerometer>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IAccelerometerStatics3<D>::GetDeviceSelector(Windows::Devices::Sensors::AccelerometerReadingType const& readingType) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAccelerometerStatics3)->GetDeviceSelector(static_cast<int32_t>(readingType), &result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensorReading>) consume_Windows_Devices_Sensors_IActivitySensor<D>::GetCurrentReadingAsync() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensor)->GetCurrentReadingAsync(&result)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensorReading>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IVector<Windows::Devices::Sensors::ActivityType>) consume_Windows_Devices_Sensors_IActivitySensor<D>::SubscribedActivities() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensor)->get_SubscribedActivities(&value)); return Windows::Foundation::Collections::IVector<Windows::Devices::Sensors::ActivityType>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IActivitySensor<D>::PowerInMilliwatts() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensor)->get_PowerInMilliwatts(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IActivitySensor<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensor)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivityType>) consume_Windows_Devices_Sensors_IActivitySensor<D>::SupportedActivities() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensor)->get_SupportedActivities(&value)); return Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivityType>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IActivitySensor<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensor)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IActivitySensor<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::ActivitySensor, Windows::Devices::Sensors::ActivitySensorReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensor)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IActivitySensor<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IActivitySensor<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::ActivitySensor, Windows::Devices::Sensors::ActivitySensorReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IActivitySensor<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensor)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IActivitySensorReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::ActivityType) consume_Windows_Devices_Sensors_IActivitySensorReading<D>::Activity() const { Windows::Devices::Sensors::ActivityType value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorReading)->get_Activity(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::ActivitySensorReadingConfidence) consume_Windows_Devices_Sensors_IActivitySensorReading<D>::Confidence() const { Windows::Devices::Sensors::ActivitySensorReadingConfidence value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorReading)->get_Confidence(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::ActivitySensorReading) consume_Windows_Devices_Sensors_IActivitySensorReadingChangeReport<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorReadingChangeReport)->get_Reading(&value)); return Windows::Devices::Sensors::ActivitySensorReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::ActivitySensorReading) consume_Windows_Devices_Sensors_IActivitySensorReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::ActivitySensorReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensor>) consume_Windows_Devices_Sensors_IActivitySensorStatics<D>::GetDefaultAsync() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorStatics)->GetDefaultAsync(&result)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensor>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IActivitySensorStatics<D>::GetDeviceSelector() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorStatics)->GetDeviceSelector(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensor>) consume_Windows_Devices_Sensors_IActivitySensorStatics<D>::FromIdAsync(param::hstring const& deviceId) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorStatics)->FromIdAsync(*(void**)(&deviceId), &result)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensor>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivitySensorReading>>) consume_Windows_Devices_Sensors_IActivitySensorStatics<D>::GetSystemHistoryAsync(Windows::Foundation::DateTime const& fromTime) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorStatics)->GetSystemHistoryAsync(impl::bind_in(fromTime), &result)); return Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivitySensorReading>>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivitySensorReading>>) consume_Windows_Devices_Sensors_IActivitySensorStatics<D>::GetSystemHistoryAsync(Windows::Foundation::DateTime const& fromTime, Windows::Foundation::TimeSpan const& duration) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorStatics)->GetSystemHistoryWithDurationAsync(impl::bind_in(fromTime), impl::bind_in(duration), &result)); return Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivitySensorReading>>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivitySensorReadingChangeReport>) consume_Windows_Devices_Sensors_IActivitySensorTriggerDetails<D>::ReadReports() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IActivitySensorTriggerDetails)->ReadReports(&value)); return Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivitySensorReadingChangeReport>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::AltimeterReading) consume_Windows_Devices_Sensors_IAltimeter<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter)->GetCurrentReading(&value)); return Windows::Devices::Sensors::AltimeterReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IAltimeter<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IAltimeter<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAltimeter<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IAltimeter<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IAltimeter<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Altimeter, Windows::Devices::Sensors::AltimeterReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IAltimeter<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IAltimeter<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Altimeter, Windows::Devices::Sensors::AltimeterReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAltimeter<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IAltimeter2<D>::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter2)->put_ReportLatency(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IAltimeter2<D>::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter2)->get_ReportLatency(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IAltimeter2<D>::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeter2)->get_MaxBatchSize(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IAltimeterReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeterReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IAltimeterReading<D>::AltitudeChangeInMeters() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeterReading)->get_AltitudeChangeInMeters(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<Windows::Foundation::TimeSpan>) consume_Windows_Devices_Sensors_IAltimeterReading2<D>::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeterReading2)->get_PerformanceCount(&value)); return Windows::Foundation::IReference<Windows::Foundation::TimeSpan>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_IAltimeterReading2<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeterReading2)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::AltimeterReading) consume_Windows_Devices_Sensors_IAltimeterReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeterReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::AltimeterReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Altimeter) consume_Windows_Devices_Sensors_IAltimeterStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IAltimeterStatics)->GetDefault(&result)); return Windows::Devices::Sensors::Altimeter{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::BarometerReading) consume_Windows_Devices_Sensors_IBarometer<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer)->GetCurrentReading(&value)); return Windows::Devices::Sensors::BarometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IBarometer<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IBarometer<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IBarometer<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IBarometer<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IBarometer<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Barometer, Windows::Devices::Sensors::BarometerReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IBarometer<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IBarometer<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Barometer, Windows::Devices::Sensors::BarometerReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IBarometer<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IBarometer2<D>::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer2)->put_ReportLatency(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IBarometer2<D>::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer2)->get_ReportLatency(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IBarometer2<D>::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer2)->get_MaxBatchSize(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::BarometerDataThreshold) consume_Windows_Devices_Sensors_IBarometer3<D>::ReportThreshold() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometer3)->get_ReportThreshold(&value)); return Windows::Devices::Sensors::BarometerDataThreshold{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IBarometerDataThreshold<D>::Hectopascals() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerDataThreshold)->get_Hectopascals(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IBarometerDataThreshold<D>::Hectopascals(double value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerDataThreshold)->put_Hectopascals(value)); } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IBarometerReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IBarometerReading<D>::StationPressureInHectopascals() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerReading)->get_StationPressureInHectopascals(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<Windows::Foundation::TimeSpan>) consume_Windows_Devices_Sensors_IBarometerReading2<D>::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerReading2)->get_PerformanceCount(&value)); return Windows::Foundation::IReference<Windows::Foundation::TimeSpan>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_IBarometerReading2<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerReading2)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::BarometerReading) consume_Windows_Devices_Sensors_IBarometerReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::BarometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Barometer) consume_Windows_Devices_Sensors_IBarometerStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerStatics)->GetDefault(&result)); return Windows::Devices::Sensors::Barometer{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Barometer>) consume_Windows_Devices_Sensors_IBarometerStatics2<D>::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerStatics2)->FromIdAsync(*(void**)(&deviceId), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Barometer>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IBarometerStatics2<D>::GetDeviceSelector() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IBarometerStatics2)->GetDeviceSelector(&result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::CompassReading) consume_Windows_Devices_Sensors_ICompass<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass)->GetCurrentReading(&value)); return Windows::Devices::Sensors::CompassReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_ICompass<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ICompass<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_ICompass<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_ICompass<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Compass, Windows::Devices::Sensors::CompassReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_ICompass<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_ICompass<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Compass, Windows::Devices::Sensors::CompassReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ICompass<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ICompass2<D>::ReadingTransform(Windows::Graphics::Display::DisplayOrientations const& value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass2)->put_ReadingTransform(static_cast<uint32_t>(value))); } template <typename D> WINRT_IMPL_AUTO(Windows::Graphics::Display::DisplayOrientations) consume_Windows_Devices_Sensors_ICompass2<D>::ReadingTransform() const { Windows::Graphics::Display::DisplayOrientations value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass2)->get_ReadingTransform(reinterpret_cast<uint32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ICompass3<D>::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass3)->put_ReportLatency(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_ICompass3<D>::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass3)->get_ReportLatency(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_ICompass3<D>::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass3)->get_MaxBatchSize(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::CompassDataThreshold) consume_Windows_Devices_Sensors_ICompass4<D>::ReportThreshold() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompass4)->get_ReportThreshold(&value)); return Windows::Devices::Sensors::CompassDataThreshold{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_ICompassDataThreshold<D>::Degrees() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassDataThreshold)->get_Degrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ICompassDataThreshold<D>::Degrees(double value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassDataThreshold)->put_Degrees(value)); } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_ICompassDeviceId<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassDeviceId)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_ICompassReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_ICompassReading<D>::HeadingMagneticNorth() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassReading)->get_HeadingMagneticNorth(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<double>) consume_Windows_Devices_Sensors_ICompassReading<D>::HeadingTrueNorth() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassReading)->get_HeadingTrueNorth(&value)); return Windows::Foundation::IReference<double>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<Windows::Foundation::TimeSpan>) consume_Windows_Devices_Sensors_ICompassReading2<D>::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassReading2)->get_PerformanceCount(&value)); return Windows::Foundation::IReference<Windows::Foundation::TimeSpan>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_ICompassReading2<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassReading2)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::CompassReading) consume_Windows_Devices_Sensors_ICompassReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::CompassReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::MagnetometerAccuracy) consume_Windows_Devices_Sensors_ICompassReadingHeadingAccuracy<D>::HeadingAccuracy() const { Windows::Devices::Sensors::MagnetometerAccuracy value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassReadingHeadingAccuracy)->get_HeadingAccuracy(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Compass) consume_Windows_Devices_Sensors_ICompassStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassStatics)->GetDefault(&result)); return Windows::Devices::Sensors::Compass{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_ICompassStatics2<D>::GetDeviceSelector() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassStatics2)->GetDeviceSelector(&result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Compass>) consume_Windows_Devices_Sensors_ICompassStatics2<D>::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ICompassStatics2)->FromIdAsync(*(void**)(&deviceId), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Compass>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::GyrometerReading) consume_Windows_Devices_Sensors_IGyrometer<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer)->GetCurrentReading(&value)); return Windows::Devices::Sensors::GyrometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IGyrometer<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IGyrometer<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IGyrometer<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IGyrometer<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Gyrometer, Windows::Devices::Sensors::GyrometerReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IGyrometer<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IGyrometer<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Gyrometer, Windows::Devices::Sensors::GyrometerReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IGyrometer<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IGyrometer2<D>::ReadingTransform(Windows::Graphics::Display::DisplayOrientations const& value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer2)->put_ReadingTransform(static_cast<uint32_t>(value))); } template <typename D> WINRT_IMPL_AUTO(Windows::Graphics::Display::DisplayOrientations) consume_Windows_Devices_Sensors_IGyrometer2<D>::ReadingTransform() const { Windows::Graphics::Display::DisplayOrientations value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer2)->get_ReadingTransform(reinterpret_cast<uint32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IGyrometer3<D>::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer3)->put_ReportLatency(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IGyrometer3<D>::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer3)->get_ReportLatency(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IGyrometer3<D>::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer3)->get_MaxBatchSize(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::GyrometerDataThreshold) consume_Windows_Devices_Sensors_IGyrometer4<D>::ReportThreshold() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometer4)->get_ReportThreshold(&value)); return Windows::Devices::Sensors::GyrometerDataThreshold{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IGyrometerDataThreshold<D>::XAxisInDegreesPerSecond() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerDataThreshold)->get_XAxisInDegreesPerSecond(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IGyrometerDataThreshold<D>::XAxisInDegreesPerSecond(double value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerDataThreshold)->put_XAxisInDegreesPerSecond(value)); } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IGyrometerDataThreshold<D>::YAxisInDegreesPerSecond() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerDataThreshold)->get_YAxisInDegreesPerSecond(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IGyrometerDataThreshold<D>::YAxisInDegreesPerSecond(double value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerDataThreshold)->put_YAxisInDegreesPerSecond(value)); } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IGyrometerDataThreshold<D>::ZAxisInDegreesPerSecond() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerDataThreshold)->get_ZAxisInDegreesPerSecond(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IGyrometerDataThreshold<D>::ZAxisInDegreesPerSecond(double value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerDataThreshold)->put_ZAxisInDegreesPerSecond(value)); } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IGyrometerDeviceId<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerDeviceId)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IGyrometerReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IGyrometerReading<D>::AngularVelocityX() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerReading)->get_AngularVelocityX(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IGyrometerReading<D>::AngularVelocityY() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerReading)->get_AngularVelocityY(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IGyrometerReading<D>::AngularVelocityZ() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerReading)->get_AngularVelocityZ(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<Windows::Foundation::TimeSpan>) consume_Windows_Devices_Sensors_IGyrometerReading2<D>::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerReading2)->get_PerformanceCount(&value)); return Windows::Foundation::IReference<Windows::Foundation::TimeSpan>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_IGyrometerReading2<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerReading2)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::GyrometerReading) consume_Windows_Devices_Sensors_IGyrometerReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::GyrometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Gyrometer) consume_Windows_Devices_Sensors_IGyrometerStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerStatics)->GetDefault(&result)); return Windows::Devices::Sensors::Gyrometer{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IGyrometerStatics2<D>::GetDeviceSelector() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerStatics2)->GetDeviceSelector(&result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Gyrometer>) consume_Windows_Devices_Sensors_IGyrometerStatics2<D>::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IGyrometerStatics2)->FromIdAsync(*(void**)(&deviceId), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Gyrometer>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IHingeAngleReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IHingeAngleReading<D>::AngleInDegrees() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleReading)->get_AngleInDegrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_IHingeAngleReading<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleReading)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleReading>) consume_Windows_Devices_Sensors_IHingeAngleSensor<D>::GetCurrentReadingAsync() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensor)->GetCurrentReadingAsync(&value)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleReading>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IHingeAngleSensor<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensor)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IHingeAngleSensor<D>::MinReportThresholdInDegrees() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensor)->get_MinReportThresholdInDegrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IHingeAngleSensor<D>::ReportThresholdInDegrees() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensor)->get_ReportThresholdInDegrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IHingeAngleSensor<D>::ReportThresholdInDegrees(double value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensor)->put_ReportThresholdInDegrees(value)); } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IHingeAngleSensor<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::HingeAngleSensor, Windows::Devices::Sensors::HingeAngleSensorReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensor)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IHingeAngleSensor<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IHingeAngleSensor<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::HingeAngleSensor, Windows::Devices::Sensors::HingeAngleSensorReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IHingeAngleSensor<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensor)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::HingeAngleReading) consume_Windows_Devices_Sensors_IHingeAngleSensorReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensorReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::HingeAngleReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IHingeAngleSensorStatics<D>::GetDeviceSelector() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensorStatics)->GetDeviceSelector(&result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>) consume_Windows_Devices_Sensors_IHingeAngleSensorStatics<D>::GetDefaultAsync() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensorStatics)->GetDefaultAsync(&result)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>) consume_Windows_Devices_Sensors_IHingeAngleSensorStatics<D>::GetRelatedToAdjacentPanelsAsync(param::hstring const& firstPanelId, param::hstring const& secondPanelId) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensorStatics)->GetRelatedToAdjacentPanelsAsync(*(void**)(&firstPanelId), *(void**)(&secondPanelId), &result)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>) consume_Windows_Devices_Sensors_IHingeAngleSensorStatics<D>::FromIdAsync(param::hstring const& deviceId) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IHingeAngleSensorStatics)->FromIdAsync(*(void**)(&deviceId), &result)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::InclinometerReading) consume_Windows_Devices_Sensors_IInclinometer<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer)->GetCurrentReading(&value)); return Windows::Devices::Sensors::InclinometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IInclinometer<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IInclinometer<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IInclinometer<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IInclinometer<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Inclinometer, Windows::Devices::Sensors::InclinometerReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IInclinometer<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IInclinometer<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Inclinometer, Windows::Devices::Sensors::InclinometerReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IInclinometer<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IInclinometer2<D>::ReadingTransform(Windows::Graphics::Display::DisplayOrientations const& value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer2)->put_ReadingTransform(static_cast<uint32_t>(value))); } template <typename D> WINRT_IMPL_AUTO(Windows::Graphics::Display::DisplayOrientations) consume_Windows_Devices_Sensors_IInclinometer2<D>::ReadingTransform() const { Windows::Graphics::Display::DisplayOrientations value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer2)->get_ReadingTransform(reinterpret_cast<uint32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::SensorReadingType) consume_Windows_Devices_Sensors_IInclinometer2<D>::ReadingType() const { Windows::Devices::Sensors::SensorReadingType type{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer2)->get_ReadingType(reinterpret_cast<int32_t*>(&type))); return type; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IInclinometer3<D>::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer3)->put_ReportLatency(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IInclinometer3<D>::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer3)->get_ReportLatency(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IInclinometer3<D>::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer3)->get_MaxBatchSize(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::InclinometerDataThreshold) consume_Windows_Devices_Sensors_IInclinometer4<D>::ReportThreshold() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometer4)->get_ReportThreshold(&value)); return Windows::Devices::Sensors::InclinometerDataThreshold{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IInclinometerDataThreshold<D>::PitchInDegrees() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerDataThreshold)->get_PitchInDegrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IInclinometerDataThreshold<D>::PitchInDegrees(float value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerDataThreshold)->put_PitchInDegrees(value)); } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IInclinometerDataThreshold<D>::RollInDegrees() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerDataThreshold)->get_RollInDegrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IInclinometerDataThreshold<D>::RollInDegrees(float value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerDataThreshold)->put_RollInDegrees(value)); } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IInclinometerDataThreshold<D>::YawInDegrees() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerDataThreshold)->get_YawInDegrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IInclinometerDataThreshold<D>::YawInDegrees(float value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerDataThreshold)->put_YawInDegrees(value)); } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IInclinometerDeviceId<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerDeviceId)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IInclinometerReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IInclinometerReading<D>::PitchDegrees() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerReading)->get_PitchDegrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IInclinometerReading<D>::RollDegrees() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerReading)->get_RollDegrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IInclinometerReading<D>::YawDegrees() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerReading)->get_YawDegrees(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<Windows::Foundation::TimeSpan>) consume_Windows_Devices_Sensors_IInclinometerReading2<D>::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerReading2)->get_PerformanceCount(&value)); return Windows::Foundation::IReference<Windows::Foundation::TimeSpan>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_IInclinometerReading2<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerReading2)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::InclinometerReading) consume_Windows_Devices_Sensors_IInclinometerReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::InclinometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::MagnetometerAccuracy) consume_Windows_Devices_Sensors_IInclinometerReadingYawAccuracy<D>::YawAccuracy() const { Windows::Devices::Sensors::MagnetometerAccuracy value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerReadingYawAccuracy)->get_YawAccuracy(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Inclinometer) consume_Windows_Devices_Sensors_IInclinometerStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerStatics)->GetDefault(&result)); return Windows::Devices::Sensors::Inclinometer{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Inclinometer) consume_Windows_Devices_Sensors_IInclinometerStatics2<D>::GetDefaultForRelativeReadings() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerStatics2)->GetDefaultForRelativeReadings(&result)); return Windows::Devices::Sensors::Inclinometer{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Inclinometer) consume_Windows_Devices_Sensors_IInclinometerStatics3<D>::GetDefault(Windows::Devices::Sensors::SensorReadingType const& sensorReadingtype) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerStatics3)->GetDefaultWithSensorReadingType(static_cast<int32_t>(sensorReadingtype), &result)); return Windows::Devices::Sensors::Inclinometer{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IInclinometerStatics4<D>::GetDeviceSelector(Windows::Devices::Sensors::SensorReadingType const& readingType) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerStatics4)->GetDeviceSelector(static_cast<int32_t>(readingType), &result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Inclinometer>) consume_Windows_Devices_Sensors_IInclinometerStatics4<D>::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IInclinometerStatics4)->FromIdAsync(*(void**)(&deviceId), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Inclinometer>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::LightSensorReading) consume_Windows_Devices_Sensors_ILightSensor<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor)->GetCurrentReading(&value)); return Windows::Devices::Sensors::LightSensorReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_ILightSensor<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ILightSensor<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_ILightSensor<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_ILightSensor<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::LightSensor, Windows::Devices::Sensors::LightSensorReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_ILightSensor<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_ILightSensor<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::LightSensor, Windows::Devices::Sensors::LightSensorReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ILightSensor<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ILightSensor2<D>::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor2)->put_ReportLatency(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_ILightSensor2<D>::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor2)->get_ReportLatency(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_ILightSensor2<D>::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor2)->get_MaxBatchSize(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::LightSensorDataThreshold) consume_Windows_Devices_Sensors_ILightSensor3<D>::ReportThreshold() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensor3)->get_ReportThreshold(&value)); return Windows::Devices::Sensors::LightSensorDataThreshold{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ILightSensorDataThreshold<D>::LuxPercentage() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorDataThreshold)->get_LuxPercentage(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ILightSensorDataThreshold<D>::LuxPercentage(float value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorDataThreshold)->put_LuxPercentage(value)); } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ILightSensorDataThreshold<D>::AbsoluteLux() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorDataThreshold)->get_AbsoluteLux(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ILightSensorDataThreshold<D>::AbsoluteLux(float value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorDataThreshold)->put_AbsoluteLux(value)); } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_ILightSensorDeviceId<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorDeviceId)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_ILightSensorReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ILightSensorReading<D>::IlluminanceInLux() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorReading)->get_IlluminanceInLux(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<Windows::Foundation::TimeSpan>) consume_Windows_Devices_Sensors_ILightSensorReading2<D>::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorReading2)->get_PerformanceCount(&value)); return Windows::Foundation::IReference<Windows::Foundation::TimeSpan>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_ILightSensorReading2<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorReading2)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::LightSensorReading) consume_Windows_Devices_Sensors_ILightSensorReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::LightSensorReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::LightSensor) consume_Windows_Devices_Sensors_ILightSensorStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorStatics)->GetDefault(&result)); return Windows::Devices::Sensors::LightSensor{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_ILightSensorStatics2<D>::GetDeviceSelector() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorStatics2)->GetDeviceSelector(&result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::LightSensor>) consume_Windows_Devices_Sensors_ILightSensorStatics2<D>::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ILightSensorStatics2)->FromIdAsync(*(void**)(&deviceId), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::LightSensor>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::MagnetometerReading) consume_Windows_Devices_Sensors_IMagnetometer<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer)->GetCurrentReading(&value)); return Windows::Devices::Sensors::MagnetometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IMagnetometer<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IMagnetometer<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IMagnetometer<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IMagnetometer<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Magnetometer, Windows::Devices::Sensors::MagnetometerReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IMagnetometer<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IMagnetometer<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Magnetometer, Windows::Devices::Sensors::MagnetometerReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IMagnetometer<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IMagnetometer2<D>::ReadingTransform(Windows::Graphics::Display::DisplayOrientations const& value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer2)->put_ReadingTransform(static_cast<uint32_t>(value))); } template <typename D> WINRT_IMPL_AUTO(Windows::Graphics::Display::DisplayOrientations) consume_Windows_Devices_Sensors_IMagnetometer2<D>::ReadingTransform() const { Windows::Graphics::Display::DisplayOrientations value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer2)->get_ReadingTransform(reinterpret_cast<uint32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IMagnetometer3<D>::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer3)->put_ReportLatency(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IMagnetometer3<D>::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer3)->get_ReportLatency(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IMagnetometer3<D>::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer3)->get_MaxBatchSize(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::MagnetometerDataThreshold) consume_Windows_Devices_Sensors_IMagnetometer4<D>::ReportThreshold() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometer4)->get_ReportThreshold(&value)); return Windows::Devices::Sensors::MagnetometerDataThreshold{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IMagnetometerDataThreshold<D>::XAxisMicroteslas() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerDataThreshold)->get_XAxisMicroteslas(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IMagnetometerDataThreshold<D>::XAxisMicroteslas(float value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerDataThreshold)->put_XAxisMicroteslas(value)); } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IMagnetometerDataThreshold<D>::YAxisMicroteslas() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerDataThreshold)->get_YAxisMicroteslas(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IMagnetometerDataThreshold<D>::YAxisMicroteslas(float value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerDataThreshold)->put_YAxisMicroteslas(value)); } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IMagnetometerDataThreshold<D>::ZAxisMicroteslas() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerDataThreshold)->get_ZAxisMicroteslas(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IMagnetometerDataThreshold<D>::ZAxisMicroteslas(float value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerDataThreshold)->put_ZAxisMicroteslas(value)); } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IMagnetometerDeviceId<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerDeviceId)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IMagnetometerReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IMagnetometerReading<D>::MagneticFieldX() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerReading)->get_MagneticFieldX(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IMagnetometerReading<D>::MagneticFieldY() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerReading)->get_MagneticFieldY(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_IMagnetometerReading<D>::MagneticFieldZ() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerReading)->get_MagneticFieldZ(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::MagnetometerAccuracy) consume_Windows_Devices_Sensors_IMagnetometerReading<D>::DirectionalAccuracy() const { Windows::Devices::Sensors::MagnetometerAccuracy value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerReading)->get_DirectionalAccuracy(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<Windows::Foundation::TimeSpan>) consume_Windows_Devices_Sensors_IMagnetometerReading2<D>::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerReading2)->get_PerformanceCount(&value)); return Windows::Foundation::IReference<Windows::Foundation::TimeSpan>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_IMagnetometerReading2<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerReading2)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::MagnetometerReading) consume_Windows_Devices_Sensors_IMagnetometerReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::MagnetometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::Magnetometer) consume_Windows_Devices_Sensors_IMagnetometerStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerStatics)->GetDefault(&result)); return Windows::Devices::Sensors::Magnetometer{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IMagnetometerStatics2<D>::GetDeviceSelector() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerStatics2)->GetDeviceSelector(&result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Magnetometer>) consume_Windows_Devices_Sensors_IMagnetometerStatics2<D>::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IMagnetometerStatics2)->FromIdAsync(*(void**)(&deviceId), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Magnetometer>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::OrientationSensorReading) consume_Windows_Devices_Sensors_IOrientationSensor<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor)->GetCurrentReading(&value)); return Windows::Devices::Sensors::OrientationSensorReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IOrientationSensor<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IOrientationSensor<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IOrientationSensor<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IOrientationSensor<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::OrientationSensor, Windows::Devices::Sensors::OrientationSensorReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IOrientationSensor<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IOrientationSensor<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::OrientationSensor, Windows::Devices::Sensors::OrientationSensorReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IOrientationSensor<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IOrientationSensor2<D>::ReadingTransform(Windows::Graphics::Display::DisplayOrientations const& value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor2)->put_ReadingTransform(static_cast<uint32_t>(value))); } template <typename D> WINRT_IMPL_AUTO(Windows::Graphics::Display::DisplayOrientations) consume_Windows_Devices_Sensors_IOrientationSensor2<D>::ReadingTransform() const { Windows::Graphics::Display::DisplayOrientations value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor2)->get_ReadingTransform(reinterpret_cast<uint32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::SensorReadingType) consume_Windows_Devices_Sensors_IOrientationSensor2<D>::ReadingType() const { Windows::Devices::Sensors::SensorReadingType type{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor2)->get_ReadingType(reinterpret_cast<int32_t*>(&type))); return type; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IOrientationSensor3<D>::ReportLatency(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor3)->put_ReportLatency(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IOrientationSensor3<D>::ReportLatency() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor3)->get_ReportLatency(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IOrientationSensor3<D>::MaxBatchSize() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensor3)->get_MaxBatchSize(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IOrientationSensorDeviceId<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorDeviceId)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IOrientationSensorReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::SensorRotationMatrix) consume_Windows_Devices_Sensors_IOrientationSensorReading<D>::RotationMatrix() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorReading)->get_RotationMatrix(&value)); return Windows::Devices::Sensors::SensorRotationMatrix{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::SensorQuaternion) consume_Windows_Devices_Sensors_IOrientationSensorReading<D>::Quaternion() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorReading)->get_Quaternion(&value)); return Windows::Devices::Sensors::SensorQuaternion{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<Windows::Foundation::TimeSpan>) consume_Windows_Devices_Sensors_IOrientationSensorReading2<D>::PerformanceCount() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorReading2)->get_PerformanceCount(&value)); return Windows::Foundation::IReference<Windows::Foundation::TimeSpan>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>) consume_Windows_Devices_Sensors_IOrientationSensorReading2<D>::Properties() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorReading2)->get_Properties(&value)); return Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::OrientationSensorReading) consume_Windows_Devices_Sensors_IOrientationSensorReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::OrientationSensorReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::MagnetometerAccuracy) consume_Windows_Devices_Sensors_IOrientationSensorReadingYawAccuracy<D>::YawAccuracy() const { Windows::Devices::Sensors::MagnetometerAccuracy value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorReadingYawAccuracy)->get_YawAccuracy(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::OrientationSensor) consume_Windows_Devices_Sensors_IOrientationSensorStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorStatics)->GetDefault(&result)); return Windows::Devices::Sensors::OrientationSensor{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::OrientationSensor) consume_Windows_Devices_Sensors_IOrientationSensorStatics2<D>::GetDefaultForRelativeReadings() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorStatics2)->GetDefaultForRelativeReadings(&result)); return Windows::Devices::Sensors::OrientationSensor{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::OrientationSensor) consume_Windows_Devices_Sensors_IOrientationSensorStatics3<D>::GetDefault(Windows::Devices::Sensors::SensorReadingType const& sensorReadingtype) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorStatics3)->GetDefaultWithSensorReadingType(static_cast<int32_t>(sensorReadingtype), &result)); return Windows::Devices::Sensors::OrientationSensor{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::OrientationSensor) consume_Windows_Devices_Sensors_IOrientationSensorStatics3<D>::GetDefault(Windows::Devices::Sensors::SensorReadingType const& sensorReadingType, Windows::Devices::Sensors::SensorOptimizationGoal const& optimizationGoal) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorStatics3)->GetDefaultWithSensorReadingTypeAndSensorOptimizationGoal(static_cast<int32_t>(sensorReadingType), static_cast<int32_t>(optimizationGoal), &result)); return Windows::Devices::Sensors::OrientationSensor{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IOrientationSensorStatics4<D>::GetDeviceSelector(Windows::Devices::Sensors::SensorReadingType const& readingType) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorStatics4)->GetDeviceSelector(static_cast<int32_t>(readingType), &result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IOrientationSensorStatics4<D>::GetDeviceSelector(Windows::Devices::Sensors::SensorReadingType const& readingType, Windows::Devices::Sensors::SensorOptimizationGoal const& optimizationGoal) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorStatics4)->GetDeviceSelectorWithSensorReadingTypeAndSensorOptimizationGoal(static_cast<int32_t>(readingType), static_cast<int32_t>(optimizationGoal), &result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::OrientationSensor>) consume_Windows_Devices_Sensors_IOrientationSensorStatics4<D>::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IOrientationSensorStatics4)->FromIdAsync(*(void**)(&deviceId), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::OrientationSensor>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IPedometer<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometer)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(double) consume_Windows_Devices_Sensors_IPedometer<D>::PowerInMilliwatts() const { double value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometer)->get_PowerInMilliwatts(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IPedometer<D>::MinimumReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometer)->get_MinimumReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IPedometer<D>::ReportInterval(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometer)->put_ReportInterval(value)); } template <typename D> WINRT_IMPL_AUTO(uint32_t) consume_Windows_Devices_Sensors_IPedometer<D>::ReportInterval() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometer)->get_ReportInterval(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IPedometer<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Pedometer, Windows::Devices::Sensors::PedometerReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometer)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IPedometer<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IPedometer<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Pedometer, Windows::Devices::Sensors::PedometerReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IPedometer<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometer)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IMapView<Windows::Devices::Sensors::PedometerStepKind, Windows::Devices::Sensors::PedometerReading>) consume_Windows_Devices_Sensors_IPedometer2<D>::GetCurrentReadings() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometer2)->GetCurrentReadings(&value)); return Windows::Foundation::Collections::IMapView<Windows::Devices::Sensors::PedometerStepKind, Windows::Devices::Sensors::PedometerReading>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::PedometerDataThreshold) consume_Windows_Devices_Sensors_IPedometerDataThresholdFactory<D>::Create(Windows::Devices::Sensors::Pedometer const& sensor, int32_t stepGoal) const { void* threshold{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerDataThresholdFactory)->Create(*(void**)(&sensor), stepGoal, &threshold)); return Windows::Devices::Sensors::PedometerDataThreshold{ threshold, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::PedometerStepKind) consume_Windows_Devices_Sensors_IPedometerReading<D>::StepKind() const { Windows::Devices::Sensors::PedometerStepKind value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerReading)->get_StepKind(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(int32_t) consume_Windows_Devices_Sensors_IPedometerReading<D>::CumulativeSteps() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerReading)->get_CumulativeSteps(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IPedometerReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::TimeSpan) consume_Windows_Devices_Sensors_IPedometerReading<D>::CumulativeStepsDuration() const { Windows::Foundation::TimeSpan value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerReading)->get_CumulativeStepsDuration(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::PedometerReading) consume_Windows_Devices_Sensors_IPedometerReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::PedometerReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Pedometer>) consume_Windows_Devices_Sensors_IPedometerStatics<D>::FromIdAsync(param::hstring const& deviceId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerStatics)->FromIdAsync(*(void**)(&deviceId), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Pedometer>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Pedometer>) consume_Windows_Devices_Sensors_IPedometerStatics<D>::GetDefaultAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerStatics)->GetDefaultAsync(&operation)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Pedometer>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IPedometerStatics<D>::GetDeviceSelector() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerStatics)->GetDeviceSelector(&result)); return hstring{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::PedometerReading>>) consume_Windows_Devices_Sensors_IPedometerStatics<D>::GetSystemHistoryAsync(Windows::Foundation::DateTime const& fromTime) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerStatics)->GetSystemHistoryAsync(impl::bind_in(fromTime), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::PedometerReading>>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::PedometerReading>>) consume_Windows_Devices_Sensors_IPedometerStatics<D>::GetSystemHistoryAsync(Windows::Foundation::DateTime const& fromTime, Windows::Foundation::TimeSpan const& duration) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerStatics)->GetSystemHistoryWithDurationAsync(impl::bind_in(fromTime), impl::bind_in(duration), &operation)); return Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::PedometerReading>>{ operation, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::PedometerReading>) consume_Windows_Devices_Sensors_IPedometerStatics2<D>::GetReadingsFromTriggerDetails(Windows::Devices::Sensors::SensorDataThresholdTriggerDetails const& triggerDetails) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IPedometerStatics2)->GetReadingsFromTriggerDetails(*(void**)(&triggerDetails), &result)); return Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::PedometerReading>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IProximitySensor<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensor)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<uint32_t>) consume_Windows_Devices_Sensors_IProximitySensor<D>::MaxDistanceInMillimeters() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensor)->get_MaxDistanceInMillimeters(&value)); return Windows::Foundation::IReference<uint32_t>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<uint32_t>) consume_Windows_Devices_Sensors_IProximitySensor<D>::MinDistanceInMillimeters() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensor)->get_MinDistanceInMillimeters(&value)); return Windows::Foundation::IReference<uint32_t>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::ProximitySensorReading) consume_Windows_Devices_Sensors_IProximitySensor<D>::GetCurrentReading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensor)->GetCurrentReading(&value)); return Windows::Devices::Sensors::ProximitySensorReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_IProximitySensor<D>::ReadingChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::ProximitySensor, Windows::Devices::Sensors::ProximitySensorReadingChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensor)->add_ReadingChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_IProximitySensor<D>::ReadingChanged_revoker consume_Windows_Devices_Sensors_IProximitySensor<D>::ReadingChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::ProximitySensor, Windows::Devices::Sensors::ProximitySensorReadingChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, ReadingChanged_revoker>(this, ReadingChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_IProximitySensor<D>::ReadingChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensor)->remove_ReadingChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::ProximitySensorDisplayOnOffController) consume_Windows_Devices_Sensors_IProximitySensor<D>::CreateDisplayOnOffController() const { void* controller{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensor)->CreateDisplayOnOffController(&controller)); return Windows::Devices::Sensors::ProximitySensorDisplayOnOffController{ controller, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::ProximitySensorDataThreshold) consume_Windows_Devices_Sensors_IProximitySensorDataThresholdFactory<D>::Create(Windows::Devices::Sensors::ProximitySensor const& sensor) const { void* threshold{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensorDataThresholdFactory)->Create(*(void**)(&sensor), &threshold)); return Windows::Devices::Sensors::ProximitySensorDataThreshold{ threshold, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_IProximitySensorReading<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensorReading)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(bool) consume_Windows_Devices_Sensors_IProximitySensorReading<D>::IsDetected() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensorReading)->get_IsDetected(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IReference<uint32_t>) consume_Windows_Devices_Sensors_IProximitySensorReading<D>::DistanceInMillimeters() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensorReading)->get_DistanceInMillimeters(&value)); return Windows::Foundation::IReference<uint32_t>{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::ProximitySensorReading) consume_Windows_Devices_Sensors_IProximitySensorReadingChangedEventArgs<D>::Reading() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensorReadingChangedEventArgs)->get_Reading(&value)); return Windows::Devices::Sensors::ProximitySensorReading{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_IProximitySensorStatics<D>::GetDeviceSelector() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensorStatics)->GetDeviceSelector(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::ProximitySensor) consume_Windows_Devices_Sensors_IProximitySensorStatics<D>::FromId(param::hstring const& sensorId) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensorStatics)->FromId(*(void**)(&sensorId), &result)); return Windows::Devices::Sensors::ProximitySensor{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ProximitySensorReading>) consume_Windows_Devices_Sensors_IProximitySensorStatics2<D>::GetReadingsFromTriggerDetails(Windows::Devices::Sensors::SensorDataThresholdTriggerDetails const& triggerDetails) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::IProximitySensorStatics2)->GetReadingsFromTriggerDetails(*(void**)(&triggerDetails), &result)); return Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ProximitySensorReading>{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_ISensorDataThresholdTriggerDetails<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorDataThresholdTriggerDetails)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::SensorType) consume_Windows_Devices_Sensors_ISensorDataThresholdTriggerDetails<D>::SensorType() const { Windows::Devices::Sensors::SensorType value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorDataThresholdTriggerDetails)->get_SensorType(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorQuaternion<D>::W() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorQuaternion)->get_W(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorQuaternion<D>::X() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorQuaternion)->get_X(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorQuaternion<D>::Y() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorQuaternion)->get_Y(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorQuaternion<D>::Z() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorQuaternion)->get_Z(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorRotationMatrix<D>::M11() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorRotationMatrix)->get_M11(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorRotationMatrix<D>::M12() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorRotationMatrix)->get_M12(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorRotationMatrix<D>::M13() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorRotationMatrix)->get_M13(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorRotationMatrix<D>::M21() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorRotationMatrix)->get_M21(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorRotationMatrix<D>::M22() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorRotationMatrix)->get_M22(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorRotationMatrix<D>::M23() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorRotationMatrix)->get_M23(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorRotationMatrix<D>::M31() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorRotationMatrix)->get_M31(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorRotationMatrix<D>::M32() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorRotationMatrix)->get_M32(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(float) consume_Windows_Devices_Sensors_ISensorRotationMatrix<D>::M33() const { float value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISensorRotationMatrix)->get_M33(&value)); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::SimpleOrientation) consume_Windows_Devices_Sensors_ISimpleOrientationSensor<D>::GetCurrentOrientation() const { Windows::Devices::Sensors::SimpleOrientation value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensor)->GetCurrentOrientation(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(winrt::event_token) consume_Windows_Devices_Sensors_ISimpleOrientationSensor<D>::OrientationChanged(Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::SimpleOrientationSensor, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs> const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensor)->add_OrientationChanged(*(void**)(&handler), put_abi(token))); return token; } template <typename D> typename consume_Windows_Devices_Sensors_ISimpleOrientationSensor<D>::OrientationChanged_revoker consume_Windows_Devices_Sensors_ISimpleOrientationSensor<D>::OrientationChanged(auto_revoke_t, Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::SimpleOrientationSensor, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs> const& handler) const { return impl::make_event_revoker<D, OrientationChanged_revoker>(this, OrientationChanged(handler)); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ISimpleOrientationSensor<D>::OrientationChanged(winrt::event_token const& token) const noexcept { WINRT_VERIFY_(0, WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensor)->remove_OrientationChanged(impl::bind_in(token))); } template <typename D> WINRT_IMPL_AUTO(void) consume_Windows_Devices_Sensors_ISimpleOrientationSensor2<D>::ReadingTransform(Windows::Graphics::Display::DisplayOrientations const& value) const { check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensor2)->put_ReadingTransform(static_cast<uint32_t>(value))); } template <typename D> WINRT_IMPL_AUTO(Windows::Graphics::Display::DisplayOrientations) consume_Windows_Devices_Sensors_ISimpleOrientationSensor2<D>::ReadingTransform() const { Windows::Graphics::Display::DisplayOrientations value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensor2)->get_ReadingTransform(reinterpret_cast<uint32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_ISimpleOrientationSensorDeviceId<D>::DeviceId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensorDeviceId)->get_DeviceId(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::DateTime) consume_Windows_Devices_Sensors_ISimpleOrientationSensorOrientationChangedEventArgs<D>::Timestamp() const { Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensorOrientationChangedEventArgs)->get_Timestamp(put_abi(value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::SimpleOrientation) consume_Windows_Devices_Sensors_ISimpleOrientationSensorOrientationChangedEventArgs<D>::Orientation() const { Windows::Devices::Sensors::SimpleOrientation value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensorOrientationChangedEventArgs)->get_Orientation(reinterpret_cast<int32_t*>(&value))); return value; } template <typename D> WINRT_IMPL_AUTO(Windows::Devices::Sensors::SimpleOrientationSensor) consume_Windows_Devices_Sensors_ISimpleOrientationSensorStatics<D>::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensorStatics)->GetDefault(&result)); return Windows::Devices::Sensors::SimpleOrientationSensor{ result, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(hstring) consume_Windows_Devices_Sensors_ISimpleOrientationSensorStatics2<D>::GetDeviceSelector() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensorStatics2)->GetDeviceSelector(&value)); return hstring{ value, take_ownership_from_abi }; } template <typename D> WINRT_IMPL_AUTO(Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::SimpleOrientationSensor>) consume_Windows_Devices_Sensors_ISimpleOrientationSensorStatics2<D>::FromIdAsync(param::hstring const& deviceId) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(Windows::Devices::Sensors::ISimpleOrientationSensorStatics2)->FromIdAsync(*(void**)(&deviceId), &result)); return Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::SimpleOrientationSensor>{ result, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometer> : produce_base<D, Windows::Devices::Sensors::IAccelerometer> { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::AccelerometerReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Accelerometer, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } int32_t __stdcall add_Shaken(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().Shaken(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Accelerometer, Windows::Devices::Sensors::AccelerometerShakenEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Shaken(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Shaken(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometer2> : produce_base<D, Windows::Devices::Sensors::IAccelerometer2> { int32_t __stdcall put_ReadingTransform(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadingTransform(*reinterpret_cast<Windows::Graphics::Display::DisplayOrientations const*>(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadingTransform(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Graphics::Display::DisplayOrientations>(this->shim().ReadingTransform()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometer3> : produce_base<D, Windows::Devices::Sensors::IAccelerometer3> { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometer4> : produce_base<D, Windows::Devices::Sensors::IAccelerometer4> { int32_t __stdcall get_ReadingType(int32_t* type) noexcept final try { typename D::abi_guard guard(this->shim()); *type = detach_from<Windows::Devices::Sensors::AccelerometerReadingType>(this->shim().ReadingType()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometer5> : produce_base<D, Windows::Devices::Sensors::IAccelerometer5> { int32_t __stdcall get_ReportThreshold(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::AccelerometerDataThreshold>(this->shim().ReportThreshold()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometerDataThreshold> : produce_base<D, Windows::Devices::Sensors::IAccelerometerDataThreshold> { int32_t __stdcall get_XAxisInGForce(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().XAxisInGForce()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_XAxisInGForce(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().XAxisInGForce(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_YAxisInGForce(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().YAxisInGForce()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_YAxisInGForce(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().YAxisInGForce(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ZAxisInGForce(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().ZAxisInGForce()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ZAxisInGForce(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ZAxisInGForce(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometerDeviceId> : produce_base<D, Windows::Devices::Sensors::IAccelerometerDeviceId> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometerReading> : produce_base<D, Windows::Devices::Sensors::IAccelerometerReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AccelerationX(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().AccelerationX()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AccelerationY(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().AccelerationY()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AccelerationZ(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().AccelerationZ()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometerReading2> : produce_base<D, Windows::Devices::Sensors::IAccelerometerReading2> { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<Windows::Foundation::TimeSpan>>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometerReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IAccelerometerReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::AccelerometerReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometerShakenEventArgs> : produce_base<D, Windows::Devices::Sensors::IAccelerometerShakenEventArgs> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometerStatics> : produce_base<D, Windows::Devices::Sensors::IAccelerometerStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Accelerometer>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometerStatics2> : produce_base<D, Windows::Devices::Sensors::IAccelerometerStatics2> { int32_t __stdcall GetDefaultWithAccelerometerReadingType(int32_t readingType, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Accelerometer>(this->shim().GetDefault(*reinterpret_cast<Windows::Devices::Sensors::AccelerometerReadingType const*>(&readingType))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAccelerometerStatics3> : produce_base<D, Windows::Devices::Sensors::IAccelerometerStatics3> { int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Accelerometer>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelector(int32_t readingType, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector(*reinterpret_cast<Windows::Devices::Sensors::AccelerometerReadingType const*>(&readingType))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IActivitySensor> : produce_base<D, Windows::Devices::Sensors::IActivitySensor> { int32_t __stdcall GetCurrentReadingAsync(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensorReading>>(this->shim().GetCurrentReadingAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SubscribedActivities(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IVector<Windows::Devices::Sensors::ActivityType>>(this->shim().SubscribedActivities()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PowerInMilliwatts(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().PowerInMilliwatts()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SupportedActivities(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivityType>>(this->shim().SupportedActivities()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::ActivitySensor, Windows::Devices::Sensors::ActivitySensorReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IActivitySensorReading> : produce_base<D, Windows::Devices::Sensors::IActivitySensorReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Activity(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::ActivityType>(this->shim().Activity()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Confidence(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::ActivitySensorReadingConfidence>(this->shim().Confidence()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IActivitySensorReadingChangeReport> : produce_base<D, Windows::Devices::Sensors::IActivitySensorReadingChangeReport> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::ActivitySensorReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IActivitySensorReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IActivitySensorReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::ActivitySensorReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IActivitySensorStatics> : produce_base<D, Windows::Devices::Sensors::IActivitySensorStatics> { int32_t __stdcall GetDefaultAsync(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensor>>(this->shim().GetDefaultAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelector(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensor>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetSystemHistoryAsync(int64_t fromTime, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivitySensorReading>>>(this->shim().GetSystemHistoryAsync(*reinterpret_cast<Windows::Foundation::DateTime const*>(&fromTime))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetSystemHistoryWithDurationAsync(int64_t fromTime, int64_t duration, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivitySensorReading>>>(this->shim().GetSystemHistoryAsync(*reinterpret_cast<Windows::Foundation::DateTime const*>(&fromTime), *reinterpret_cast<Windows::Foundation::TimeSpan const*>(&duration))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IActivitySensorTriggerDetails> : produce_base<D, Windows::Devices::Sensors::IActivitySensorTriggerDetails> { int32_t __stdcall ReadReports(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ActivitySensorReadingChangeReport>>(this->shim().ReadReports()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAltimeter> : produce_base<D, Windows::Devices::Sensors::IAltimeter> { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::AltimeterReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Altimeter, Windows::Devices::Sensors::AltimeterReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAltimeter2> : produce_base<D, Windows::Devices::Sensors::IAltimeter2> { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAltimeterReading> : produce_base<D, Windows::Devices::Sensors::IAltimeterReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AltitudeChangeInMeters(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().AltitudeChangeInMeters()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAltimeterReading2> : produce_base<D, Windows::Devices::Sensors::IAltimeterReading2> { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<Windows::Foundation::TimeSpan>>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAltimeterReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IAltimeterReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::AltimeterReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IAltimeterStatics> : produce_base<D, Windows::Devices::Sensors::IAltimeterStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Altimeter>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IBarometer> : produce_base<D, Windows::Devices::Sensors::IBarometer> { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::BarometerReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Barometer, Windows::Devices::Sensors::BarometerReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IBarometer2> : produce_base<D, Windows::Devices::Sensors::IBarometer2> { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IBarometer3> : produce_base<D, Windows::Devices::Sensors::IBarometer3> { int32_t __stdcall get_ReportThreshold(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::BarometerDataThreshold>(this->shim().ReportThreshold()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IBarometerDataThreshold> : produce_base<D, Windows::Devices::Sensors::IBarometerDataThreshold> { int32_t __stdcall get_Hectopascals(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().Hectopascals()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Hectopascals(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Hectopascals(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IBarometerReading> : produce_base<D, Windows::Devices::Sensors::IBarometerReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_StationPressureInHectopascals(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().StationPressureInHectopascals()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IBarometerReading2> : produce_base<D, Windows::Devices::Sensors::IBarometerReading2> { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<Windows::Foundation::TimeSpan>>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IBarometerReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IBarometerReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::BarometerReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IBarometerStatics> : produce_base<D, Windows::Devices::Sensors::IBarometerStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Barometer>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IBarometerStatics2> : produce_base<D, Windows::Devices::Sensors::IBarometerStatics2> { int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Barometer>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelector(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompass> : produce_base<D, Windows::Devices::Sensors::ICompass> { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::CompassReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Compass, Windows::Devices::Sensors::CompassReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompass2> : produce_base<D, Windows::Devices::Sensors::ICompass2> { int32_t __stdcall put_ReadingTransform(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadingTransform(*reinterpret_cast<Windows::Graphics::Display::DisplayOrientations const*>(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadingTransform(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Graphics::Display::DisplayOrientations>(this->shim().ReadingTransform()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompass3> : produce_base<D, Windows::Devices::Sensors::ICompass3> { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompass4> : produce_base<D, Windows::Devices::Sensors::ICompass4> { int32_t __stdcall get_ReportThreshold(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::CompassDataThreshold>(this->shim().ReportThreshold()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompassDataThreshold> : produce_base<D, Windows::Devices::Sensors::ICompassDataThreshold> { int32_t __stdcall get_Degrees(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().Degrees()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Degrees(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Degrees(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompassDeviceId> : produce_base<D, Windows::Devices::Sensors::ICompassDeviceId> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompassReading> : produce_base<D, Windows::Devices::Sensors::ICompassReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_HeadingMagneticNorth(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().HeadingMagneticNorth()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_HeadingTrueNorth(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<double>>(this->shim().HeadingTrueNorth()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompassReading2> : produce_base<D, Windows::Devices::Sensors::ICompassReading2> { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<Windows::Foundation::TimeSpan>>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompassReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::ICompassReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::CompassReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompassReadingHeadingAccuracy> : produce_base<D, Windows::Devices::Sensors::ICompassReadingHeadingAccuracy> { int32_t __stdcall get_HeadingAccuracy(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::MagnetometerAccuracy>(this->shim().HeadingAccuracy()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompassStatics> : produce_base<D, Windows::Devices::Sensors::ICompassStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Compass>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ICompassStatics2> : produce_base<D, Windows::Devices::Sensors::ICompassStatics2> { int32_t __stdcall GetDeviceSelector(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Compass>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometer> : produce_base<D, Windows::Devices::Sensors::IGyrometer> { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::GyrometerReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Gyrometer, Windows::Devices::Sensors::GyrometerReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometer2> : produce_base<D, Windows::Devices::Sensors::IGyrometer2> { int32_t __stdcall put_ReadingTransform(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadingTransform(*reinterpret_cast<Windows::Graphics::Display::DisplayOrientations const*>(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadingTransform(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Graphics::Display::DisplayOrientations>(this->shim().ReadingTransform()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometer3> : produce_base<D, Windows::Devices::Sensors::IGyrometer3> { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometer4> : produce_base<D, Windows::Devices::Sensors::IGyrometer4> { int32_t __stdcall get_ReportThreshold(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::GyrometerDataThreshold>(this->shim().ReportThreshold()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometerDataThreshold> : produce_base<D, Windows::Devices::Sensors::IGyrometerDataThreshold> { int32_t __stdcall get_XAxisInDegreesPerSecond(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().XAxisInDegreesPerSecond()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_XAxisInDegreesPerSecond(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().XAxisInDegreesPerSecond(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_YAxisInDegreesPerSecond(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().YAxisInDegreesPerSecond()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_YAxisInDegreesPerSecond(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().YAxisInDegreesPerSecond(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ZAxisInDegreesPerSecond(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().ZAxisInDegreesPerSecond()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ZAxisInDegreesPerSecond(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ZAxisInDegreesPerSecond(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometerDeviceId> : produce_base<D, Windows::Devices::Sensors::IGyrometerDeviceId> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometerReading> : produce_base<D, Windows::Devices::Sensors::IGyrometerReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AngularVelocityX(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().AngularVelocityX()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AngularVelocityY(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().AngularVelocityY()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AngularVelocityZ(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().AngularVelocityZ()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometerReading2> : produce_base<D, Windows::Devices::Sensors::IGyrometerReading2> { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<Windows::Foundation::TimeSpan>>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometerReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IGyrometerReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::GyrometerReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometerStatics> : produce_base<D, Windows::Devices::Sensors::IGyrometerStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Gyrometer>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IGyrometerStatics2> : produce_base<D, Windows::Devices::Sensors::IGyrometerStatics2> { int32_t __stdcall GetDeviceSelector(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Gyrometer>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IHingeAngleReading> : produce_base<D, Windows::Devices::Sensors::IHingeAngleReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AngleInDegrees(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().AngleInDegrees()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IHingeAngleSensor> : produce_base<D, Windows::Devices::Sensors::IHingeAngleSensor> { int32_t __stdcall GetCurrentReadingAsync(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleReading>>(this->shim().GetCurrentReadingAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinReportThresholdInDegrees(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().MinReportThresholdInDegrees()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportThresholdInDegrees(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().ReportThresholdInDegrees()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportThresholdInDegrees(double value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportThresholdInDegrees(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::HingeAngleSensor, Windows::Devices::Sensors::HingeAngleSensorReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IHingeAngleSensorReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IHingeAngleSensorReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::HingeAngleReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IHingeAngleSensorStatics> : produce_base<D, Windows::Devices::Sensors::IHingeAngleSensorStatics> { int32_t __stdcall GetDeviceSelector(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDefaultAsync(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>>(this->shim().GetDefaultAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetRelatedToAdjacentPanelsAsync(void* firstPanelId, void* secondPanelId, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>>(this->shim().GetRelatedToAdjacentPanelsAsync(*reinterpret_cast<hstring const*>(&firstPanelId), *reinterpret_cast<hstring const*>(&secondPanelId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometer> : produce_base<D, Windows::Devices::Sensors::IInclinometer> { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::InclinometerReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Inclinometer, Windows::Devices::Sensors::InclinometerReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometer2> : produce_base<D, Windows::Devices::Sensors::IInclinometer2> { int32_t __stdcall put_ReadingTransform(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadingTransform(*reinterpret_cast<Windows::Graphics::Display::DisplayOrientations const*>(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadingTransform(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Graphics::Display::DisplayOrientations>(this->shim().ReadingTransform()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadingType(int32_t* type) noexcept final try { typename D::abi_guard guard(this->shim()); *type = detach_from<Windows::Devices::Sensors::SensorReadingType>(this->shim().ReadingType()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometer3> : produce_base<D, Windows::Devices::Sensors::IInclinometer3> { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometer4> : produce_base<D, Windows::Devices::Sensors::IInclinometer4> { int32_t __stdcall get_ReportThreshold(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::InclinometerDataThreshold>(this->shim().ReportThreshold()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerDataThreshold> : produce_base<D, Windows::Devices::Sensors::IInclinometerDataThreshold> { int32_t __stdcall get_PitchInDegrees(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().PitchInDegrees()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_PitchInDegrees(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().PitchInDegrees(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RollInDegrees(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().RollInDegrees()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_RollInDegrees(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().RollInDegrees(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_YawInDegrees(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().YawInDegrees()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_YawInDegrees(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().YawInDegrees(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerDeviceId> : produce_base<D, Windows::Devices::Sensors::IInclinometerDeviceId> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerReading> : produce_base<D, Windows::Devices::Sensors::IInclinometerReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PitchDegrees(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().PitchDegrees()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RollDegrees(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().RollDegrees()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_YawDegrees(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().YawDegrees()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerReading2> : produce_base<D, Windows::Devices::Sensors::IInclinometerReading2> { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<Windows::Foundation::TimeSpan>>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IInclinometerReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::InclinometerReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerReadingYawAccuracy> : produce_base<D, Windows::Devices::Sensors::IInclinometerReadingYawAccuracy> { int32_t __stdcall get_YawAccuracy(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::MagnetometerAccuracy>(this->shim().YawAccuracy()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerStatics> : produce_base<D, Windows::Devices::Sensors::IInclinometerStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Inclinometer>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerStatics2> : produce_base<D, Windows::Devices::Sensors::IInclinometerStatics2> { int32_t __stdcall GetDefaultForRelativeReadings(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Inclinometer>(this->shim().GetDefaultForRelativeReadings()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerStatics3> : produce_base<D, Windows::Devices::Sensors::IInclinometerStatics3> { int32_t __stdcall GetDefaultWithSensorReadingType(int32_t sensorReadingtype, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Inclinometer>(this->shim().GetDefault(*reinterpret_cast<Windows::Devices::Sensors::SensorReadingType const*>(&sensorReadingtype))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IInclinometerStatics4> : produce_base<D, Windows::Devices::Sensors::IInclinometerStatics4> { int32_t __stdcall GetDeviceSelector(int32_t readingType, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector(*reinterpret_cast<Windows::Devices::Sensors::SensorReadingType const*>(&readingType))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Inclinometer>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensor> : produce_base<D, Windows::Devices::Sensors::ILightSensor> { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::LightSensorReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::LightSensor, Windows::Devices::Sensors::LightSensorReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensor2> : produce_base<D, Windows::Devices::Sensors::ILightSensor2> { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensor3> : produce_base<D, Windows::Devices::Sensors::ILightSensor3> { int32_t __stdcall get_ReportThreshold(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::LightSensorDataThreshold>(this->shim().ReportThreshold()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensorDataThreshold> : produce_base<D, Windows::Devices::Sensors::ILightSensorDataThreshold> { int32_t __stdcall get_LuxPercentage(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().LuxPercentage()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_LuxPercentage(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().LuxPercentage(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AbsoluteLux(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().AbsoluteLux()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_AbsoluteLux(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AbsoluteLux(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensorDeviceId> : produce_base<D, Windows::Devices::Sensors::ILightSensorDeviceId> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensorReading> : produce_base<D, Windows::Devices::Sensors::ILightSensorReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IlluminanceInLux(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().IlluminanceInLux()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensorReading2> : produce_base<D, Windows::Devices::Sensors::ILightSensorReading2> { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<Windows::Foundation::TimeSpan>>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensorReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::ILightSensorReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::LightSensorReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensorStatics> : produce_base<D, Windows::Devices::Sensors::ILightSensorStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::LightSensor>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ILightSensorStatics2> : produce_base<D, Windows::Devices::Sensors::ILightSensorStatics2> { int32_t __stdcall GetDeviceSelector(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::LightSensor>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometer> : produce_base<D, Windows::Devices::Sensors::IMagnetometer> { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::MagnetometerReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Magnetometer, Windows::Devices::Sensors::MagnetometerReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometer2> : produce_base<D, Windows::Devices::Sensors::IMagnetometer2> { int32_t __stdcall put_ReadingTransform(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadingTransform(*reinterpret_cast<Windows::Graphics::Display::DisplayOrientations const*>(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadingTransform(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Graphics::Display::DisplayOrientations>(this->shim().ReadingTransform()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometer3> : produce_base<D, Windows::Devices::Sensors::IMagnetometer3> { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometer4> : produce_base<D, Windows::Devices::Sensors::IMagnetometer4> { int32_t __stdcall get_ReportThreshold(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::MagnetometerDataThreshold>(this->shim().ReportThreshold()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometerDataThreshold> : produce_base<D, Windows::Devices::Sensors::IMagnetometerDataThreshold> { int32_t __stdcall get_XAxisMicroteslas(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().XAxisMicroteslas()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_XAxisMicroteslas(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().XAxisMicroteslas(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_YAxisMicroteslas(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().YAxisMicroteslas()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_YAxisMicroteslas(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().YAxisMicroteslas(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ZAxisMicroteslas(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().ZAxisMicroteslas()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ZAxisMicroteslas(float value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ZAxisMicroteslas(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometerDeviceId> : produce_base<D, Windows::Devices::Sensors::IMagnetometerDeviceId> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometerReading> : produce_base<D, Windows::Devices::Sensors::IMagnetometerReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MagneticFieldX(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().MagneticFieldX()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MagneticFieldY(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().MagneticFieldY()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MagneticFieldZ(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().MagneticFieldZ()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DirectionalAccuracy(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::MagnetometerAccuracy>(this->shim().DirectionalAccuracy()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometerReading2> : produce_base<D, Windows::Devices::Sensors::IMagnetometerReading2> { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<Windows::Foundation::TimeSpan>>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometerReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IMagnetometerReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::MagnetometerReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometerStatics> : produce_base<D, Windows::Devices::Sensors::IMagnetometerStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::Magnetometer>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IMagnetometerStatics2> : produce_base<D, Windows::Devices::Sensors::IMagnetometerStatics2> { int32_t __stdcall GetDeviceSelector(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Magnetometer>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensor> : produce_base<D, Windows::Devices::Sensors::IOrientationSensor> { int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::OrientationSensorReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::OrientationSensor, Windows::Devices::Sensors::OrientationSensorReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensor2> : produce_base<D, Windows::Devices::Sensors::IOrientationSensor2> { int32_t __stdcall put_ReadingTransform(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadingTransform(*reinterpret_cast<Windows::Graphics::Display::DisplayOrientations const*>(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadingTransform(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Graphics::Display::DisplayOrientations>(this->shim().ReadingTransform()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadingType(int32_t* type) noexcept final try { typename D::abi_guard guard(this->shim()); *type = detach_from<Windows::Devices::Sensors::SensorReadingType>(this->shim().ReadingType()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensor3> : produce_base<D, Windows::Devices::Sensors::IOrientationSensor3> { int32_t __stdcall put_ReportLatency(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportLatency(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportLatency(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportLatency()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxBatchSize(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MaxBatchSize()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensorDeviceId> : produce_base<D, Windows::Devices::Sensors::IOrientationSensorDeviceId> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensorReading> : produce_base<D, Windows::Devices::Sensors::IOrientationSensorReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RotationMatrix(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::SensorRotationMatrix>(this->shim().RotationMatrix()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Quaternion(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::SensorQuaternion>(this->shim().Quaternion()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensorReading2> : produce_base<D, Windows::Devices::Sensors::IOrientationSensorReading2> { int32_t __stdcall get_PerformanceCount(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<Windows::Foundation::TimeSpan>>(this->shim().PerformanceCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Properties(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<hstring, Windows::Foundation::IInspectable>>(this->shim().Properties()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensorReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IOrientationSensorReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::OrientationSensorReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensorReadingYawAccuracy> : produce_base<D, Windows::Devices::Sensors::IOrientationSensorReadingYawAccuracy> { int32_t __stdcall get_YawAccuracy(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::MagnetometerAccuracy>(this->shim().YawAccuracy()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensorStatics> : produce_base<D, Windows::Devices::Sensors::IOrientationSensorStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::OrientationSensor>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensorStatics2> : produce_base<D, Windows::Devices::Sensors::IOrientationSensorStatics2> { int32_t __stdcall GetDefaultForRelativeReadings(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::OrientationSensor>(this->shim().GetDefaultForRelativeReadings()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensorStatics3> : produce_base<D, Windows::Devices::Sensors::IOrientationSensorStatics3> { int32_t __stdcall GetDefaultWithSensorReadingType(int32_t sensorReadingtype, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::OrientationSensor>(this->shim().GetDefault(*reinterpret_cast<Windows::Devices::Sensors::SensorReadingType const*>(&sensorReadingtype))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDefaultWithSensorReadingTypeAndSensorOptimizationGoal(int32_t sensorReadingType, int32_t optimizationGoal, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::OrientationSensor>(this->shim().GetDefault(*reinterpret_cast<Windows::Devices::Sensors::SensorReadingType const*>(&sensorReadingType), *reinterpret_cast<Windows::Devices::Sensors::SensorOptimizationGoal const*>(&optimizationGoal))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IOrientationSensorStatics4> : produce_base<D, Windows::Devices::Sensors::IOrientationSensorStatics4> { int32_t __stdcall GetDeviceSelector(int32_t readingType, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector(*reinterpret_cast<Windows::Devices::Sensors::SensorReadingType const*>(&readingType))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelectorWithSensorReadingTypeAndSensorOptimizationGoal(int32_t readingType, int32_t optimizationGoal, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector(*reinterpret_cast<Windows::Devices::Sensors::SensorReadingType const*>(&readingType), *reinterpret_cast<Windows::Devices::Sensors::SensorOptimizationGoal const*>(&optimizationGoal))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::OrientationSensor>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IPedometer> : produce_base<D, Windows::Devices::Sensors::IPedometer> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PowerInMilliwatts(double* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<double>(this->shim().PowerInMilliwatts()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinimumReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().MinimumReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ReportInterval(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReportInterval(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReportInterval(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<uint32_t>(this->shim().ReportInterval()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::Pedometer, Windows::Devices::Sensors::PedometerReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IPedometer2> : produce_base<D, Windows::Devices::Sensors::IPedometer2> { int32_t __stdcall GetCurrentReadings(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::Collections::IMapView<Windows::Devices::Sensors::PedometerStepKind, Windows::Devices::Sensors::PedometerReading>>(this->shim().GetCurrentReadings()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IPedometerDataThresholdFactory> : produce_base<D, Windows::Devices::Sensors::IPedometerDataThresholdFactory> { int32_t __stdcall Create(void* sensor, int32_t stepGoal, void** threshold) noexcept final try { clear_abi(threshold); typename D::abi_guard guard(this->shim()); *threshold = detach_from<Windows::Devices::Sensors::PedometerDataThreshold>(this->shim().Create(*reinterpret_cast<Windows::Devices::Sensors::Pedometer const*>(&sensor), stepGoal)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IPedometerReading> : produce_base<D, Windows::Devices::Sensors::IPedometerReading> { int32_t __stdcall get_StepKind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::PedometerStepKind>(this->shim().StepKind()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_CumulativeSteps(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<int32_t>(this->shim().CumulativeSteps()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_CumulativeStepsDuration(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::TimeSpan>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::TimeSpan>(this->shim().CumulativeStepsDuration()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IPedometerReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IPedometerReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::PedometerReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IPedometerStatics> : produce_base<D, Windows::Devices::Sensors::IPedometerStatics> { int32_t __stdcall FromIdAsync(void* deviceId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Pedometer>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDefaultAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Pedometer>>(this->shim().GetDefaultAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelector(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetSystemHistoryAsync(int64_t fromTime, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::PedometerReading>>>(this->shim().GetSystemHistoryAsync(*reinterpret_cast<Windows::Foundation::DateTime const*>(&fromTime))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetSystemHistoryWithDurationAsync(int64_t fromTime, int64_t duration, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from<Windows::Foundation::IAsyncOperation<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::PedometerReading>>>(this->shim().GetSystemHistoryAsync(*reinterpret_cast<Windows::Foundation::DateTime const*>(&fromTime), *reinterpret_cast<Windows::Foundation::TimeSpan const*>(&duration))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IPedometerStatics2> : produce_base<D, Windows::Devices::Sensors::IPedometerStatics2> { int32_t __stdcall GetReadingsFromTriggerDetails(void* triggerDetails, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::PedometerReading>>(this->shim().GetReadingsFromTriggerDetails(*reinterpret_cast<Windows::Devices::Sensors::SensorDataThresholdTriggerDetails const*>(&triggerDetails))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IProximitySensor> : produce_base<D, Windows::Devices::Sensors::IProximitySensor> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MaxDistanceInMillimeters(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<uint32_t>>(this->shim().MaxDistanceInMillimeters()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_MinDistanceInMillimeters(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<uint32_t>>(this->shim().MinDistanceInMillimeters()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetCurrentReading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::ProximitySensorReading>(this->shim().GetCurrentReading()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_ReadingChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().ReadingChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::ProximitySensor, Windows::Devices::Sensors::ProximitySensorReadingChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_ReadingChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().ReadingChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } int32_t __stdcall CreateDisplayOnOffController(void** controller) noexcept final try { clear_abi(controller); typename D::abi_guard guard(this->shim()); *controller = detach_from<Windows::Devices::Sensors::ProximitySensorDisplayOnOffController>(this->shim().CreateDisplayOnOffController()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IProximitySensorDataThresholdFactory> : produce_base<D, Windows::Devices::Sensors::IProximitySensorDataThresholdFactory> { int32_t __stdcall Create(void* sensor, void** threshold) noexcept final try { clear_abi(threshold); typename D::abi_guard guard(this->shim()); *threshold = detach_from<Windows::Devices::Sensors::ProximitySensorDataThreshold>(this->shim().Create(*reinterpret_cast<Windows::Devices::Sensors::ProximitySensor const*>(&sensor))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IProximitySensorReading> : produce_base<D, Windows::Devices::Sensors::IProximitySensorReading> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsDetected(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<bool>(this->shim().IsDetected()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DistanceInMillimeters(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::IReference<uint32_t>>(this->shim().DistanceInMillimeters()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IProximitySensorReadingChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::IProximitySensorReadingChangedEventArgs> { int32_t __stdcall get_Reading(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::ProximitySensorReading>(this->shim().Reading()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IProximitySensorStatics> : produce_base<D, Windows::Devices::Sensors::IProximitySensorStatics> { int32_t __stdcall GetDeviceSelector(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromId(void* sensorId, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::ProximitySensor>(this->shim().FromId(*reinterpret_cast<hstring const*>(&sensorId))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::IProximitySensorStatics2> : produce_base<D, Windows::Devices::Sensors::IProximitySensorStatics2> { int32_t __stdcall GetReadingsFromTriggerDetails(void* triggerDetails, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::Collections::IVectorView<Windows::Devices::Sensors::ProximitySensorReading>>(this->shim().GetReadingsFromTriggerDetails(*reinterpret_cast<Windows::Devices::Sensors::SensorDataThresholdTriggerDetails const*>(&triggerDetails))); return 0; } catch (...) { return to_hresult(); } }; #endif template <typename D> struct produce<D, Windows::Devices::Sensors::ISensorDataThreshold> : produce_base<D, Windows::Devices::Sensors::ISensorDataThreshold> { }; #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ISensorDataThresholdTriggerDetails> : produce_base<D, Windows::Devices::Sensors::ISensorDataThresholdTriggerDetails> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SensorType(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::SensorType>(this->shim().SensorType()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ISensorQuaternion> : produce_base<D, Windows::Devices::Sensors::ISensorQuaternion> { int32_t __stdcall get_W(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().W()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_X(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().X()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Y(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().Y()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Z(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().Z()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ISensorRotationMatrix> : produce_base<D, Windows::Devices::Sensors::ISensorRotationMatrix> { int32_t __stdcall get_M11(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().M11()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_M12(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().M12()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_M13(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().M13()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_M21(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().M21()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_M22(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().M22()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_M23(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().M23()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_M31(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().M31()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_M32(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().M32()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_M33(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<float>(this->shim().M33()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ISimpleOrientationSensor> : produce_base<D, Windows::Devices::Sensors::ISimpleOrientationSensor> { int32_t __stdcall GetCurrentOrientation(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::SimpleOrientation>(this->shim().GetCurrentOrientation()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_OrientationChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi<winrt::event_token>(token); typename D::abi_guard guard(this->shim()); *token = detach_from<winrt::event_token>(this->shim().OrientationChanged(*reinterpret_cast<Windows::Foundation::TypedEventHandler<Windows::Devices::Sensors::SimpleOrientationSensor, Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs> const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_OrientationChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().OrientationChanged(*reinterpret_cast<winrt::event_token const*>(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ISimpleOrientationSensor2> : produce_base<D, Windows::Devices::Sensors::ISimpleOrientationSensor2> { int32_t __stdcall put_ReadingTransform(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ReadingTransform(*reinterpret_cast<Windows::Graphics::Display::DisplayOrientations const*>(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ReadingTransform(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Graphics::Display::DisplayOrientations>(this->shim().ReadingTransform()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ISimpleOrientationSensorDeviceId> : produce_base<D, Windows::Devices::Sensors::ISimpleOrientationSensorDeviceId> { int32_t __stdcall get_DeviceId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().DeviceId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ISimpleOrientationSensorOrientationChangedEventArgs> : produce_base<D, Windows::Devices::Sensors::ISimpleOrientationSensorOrientationChangedEventArgs> { int32_t __stdcall get_Timestamp(int64_t* value) noexcept final try { zero_abi<Windows::Foundation::DateTime>(value); typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Foundation::DateTime>(this->shim().Timestamp()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Orientation(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from<Windows::Devices::Sensors::SimpleOrientation>(this->shim().Orientation()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ISimpleOrientationSensorStatics> : produce_base<D, Windows::Devices::Sensors::ISimpleOrientationSensorStatics> { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Devices::Sensors::SimpleOrientationSensor>(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template <typename D> struct produce<D, Windows::Devices::Sensors::ISimpleOrientationSensorStatics2> : produce_base<D, Windows::Devices::Sensors::ISimpleOrientationSensorStatics2> { int32_t __stdcall GetDeviceSelector(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from<hstring>(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::SimpleOrientationSensor>>(this->shim().FromIdAsync(*reinterpret_cast<hstring const*>(&deviceId))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Devices::Sensors { inline auto Accelerometer::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::Accelerometer(*)(IAccelerometerStatics const&), Accelerometer, IAccelerometerStatics>([](IAccelerometerStatics const& f) { return f.GetDefault(); }); } inline auto Accelerometer::GetDefault(Windows::Devices::Sensors::AccelerometerReadingType const& readingType) { return impl::call_factory<Accelerometer, IAccelerometerStatics2>([&](IAccelerometerStatics2 const& f) { return f.GetDefault(readingType); }); } inline auto Accelerometer::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<Accelerometer, IAccelerometerStatics3>([&](IAccelerometerStatics3 const& f) { return f.FromIdAsync(deviceId); }); } inline auto Accelerometer::GetDeviceSelector(Windows::Devices::Sensors::AccelerometerReadingType const& readingType) { return impl::call_factory<Accelerometer, IAccelerometerStatics3>([&](IAccelerometerStatics3 const& f) { return f.GetDeviceSelector(readingType); }); } inline auto ActivitySensor::GetDefaultAsync() { return impl::call_factory_cast<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::ActivitySensor>(*)(IActivitySensorStatics const&), ActivitySensor, IActivitySensorStatics>([](IActivitySensorStatics const& f) { return f.GetDefaultAsync(); }); } inline auto ActivitySensor::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(IActivitySensorStatics const&), ActivitySensor, IActivitySensorStatics>([](IActivitySensorStatics const& f) { return f.GetDeviceSelector(); }); } inline auto ActivitySensor::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<ActivitySensor, IActivitySensorStatics>([&](IActivitySensorStatics const& f) { return f.FromIdAsync(deviceId); }); } inline auto ActivitySensor::GetSystemHistoryAsync(Windows::Foundation::DateTime const& fromTime) { return impl::call_factory<ActivitySensor, IActivitySensorStatics>([&](IActivitySensorStatics const& f) { return f.GetSystemHistoryAsync(fromTime); }); } inline auto ActivitySensor::GetSystemHistoryAsync(Windows::Foundation::DateTime const& fromTime, Windows::Foundation::TimeSpan const& duration) { return impl::call_factory<ActivitySensor, IActivitySensorStatics>([&](IActivitySensorStatics const& f) { return f.GetSystemHistoryAsync(fromTime, duration); }); } inline auto Altimeter::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::Altimeter(*)(IAltimeterStatics const&), Altimeter, IAltimeterStatics>([](IAltimeterStatics const& f) { return f.GetDefault(); }); } inline auto Barometer::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::Barometer(*)(IBarometerStatics const&), Barometer, IBarometerStatics>([](IBarometerStatics const& f) { return f.GetDefault(); }); } inline auto Barometer::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<Barometer, IBarometerStatics2>([&](IBarometerStatics2 const& f) { return f.FromIdAsync(deviceId); }); } inline auto Barometer::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(IBarometerStatics2 const&), Barometer, IBarometerStatics2>([](IBarometerStatics2 const& f) { return f.GetDeviceSelector(); }); } inline auto Compass::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::Compass(*)(ICompassStatics const&), Compass, ICompassStatics>([](ICompassStatics const& f) { return f.GetDefault(); }); } inline auto Compass::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(ICompassStatics2 const&), Compass, ICompassStatics2>([](ICompassStatics2 const& f) { return f.GetDeviceSelector(); }); } inline auto Compass::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<Compass, ICompassStatics2>([&](ICompassStatics2 const& f) { return f.FromIdAsync(deviceId); }); } inline auto Gyrometer::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::Gyrometer(*)(IGyrometerStatics const&), Gyrometer, IGyrometerStatics>([](IGyrometerStatics const& f) { return f.GetDefault(); }); } inline auto Gyrometer::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(IGyrometerStatics2 const&), Gyrometer, IGyrometerStatics2>([](IGyrometerStatics2 const& f) { return f.GetDeviceSelector(); }); } inline auto Gyrometer::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<Gyrometer, IGyrometerStatics2>([&](IGyrometerStatics2 const& f) { return f.FromIdAsync(deviceId); }); } inline auto HingeAngleSensor::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(IHingeAngleSensorStatics const&), HingeAngleSensor, IHingeAngleSensorStatics>([](IHingeAngleSensorStatics const& f) { return f.GetDeviceSelector(); }); } inline auto HingeAngleSensor::GetDefaultAsync() { return impl::call_factory_cast<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::HingeAngleSensor>(*)(IHingeAngleSensorStatics const&), HingeAngleSensor, IHingeAngleSensorStatics>([](IHingeAngleSensorStatics const& f) { return f.GetDefaultAsync(); }); } inline auto HingeAngleSensor::GetRelatedToAdjacentPanelsAsync(param::hstring const& firstPanelId, param::hstring const& secondPanelId) { return impl::call_factory<HingeAngleSensor, IHingeAngleSensorStatics>([&](IHingeAngleSensorStatics const& f) { return f.GetRelatedToAdjacentPanelsAsync(firstPanelId, secondPanelId); }); } inline auto HingeAngleSensor::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<HingeAngleSensor, IHingeAngleSensorStatics>([&](IHingeAngleSensorStatics const& f) { return f.FromIdAsync(deviceId); }); } inline auto Inclinometer::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::Inclinometer(*)(IInclinometerStatics const&), Inclinometer, IInclinometerStatics>([](IInclinometerStatics const& f) { return f.GetDefault(); }); } inline auto Inclinometer::GetDefaultForRelativeReadings() { return impl::call_factory_cast<Windows::Devices::Sensors::Inclinometer(*)(IInclinometerStatics2 const&), Inclinometer, IInclinometerStatics2>([](IInclinometerStatics2 const& f) { return f.GetDefaultForRelativeReadings(); }); } inline auto Inclinometer::GetDefault(Windows::Devices::Sensors::SensorReadingType const& sensorReadingtype) { return impl::call_factory<Inclinometer, IInclinometerStatics3>([&](IInclinometerStatics3 const& f) { return f.GetDefault(sensorReadingtype); }); } inline auto Inclinometer::GetDeviceSelector(Windows::Devices::Sensors::SensorReadingType const& readingType) { return impl::call_factory<Inclinometer, IInclinometerStatics4>([&](IInclinometerStatics4 const& f) { return f.GetDeviceSelector(readingType); }); } inline auto Inclinometer::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<Inclinometer, IInclinometerStatics4>([&](IInclinometerStatics4 const& f) { return f.FromIdAsync(deviceId); }); } inline auto LightSensor::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::LightSensor(*)(ILightSensorStatics const&), LightSensor, ILightSensorStatics>([](ILightSensorStatics const& f) { return f.GetDefault(); }); } inline auto LightSensor::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(ILightSensorStatics2 const&), LightSensor, ILightSensorStatics2>([](ILightSensorStatics2 const& f) { return f.GetDeviceSelector(); }); } inline auto LightSensor::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<LightSensor, ILightSensorStatics2>([&](ILightSensorStatics2 const& f) { return f.FromIdAsync(deviceId); }); } inline auto Magnetometer::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::Magnetometer(*)(IMagnetometerStatics const&), Magnetometer, IMagnetometerStatics>([](IMagnetometerStatics const& f) { return f.GetDefault(); }); } inline auto Magnetometer::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(IMagnetometerStatics2 const&), Magnetometer, IMagnetometerStatics2>([](IMagnetometerStatics2 const& f) { return f.GetDeviceSelector(); }); } inline auto Magnetometer::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<Magnetometer, IMagnetometerStatics2>([&](IMagnetometerStatics2 const& f) { return f.FromIdAsync(deviceId); }); } inline auto OrientationSensor::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::OrientationSensor(*)(IOrientationSensorStatics const&), OrientationSensor, IOrientationSensorStatics>([](IOrientationSensorStatics const& f) { return f.GetDefault(); }); } inline auto OrientationSensor::GetDefaultForRelativeReadings() { return impl::call_factory_cast<Windows::Devices::Sensors::OrientationSensor(*)(IOrientationSensorStatics2 const&), OrientationSensor, IOrientationSensorStatics2>([](IOrientationSensorStatics2 const& f) { return f.GetDefaultForRelativeReadings(); }); } inline auto OrientationSensor::GetDefault(Windows::Devices::Sensors::SensorReadingType const& sensorReadingtype) { return impl::call_factory<OrientationSensor, IOrientationSensorStatics3>([&](IOrientationSensorStatics3 const& f) { return f.GetDefault(sensorReadingtype); }); } inline auto OrientationSensor::GetDefault(Windows::Devices::Sensors::SensorReadingType const& sensorReadingType, Windows::Devices::Sensors::SensorOptimizationGoal const& optimizationGoal) { return impl::call_factory<OrientationSensor, IOrientationSensorStatics3>([&](IOrientationSensorStatics3 const& f) { return f.GetDefault(sensorReadingType, optimizationGoal); }); } inline auto OrientationSensor::GetDeviceSelector(Windows::Devices::Sensors::SensorReadingType const& readingType) { return impl::call_factory<OrientationSensor, IOrientationSensorStatics4>([&](IOrientationSensorStatics4 const& f) { return f.GetDeviceSelector(readingType); }); } inline auto OrientationSensor::GetDeviceSelector(Windows::Devices::Sensors::SensorReadingType const& readingType, Windows::Devices::Sensors::SensorOptimizationGoal const& optimizationGoal) { return impl::call_factory<OrientationSensor, IOrientationSensorStatics4>([&](IOrientationSensorStatics4 const& f) { return f.GetDeviceSelector(readingType, optimizationGoal); }); } inline auto OrientationSensor::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<OrientationSensor, IOrientationSensorStatics4>([&](IOrientationSensorStatics4 const& f) { return f.FromIdAsync(deviceId); }); } inline auto Pedometer::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<Pedometer, IPedometerStatics>([&](IPedometerStatics const& f) { return f.FromIdAsync(deviceId); }); } inline auto Pedometer::GetDefaultAsync() { return impl::call_factory_cast<Windows::Foundation::IAsyncOperation<Windows::Devices::Sensors::Pedometer>(*)(IPedometerStatics const&), Pedometer, IPedometerStatics>([](IPedometerStatics const& f) { return f.GetDefaultAsync(); }); } inline auto Pedometer::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(IPedometerStatics const&), Pedometer, IPedometerStatics>([](IPedometerStatics const& f) { return f.GetDeviceSelector(); }); } inline auto Pedometer::GetSystemHistoryAsync(Windows::Foundation::DateTime const& fromTime) { return impl::call_factory<Pedometer, IPedometerStatics>([&](IPedometerStatics const& f) { return f.GetSystemHistoryAsync(fromTime); }); } inline auto Pedometer::GetSystemHistoryAsync(Windows::Foundation::DateTime const& fromTime, Windows::Foundation::TimeSpan const& duration) { return impl::call_factory<Pedometer, IPedometerStatics>([&](IPedometerStatics const& f) { return f.GetSystemHistoryAsync(fromTime, duration); }); } inline auto Pedometer::GetReadingsFromTriggerDetails(Windows::Devices::Sensors::SensorDataThresholdTriggerDetails const& triggerDetails) { return impl::call_factory<Pedometer, IPedometerStatics2>([&](IPedometerStatics2 const& f) { return f.GetReadingsFromTriggerDetails(triggerDetails); }); } inline PedometerDataThreshold::PedometerDataThreshold(Windows::Devices::Sensors::Pedometer const& sensor, int32_t stepGoal) : PedometerDataThreshold(impl::call_factory<PedometerDataThreshold, IPedometerDataThresholdFactory>([&](IPedometerDataThresholdFactory const& f) { return f.Create(sensor, stepGoal); })) { } inline auto ProximitySensor::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(IProximitySensorStatics const&), ProximitySensor, IProximitySensorStatics>([](IProximitySensorStatics const& f) { return f.GetDeviceSelector(); }); } inline auto ProximitySensor::FromId(param::hstring const& sensorId) { return impl::call_factory<ProximitySensor, IProximitySensorStatics>([&](IProximitySensorStatics const& f) { return f.FromId(sensorId); }); } inline auto ProximitySensor::GetReadingsFromTriggerDetails(Windows::Devices::Sensors::SensorDataThresholdTriggerDetails const& triggerDetails) { return impl::call_factory<ProximitySensor, IProximitySensorStatics2>([&](IProximitySensorStatics2 const& f) { return f.GetReadingsFromTriggerDetails(triggerDetails); }); } inline ProximitySensorDataThreshold::ProximitySensorDataThreshold(Windows::Devices::Sensors::ProximitySensor const& sensor) : ProximitySensorDataThreshold(impl::call_factory<ProximitySensorDataThreshold, IProximitySensorDataThresholdFactory>([&](IProximitySensorDataThresholdFactory const& f) { return f.Create(sensor); })) { } inline auto SimpleOrientationSensor::GetDefault() { return impl::call_factory_cast<Windows::Devices::Sensors::SimpleOrientationSensor(*)(ISimpleOrientationSensorStatics const&), SimpleOrientationSensor, ISimpleOrientationSensorStatics>([](ISimpleOrientationSensorStatics const& f) { return f.GetDefault(); }); } inline auto SimpleOrientationSensor::GetDeviceSelector() { return impl::call_factory_cast<hstring(*)(ISimpleOrientationSensorStatics2 const&), SimpleOrientationSensor, ISimpleOrientationSensorStatics2>([](ISimpleOrientationSensorStatics2 const& f) { return f.GetDeviceSelector(); }); } inline auto SimpleOrientationSensor::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory<SimpleOrientationSensor, ISimpleOrientationSensorStatics2>([&](ISimpleOrientationSensorStatics2 const& f) { return f.FromIdAsync(deviceId); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometer2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometer3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometer4> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometer5> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometerDeviceId> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometerReading2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometerShakenEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometerStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometerStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAccelerometerStatics3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IActivitySensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IActivitySensorReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IActivitySensorReadingChangeReport> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IActivitySensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IActivitySensorStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IActivitySensorTriggerDetails> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAltimeter> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAltimeter2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAltimeterReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAltimeterReading2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAltimeterReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IAltimeterStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IBarometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IBarometer2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IBarometer3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IBarometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IBarometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IBarometerReading2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IBarometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IBarometerStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IBarometerStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompass> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompass2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompass3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompass4> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompassDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompassDeviceId> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompassReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompassReading2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompassReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompassReadingHeadingAccuracy> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompassStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ICompassStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometer2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometer3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometer4> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometerDeviceId> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometerReading2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometerStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IGyrometerStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IHingeAngleReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IHingeAngleSensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IHingeAngleSensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IHingeAngleSensorStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometer2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometer3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometer4> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerDeviceId> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerReading2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerReadingYawAccuracy> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerStatics3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IInclinometerStatics4> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensor2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensor3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensorDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensorDeviceId> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensorReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensorReading2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensorStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ILightSensorStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometer2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometer3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometer4> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometerDeviceId> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometerReading2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometerStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IMagnetometerStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensor2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensor3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensorDeviceId> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensorReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensorReading2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensorReadingYawAccuracy> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensorStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensorStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensorStatics3> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IOrientationSensorStatics4> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IPedometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IPedometer2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IPedometerDataThresholdFactory> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IPedometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IPedometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IPedometerStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IPedometerStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IProximitySensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IProximitySensorDataThresholdFactory> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IProximitySensorReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IProximitySensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IProximitySensorStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::IProximitySensorStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISensorDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISensorDataThresholdTriggerDetails> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISensorQuaternion> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISensorRotationMatrix> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISimpleOrientationSensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISimpleOrientationSensor2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISimpleOrientationSensorDeviceId> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISimpleOrientationSensorOrientationChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISimpleOrientationSensorStatics> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ISimpleOrientationSensorStatics2> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::Accelerometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::AccelerometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::AccelerometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::AccelerometerShakenEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ActivitySensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ActivitySensorReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ActivitySensorReadingChangeReport> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ActivitySensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ActivitySensorTriggerDetails> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::Altimeter> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::AltimeterReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::AltimeterReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::Barometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::BarometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::BarometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::BarometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::Compass> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::CompassDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::CompassReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::CompassReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::Gyrometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::GyrometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::GyrometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::GyrometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::HingeAngleReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::HingeAngleSensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::HingeAngleSensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::Inclinometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::InclinometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::InclinometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::InclinometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::LightSensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::LightSensorDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::LightSensorReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::LightSensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::Magnetometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::MagnetometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::MagnetometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::MagnetometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::OrientationSensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::OrientationSensorReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::OrientationSensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::Pedometer> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::PedometerDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::PedometerReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::PedometerReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ProximitySensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ProximitySensorDataThreshold> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ProximitySensorDisplayOnOffController> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ProximitySensorReading> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::ProximitySensorReadingChangedEventArgs> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::SensorDataThresholdTriggerDetails> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::SensorQuaternion> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::SensorRotationMatrix> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::SimpleOrientationSensor> : winrt::impl::hash_base {}; template<> struct hash<winrt::Windows::Devices::Sensors::SimpleOrientationSensorOrientationChangedEventArgs> : winrt::impl::hash_base {}; #endif } #endif
[ "angzhang@microsoft.com" ]
angzhang@microsoft.com
4de024e984789280b7456d0392d4798d3f17cb72
a3d22f6dcc20dc8b729b04f8f3b5564c4c3f08bb
/Tests/TestTaxiCenter.h
e710d09ffa6bf842bc0755390332baa495e560a8
[]
no_license
Agent77/ex2
651b8046fbea7ef2d5035bcfc1e54465e02eeb0d
8efd8224d2e9e6c879abbb855df1193b6aba05d3
refs/heads/master
2020-06-16T11:24:44.771537
2016-12-04T15:46:36
2016-12-04T15:46:36
75,109,228
0
0
null
null
null
null
UTF-8
C++
false
false
724
h
#ifndef EX2_TESTTAXICENTER_H #define EX2_TESTTAXICENTER_H #include <gtest/gtest.h> #include "../TaxiCenter.h" class TestTaxiCenter:public::testing::Test { private: TaxiCenter tc; public: void SetUp() { tc = TaxiCenter(); tc.getLocations()[0] = Point(0,0); tc.getLocations()[1] = Point(1,1); tc.getLocations()[2] = Point(2,2); tc.getTrips()[0] = Trip(Point(3,3), Point(1,1)); tc.getTrips()[1] = Trip(Point(2,2), Point(3,4)); } void addTrip(); void setTaxiLocations(); Driver findDriver(Trip t); Trip createTrip(Passenger p); void addTrip(Passenger p); void updateMeters(); int checkDestinations(); }; #endif //EX2_TESTTAXICENTER_H
[ "lobel.tiki@gmail.com" ]
lobel.tiki@gmail.com
79f6881508947f31759214b104f342e0bbddc415
6c77cf237697f252d48b287ae60ccf61b3220044
/aws-cpp-sdk-ec2/include/aws/ec2/model/DeleteNetworkInterfacePermissionRequest.h
1e3220e8881722cdbbfdd2452c6dee3ca2c7db82
[ "MIT", "Apache-2.0", "JSON" ]
permissive
Gohan/aws-sdk-cpp
9a9672de05a96b89d82180a217ccb280537b9e8e
51aa785289d9a76ac27f026d169ddf71ec2d0686
refs/heads/master
2020-03-26T18:48:43.043121
2018-11-09T08:44:41
2018-11-09T08:44:41
145,232,234
1
0
Apache-2.0
2018-08-30T13:42:27
2018-08-18T15:42:39
C++
UTF-8
C++
false
false
5,620
h
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/ec2/EC2_EXPORTS.h> #include <aws/ec2/EC2Request.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace EC2 { namespace Model { /** * <p>Contains the parameters for DeleteNetworkInterfacePermission.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterfacePermissionRequest">AWS * API Reference</a></p> */ class AWS_EC2_API DeleteNetworkInterfacePermissionRequest : public EC2Request { public: DeleteNetworkInterfacePermissionRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "DeleteNetworkInterfacePermission"; } Aws::String SerializePayload() const override; protected: void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** * <p>The ID of the network interface permission.</p> */ inline const Aws::String& GetNetworkInterfacePermissionId() const{ return m_networkInterfacePermissionId; } /** * <p>The ID of the network interface permission.</p> */ inline void SetNetworkInterfacePermissionId(const Aws::String& value) { m_networkInterfacePermissionIdHasBeenSet = true; m_networkInterfacePermissionId = value; } /** * <p>The ID of the network interface permission.</p> */ inline void SetNetworkInterfacePermissionId(Aws::String&& value) { m_networkInterfacePermissionIdHasBeenSet = true; m_networkInterfacePermissionId = std::move(value); } /** * <p>The ID of the network interface permission.</p> */ inline void SetNetworkInterfacePermissionId(const char* value) { m_networkInterfacePermissionIdHasBeenSet = true; m_networkInterfacePermissionId.assign(value); } /** * <p>The ID of the network interface permission.</p> */ inline DeleteNetworkInterfacePermissionRequest& WithNetworkInterfacePermissionId(const Aws::String& value) { SetNetworkInterfacePermissionId(value); return *this;} /** * <p>The ID of the network interface permission.</p> */ inline DeleteNetworkInterfacePermissionRequest& WithNetworkInterfacePermissionId(Aws::String&& value) { SetNetworkInterfacePermissionId(std::move(value)); return *this;} /** * <p>The ID of the network interface permission.</p> */ inline DeleteNetworkInterfacePermissionRequest& WithNetworkInterfacePermissionId(const char* value) { SetNetworkInterfacePermissionId(value); return *this;} /** * <p>Specify <code>true</code> to remove the permission even if the network * interface is attached to an instance.</p> */ inline bool GetForce() const{ return m_force; } /** * <p>Specify <code>true</code> to remove the permission even if the network * interface is attached to an instance.</p> */ inline void SetForce(bool value) { m_forceHasBeenSet = true; m_force = value; } /** * <p>Specify <code>true</code> to remove the permission even if the network * interface is attached to an instance.</p> */ inline DeleteNetworkInterfacePermissionRequest& WithForce(bool value) { SetForce(value); return *this;} /** * <p>Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is <code>DryRunOperation</code>. * Otherwise, it is <code>UnauthorizedOperation</code>.</p> */ inline bool GetDryRun() const{ return m_dryRun; } /** * <p>Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is <code>DryRunOperation</code>. * Otherwise, it is <code>UnauthorizedOperation</code>.</p> */ inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; } /** * <p>Checks whether you have the required permissions for the action, without * actually making the request, and provides an error response. If you have the * required permissions, the error response is <code>DryRunOperation</code>. * Otherwise, it is <code>UnauthorizedOperation</code>.</p> */ inline DeleteNetworkInterfacePermissionRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} private: Aws::String m_networkInterfacePermissionId; bool m_networkInterfacePermissionIdHasBeenSet; bool m_force; bool m_forceHasBeenSet; bool m_dryRun; bool m_dryRunHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws
[ "henso@amazon.com" ]
henso@amazon.com
80413f4d278f183240eeb7aa370bf3fbe72082cd
befd823f5b04c6b3fe51dd918b41baaec2f879d9
/Test Directory for JudgeAll/data/A/checker.cpp
4abb3e988392cee10465839a9e5e05dd83e99839
[]
no_license
hhjami/offline-judge
5d373a50e3210015e6d7eed1859bb59756358305
b55cc7ca177a6fa942184d3a823d5c5117a2e68b
refs/heads/master
2022-05-24T10:40:29.674697
2020-05-01T15:11:44
2020-05-01T15:11:44
165,669,371
3
1
null
null
null
null
UTF-8
C++
false
false
2,572
cpp
#include<bits/stdc++.h> using namespace std; #define ui64 unsigned long long #define ACTUAL 0 #define WSIG 1 #define CSIG 2 ui64 judgeActualHash[] = { 10000000189000000882ULL, 10000000189000000882ULL, 10000000119ULL, 10000000188000000876ULL, 10000000192000000904ULL}; ui64 judgeWSIgnoreHash[] = { 49000000392ULL, 49000000392ULL, 49ULL, 48000000386ULL, 52000000414ULL}; ui64 judgeWS_CaseIgnoreHash[] = { 49000000392ULL, 49000000392ULL, 49ULL, 48000000386ULL, 52000000414ULL}; bool isWS(char c){ return c == ' ' || c == '\n' || c == '\r' || c == '\t'; } ui64 findHash(char filename[], int flag = ACTUAL){ FILE *fp = fopen(filename,"r"); ui64 p = 1000000007; char c; ui64 hash = 0, coeff = 1; while((c = fgetc(fp))!=EOF){ if(isWS(c) && (flag & WSIG))continue; if(isalpha(c) && (flag & CSIG)) c = tolower(c); hash += (c * coeff); coeff *= p; } fclose(fp); return hash; } void check(int cs){ int i; ui64 scHash; for(i = 1; i <= cs; i++){ char file[100],infile[100],stsfile[100]; sprintf(file,"%d.out",i); sprintf(infile,"%d.in",i); sprintf(stsfile,"%d.status",i); printf("Case %d: ",i); FILE *fp; int flag = 0; if((fp = fopen(infile, "r")) == NULL) flag = 1; if(flag) printf("Input File Missing!!!\n"); else{ FILE *stsfp = fopen(stsfile, "r"); char sts[100]; fgets(sts, 100, stsfp); if(strncmp(sts, "TLE", 3) == 0) printf("Time Limit Exceeded\n"); else if(strncmp(sts, "timeout", 7) == 0) printf("Run Time Error\n"); else if(strncmp(sts, "+Accepted", 8) == 0) printf("*********************PASSED***********************\n"); else { scHash = findHash(file); if(scHash == judgeActualHash[i-1])printf("*********************PASSED***********************\n"); else{ scHash = findHash(file, WSIG); if(scHash == judgeWSIgnoreHash[i-1])printf("White Space Error\n"); else{ scHash = findHash(file, WSIG | CSIG); if(scHash == judgeWS_CaseIgnoreHash[i-1])printf("Upper/Lower Case Error\n"); else printf("Failed\n"); } } } } } } int main(){ check(5); return 0; }
[ "hhjami@gmail.com" ]
hhjami@gmail.com
6e68d98b8fbcc935b47c4bfdc29f498efa693f42
935ba8255b0fe289bc6cbaf8a539c3c0320e494b
/hocC++/bai 48 tinh dong goi private .cpp
0bee98f8834c403fae9e674020453d8fa5b06746
[]
no_license
tranngocduhust/My-Learn-C-
40333f4eacecd7971ae826d8ead29f3402e9818f
93704d4196440bc9a9ee32c220509312b994df42
refs/heads/master
2022-12-16T13:48:34.542127
2020-09-07T13:35:50
2020-09-07T13:35:50
293,536,204
0
0
null
null
null
null
UTF-8
C++
false
false
2,219
cpp
#include<iostream> using namespace std; class student { private: char name[50]; char nameUniversity[100]; int age; float point; char classification; public: student(); student(char* name1, char* nameUi, int& Age); student(char* name1, char* nameUi, int& Age, float& Poi, char& cl); void showinfo(); ~student(); }; void getinfo(char* name1, char* nameUi, int& Age, float& Poi, char& cl); int main() { char* name1=new char[50], *nameUi=new char[100]; int Age; float Poi; char cl; getinfo(name1, nameUi, Age, Poi, cl); student s(name1, nameUi, Age, Poi, cl); s.showinfo(); return 0; } student::student() { strcpy_s(name, 45, "Tran ngoc du"); strcpy_s(nameUniversity, 99, "Ha Noi university of science and technology"); age = 19; point = 3.77; classification = 'A'; } student::student(char* name1, char* nameUi, int& Age) { strcpy_s(name, 45, name1); strcpy_s(nameUniversity, 99, nameUi); age = Age; point = 3.77; classification = 'A'; } student::student(char* name1, char* nameUi, int& Age, float& Poi, char& cl) { cout << "constructor" << endl; strcpy_s(name, 45, name1); strcpy_s(nameUniversity, 99, nameUi); age = Age; point = Poi; classification = cl; } void student::showinfo() { cout << "\n===================Show information of student====================" << endl; cout << "Name : " << name << endl; cout << "Age : " << age << endl; cout << "Name University : " << nameUniversity << endl; cout << "Point : " << point << endl; cout << "Classification : " << classification << endl; cout << "==============================The end============================" << endl; } student::~student() { cout << "deconstructor" << endl; } void getinfo(char* name1, char* nameUi, int& Age, float& Poi, char& cl) { cout << "====================Get information of student====================" << endl; cout << "Name : "; cin.getline(name1, 45); cout << "Age : "; cin >> Age; cin.ignore(); cout << "Name University : "; cin.getline(nameUi, 99); cout << "Point : "; cin >> Poi; cout << "Classification : "; cin >> cl; cout << "==============================The end============================" << endl; }
[ "70502929+tranngocduhust@users.noreply.github.com" ]
70502929+tranngocduhust@users.noreply.github.com
c410eadc605a7c6cad5dedb91f440b4cee91b93b
b1bcae7f29832021e95bc261f1b9cf3a585d0f66
/CodeBlocks/ACM/Regionals Contests/SocialHolidaying5874.cpp
128209642e970f535a58ccb219fe84f0003617bd
[]
no_license
ABHINAVKR/ACM
9ec9427d94dab001b35b4300101ef36f1631ec9d
ed8877fe0bd57f0c48f19a375b7b3a19a782b1c7
refs/heads/master
2021-05-01T10:18:22.763203
2014-08-21T17:12:44
2014-08-21T17:12:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,505
cpp
#include <stdio.h> #include <string.h> #include <vector> #include <algorithm> using namespace std; int fam[410], sz[110], took[410]; vector<int> g[410]; pair<int, int> lens[410]; int main(){ int t, n, m, i, j, s, u, v, len, maxpair; scanf("%d", &t); while(t--){ scanf("%d %d", &n, &m); for(i=0; i<n; i++) { scanf("%d", &fam[i]); g[i].clear(); } for(i=0; i<m; i++) scanf("%d", &sz[i]); sort(sz, sz+m); for(i=0; i<n; i++) { for(j=i+1; j<n; j++) { s = fam[i]+fam[j]; if(binary_search (sz, sz+m, s)){ g[i].push_back(j); g[j].push_back(i); } } } for(i=0; i<n; i++) lens[i]=make_pair(g[i].size(), i); sort(lens, lens+n); memset(took, 0, sizeof took); maxpair=0; for(i=0; i<n; i++) { u=lens[i].second; if(!took[u]){ len=-1; for(j=0; j<g[u].size(); j++){ if((len==-1 || g[g[u][j]].size()<=len) && !took[g[u][j]]){ len = g[g[u][j]].size(); v = g[u][j]; } } if(len!=-1){ took[u]=took[v]=1; maxpair++; } } } printf("%d\n", maxpair); } return 0; /* 2 6 4 1 2 3 4 4 5 6 9 3 5 5 4 1 2 3 4 5 6 9 3 5 */
[ "ahmadadel922gmail.com" ]
ahmadadel922gmail.com
6a8bba6c1faa15a641af46187115d95dcfc60a31
b7204b021b410219ff89d720064d4708bea97b22
/0501-0600/527. Word Abbreviation 32ms.cpp
3aa3d6bdfb5f9fae4cd3bf3f2a6ff8777080e542
[]
no_license
giangbui/LeetCodeSolutions
47a59f2fd85e6110a783600efc0ae1cd7c460737
84a01e234b5ec2f98ec3af931e9e2b5e3d9f5d6e
refs/heads/master
2023-03-11T14:10:52.339238
2021-02-28T04:11:50
2021-02-28T04:11:50
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,479
cpp
static const int N=405,L=5005,CH=26; //160005 struct node{ node *son[CH];int sum; }; node a[L];int res[N],l; void clear(){memset(a,0,sizeof(node)*(l+1)); l=0;} inline int get(char ch){return ch-'a';} struct prefix{ int id; const char *s; node *x; }p[N]; class Solution { public: string abbre(const string &s){ if (s.length()<=3)return s; return s[0]+to_string(s.length()-2)+s.back(); } string abbre1(const string &s,int l){ if (s.length()-l<=3)return s.substr(l); return s[l]+to_string(s.length()-l-2)+s.back(); } vector<string> wordsAbbreviation(vector<string> &d) { int n=d.size(); vector<string> ans(n); unordered_map<string, vector<int> > M; for (int i=0;i<n;++i){ string s1=abbre(d[i]); M[s1].emplace_back(i); ans[i]=s1; } for (auto &s:M){ int m=s.second.size(); if (m<2)continue; clear(); for (int i=0;i<m;++i)p[i].id=i,p[i].s=&d[s.second[i]][0],p[i].x=a; for (int I=0;m;++I){ for (int i=0,c;i<m;++i){ c=get(p[i].s[I]); node *&x=p[i].x; if (!x->son[c])x->son[c]=a+(++l); x=x->son[c]; ++x->sum; } for (int i=0;i<m;++i) if (p[i].x->sum==1)res[p[i].id]=I,p[i--]=p[--m]; } m=s.second.size(); for (int i=0;i<m;++i){ string &cur=d[s.second[i]]; int l=res[i]; if (l>=cur.length()-3)ans[s.second[i]]=cur; else ans[s.second[i]]=cur.substr(0,l)+abbre1(cur,l); } } return ans; } }; //IO int _IO=[](){ ios::sync_with_stdio(0); cin.tie(0); //cout.tie(0); return 0; }();
[ "hqztrue@sina.com" ]
hqztrue@sina.com
e887be8e37ccca8d8b2fb54c972e7dac3239b66f
f231fd7cb34b042a91addf2e96468cc08ab785e3
/courses/coursera-sandiego-algorithms/algorithms-on-graphs/assignment005/clustering/clustering.cpp
053c08152940f26041e49fcbc1032929d0be32d0
[ "Apache-2.0" ]
permissive
xunilrj/sandbox
f1a0d7a1af536bea217bc713e748f04819c2480b
d65076ba487b8bf170368c9e0a0d23e0575fc09f
refs/heads/master
2023-05-10T09:27:59.541942
2023-04-26T15:39:25
2023-04-26T15:39:25
64,613,121
8
5
Apache-2.0
2023-03-07T01:57:24
2016-07-31T20:12:02
C++
UTF-8
C++
false
false
3,057
cpp
#include <algorithm> #include <iostream> #include <iomanip> #include <cassert> #include <vector> #include <cmath> #include <deque> using std::vector; using std::pair; class UF { int *id, cnt, *sz; public: // Create an empty union find data structure with N isolated sets. UF(int N) { cnt = N; id = new int[N]; sz = new int[N]; for (int i = 0; i < N; i++) { id[i] = i; sz[i] = 1; } } ~UF() { delete[] id; delete[] sz; } // Return the id of component corresponding to object p. int find(int p) { int root = p; while (root != id[root]) root = id[root]; while (p != root) { int newp = id[p]; id[p] = root; p = newp; } return root; } // Replace sets containing x and y with their union. void merge(int x, int y) { int i = find(x); int j = find(y); if (i == j) return; // make smaller root point to larger one if (sz[i] < sz[j]) { id[i] = j; sz[j] += sz[i]; } else { id[j] = i; sz[i] += sz[j]; } cnt--; } // Are objects x and y in the same set? bool connected(int x, int y) { return find(x) == find(y); } // Return the number of disjoint sets. int count() { return cnt; } }; struct EdgeCost { int u, v; long double cost; }; double clustering(vector<int> x, vector<int> y, int k) { auto cost = [&](const int& l, const int&r) { long double dx = x[l] - x[r]; long double dy = y[l] - y[r]; return std::sqrt(dx*dx + dy*dy); }; auto at = [&](int xx, int yy) { return yy*x.size() + xx; }; auto visited = std::vector<int>(x.size() * x.size(), 0); auto E = std::deque<EdgeCost>(); for (int i = 0; i < x.size(); ++i) { for (int j = 0; j < x.size(); ++j) { if (i == j) continue; if ((visited[at(i, j)] == 1) || (visited[at(j, i)] == 1)) continue; visited[at(i, j)] = visited[at(j, i)] = 1; E.push_back({ i, j, cost(i, j)}); } } std::sort(std::begin(E), std::end(E), [](const EdgeCost& l, const EdgeCost& r) {return l.cost < r.cost; }); auto sets = UF(x.size()); EdgeCost last; while (sets.count() > k) { last = E.front(); E.pop_front(); if (sets.connected(last.u, last.v)) continue; sets.merge(last.u, last.v); } while (E.size() > 0) { last = E.front(); E.pop_front(); if (!sets.connected(last.u, last.v)) break; } return last.cost; } void run(std::istream& in, std::ostream& out) { size_t n; int k; in >> n; vector<int> x(n), y(n); for (size_t i = 0; i < n; i++) { in >> x[i] >> y[i]; } in >> k; out << std::setprecision(10) << clustering(x, y, k) << std::endl; } #ifdef UNITTESTS #define CATCH_CONFIG_MAIN #include "../../catch.hpp" void test(const std::string &instr, const std::string& expectedOut) { auto in = std::stringstream{ instr }; auto actualOut = std::stringstream(); run(in, actualOut); REQUIRE(expectedOut == actualOut.str()); } TEST_CASE("","") { test(R"(12 7 6 4 3 5 1 1 7 2 7 5 7 3 3 7 8 2 8 4 4 6 7 2 6 3)",R"(2.828427125 )"); } #else int main() { run(std::cin, std::cout); return 0; } #endif
[ "xunilrj@hotmail.com" ]
xunilrj@hotmail.com
83a244be0cba7aaf8504e947ab91d08f0d741135
b92769dda6c8b7e9bf79c48df810a702bfdf872f
/5.Loops&RelationalExpressions/5.5.bigstep.cpp
e7988d57e66308a5c8d68e251836432cea7a3eef
[ "MIT" ]
permissive
HuangStomach/Cpp-primer-plus
4276e0a24887ef6d48f202107b7b4c448230cd20
c8b2b90f10057e72da3ab570da7cc39220c88f70
refs/heads/master
2021-06-25T07:22:15.405581
2021-02-28T06:55:23
2021-02-28T06:55:23
209,192,905
1
0
null
null
null
null
UTF-8
C++
false
false
268
cpp
#include <iostream> int main(int argc, char const *argv[]) { using namespace std; cout << "Enter a integer: "; int by; cin >> by; cout << "Couting by " << by << "s:\n"; for (int i = 0; i < 100; i += by) cout << i << endl; return 0; }
[ "nxmbest@qq.com" ]
nxmbest@qq.com
95b16c6a5502ac6ff9a44658ee388f89d0c5ec5e
8ac1b220c3d534b8a1b5f10449c535cfefac9160
/testing/testing_cgeqrf.cpp
791cbd6db1e1da084cdcb1bf9f02353fca329489
[]
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
7,785
cpp
/* -- MAGMA (version 1.4.0) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver August 2013 @generated c Tue Aug 13 16:46:07 2013 */ // includes, system #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <cuda_runtime_api.h> #include <cublas.h> // includes, project #include "flops.h" #include "magma.h" #include "magma_lapack.h" #include "testings.h" /* //////////////////////////////////////////////////////////////////////////// -- Testing cgeqrf */ int main( int argc, char** argv) { TESTING_INIT(); real_Double_t gflops, gpu_perf, gpu_time, cpu_perf=0, cpu_time=0; float error, work[1]; magmaFloatComplex c_neg_one = MAGMA_C_NEG_ONE; magmaFloatComplex *h_A, *h_R, *tau, *h_work, tmp[1]; magma_int_t M, N, n2, lda, lwork, info, min_mn, nb; magma_int_t ione = 1; magma_int_t ISEED[4] = {0,0,0,1}, ISEED2[4]; magma_opts opts; parse_opts( argc, argv, &opts ); magma_int_t status = 0; float tol, eps = lapackf77_slamch("E"); tol = opts.tolerance * eps; opts.lapack |= ( opts.check == 2 ); // check (-c2) implies lapack (-l) printf("ngpu %d\n", (int) opts.ngpu ); if ( opts.check == 1 ) { printf(" M N CPU GFlop/s (sec) GPU GFlop/s (sec) ||R-Q'A||_1 / (M*||A||_1) ||I-Q'Q||_1 / M\n"); printf("===============================================================================================\n"); } else { printf(" M N CPU GFlop/s (sec) GPU GFlop/s (sec) ||R||_F / ||A||_F\n"); printf("=======================================================================\n"); } for( int i = 0; i < opts.ntest; ++i ) { for( int iter = 0; iter < opts.niter; ++iter ) { M = opts.msize[i]; N = opts.nsize[i]; min_mn = min(M, N); lda = M; n2 = lda*N; nb = magma_get_cgeqrf_nb(M); gflops = FLOPS_CGEQRF( M, N ) / 1e9; lwork = -1; lapackf77_cgeqrf(&M, &N, h_A, &M, tau, tmp, &lwork, &info); lwork = (magma_int_t)MAGMA_C_REAL( tmp[0] ); lwork = max( lwork, max( N*nb, 2*nb*nb )); TESTING_MALLOC( tau, magmaFloatComplex, min_mn ); TESTING_MALLOC( h_A, magmaFloatComplex, n2 ); TESTING_HOSTALLOC( h_R, magmaFloatComplex, n2 ); TESTING_MALLOC( h_work, magmaFloatComplex, lwork ); /* Initialize the matrix */ for ( int j=0; j<4; j++ ) ISEED2[j] = ISEED[j]; // saving seeds lapackf77_clarnv( &ione, ISEED, &n2, h_A ); lapackf77_clacpy( MagmaUpperLowerStr, &M, &N, h_A, &lda, h_R, &lda ); /* ==================================================================== Performs operation using MAGMA =================================================================== */ gpu_time = magma_wtime(); magma_cgeqrf(M, N, h_R, lda, tau, h_work, lwork, &info); gpu_time = magma_wtime() - gpu_time; gpu_perf = gflops / gpu_time; if (info != 0) printf("magma_cgeqrf returned error %d: %s.\n", (int) info, magma_strerror( info )); if ( opts.lapack ) { /* ===================================================================== Performs operation using LAPACK =================================================================== */ magmaFloatComplex *tau; TESTING_MALLOC( tau, magmaFloatComplex, min_mn ); cpu_time = magma_wtime(); lapackf77_cgeqrf(&M, &N, h_A, &lda, tau, h_work, &lwork, &info); cpu_time = magma_wtime() - cpu_time; cpu_perf = gflops / cpu_time; if (info != 0) printf("lapackf77_cgeqrf returned error %d: %s.\n", (int) info, magma_strerror( info )); TESTING_FREE( tau ); } if ( opts.check == 1 ) { /* ===================================================================== Check the result =================================================================== */ magma_int_t lwork = n2+N; magmaFloatComplex *h_W1, *h_W2, *h_W3; float *h_RW, results[2]; TESTING_MALLOC( h_W1, magmaFloatComplex, n2 ); // Q TESTING_MALLOC( h_W2, magmaFloatComplex, n2 ); // R TESTING_MALLOC( h_W3, magmaFloatComplex, lwork ); // WORK TESTING_MALLOC( h_RW, float, M ); // RWORK lapackf77_clarnv( &ione, ISEED2, &n2, h_A ); lapackf77_cqrt02( &M, &N, &min_mn, h_A, h_R, h_W1, h_W2, &lda, tau, h_W3, &lwork, h_RW, results ); results[0] *= eps; results[1] *= eps; if ( opts.lapack ) { printf("%5d %5d %7.2f (%7.2f) %7.2f (%7.2f) %8.2e %8.2e", (int) M, (int) N, cpu_perf, cpu_time, gpu_perf, gpu_time, results[0],results[1] ); printf("%s\n", (results[0] < tol ? "" : " failed")); } else { printf("%5d %5d --- ( --- ) %7.2f (%7.2f) %8.2e %8.2e", (int) M, (int) N, gpu_perf, gpu_time, results[0],results[1] ); printf("%s\n", (results[0] < tol ? "" : " failed")); } status |= ! (results[0] < tol); TESTING_FREE( h_W1 ); TESTING_FREE( h_W2 ); TESTING_FREE( h_W3 ); TESTING_FREE( h_RW ); } else if ( opts.check == 2 ) { /* ===================================================================== Check the result compared to LAPACK =================================================================== */ error = lapackf77_clange("f", &M, &N, h_A, &lda, work); blasf77_caxpy(&n2, &c_neg_one, h_A, &ione, h_R, &ione); error = lapackf77_clange("f", &M, &N, h_R, &lda, work) / error; if ( opts.lapack ) { printf("%5d %5d %7.2f (%7.2f) %7.2f (%7.2f) %8.2e", (int) M, (int) N, cpu_perf, cpu_time, gpu_perf, gpu_time, error ); } else { printf("%5d %5d --- ( --- ) %7.2f (%7.2f) %8.2e", (int) M, (int) N, gpu_perf, gpu_time, error ); } printf("%s\n", (error < tol ? "" : " failed")); status |= ! (error < tol); } else { if ( opts.lapack ) { printf("%5d %5d %7.2f (%7.2f) %7.2f (%7.2f) ---\n", (int) M, (int) N, cpu_perf, cpu_time, gpu_perf, gpu_time ); } else { printf("%5d %5d --- ( --- ) %7.2f (%7.2f) --- \n", (int) M, (int) N, gpu_perf, gpu_time); } } TESTING_FREE( tau ); TESTING_FREE( h_A ); TESTING_FREE( h_work ); TESTING_HOSTFREE( h_R ); } if ( opts.niter > 1 ) { printf( "\n" ); } } TESTING_FINALIZE(); return status; }
[ "maxhutch@gmail.com" ]
maxhutch@gmail.com
0854b340cf4456d6067285d0ee57037012b4593b
7ce91a98ae434dbb48099699b0b6bcaa705ba693
/TestModule/HK1/Users/20133068/BAI4.CPP
b2c3a8f8604c176e2f326e50213a9dbfec10dc2e
[]
no_license
ngthvan1612/OJCore
ea2e33c1310c71f9375f7c5cd0a7944b53a1d6bd
3ec0752a56c6335967e5bb4c0617f876caabecd8
refs/heads/master
2023-04-25T19:41:17.050412
2021-05-12T05:29:40
2021-05-12T05:29:40
357,612,534
0
0
null
null
null
null
UTF-8
C++
false
false
50
cpp
#include<stdio.h> void main() { printf("12"); }
[ "Nguyen Van@DESKTOP-8HI58DE" ]
Nguyen Van@DESKTOP-8HI58DE
3055102d75fdb440924d0a2fb16071106bdfab52
35918be245e2857156fd9e646aa53c5757f33573
/src/bms_c2f_q.cpp
01d7a63dd229063aa87d795940f589a554018804
[]
no_license
YvanMokwinski/WGRID
d795b635f6214d1b07cadea844c426e29c67511c
e35bc0ff51fb65cd13086aae65bb00787818188b
refs/heads/master
2022-11-12T21:41:20.986032
2020-07-08T18:42:28
2020-07-08T18:42:28
258,705,105
0
0
null
null
null
null
UTF-8
C++
false
false
1,560
cpp
#include <limits> #include <iostream> #include <array> #include "bms_c2x_template.hpp" extern "C" { wmesh_status_t bms_c2f_q_buffer_size(wmesh_int_t c2n_size_, const_wmesh_int_p c2n_n_, wmesh_int_p work_n_) { return bms_c2x_buffer_size<WMESH_ELEMENT_QUADRILATERAL>(c2n_size_, c2n_n_, work_n_); }; wmesh_status_t bms_c2f_q(wmesh_int_t c2n_size_, const_wmesh_int_p c2n_ptr_, const_wmesh_int_p c2n_m_, const_wmesh_int_p c2n_n_, const_wmesh_int_p c2n_v_, const_wmesh_int_p c2n_ld_, wmesh_int_t c2q_size_, const_wmesh_int_p c2q_ptr_, const_wmesh_int_p c2q_m_, const_wmesh_int_p c2q_n_, wmesh_int_p c2q_v_, const_wmesh_int_p c2q_ld_, wmesh_int_t s_q2n_size_, const_wmesh_int_p s_q2n_ptr_, const_wmesh_int_p s_q2n_m_, const_wmesh_int_p s_q2n_n_, const_wmesh_int_p s_q2n_v_, const_wmesh_int_p s_q2n_ld_, wmesh_int_p idx_, wmesh_int_t work_n_, wmesh_int_p work_) { bool match_mode = true; return bms_c2x<WMESH_ELEMENT_QUADRILATERAL>(c2n_size_, c2n_ptr_, c2n_m_, c2n_n_, c2n_v_, c2n_ld_, c2q_size_, c2q_ptr_, c2q_m_, c2q_n_, c2q_v_, c2q_ld_, s_q2n_size_, s_q2n_ptr_, s_q2n_m_, s_q2n_n_, s_q2n_v_, s_q2n_ld_, match_mode, idx_, work_n_, work_); } };
[ "yvan.mokwinski@gmail.com" ]
yvan.mokwinski@gmail.com
8f1a1bda4936248c22516be08c40ac3093f302a8
13337066b3e3511bd15a4dd3222b7aba099f2049
/test/bai7.h
c712845c0c1685c1bd2952f608fec72834c42ca5
[]
no_license
hungnduet/anlab
41fac1c04a62c3b0cf4adc9f035e315e1a937c20
3d14f3e9211176d490d9f2fb5c4b1beb4e683527
refs/heads/master
2020-03-22T19:09:51.956960
2018-07-24T04:49:01
2018-07-24T04:49:01
140,510,091
0
0
null
null
null
null
UTF-8
C++
false
false
213
h
#ifndef BAI7_H #define BAI7_H #include"bassic.h" #include "bai1.h" class bai7:public bai1 { public: bai7 operator ++(); // bai7 &operator --(); void nhaptt7(); void xuatkq7(); }; #endif // BAI7_H
[ "hungnduet@gmail.com" ]
hungnduet@gmail.com
42877aa6c82c99a10e89b1324a48181f0acf7132
fb7efe44f4d9f30d623f880d0eb620f3a81f0fbd
/components/signin/core/browser/access_token_fetcher.h
cfa84724e48bee29c2d4a27e92d41238620a7232
[ "BSD-3-Clause" ]
permissive
wzyy2/chromium-browser
2644b0daf58f8b3caee8a6c09a2b448b2dfe059c
eb905f00a0f7e141e8d6c89be8fb26192a88c4b7
refs/heads/master
2022-11-23T20:25:08.120045
2018-01-16T06:41:26
2018-01-16T06:41:26
117,618,467
3
2
BSD-3-Clause
2022-11-20T22:03:57
2018-01-16T02:09:10
null
UTF-8
C++
false
false
3,478
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. #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCESS_TOKEN_FETCHER_H_ #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCESS_TOKEN_FETCHER_H_ #include <memory> #include <string> #include "base/callback.h" #include "base/macros.h" #include "components/signin/core/browser/signin_manager_base.h" #include "google_apis/gaia/google_service_auth_error.h" #include "google_apis/gaia/oauth2_token_service.h" // Helper class to ease the task of obtaining an OAuth2 access token for the // authenticated account. This handles various special cases, e.g. when the // refresh token isn't loaded yet (during startup), or when there is some // transient error. // May only be used on the UI thread. class AccessTokenFetcher : public SigninManagerBase::Observer, public OAuth2TokenService::Observer, public OAuth2TokenService::Consumer { public: // Callback for when a request completes (successful or not). On successful // requests, |error| is NONE and |access_token| contains the obtained OAuth2 // access token. On failed requests, |error| contains the actual error and // |access_token| is empty. using TokenCallback = base::OnceCallback<void(const GoogleServiceAuthError& error, const std::string& access_token)>; // Instantiates a fetcher and immediately starts the process of obtaining an // OAuth2 access token for the given |scopes|. The |callback| is called once // the request completes (successful or not). If the AccessTokenFetcher is // destroyed before the process completes, the callback is not called. AccessTokenFetcher(const std::string& oauth_consumer_name, SigninManagerBase* signin_manager, OAuth2TokenService* token_service, const OAuth2TokenService::ScopeSet& scopes, TokenCallback callback); ~AccessTokenFetcher() override; private: void Start(); void WaitForRefreshToken(); void StartAccessTokenRequest(); // SigninManagerBase::Observer implementation. void GoogleSigninSucceeded(const std::string& account_id, const std::string& username) override; void GoogleSigninFailed(const GoogleServiceAuthError& error) override; // OAuth2TokenService::Observer implementation. void OnRefreshTokenAvailable(const std::string& account_id) override; void OnRefreshTokensLoaded() override; // OAuth2TokenService::Consumer implementation. void OnGetTokenSuccess(const OAuth2TokenService::Request* request, const std::string& access_token, const base::Time& expiration_time) override; void OnGetTokenFailure(const OAuth2TokenService::Request* request, const GoogleServiceAuthError& error) override; SigninManagerBase* signin_manager_; OAuth2TokenService* token_service_; OAuth2TokenService::ScopeSet scopes_; TokenCallback callback_; bool waiting_for_sign_in_; bool waiting_for_refresh_token_; std::unique_ptr<OAuth2TokenService::Request> access_token_request_; // When a token request gets canceled, we want to retry once. bool access_token_retried_; DISALLOW_COPY_AND_ASSIGN(AccessTokenFetcher); }; #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCESS_TOKEN_FETCHER_H_
[ "jacob-chen@iotwrt.com" ]
jacob-chen@iotwrt.com
d39f15c1174351d46c0dced2c4f3dc4cb95068f5
03a44baca9e6ed95705432d96ba059f16e62a662
/Opentrains_Contest/10273/C.cpp
cbe7eac838066c64912ca1dc35b2a97264273341
[]
no_license
ytz12345/2019_ICPC_Trainings
5c6e113afb8e910dd91c8340ff43af00a701c7c7
cf0ce781675a7dbc454fd999693239e235fbbe87
refs/heads/master
2020-05-14T08:29:19.671739
2020-04-03T03:21:30
2020-04-03T03:21:30
181,722,314
0
0
null
null
null
null
UTF-8
C++
false
false
1,367
cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> piir; typedef pair<piir, int> pr; typedef long long ll; const int N = 70000; int n, m, a[20]; int dp[101][N][2]; int main() { ios::sync_with_stdio(false); cin >> n >> m; memset (dp, -1, sizeof dp); for (int i = 0; i <= m; i ++) cin >> a[i]; dp[1][0][0] = 0; for (int i = 0, j = 1 << m; i < j; i ++) { dp[1][i][1] = a[0]; for (int k = 0; k < m; k ++) if ((i >> k) & 1) dp[1][i][1] += a[k + 1]; } for (int i = 2; i <= n; i ++) { for (int j = 0; j <= m; j ++) cin >> a[j]; for (int j = 0; j < (1 << m); j ++) { dp[i][j][0] = dp[i - 1][j][1]; if (dp[i - 1][j][0] != -1 && dp[i - 1][j][0] < dp[i][j][0]) dp[i][j][0] = dp[i - 1][j][0]; dp[i][j][1] = dp[i][j][0] + a[0]; } for (int j = 0; j < (1 << m); j ++) { for (int k = 0; k < m; k ++) if (!((j >> k) & 1)) { if (dp[i][j | (1 << k)][1] == -1 || dp[i][j | (1 << k)][1] > dp[i][j][0] + a[k + 1] + a[0]) dp[i][j | (1 << k)][1] = dp[i][j][0] + a[k + 1] + a[0]; if (dp[i][j | (1 << k)][1] == -1 || dp[i][j | (1 << k)][1] > dp[i][j][1] + a[k + 1]) dp[i][j | (1 << k)][1] = dp[i][j][1] + a[k + 1]; } } } int ans = dp[n][(1 << m) - 1][1]; if (dp[n][(1 << m) - 1][0] != -1 && dp[n][(1 << m) - 1][0] < ans) ans = dp[n][(1 << m) - 1][0]; cout << ans; return 0; }
[ "tz_young@bupt.edu.cn" ]
tz_young@bupt.edu.cn
a50e9f5be30489cf96edda213b86927c49ac84b9
e52c2c98a5ebb3ddee4b19d302d9701e7c90541b
/LeetCode-CPP/1202.cpp
0be996bb4989f8f8d87d424cd4d9501a06613e34
[]
no_license
EvAn-HuAngBiu/Leetcode
bc578cf320b380d59727b6d4aa31a63555e5c9e6
b5b8104973a99dab13ea6040cba4fe85e0408504
refs/heads/master
2023-08-02T07:03:07.722680
2021-10-09T08:46:52
2021-10-09T08:46:52
279,460,526
0
0
null
null
null
null
UTF-8
C++
false
false
1,394
cpp
#include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; class Solution { private: vector<int> father; public: int find(int a) { int s = a, t; while (father[a] != a) { a = father[a]; } while (s != a) { t = father[s]; father[s] = a; s = t; } return a; } string smallestStringWithSwaps(string s, vector<vector<int>>& pairs) { int size = s.size(); father.assign(size, 0); for (int i = 0; i < size; ++i) { father[i] = i; } for (auto& pair : pairs) { father[find(pair[0])] = find(pair[1]); } vector<vector<char>> v(size); for (int i = 0; i < size; ++i) { v[find(i)].emplace_back(s[i]); } for (int i = 0; i < size; ++i) { sort(v[i].rbegin(), v[i].rend()); } string result; for (int i = 0; i < size; ++i) { result += v[father[i]].back(); v[father[i]].pop_back(); } return result; } }; int main() { string s; cin >> s; int n; cin >> n; vector<vector<int>> v(n, vector<int>(2)); for (int i = 0; i < n; ++i) { cin >> v[i][0] >> v[i][1]; } cout << Solution().smallestStringWithSwaps(s, v) << endl; return 0; }
[ "779700014@qq.com" ]
779700014@qq.com
f4ce6b0d20e31a0fc2c6964ca5218b474a286e42
b5cc26ed6075fc198e6683cd31da207b7ec4f164
/algo1.c++
30ab4b8d500d4bd902ff55398ed7492faebf7efd
[]
no_license
yusuf69/FOR-check
1f5f39a1b56725d5b885ac353a16bc2c52c261e7
e75f45cf317bee8a0b4f3802cb88b77b8299cd68
refs/heads/master
2021-04-29T19:08:11.696016
2020-03-10T21:24:03
2020-03-10T21:24:03
121,705,876
0
0
null
null
null
null
UTF-8
C++
false
false
548
#include<iostream> using namespace std; void unionc(int arr1[],int arr2[]) { int arr3[50],k=0; int i,j; for(i=0;i<7;i++) { for(j=0;j<7;j++) { if(arr1[i]==arr2[j]) { arr3[k]=arr1[i]; k++; } } } cout<<"Intersection of two array elements"<<endl; for(i=0;i<k;i++) { cout<<"\t"<<arr3[i]; } cout<<endl; } int main() { int arr1[]={2,3,4,7,5,9,6},arr2[]={3,4,8,5,6,9,7}; unionc(arr1,arr2); return 0; }
[ "yousufansari11111@gmail.com" ]
yousufansari11111@gmail.com
051d548c389ddd683663eb15c6d25a6fe469eb8c
91a882547e393d4c4946a6c2c99186b5f72122dd
/Source/XPSP1/NT/inetsrv/msmq/src/admin/mqsnap/mgmtext.h
3b183c2b3ceab3a6211c95c1f1b9c618ee062207
[]
no_license
IAmAnubhavSaini/cryptoAlgorithm-nt5src
94f9b46f101b983954ac6e453d0cf8d02aa76fc7
d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2
refs/heads/master
2023-09-02T10:14:14.795579
2021-11-20T13:47:06
2021-11-20T13:47:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,351
h
////////////////////////////////////////////////////////////////////////////// /*++ Copyright (c) 1998 Microsoft Corporation Module Name: mgmtext.h Abstract: Definition for the Local Computer management extensions Author: RaphiR --*/ ////////////////////////////////////////////////////////////////////////////// #ifndef __MGMTEXT_H_ #define __MGMTEXT_H_ #include "resource.h" #ifndef ATLASSERT #define ATLASSERT(expr) _ASSERTE(expr) #endif #include "atlsnap.h" #include "snpnscp.h" #include "icons.h" /**************************************************** CSnapinComputerMgmt Class ****************************************************/ class CSnapinComputerMgmt : public CNodeWithScopeChildrenList<CSnapinComputerMgmt, TRUE> { public: CString m_szMachineName; BEGIN_SNAPINCOMMAND_MAP(CSnapinComputerMgmt, FALSE) END_SNAPINCOMMAND_MAP() CSnapinComputerMgmt(CSnapInItem * pParentNode, CSnapin * pComponentData, CString strComputer) : CNodeWithScopeChildrenList<CSnapinComputerMgmt, TRUE>(pParentNode, pComponentData ), m_szMachineName(strComputer) { memset(&m_scopeDataItem, 0, sizeof(SCOPEDATAITEM)); memset(&m_resultDataItem, 0, sizeof(RESULTDATAITEM)); } ~CSnapinComputerMgmt() { } virtual HRESULT PopulateScopeChildrenList(); virtual HRESULT OnRemoveChildren( LPARAM arg , LPARAM param , IComponentData * pComponentData , IComponent * pComponent , DATA_OBJECT_TYPES type ); private: }; /**************************************************** CComputerMgmtExtData Class ****************************************************/ class CComputerMgmtExtData : public CSnapInItemImpl<CComputerMgmtExtData, TRUE> { public: static const GUID* m_NODETYPE; static const OLECHAR* m_SZNODETYPE; static const OLECHAR* m_SZDISPLAY_NAME; static const CLSID* m_SNAPIN_CLASSID; CSnapin * m_pComponentData; BEGIN_SNAPINCOMMAND_MAP(CComputerMgmtExtData, FALSE) END_SNAPINCOMMAND_MAP() BEGIN_SNAPINTOOLBARID_MAP(CComputerMgmtExtData) // Create toolbar resources with button dimensions 16x16 // and add an entry to the MAP. You can add multiple toolbars // SNAPINTOOLBARID_ENTRY(Toolbar ID) END_SNAPINTOOLBARID_MAP() CComputerMgmtExtData() { memset(&m_scopeDataItem, 0, sizeof(SCOPEDATAITEM)); memset(&m_resultDataItem, 0, sizeof(RESULTDATAITEM)); } ~CComputerMgmtExtData(); STDMETHOD(CreatePropertyPages)(LPPROPERTYSHEETCALLBACK lpProvider, LONG_PTR handle, IUnknown* pUnk, DATA_OBJECT_TYPES type); STDMETHOD(QueryPagesFor)(DATA_OBJECT_TYPES type) { //if (type == CCT_SCOPE || type == CCT_RESULT) // return S_OK; return S_FALSE; } IDataObject* m_pDataObject; virtual void InitDataClass(IDataObject* pDataObject, CSnapInItem* pDefault) { m_pDataObject = pDataObject; // The default code stores off the pointer to the Dataobject the class is wrapping // at the time. // Alternatively you could convert the dataobject to the internal format // it represents and store that information } CSnapInItem* GetExtNodeObject(IDataObject* pDataObject, CSnapInItem* pDefault); void RemoveChild(CString &strCompName); private: CMap< CString, LPCWSTR, CSnapinComputerMgmt*, CSnapinComputerMgmt* > m_mapComputers; }; #endif
[ "support@cryptoalgo.cf" ]
support@cryptoalgo.cf
76b0248e5275da5552f56dc5fc533c3f9dd90870
3d232018a25f15042164aa7726b73f71e3165252
/indra/llcommon/llsecondlifeurls.cpp
ee478fe11be79410fa3cae965026f836b803b434
[]
no_license
OS-Development/VW.Meerkat
ee8dae5b077a709a618ed6550f157797fe577dcf
00645a93b672dd3ce5e02bd620a90b8e275aba01
refs/heads/master
2021-01-19T18:08:40.932912
2015-04-04T23:20:08
2015-04-04T23:20:08
33,423,332
1
0
null
null
null
null
UTF-8
C++
false
false
2,763
cpp
/** * @file llsecondlifeurls.cpp * @brief Urls used in the product * * $LicenseInfo:firstyear=2005&license=viewergpl$ * * Copyright (c) 2005-2008, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ #include "linden_common.h" #include "llsecondlifeurls.h" const std::string CREATE_ACCOUNT_URL ( "http://secondlife.com/registration/"); const std::string MANAGE_ACCOUNT ( "http://secondlife.com/account/"); const std::string AUCTION_URL ( "http://secondlife.com/auctions/auction-detail.php?id="); const std::string EVENTS_URL ( "http://secondlife.com/events/"); const std::string TIER_UP_URL ( "http://secondlife.com/app/landtier"); const std::string LAND_URL ( "http://secondlife.com/app/landtier"); const std::string UPGRADE_TO_PREMIUM_URL ( "http://secondlife.com/app/upgrade/"); const std::string DIRECTX_9_URL ( "http://secondlife.com/support/"); const std::string AMD_AGP_URL ( "http://secondlife.com/support/"); const std::string VIA_URL ( "http://secondlife.com/support/"); const std::string SUPPORT_URL ( "http://secondlife.com/support/"); const std::string INTEL_CHIPSET_URL ( "http://secondlife.com/support/"); const std::string SIS_CHIPSET_URL ( "http://secondlife.com/support/"); const std::string BLOGS_URL ( "http://blog.secondlife.com/"); const std::string BUY_CURRENCY_URL ( "http://secondlife.com/app/currency/"); const std::string LSL_DOC_URL ( "http://secondlife.com/app/lsldoc/"); const std::string SL_KB_URL ( "http://secondlife.com/knowledgebase/"); const std::string RELEASE_NOTES_BASE_URL ( "http://secondlife.com/app/releasenotes/");
[ "?@?.?" ]
?@?.?
bf698a4d9669687d9c601f31ac67065da6e3a840
db021f4b97fd02a642ba6f7250ac7650993d84ec
/EASY/PERMUT2.cpp
c1070953a8b82895918840bd592bf210b16a40c3
[]
no_license
sakshi-chauhan/CodechefCppCodes
39a6a2d7e16b13c5bd619c1e312249ff91a70ef0
fb2174ae362bebd2f42bd81ab423b7ae33719ed8
refs/heads/master
2021-01-13T02:40:20.288591
2015-06-16T06:42:38
2015-06-16T06:42:38
37,512,926
2
0
null
null
null
null
UTF-8
C++
false
false
690
cpp
#include<iostream> int main(){ int n,i,t,not_amb=0; int arr1[10005],arr2[10005]; std::cin>>t; while(t>0){ not_amb=0; for(i=1;i<=t;i++) std::cin>>arr1[i]; for(i=1;i<=t;i++){ arr2[arr1[i]]=i; } for(i=1;i<=t;i++){ if(arr2[i]!=arr1[i]){ not_amb=1; break; } } if(not_amb) std::cout<<"not ambiguous\n"; else std::cout<<"ambiguous\n"; std::cin>>t; } return 0; }
[ "csakshi25@yahoo.com" ]
csakshi25@yahoo.com
ca7f2b19d17b19767b43b26383334e9511ac464e
194ba83990e3768ab9e310a183b3098e7c1e55d3
/sdk4.2.1.1/development/amd/examples/GPU_P2P/SyncedBuffer.cpp
a6609fdf47239b7782476aad093b818eea5e649e
[]
no_license
elliotwoods/SDICapture-Test
0eae01092590760fec3c55a95cf44d14132041af
0875a51e23d794b19ea1aba6a0df9f6b03c07104
refs/heads/master
2021-01-23T03:53:27.298102
2012-07-11T10:04:39
2012-07-11T10:04:39
4,987,274
1
2
null
null
null
null
UTF-8
C++
false
false
3,251
cpp
#include <windows.h> #include "SyncedBuffer.h" SyncedBuffer::SyncedBuffer(void) : m_pBuffer(NULL), m_uiSize(0), m_uiHead(0), m_uiTail(0), m_lNumFullElements(0) { } SyncedBuffer::~SyncedBuffer(void) { CloseHandle(m_hNumFull); CloseHandle(m_hNumEmpty); // Release all semaphores for (unsigned int i = 0; i < m_uiSize; i++) { CloseHandle(m_pBuffer[i].hMutex); } if (m_pBuffer) { delete [] m_pBuffer; } } void SyncedBuffer::createSyncedBuffer(unsigned int uiSize) { if (!m_pBuffer && uiSize < MAX_BUFFERS) { m_pBuffer = new BufferElement[uiSize]; m_uiSize = uiSize; m_uiHead = 0; m_uiTail = 0; m_hNumFull = CreateSemaphore(NULL, 0, uiSize, NULL); m_hNumEmpty = CreateSemaphore(NULL, uiSize, uiSize, NULL); for (unsigned int i = 0; i < m_uiSize; i++) { m_pBuffer[i].hMutex = CreateSemaphore(NULL, 1, 1, NULL); m_pBuffer[i].pData = NULL; } } } // assigns memory to this buffer. void SyncedBuffer::setBufferMemory(unsigned int uiId, void* pData) { if (m_pBuffer && uiId < m_uiSize) { WaitForSingleObject(m_pBuffer[uiId].hMutex, INFINITE); m_pBuffer[uiId].pData = pData; ReleaseSemaphore(m_pBuffer[uiId].hMutex, 1, NULL); } } // get a buffer for writing. Buffer will be filled unsigned int SyncedBuffer::getBufferForWriting(void* &pBuffer) { // Wait until an emty slot is available WaitForSingleObject(m_hNumEmpty, INFINITE); // Enter critical section WaitForSingleObject(m_pBuffer[m_uiHead].hMutex, INFINITE); pBuffer = m_pBuffer[m_uiHead].pData; return m_uiHead; } // Mark buffer as full, ready to be consumed void SyncedBuffer::releaseWriteBuffer() { // Leave critical section ReleaseSemaphore(m_pBuffer[m_uiHead].hMutex, 1, 0); // Increment the number of full buffers ReleaseSemaphore(m_hNumFull, 1, &m_lNumFullElements); ++m_lNumFullElements; // switch to next buffer m_uiHead = (m_uiHead + 1) % m_uiSize; } // get a buffer for reading unsigned int SyncedBuffer::getBufferForReading(void* &pBuffer) { // Wait until the buffer is available WaitForSingleObject(m_hNumFull, INFINITE); // Block buffer WaitForSingleObject(m_pBuffer[m_uiTail].hMutex, INFINITE); pBuffer = m_pBuffer[m_uiTail].pData; return m_uiTail; } // Check if a full buffer is ready but do not block in case no buffer is available bool SyncedBuffer::getBufferForReadingIfAvailable(void* &pBuffer, unsigned int &uiIdx) { DWORD dwStatus = WaitForSingleObject(m_hNumFull, 0); if (dwStatus == WAIT_OBJECT_0) { // Block buffer WaitForSingleObject(m_pBuffer[m_uiTail].hMutex, INFINITE); pBuffer = m_pBuffer[m_uiTail].pData; uiIdx = m_uiTail; return true; } return false; } // Mark buffer as empty, ready to be filled void SyncedBuffer::releaseReadBuffer() { // Release buffer ReleaseSemaphore(m_pBuffer[m_uiTail].hMutex, 1, NULL); // Increase number of empty buffers ReleaseSemaphore(m_hNumEmpty, 1, NULL); // switch to next buffer m_uiTail = (m_uiTail + 1) % m_uiSize; }
[ "ingolf.heinsch@gmail.com" ]
ingolf.heinsch@gmail.com
affe1e59e5fd84506b476facf31e7d26be4d7ec1
9e11990ba732f16ff318da6e4a0a798a40c7aad6
/HelloMario/UIcode/resource/frame_06_bmp.cpp
4b0d460d91dd33a8a5f27f5433637e2ada48517f
[ "Apache-2.0" ]
permissive
kof98765/GuiLiteSamples
4baf60907f9f7f938defc4206f58da052d2ba686
aad3dcafcc1e7f481389e3dd018fed30e77c05e8
refs/heads/master
2020-07-24T01:03:33.601117
2019-09-11T07:51:40
2019-09-11T07:51:40
207,756,266
0
0
Apache-2.0
2019-09-11T07:58:53
2019-09-11T07:58:50
null
UTF-8
C++
false
false
80,570
cpp
#include "../GuiLite.h" static const unsigned short raw_data[] = { 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 60622, 64977, 64977, 64977, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 25126, 64977, 25126, 52300, 64977, 4226, 4226, 4226, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 64977, 64977, 39722, 25126, 52300, 25126, 64977, 64977, 52300, 4226, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 64977, 25126, 60622, 64977, 64977, 25126, 65267, 65267, 65267, 65267, 4226, 4226, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 60622, 64977, 25126, 25126, 25126, 60622, 65267, 65267, 65267, 60622, 4226, 39722, 4226, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 25126, 25126, 64977, 25126, 64977, 64977, 52300, 39722, 39722, 25126, 39722, 39722, 4226, 4226, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 60622, 25126, 25126, 64977, 64977, 25126, 25126, 4226, 25126, 25126, 4226, 39722, 39722, 4226, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 25126, 25126, 4226, 4226, 4226, 25126, 4226, 25126, 39722, 39722, 4226, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 4226, 25126, 25126, 25126, 4226, 4226, 4226, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 4226, 4226, 4226, 4226, 39722, 60622, 65267, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 4226, 39722, 39722, 64977, 64977, 65267, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 39722, 52300, 52300, 52300, 64977, 64977, 65267, 65267, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 52300, 60622, 60622, 52300, 64977, 64977, 64977, 65267, 65267, 65267, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 52300, 60622, 64977, 52300, 60622, 64977, 64977, 65267, 65267, 65267, 65267, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 52300, 64977, 64977, 52300, 60622, 64977, 64977, 65267, 65267, 65267, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 39722, 64977, 64977, 52300, 60622, 64977, 64977, 64977, 65267, 65267, 65267, 65267, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 39722, 60622, 64977, 60622, 52300, 60622, 64977, 64977, 65267, 65267, 65267, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 52300, 60622, 60622, 52300, 60622, 60622, 64977, 64977, 65267, 65267, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 39722, 60622, 60622, 52300, 52300, 60622, 60622, 64977, 64977, 64977, 64977, 64977, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 39722, 52300, 52300, 39722, 52300, 52300, 39722, 39722, 52300, 52300, 60622, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 21595, 21595, 21595, 25126, 39722, 39722, 39722, 39722, 39722, 52300, 52300, 60622, 60622, 52300, 60622, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 39722, 39722, 39722, 39722, 39722, 39722, 39722, 39722, 25126, 4226, 4226, 21595, 25126, 25126, 39722, 52300, 52300, 52300, 60622, 64977, 65267, 64977, 60622, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 39722, 25126, 39722, 25126, 25126, 39722, 39722, 25126, 52300, 39722, 39722, 4226, 21595, 25126, 39722, 60622, 60622, 52300, 60622, 64977, 65267, 65267, 65267, 64977, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 25126, 4226, 25126, 25126, 25126, 25126, 39722, 25126, 25126, 4226, 25126, 39722, 25126, 4226, 25126, 52300, 60622, 60622, 52300, 60622, 64977, 65267, 65267, 65267, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 25126, 4226, 4226, 25126, 4226, 4226, 25126, 25126, 4226, 4226, 4226, 25126, 25126, 4226, 39722, 52300, 60622, 52300, 52300, 60622, 64977, 65267, 65267, 65267, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 25126, 4226, 4226, 4226, 4226, 4226, 47104, 39722, 39722, 52300, 60622, 60622, 60622, 60622, 60622, 64977, 65267, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 47104, 47104, 63488, 63488, 47104, 47104, 39722, 52300, 64977, 64977, 65267, 65267, 65267, 64977, 60622, 64977, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 25126, 47104, 47104, 4226, 4226, 47104, 63488, 63488, 63488, 63488, 63488, 63488, 63488, 47104, 25126, 48465, 48465, 56949, 61305, 56949, 65267, 65267, 65267, 65267, 64977, 65267, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 21595, 25126, 47104, 47104, 4226, 47104, 63488, 63488, 63488, 47104, 47104, 47104, 4226, 25126, 4226, 48465, 48465, 56949, 61305, 61305, 65535, 61305, 56949, 65267, 64977, 64977, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 21595, 25126, 39722, 39722, 52300, 60622, 4226, 4226, 47104, 25126, 47104, 25126, 39722, 4226, 25126, 44110, 48465, 56949, 56949, 61305, 65535, 65535, 61305, 60622, 64977, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 39722, 39722, 64977, 60622, 47104, 47104, 4226, 63488, 4226, 4226, 39722, 52300, 25126, 48465, 48465, 48465, 56949, 61305, 65535, 65535, 61305, 52300, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 39722, 39722, 64977, 47104, 47104, 39722, 63488, 63488, 4226, 4226, 65267, 64977, 39722, 56949, 44110, 56949, 48465, 48465, 56949, 65535, 65535, 61305, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 47104, 47104, 47104, 39722, 47104, 63488, 63488, 64977, 65267, 65267, 65267, 39722, 65535, 44110, 56949, 61305, 56949, 48465, 56949, 65535, 61305, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 47104, 63488, 63488, 63488, 63488, 52300, 63488, 63488, 63488, 60622, 64977, 65267, 65267, 39722, 65535, 61305, 44110, 44110, 56949, 61305, 56949, 48465, 56949, 65535, 61305, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 47104, 47104, 47104, 47104, 47104, 47104, 63488, 63488, 63488, 44110, 52300, 63488, 63488, 63488, 63488, 60622, 60622, 52300, 61305, 65535, 65535, 44110, 44110, 48465, 44110, 56949, 61305, 56949, 48465, 65535, 61305, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 47104, 47104, 47104, 47104, 47104, 29482, 29482, 63488, 63488, 63488, 63488, 63488, 48465, 56949, 56949, 65535, 65535, 61305, 44110, 44110, 56949, 61305, 56949, 44110, 56949, 61305, 56949, 65535, 65535, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 29482, 63488, 63488, 63488, 63488, 56949, 56949, 61305, 61305, 61305, 56949, 44110, 44110, 48465, 56949, 65535, 65535, 61305, 56949, 44110, 61305, 56949, 56949, 65535, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 44110, 48465, 48465, 56949, 56949, 56949, 48465, 48465, 48465, 44110, 44110, 44110, 44110, 44110, 48465, 56949, 56949, 65535, 65535, 65535, 65535, 56949, 44110, 56949, 61305, 56949, 65535, 65535, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 44110, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 65535, 65535, 61305, 61305, 61305, 65535, 65535, 65535, 65535, 65535, 61305, 56949, 44110, 61305, 56949, 65535, 65535, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 48465, 56949, 61305, 61305, 61305, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 61305, 61305, 61305, 61305, 65535, 65535, 65535, 65535, 61305, 56949, 44110, 56949, 61305, 65535, 65535, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 56949, 61305, 56949, 44110, 25126, 25126, 25126, 25126, 29482, 29482, 48465, 61305, 65535, 65535, 65535, 65535, 61305, 56949, 61305, 61305, 61305, 65535, 65535, 65535, 65535, 61305, 44110, 48465, 61305, 65535, 65535, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 48465, 56949, 56949, 25126, 25126, 52300, 52300, 60622, 60622, 60622, 52300, 29482, 29482, 48465, 61305, 65535, 65535, 61305, 56949, 56949, 61305, 61305, 65535, 65535, 65535, 65535, 61305, 48465, 44110, 61305, 65535, 65535, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 56949, 56949, 25126, 39722, 52300, 64977, 65267, 65267, 65267, 65267, 65267, 64977, 52300, 29482, 56949, 65535, 65535, 61305, 61305, 56949, 56949, 61305, 61305, 65535, 65535, 65535, 61305, 48465, 44110, 61305, 65535, 65535, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 56949, 25126, 39722, 60622, 64977, 65267, 65267, 65267, 65267, 65267, 65267, 65267, 64977, 39722, 29482, 61305, 61305, 61305, 61305, 56949, 56949, 61305, 61305, 65535, 65535, 65535, 61305, 56949, 44110, 61305, 65535, 65535, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 56949, 25126, 52300, 60622, 64977, 65267, 65267, 65267, 65267, 65267, 65267, 65267, 64977, 60622, 29482, 48465, 61305, 61305, 61305, 56949, 56949, 61305, 61305, 65535, 65535, 65535, 61305, 56949, 44110, 61305, 65535, 61305, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 56949, 25126, 52300, 60622, 64977, 64977, 64977, 65267, 65267, 65267, 65267, 65267, 64977, 60622, 39722, 29482, 61305, 61305, 61305, 56949, 56949, 61305, 61305, 65535, 65535, 65535, 61305, 56949, 44110, 61305, 61305, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 56949, 25126, 52300, 60622, 60622, 60622, 64977, 64977, 64977, 64977, 64977, 60622, 60622, 52300, 39722, 29482, 61305, 61305, 56949, 56949, 56949, 61305, 61305, 65535, 65535, 65535, 61305, 48465, 44110, 61305, 61305, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 48465, 25126, 39722, 52300, 60622, 60622, 60622, 60622, 60622, 60622, 60622, 60622, 52300, 52300, 39722, 29482, 61305, 61305, 56949, 56949, 56949, 61305, 65535, 65535, 65535, 65535, 61305, 48465, 44110, 61305, 61305, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 60622, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 44110, 25126, 39722, 52300, 52300, 52300, 60622, 60622, 60622, 60622, 60622, 52300, 52300, 39722, 39722, 29482, 61305, 56949, 56949, 48465, 56949, 61305, 65535, 65535, 65535, 61305, 56949, 48465, 44110, 61305, 56949, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 52300, 52300, 25126, 25126, 52300, 64977, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 44110, 25126, 25126, 39722, 39722, 52300, 52300, 60622, 60622, 60622, 52300, 52300, 39722, 39722, 39722, 29482, 56949, 56949, 48465, 48465, 56949, 65535, 65535, 65535, 61305, 61305, 48465, 44110, 48465, 61305, 56949, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 60622, 64977, 60622, 39722, 25126, 64977, 64977, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 52300, 60622, 64977, 65267, 65267, 64977, 60622, 60622, 60622, 60622, 39722, 39722, 52300, 29482, 56949, 48465, 48465, 56949, 61305, 65535, 65535, 65535, 61305, 56949, 48465, 44110, 48465, 61305, 56949, 44110, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 64977, 64977, 25126, 25126, 52300, 64977, 64977, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 39722, 60622, 64977, 65267, 65267, 65267, 65267, 64977, 60622, 60622, 60622, 39722, 52300, 29482, 48465, 48465, 48465, 48465, 56949, 61305, 65535, 65535, 61305, 56949, 48465, 44110, 44110, 48465, 56949, 56949, 44110, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 52300, 64977, 64977, 64977, 60622, 52300, 4226, 52300, 25126, 25126, 21595, 21595, 21595, 21595, 25126, 39722, 52300, 60622, 64977, 65267, 65267, 65267, 65267, 64977, 60622, 60622, 64977, 39722, 52300, 29482, 48465, 48465, 48465, 56949, 61305, 65535, 65535, 61305, 56949, 56949, 48465, 44110, 48465, 56949, 48465, 56949, 44110, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 52300, 4226, 25126, 60622, 64977, 60622, 4226, 4226, 39722, 4226, 4226, 4226, 21595, 21595, 25126, 39722, 52300, 60622, 64977, 64977, 65267, 65267, 65267, 60622, 60622, 64977, 64977, 39722, 52300, 29482, 48465, 48465, 56949, 56949, 61305, 65535, 61305, 56949, 56949, 48465, 44110, 48465, 56949, 56949, 48465, 56949, 44110, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 52300, 4226, 4226, 4226, 4226, 4226, 25126, 39722, 4226, 39722, 39722, 4226, 4226, 39722, 25126, 39722, 52300, 60622, 60622, 64977, 64977, 64977, 60622, 52300, 60622, 64977, 60622, 39722, 29482, 48465, 48465, 56949, 56949, 61305, 61305, 61305, 56949, 56949, 48465, 44110, 48465, 56949, 61305, 56949, 48465, 56949, 44110, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 4226, 4226, 4226, 4226, 4226, 25126, 4226, 39722, 39722, 4226, 52300, 60622, 60622, 39722, 25126, 52300, 52300, 60622, 60622, 60622, 52300, 52300, 60622, 64977, 64977, 52300, 29482, 48465, 48465, 56949, 56949, 61305, 61305, 56949, 56949, 56949, 48465, 48465, 48465, 56949, 61305, 61305, 56949, 48465, 48465, 29482, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 4226, 4226, 4226, 25126, 25126, 4226, 52300, 64977, 65267, 64977, 60622, 25126, 52300, 52300, 52300, 52300, 52300, 60622, 60622, 64977, 64977, 60622, 39722, 48465, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 48465, 48465, 48465, 56949, 61305, 61305, 61305, 56949, 48465, 29482, 29482, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 4226, 25126, 4226, 39722, 65267, 65267, 65267, 65267, 65267, 52300, 39722, 52300, 60622, 60622, 60622, 60622, 60622, 64977, 60622, 52300, 39722, 44110, 48465, 48465, 48465, 48465, 48465, 48465, 48465, 48465, 56949, 56949, 61305, 61305, 61305, 61305, 48465, 4226, 4226, 56949, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 4226, 4226, 52300, 60622, 64977, 65267, 65267, 65267, 65267, 60622, 39722, 52300, 52300, 60622, 64977, 64977, 60622, 52300, 39722, 29482, 29482, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 48465, 4226, 4226, 4226, 65535, 61305, 48465, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 4226, 39722, 52300, 60622, 60622, 64977, 64977, 64977, 64977, 52300, 52300, 60622, 64977, 64977, 60622, 52300, 39722, 44110, 48465, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 56949, 44110, 4226, 4226, 4226, 4226, 65535, 65535, 61305, 48465, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 39722, 39722, 52300, 60622, 60622, 52300, 52300, 52300, 60622, 60622, 60622, 52300, 52300, 39722, 4226, 4226, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 48465, 48465, 44110, 25126, 4226, 4226, 4226, 4226, 29482, 65535, 65535, 65535, 48465, 56949, 61305, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 25126, 39722, 52300, 52300, 64977, 64977, 64977, 64977, 60622, 52300, 52300, 39722, 29482, 56949, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 29482, 44110, 61305, 65535, 65535, 65535, 48465, 48465, 61305, 65535, 56949, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 25126, 39722, 52300, 52300, 64977, 64977, 64977, 52300, 39722, 21595, 29482, 48465, 61305, 48465, 44110, 29482, 4226, 4226, 4226, 4226, 4226, 4226, 29482, 44110, 48465, 56949, 65535, 65535, 65535, 65535, 48465, 48465, 61305, 65535, 65535, 61305, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 25126, 25126, 39722, 52300, 52300, 39722, 21595, 21595, 29482, 48465, 48465, 61305, 61305, 61305, 61305, 61305, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 65535, 65535, 65535, 56949, 48465, 48465, 56949, 65535, 65535, 65535, 56949, 29482, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 25126, 39722, 21595, 21595, 29482, 48465, 29482, 29482, 48465, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 56949, 48465, 56949, 61305, 65535, 65535, 65535, 61305, 29482, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 48465, 29482, 29482, 29482, 48465, 48465, 48465, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 61305, 65535, 65535, 65535, 65535, 61305, 29482, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 56949, 48465, 29482, 44110, 29482, 44110, 44110, 44110, 44110, 48465, 48465, 48465, 48465, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 65535, 65535, 56949, 29482, 48465, 56949, 44110, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 56949, 29482, 44110, 44110, 44110, 29482, 48465, 48465, 48465, 48465, 48465, 48465, 56949, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 56949, 29482, 29482, 48465, 56949, 61305, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 48465, 48465, 29482, 44110, 44110, 44110, 29482, 48465, 48465, 48465, 48465, 48465, 56949, 56949, 56949, 56949, 56949, 61305, 61305, 61305, 56949, 29482, 29482, 44110, 48465, 56949, 56949, 61305, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 48465, 29482, 44110, 44110, 44110, 44110, 44110, 29482, 48465, 48465, 48465, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 48465, 29482, 29482, 29482, 44110, 48465, 48465, 56949, 61305, 61305, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 29482, 44110, 44110, 44110, 44110, 44110, 29482, 48465, 48465, 48465, 56949, 56949, 56949, 56949, 48465, 29482, 29482, 29482, 29482, 29482, 44110, 48465, 48465, 56949, 56949, 61305, 56949, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 48465, 44110, 44110, 29482, 48465, 56949, 56949, 48465, 29482, 29482, 29482, 56949, 56949, 29482, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 56949, 44110, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 48465, 48465, 48465, 48465, 29482, 29482, 29482, 29482, 56949, 56949, 56949, 56949, 56949, 29482, 44110, 44110, 29482, 29482, 44110, 44110, 44110, 44110, 44110, 44110, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 48465, 48465, 48465, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 56949, 48465, 29482, 29482, 29482, 44110, 44110, 48465, 56949, 56949, 56949, 56949, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 56949, 48465, 29482, 44110, 48465, 48465, 56949, 56949, 61305, 65535, 65535, 65535, 65535, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 56949, 56949, 29482, 29482, 48465, 48465, 56949, 61305, 61305, 61305, 65535, 65535, 65535, 65535, 61305, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 56949, 48465, 29482, 44110, 48465, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 65535, 65535, 65535, 61305, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 56949, 56949, 29482, 29482, 44110, 48465, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 56949, 56949, 56949, 48465, 29482, 44110, 44110, 48465, 56949, 56949, 56949, 61305, 48465, 39722, 39722, 39722, 39722, 39722, 61305, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 44110, 29482, 29482, 44110, 44110, 48465, 48465, 56949, 56949, 25126, 39722, 52300, 60622, 65267, 65267, 65267, 60622, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 48465, 44110, 44110, 44110, 48465, 56949, 56949, 48465, 48465, 48465, 44110, 44110, 29482, 29482, 29482, 44110, 44110, 48465, 48465, 48465, 25126, 39722, 39722, 60622, 64977, 64977, 65267, 65267, 65267, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 48465, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 56949, 44110, 29482, 29482, 44110, 44110, 44110, 48465, 44110, 25126, 39722, 52300, 60622, 60622, 52300, 52300, 52300, 64977, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 48465, 56949, 56949, 61305, 61305, 61305, 56949, 48465, 48465, 48465, 48465, 56949, 56949, 48465, 29482, 29482, 44110, 44110, 44110, 44110, 25126, 25126, 39722, 52300, 60622, 52300, 52300, 52300, 52300, 60622, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 48465, 56949, 56949, 56949, 48465, 29482, 29482, 44110, 44110, 44110, 44110, 44110, 29482, 29482, 29482, 21595, 21595, 29482, 44110, 44110, 44110, 25126, 39722, 39722, 52300, 60622, 52300, 52300, 52300, 52300, 52300, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 48465, 56949, 44110, 29482, 29482, 44110, 48465, 56949, 56949, 61305, 61305, 56949, 56949, 48465, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 25126, 39722, 39722, 60622, 60622, 52300, 52300, 52300, 52300, 39722, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 48465, 56949, 56949, 44110, 48465, 56949, 56949, 61305, 61305, 65535, 65535, 65535, 65535, 61305, 56949, 21595, 21595, 21595, 29482, 44110, 44110, 25126, 39722, 39722, 60622, 52300, 52300, 52300, 52300, 52300, 39722, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 48465, 56949, 56949, 56949, 56949, 56949, 61305, 61305, 65535, 65535, 65535, 65535, 65535, 65535, 61305, 56949, 21595, 21595, 21595, 29482, 44110, 25126, 39722, 52300, 52300, 52300, 52300, 60622, 60622, 60622, 39722, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 48465, 48465, 56949, 56949, 56949, 61305, 61305, 65535, 65535, 65535, 65535, 65535, 65535, 61305, 56949, 48465, 21595, 21595, 29482, 44110, 44110, 39722, 52300, 60622, 60622, 60622, 60622, 60622, 60622, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 29482, 44110, 48465, 48465, 56949, 56949, 61305, 61305, 61305, 61305, 65535, 65535, 65535, 65535, 61305, 61305, 56949, 21595, 21595, 21595, 29482, 44110, 39722, 64977, 64977, 64977, 60622, 60622, 60622, 64977, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 56949, 21595, 21595, 21595, 21595, 39722, 60622, 64977, 64977, 64977, 64977, 60622, 60622, 64977, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 48465, 48465, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 61305, 56949, 48465, 21595, 21595, 21595, 39722, 60622, 64977, 64977, 64977, 64977, 60622, 60622, 64977, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 48465, 48465, 56949, 56949, 56949, 61305, 61305, 61305, 61305, 61305, 61305, 56949, 56949, 48465, 21595, 21595, 21595, 39722, 60622, 64977, 64977, 64977, 64977, 60622, 60622, 64977, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 44110, 48465, 48465, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 56949, 21595, 21595, 21595, 39722, 60622, 64977, 64977, 64977, 60622, 60622, 64977, 64977, 39722, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 44110, 48465, 48465, 48465, 48465, 48465, 48465, 56949, 61305, 61305, 61305, 56949, 56949, 21595, 21595, 39722, 52300, 52300, 39722, 52300, 60622, 60622, 60622, 52300, 39722, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 44110, 44110, 44110, 48465, 48465, 56949, 56949, 56949, 61305, 65535, 65535, 61305, 61305, 21595, 21595, 25126, 39722, 60622, 64977, 60622, 25126, 39722, 25126, 39722, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 56949, 61305, 65535, 65535, 65535, 61305, 21595, 21595, 39722, 64977, 64977, 64977, 52300, 39722, 64977, 39722, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 56949, 48465, 44110, 39722, 29482, 29482, 48465, 61305, 61305, 21595, 21595, 39722, 64977, 39722, 60622, 39722, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 44110, 48465, 48465, 48465, 56949, 56949, 39722, 39722, 39722, 39722, 39722, 29482, 29482, 56949, 61305, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 44110, 48465, 48465, 48465, 56949, 39722, 39722, 39722, 39722, 39722, 39722, 39722, 29482, 56949, 48465, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 48465, 48465, 48465, 48465, 39722, 39722, 39722, 52300, 60622, 64977, 52300, 39722, 56949, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 48465, 48465, 25126, 39722, 39722, 52300, 64977, 64977, 65267, 65267, 65267, 64977, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 48465, 48465, 25126, 25126, 52300, 64977, 64977, 65267, 65267, 65267, 65267, 65267, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 48465, 25126, 25126, 52300, 65267, 65267, 64977, 64977, 60622, 52300, 52300, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 44110, 25126, 25126, 52300, 60622, 64977, 64977, 60622, 52300, 52300, 52300, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 29482, 25126, 39722, 52300, 60622, 64977, 60622, 52300, 52300, 52300, 52300, 39722, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 25126, 39722, 52300, 64977, 64977, 60622, 52300, 52300, 52300, 52300, 39722, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 39722, 52300, 64977, 64977, 60622, 52300, 52300, 52300, 39722, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 52300, 60622, 64977, 64977, 52300, 52300, 52300, 52300, 39722, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 52300, 64977, 64977, 64977, 52300, 52300, 52300, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 52300, 60622, 64977, 64977, 64977, 60622, 52300, 60622, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 52300, 64977, 64977, 65267, 65267, 64977, 52300, 64977, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 52300, 64977, 65267, 65267, 65267, 65267, 52300, 65267, 64977, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 60622, 64977, 65267, 65267, 65267, 65267, 60622, 65267, 65267, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 60622, 64977, 65267, 65267, 65267, 64977, 60622, 64977, 64977, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 60622, 64977, 64977, 64977, 60622, 52300, 64977, 64977, 52300, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 39722, 52300, 52300, 52300, 52300, 52300, 60622, 52300, 39722, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 64977, 60622, 25126, 39722, 25126, 39722, 39722, 39722, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 39722, 64977, 39722, 64977, 39722, 60622, 39722, 60622, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, 21595, }; extern const BITMAP_INFO frame_06_bmp; const BITMAP_INFO frame_06_bmp ={ 74, 154, 16, (unsigned char*)raw_data };
[ "idea4good@outlook.com" ]
idea4good@outlook.com
6816d1430939869dde612bf48e7dfed373e26e7d
cec5bfb44617ee749ae5fb7180e35a908804c124
/src/Menu.cpp
308e2ad4cb03072729a2ca75c3e9db45a63144c1
[]
no_license
orbisvicis/prime
2fc04e595c1140f7356726a6b154e0d94a5e2b4f
de7121b837b7a25a531b94e3358d3898b3f92c87
refs/heads/master
2016-09-13T12:12:16.213493
2016-04-22T22:41:42
2016-04-22T22:44:30
56,885,037
0
0
null
null
null
null
UTF-8
C++
false
false
28,269
cpp
#include <stdio.h> #include <ctype.h> #include "Interface.h" shMenuChoice::shMenuChoice (char letter, char alt, const char *text, const void *value, int count, int selected) { mLetter = letter; mAltLetter = alt; strncpy (mText, text, 255); mText[255] = 0; mValue.mPtr = value; mSelected = selected; mCount = count; } shMenuChoice::shMenuChoice (char letter, char alt, const char *text, int value, int count, int selected) { mLetter = letter; mAltLetter = alt; strncpy (mText, text, 255); mText[255] = 0; mValue.mInt = value; mSelected = selected; mCount = count; } shMenu::shMenu (const char *prompt, int flags) : mChoices () { strncpy (mPrompt, prompt, 79); mPrompt[79] = 0; mFlags = flags; mResultIterator = 0; mOffset = 0; mDone = 0; mNum = 0; mObjTypeHack = kMaxObjectType; mLastLet = 'a'-1; mHelpFileName = NULL; mHelpHandlerP = NULL; mHelpHandlerI = NULL; mHelpMode = false; mHeight = I->getMaxLines (); mWidth = I->getMaxColumns (); if (!(mFlags & kNoPick)) { /* KLUDGE: avoid repeating a letter on the same page */ mHeight = mini (52, mHeight); } } shMenu::~shMenu (void) { for (int i = 0; i < mChoices.count (); ++i) delete mChoices.get (i); } char shMenu::nextLet (void) { ++mLastLet; if (mLastLet == 'z' + 1) mLastLet = 'A'; return mLastLet; } void shMenu::addIntItem (char letter, const char *text, int value, int count /* = 1 */, int selected /* = 0 */) { if (0 == letter) letter = ' '; char alt = letter >= 0 ? nextLet () : ' '; mChoices.add (new shMenuChoice (letter, alt, text, value, count, selected)); } void shMenu::addPtrItem (char letter, const char *text, const void *value, int count /* = 1 */, int selected /* = 0 */) { const char *typeHeader[kMaxObjectType] = { "UNINITIALIZED (! please report !)", "Money (toggle all with $)", "Bionic Implants (toggle all with :)", "Floppy Disks (toggle all with ?)", "Canisters (toggle all with !)", "Tools (toggle all with ()", "Armor (toggle all with [)", "Weapons (toggle all with ))", "Ammunition (toggle all with =)", "Other (toggle all with &)", "Ray Guns (toggle all with /)", "Energy Cells (toggle all with *)" }; if (0 == letter) letter = ' '; if (mFlags & kCategorizeObjects and value) { shObjectType t = ((shObject *) value) -> apparent ()->mType; if (t != mObjTypeHack) { if (t >= kUninitialized and t <= kEnergyCell) { if (mFlags & kMultiPick) { /* Show toggle key. */ addHeader (typeHeader[t]); /* From above table. */ } else { addHeader (objectTypeHeader[t]); /* Default. */ } } else { addHeader ("------"); } mObjTypeHack = t; } } char alt = letter >= 0 ? nextLet () : ' '; mChoices.add (new shMenuChoice (letter, alt, text, value, count, selected)); } void shMenu::addHeader (const char *text) { /* prints out the header */ addPtrItem (-1, text, NULL, -1); } void shMenu::addPageBreak (void) { /* Just a prettifier. */ addPtrItem (0, "", NULL, -1); /* -2 is signal to adjust space on both sides of text. */ addPtrItem (-2, "---..oo..--=oOo=--..oo..---", NULL, -1); addPtrItem (0, "", NULL, -1); } void shMenu::addText (const char *text) { addPtrItem (' ', text, NULL); } void shMenu::finish () { assert (kNoPick & mFlags); accumulateResults (); } shMenuChoice * shMenu::getResultChoice (void) { if (!mDone) accumulateResults (); while (mResultIterator < mChoices.count ()) { shMenuChoice *choice = mChoices.get (mResultIterator++); if (choice->mSelected) return choice; } return NULL; } /* call this repeatedly to store the selected results into value and count. RETURNS: 0 if there are no (more) results, 1 o/w */ int shMenu::getIntResult (int *value, int *count /* = NULL */) { shMenuChoice *choice = getResultChoice (); if (choice) { *value = choice->mValue.mInt; if (NULL != count) { *count = choice->mSelected; } return 1; } *value = 0; return 0; } int shMenu::getPtrResult (const void **value, int *count /* = NULL */) { shMenuChoice *choice = getResultChoice (); if (mDone == DELETE_FILTER_SIGNAL) return DELETE_FILTER_SIGNAL; if (choice) { *value = choice->mValue.mPtr; if (NULL != count) { *count = choice->mSelected; } return 1; } *value = NULL; return 0; } void shMenu::getRandIntResult (int *value, int *count /* = NULL */) { shMenuChoice *choice = mChoices.get (RNG (mChoices.count ())); *value = choice->mValue.mInt; if (NULL != count) { *count = choice->mSelected; } } void shMenu::getRandPtrResult (const void **value, int *count /* = NULL */) { shMenuChoice *choice = mChoices.get (RNG (mChoices.count ())); *value = choice->mValue.mPtr; if (NULL != count) { *count = choice->mSelected; } } int shMenu::getNumChoices (void) { int num = 0; for (int i = 0; i < mChoices.count (); ++i) if (mChoices.get (i)->mSelected) ++num; return num; } void shMenu::attachHelp (const char *fname) { mHelpFileName = fname; } void shMenu::attachHelp (shHelpFuncPtr handler) { mHelpHandlerP = handler; } void shMenu::attachHelp (shHelpFuncInt handler) { mHelpHandlerI = handler; } void shMenu::showHelp () { int lines; const char **text = prepareHelp (&lines); I->clearWin (shInterface::kMenuHelp); for (int i = 0; i < lines; ++i) { int len = strlen (text[i]); I->winGoToYX (shInterface::kMenuHelp, i, 0); for (int j = 0; j < len; ++j) { if (islower (text[i][j]) or text[i][j] == ':' or (j == 0 and (text[i][j] == 'I' or text[i][j] == 'Q'))) { I->setWinColor (shInterface::kMenuHelp, kGray); } else { I->setWinColor (shInterface::kMenuHelp, kWhite); } I->winPutchar (shInterface::kMenuHelp, text[i][j]); } } free (text); } void shMenu::select (int i1, int i2, /* mChoices[i1..i2) */ int action, /* 0 unselect, 1 select, 2 toggle */ shObjectType t) /* = kUninitialized */ { if (!(mFlags & kMultiPick)) return; for (int i = i1; i < i2; ++i) { shMenuChoice *choice = mChoices.get (i); if (choice->mCount < 0) { continue; } if (t and mFlags & kCategorizeObjects and choice->mValue.mPtr and t != ((shObject *) choice->mValue.mPtr) -> apparent ()->mType) { continue; } if (0 == action) { choice->mSelected = 0; } else if (1 == action) { choice->mSelected = choice->mCount; } else if (2 == action) { if (!choice->mSelected) choice->mSelected = choice->mCount; else choice->mSelected = 0; } } } const char ** shMenu::prepareHelp (int *lines) { /* Building blocks for help. */ const char *navigation = "ARROWS, PAGE UP, PAGE DOWN navigate SPACE, ENTER, ESCAPE finish"; static char count[] = "Quantity: [ ] press NUMBERS to change quantity of selected items"; const char *multipick = "Items: , select all - deselect all @ toggle all LETTER toggle single"; const char *help = "TAB show help file "; const char *helpoff = "TAB enter help mode "; const char *helpon = "TAB exit help mode "; const char *filter = "BACKSPACE disable filter "; const char *singlepick = "LETTER choose and accept"; const char *helppick = "LETTER show help about item"; static char lastline[81]; /* Choose appropriate blocks. */ *lines = 0; const char **text = (const char **) calloc (4, sizeof (char *)); if (mFlags & kNoHelp) return text; text[(*lines)++] = navigation; if ((mFlags & kCountAllowed) and !mHelpMode) { text[(*lines)++] = count; if (mNum == 0) { strncpy (count + 11, " all ", 5); /* Does not place \0 anywhere. */ } else { sprintf (count + 11, "%5d", mNum < 99999 ? mNum : 99999); count[16] = ']'; /* Replace \0 added by sprintf. */ } } if ((mFlags & kMultiPick) and !mHelpMode) text[(*lines)++] = multipick; const char *helpline = NULL; if (mHelpFileName) helpline = help; if (mHelpHandlerP or mHelpHandlerI) helpline = mHelpMode ? helpon : helpoff; if (helpline or (mFlags & kFiltered) or !(mFlags & kMultiPick)) { snprintf (lastline, 81, "%s%s%s", helpline ? helpline : "", mFlags & kFiltered ? filter : "", mFlags & kMultiPick ? "" : (mHelpMode ? helppick : singlepick)); text[(*lines)++] = lastline; } return text; } void shMenu::dropResults (void) { mDone = 0; mResultIterator = 0; for (int i = 0; i < mChoices.count (); ++i) mChoices.get (i) -> mSelected = 0; } /* Returns true when key pressed was valid. */ bool shMenu::interpretKey (int key, shInterface::Command cmd) { if (cmd) switch (cmd) { case shInterface::kDrop: /* Drop item filter. */ if (kFiltered & mFlags) { mDone = DELETE_FILTER_SIGNAL; return true; } return false; case shInterface::kMoveNW: /* Home */ mLast -= mOffset; mOffset = 0; return true; case shInterface::kMoveSW: /* End */ mOffset += mChoices.count () - mLast; mLast = mChoices.count (); return true; case shInterface::kMoveUp: if (mOffset > 0) { --mOffset; --mLast; } return true; case shInterface::kMoveDown: if (mLast < mChoices.count ()) { ++mOffset; ++mLast; } return true; case shInterface::kMoveNE: /* Page up */ mOffset -= mItemHeight / 2; mLast -= mItemHeight / 2; if (mOffset < 0) { mLast -= mOffset; mOffset = 0; } return true; case shInterface::kMoveSE: /* Page down */ mLast += mItemHeight / 2; mOffset += mItemHeight / 2; if (mLast >= mChoices.count ()) { mOffset -= mLast - mChoices.count (); mLast = mChoices.count (); } return true; case shInterface::kHelp: if (mHelpFileName) { shTextViewer *viewer = new shTextViewer (mHelpFileName); viewer->show (); delete viewer; } else if (mHelpHandlerP or mHelpHandlerI) { mHelpMode = !mHelpMode; } else { return false; } return true; default: break; } switch (key) { case '@': /* toggle all */ select (0, mChoices.count(), 2); return true; case '-': /* deselect all */ select (0, mChoices.count(), 0); return true; case ',': /* select all */ select (0, mChoices.count(), 1); return true; case '$': /* toggle all cash */ select (0, mChoices.count(), 2, kMoney); return true; case ':': /* toggle all implants */ select (0, mChoices.count(), 2, kImplant); return true; case '?': /* toggle all floppies */ select (0, mChoices.count(), 2, kFloppyDisk); return true; case '!': /* toggle all cans */ select (0, mChoices.count(), 2, kCanister); return true; case '(': /* toggle all tools */ select (0, mChoices.count(), 2, kTool); return true; case '[': /* toggle all armor */ select (0, mChoices.count(), 2, kArmor); return true; case ')': /* toggle all weapons */ select (0, mChoices.count(), 2, kWeapon); return true; case '=': /* toggle all ammo */ select (0, mChoices.count(), 2, kProjectile); return true; case '/': /* toggle all ray guns */ select (0, mChoices.count(), 2, kRayGun); return true; case '*': /* toggle all energy */ select (0, mChoices.count(), 2, kEnergyCell); return true; case '&': /* toggle all other things */ select (0, mChoices.count(), 2, kOther); return true; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (mFlags & kCountAllowed) { mNum = mNum * 10 + key - '0'; if (mNum >= 1000000) { mNum = 1000000; } return true; } else { return false; } default: if (!mHelpMode and (mFlags & kNoPick)) return false; for (int i = 0; i < mChoices.count (); ++i) { shMenuChoice *item = mChoices.get (i); if (mHelpMode and item->mAltLetter == key) { if (mHelpHandlerP) mHelpHandlerP (item->mValue.mPtr); else mHelpHandlerI (item->mValue.mInt); return true; } else if (item->mLetter == key) { if ((mFlags & kCountAllowed) and mNum) { /* Set exact number. */ if (mNum > item->mCount) { /* TODO: Warn user not that many items are available. */ mNum = item->mCount; } } else if (mFlags & kSelectIsPlusOne) { mNum = item->mSelected == item->mCount ? 0 : item->mSelected + 1; } else { /* Toggle all or none. */ mNum = item->mSelected ? 0 : item->mCount; } item->mSelected = mNum; mNum = 0; if (!(mFlags & kMultiPick)) { mDone = 1; } return true; } } return false; } return false; } /* Build status bar featuring numbers of lines shown and scroll information. */ const char * shMenu::bottomLine (int curpos) { const char *indicator = NULL; bool lineinfo = true; if (mLast == mChoices.count () and mOffset == 0) { indicator = "--All shown--"; lineinfo = false; } else if (curpos == mChoices.count ()) { indicator = "--End--"; } else if (0 == mOffset) { indicator = "--Top--"; } else { indicator = "--More--"; } /* Show weight for object menus. */ char wgtbuf[19] = " "; if (mFlags & kCategorizeObjects) { int total = 0; for (int i = 0; i < mChoices.count (); ++i) { shMenuChoice *choice = mChoices.get (i); if (choice->mValue.mPtr == 0) continue; total += ((shObject *) choice->mValue.mPtr)->getMass (); } sprintf (wgtbuf, "%5d weight total", total); } /* Indicator, optional weight and line number information. */ static char buf[60]; sprintf (buf, "%-8s %s", indicator, wgtbuf); if (lineinfo) sprintf (buf + strlen (buf), " displaying lines %d - %d of %d ", mOffset + 1, curpos + 1, mChoices.count () + 1); return buf; } shTextViewer::shTextViewer (const char *fname) { /* Try opening target file. */ assert (fname); mFree = true; mLines = NULL; mNumLines = 0; mMaxWidth = 0; char path[PRIME_PATH_LENGTH]; snprintf (path, sizeof (path)-1, "%s/%s", DATADIR, fname); FILE *text = fopen (path, "r"); if (!text) return; /* Count lines and check max width. */ char *buf = GetBuf (); while (fgets (buf, SHBUFLEN, text)) { mMaxWidth = maxi (mMaxWidth, strlen (buf)); ++mNumLines; } ++mNumLines; /* For adding " --End-- " at the bottom. */ mMaxWidth = maxi (mMaxWidth, 9 /* --End-- */); /* Ok, this is paranoidal. */ ++mMaxWidth; /* Compensate for \0. */ /* Copy file to memory. */ mLines = (char *) calloc (mNumLines * mMaxWidth, sizeof (char)); rewind (text); int line = 0; while (fgets (mLines + line * mMaxWidth, mMaxWidth, text)) { ++line; } strcpy (mLines + line * mMaxWidth, " --End-- "); /* Done! Now clean up. */ fclose (text); } shTextViewer::shTextViewer (char *lines, int num, int max) { /* Import text from some other procedure. */ mLines = lines; mNumLines = num; mMaxWidth = max; mFree = false; } shTextViewer::~shTextViewer (void) { if (mFree) free (mLines); } void /* Color change sequences: @X where X stands for a color code. */ shTextViewer::print (int winline, int fileline) { int control = 0, idx = 0; char *line = mLines + fileline * mMaxWidth; I->winPrint (shInterface::kTemp, winline, 0, ""); /* Just to move cursor. */ while (line[idx]) { /* Parse line. */ if (control and !isupper (line[idx])) { I->winPutchar (shInterface::kTemp, '@'); control = 0; /* Avoid choking on our email addresses. */ } if (control) { I->setWinColor (shInterface::kTemp, shColor (line[idx] - 'A')); control = 0; } else if (line[idx] == '@') { control = 1; } else { I->winPutchar (shInterface::kTemp, line[idx]); } ++idx; } } /* Displays loaded file to the screen. This procedure */ void /* should have no reason to modify member variables. */ shTextViewer::show (bool bottom) { int height = I->getMaxLines () - 1; int first = 0; if (bottom) first = maxi (mNumLines - height, 0); I->newWin (shInterface::kTemp); shInterface::SpecialKey sp; while (sp != shInterface::kEscape) { /* Show content. */ I->clearWin (shInterface::kTemp); I->setWinColor (shInterface::kTemp, kGray); int lines_drawn = mini (mNumLines - first, height); for (int i = first; i < first + lines_drawn; ++i) { print (i - first, i); } /* Show help at bottom. */ I->setWinColor (shInterface::kTemp, kWhite); I->winPrint (shInterface::kTemp, height, 0, " SPACE ENTER ESCAPE ARROWS PAGE UP PAGE DOWN"); I->setWinColor (shInterface::kTemp, kGray); I->winPrint (shInterface::kTemp, height, 9, ","); I->winPrint (shInterface::kTemp, height, 16, ","); I->winPrint (shInterface::kTemp, height, 24, " - exit"); I->winPrint (shInterface::kTemp, height, 40, ","); I->winPrint (shInterface::kTemp, height, 49, ","); I->winPrint (shInterface::kTemp, height, 60, " - navigation"); I->refreshWin (shInterface::kTemp); I->getSpecialChar (&sp); /* Navigation. */ switch (sp) { case shInterface::kHome: first = 0; break; case shInterface::kEnd: first = mNumLines - height; break; case shInterface::kUpArrow: if (first > 0) --first; break; case shInterface::kDownArrow: if (first + height < mNumLines) ++first; break; case shInterface::kPgUp: case shInterface::kLeftArrow: first -= height / 2; if (first < 0) first = 0; break; case shInterface::kPgDn: case shInterface::kRightArrow: first += height / 2; if (first + height > mNumLines) first = mNumLines - height; break; case shInterface::kEnter: case shInterface::kSpace: sp = shInterface::kEscape; break; default: break; } } I->delWin (shInterface::kTemp); } void shMenu::accumulateResults () { const int map_end = 64; /* column map ends */ extern bool mapOn; mapOn = false; /* Dim the map in graphical modes while menu is active. */ shInterface::Window menuwin = shInterface::kMenu; int helplines; /* Merely to extract number of help lines needed. */ free (prepareHelp (&helplines)); /* Two additional lines besides all the choices are the menu title and --End-- or --More-- at the bottom. */ mItemHeight = mini (mHeight - helplines, mChoices.count () + 2); int width = 10; int gap = 0; /* Used to position the menu. */ for (int i = 0; i < mChoices.count (); ++i) { width = maxi (width, strlen (mChoices.get (i)->mText) + 1); } if (!(mFlags & kNoPick)) width += 10; /* Adjust for "( ) x - " prompts. */ /* Main header might be still longer. */ width = maxi (width, strlen (mPrompt) + 2); if (mFlags & kCategorizeObjects) { /* Do not center item lists. */ /* Determine whether window can leave sidebar unobscured. */ if (width <= map_end) { /* Yes! */ width = map_end; } else { /* No, so hide it whole. */ width = mWidth; } } else { width = mini (mWidth, width); if (width > map_end) { /* Would obscure side bar window? */ width = mWidth; /* Then cover it whole. */ } else { /* Place small gap between sidebar and menu if possible. */ gap = mini (10, (map_end - width) / 2); } } int begin = maxi (0, map_end - width) - gap; I->newWin (menuwin); I->moveWin (menuwin, begin, 0, begin + width, mItemHeight); if (helplines) { I->newWin (shInterface::kMenuHelp); I->moveWin (shInterface::kMenuHelp, 0, mHeight - helplines, 80, mHeight); showHelp (); } /* -2 lines to make space for header and --End-- or similar. */ mLast = mini (mOffset + mItemHeight - 2, mChoices.count ()); while (1) { /* Menu loop. */ I->clearWin (menuwin); /* Menu header: */ I->setWinColor (menuwin, kWhite, kBlack); I->winOutXY (menuwin, 0, 0, mPrompt); I->setWinColor (menuwin, kGray, kBlack); int i; for (i = mOffset; i < mLast; ++i) { /* Draw each menu line. */ char buf[100]; shMenuChoice *item = mChoices.get (i); if (item->mLetter >= 0 and (kCategorizeObjects & mFlags) and ((shObject *) item->mValue.mPtr)->isKnownRadioactive ()) { I->setWinColor (menuwin, kGreen, kBlack); } if (-2 == item->mLetter) { /* This is a pretty delimiter. */ int len = strlen (item->mText); int j = (width - len) / 2; char *spaces = GetBuf (); for (int i = 0; i < j; ++i) { spaces[i] = ' '; } spaces[j] = '\0'; snprintf (buf, 100, "%s%s%s", spaces, item->mText, spaces); } else if (-1 == item->mLetter) { /* This is a header entry. */ if (kCategorizeObjects & mFlags and mFlags & kMultiPick) { /* Get category header. */ char part[50]; snprintf (part, 50, " %s ", item->mText); part[49] = 0; char *gap = strstr (part, " "); /* Find gap. */ gap[1] = 0; /* Truncate. */ I->setWinColor (menuwin, kBlack, kGray); I->winOutXY (menuwin, 0, 1 + i - mOffset, part); /* Get (toggle all with X) part. */ char *p2 = strstr (item->mText, "(t"); int len = strlen (p2); snprintf (part, len-2, "%s", item->mText); I->setWinColor (menuwin, kBlue, kBlack); I->winOutXY (menuwin, width-22, 1 + i - mOffset, p2); /* The toggle key should stand out. */ snprintf (buf, len - 1, "%c", p2[len - 2]); I->winGoToYX (menuwin, 1 + i - mOffset, width-22+len-2); I->setWinColor (menuwin, kWhite, kBlack); I->winPutchar (menuwin, p2[len - 2]); buf[0] = 0; /* Printing is done. */ } else { I->setWinColor (menuwin, kBlack, kGray); snprintf (buf, 100, " %s ", item->mText); } } else if (mHelpMode) { snprintf (buf, 100, " %c - %s", item->mAltLetter, item->mText); } else if (mFlags & kNoPick) { if (mHelpHandlerP or mHelpHandlerI) { if (' ' == item->mLetter) { snprintf (buf, 100, " %s", item->mText); } else { snprintf (buf, 100, " %c - %s", item->mLetter, item->mText); } } else { if (' ' == item->mLetter) { snprintf (buf, 100, "%s", item->mText); } else { snprintf (buf, 100, "%c - %s", item->mLetter, item->mText); } } } else { if (' ' == item->mLetter) { snprintf (buf, 100, " %s", item->mText); } else if (mFlags & kShowCount) { if (item->mSelected) { snprintf (buf, 100, "(%d) %c - %s", item->mSelected, item->mLetter, item->mText); } else { snprintf (buf, 100, "( ) %c - %s", item->mLetter, item->mText); } } else { snprintf (buf, 100, "(%c) %c - %s", 0 == item->mSelected ? ' ' : item->mCount == item->mSelected ? 'X' : '#', item->mLetter, item->mText); } } I->winOutXY (menuwin, 0, 1 + i - mOffset, "%s", buf); I->setWinColor (menuwin, kGray, kBlack); } I->winOutXY (menuwin, 0, 1 + i - mOffset, bottomLine (i)); while (1) { I->refreshWin (menuwin); I->refreshWin (shInterface::kMenuHelp); if (helplines) showHelp (); shInterface::SpecialKey spk; int key = I->getSpecialChar (&spk); if (27 == key or 13 == key or 10 == key or ' ' == key) { /* done */ mDone = 1; break; } else if ('\t' == key) { /* invoke help */ interpretKey (0, shInterface::kHelp); break; } else if (spk == shInterface::kBackSpace) { interpretKey (0, shInterface::kDrop); break; } else if (spk == shInterface::kHome) { interpretKey (0, shInterface::kMoveNW); break; } else if (spk == shInterface::kEnd) { interpretKey (0, shInterface::kMoveSW); break; } else if (spk == shInterface::kUpArrow) { interpretKey (0, shInterface::kMoveUp); break; } else if (spk == shInterface::kDownArrow) { interpretKey (0, shInterface::kMoveDown); break; } else if (spk == shInterface::kLeftArrow or spk == shInterface::kPgUp) { interpretKey (0, shInterface::kMoveNE); break; } else if (spk == shInterface::kRightArrow or spk == shInterface::kPgDn) { interpretKey (0, shInterface::kMoveSE); break; } else { if (interpretKey (key)) break; } if (mDone) break; } if (mDone) break; } /* Clean up. */ I->delWin (menuwin); if (helplines) I->delWin (shInterface::kMenuHelp); mapOn = true; I->drawScreen (); }
[ "pscjtwjdjtAhnbjm/dpn" ]
pscjtwjdjtAhnbjm/dpn
e0cd7567709180787de07b22872f6dc15d2b65ed
4e9e4b2aa28113e307c87cd6c777d7498fd85b0a
/src/ds/siphash.h
856436033a4c5a656ee8590b893930e61f758205
[ "LicenseRef-scancode-generic-cla", "Apache-2.0", "MIT" ]
permissive
kuychaco/CCF
b0608e4f241a1c0dfa1c3f72021b4b4d786e0e02
e11acde3be6a7d2213fe5b406b959bb5bb64361d
refs/heads/master
2020-12-23T05:14:45.012959
2020-01-29T17:49:12
2020-01-29T17:49:12
237,045,643
1
0
Apache-2.0
2020-01-29T17:45:36
2020-01-29T17:45:35
null
UTF-8
C++
false
false
3,772
h
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the Apache 2.0 License. #pragma once #include <cstddef> #include <cstdint> #include <vector> // C++ port of reference implementation namespace siphash { using SipState = uint64_t[4]; using SipKey = uint64_t[2]; constexpr uint64_t rotl(uint64_t x, size_t b) { return (x << b) | (x >> (64 - b)); } inline void u32_to_bytes_le(uint32_t v, uint8_t* out) { out[0] = (uint8_t)(v); out[1] = (uint8_t)(v >> 8); out[2] = (uint8_t)(v >> 16); out[3] = (uint8_t)(v >> 24); } inline void u64_to_bytes_le(uint64_t v, uint8_t* out) { u32_to_bytes_le((uint32_t)v, out); u32_to_bytes_le((uint32_t)(v >> 32), out + 4); } template <typename ConstRandomIterator> constexpr uint64_t bytes_to_64_le(const ConstRandomIterator in) { return ((uint64_t)in[0]) | ((uint64_t)in[1] << 8) | ((uint64_t)in[2] << 16) | ((uint64_t)in[3] << 24) | ((uint64_t)in[4] << 32) | ((uint64_t)in[5] << 40) | ((uint64_t)in[6] << 48) | ((uint64_t)in[7] << 56); } inline void sip_rounds(SipState& s, size_t rounds) { for (auto i = 0; i < rounds; ++i) { s[0] += s[1]; s[1] = rotl(s[1], 13); s[1] ^= s[0]; s[0] = rotl(s[0], 32); s[2] += s[3]; s[3] = rotl(s[3], 16); s[3] ^= s[2]; s[0] += s[3]; s[3] = rotl(s[3], 21); s[3] ^= s[0]; s[2] += s[1]; s[1] = rotl(s[1], 17); s[1] ^= s[2]; s[2] = rotl(s[2], 32); } } enum class OutputLength { EightBytes = 8, SixteenBytes = 16, }; template < size_t CompressionRounds, size_t FinalizationRounds, OutputLength out_size> void siphash_raw( const uint8_t* in, size_t in_len, const SipKey& key, uint8_t* out) { SipState s{0x736f6d6570736575ULL, 0x646f72616e646f6dULL, 0x6c7967656e657261ULL, 0x7465646279746573ULL}; SipKey k{key[0], key[1]}; s[0] ^= k[0]; s[1] ^= k[1]; s[2] ^= k[0]; s[3] ^= k[1]; const uint8_t* end = in + in_len - (in_len % 8); const size_t left = in_len & 7; if constexpr (out_size == OutputLength::SixteenBytes) { s[1] ^= 0xee; } uint64_t m; for (; in != end; in += 8) { m = bytes_to_64_le(in); s[3] ^= m; sip_rounds(s, CompressionRounds); s[0] ^= m; } uint64_t b = (uint64_t)in_len << 56; // Deliberate fall through switch (left) { case 7: b |= (uint64_t)in[6] << 48; case 6: b |= (uint64_t)in[5] << 40; case 5: b |= (uint64_t)in[4] << 32; case 4: b |= (uint64_t)in[3] << 24; case 3: b |= (uint64_t)in[2] << 16; case 2: b |= (uint64_t)in[1] << 8; case 1: b |= (uint64_t)in[0]; case 0: break; } s[3] ^= b; sip_rounds(s, CompressionRounds); s[0] ^= b; if constexpr (out_size == OutputLength::SixteenBytes) { s[2] ^= 0xee; } else { s[2] ^= 0xff; } sip_rounds(s, FinalizationRounds); b = s[0] ^ s[1] ^ s[2] ^ s[3]; u64_to_bytes_le(b, out); if constexpr (out_size == OutputLength::EightBytes) { return; } s[1] ^= 0xdd; sip_rounds(s, FinalizationRounds); b = s[0] ^ s[1] ^ s[2] ^ s[3]; u64_to_bytes_le(b, out + 8); return; } template <size_t CompressionRounds, size_t FinalizationRounds> uint64_t siphash(const std::vector<uint8_t>& in, const SipKey& key) { uint64_t out; siphash_raw< CompressionRounds, FinalizationRounds, OutputLength::EightBytes>( in.data(), in.size(), key, reinterpret_cast<uint8_t*>(&out)); return out; } }
[ "amchamay@microsoft.com" ]
amchamay@microsoft.com
251960e6bc11cb9ec2bef5d59ecd8e1fb1d6e62f
7bf18d167d441d1701b39cb37e7f43b2719c92c1
/Source/SimpleProject/Boss/AI/BTT_SelectBossAttack.h
d453bb4738e73576e2feaa878381ed0ede3dbf75
[]
no_license
juno870502/SimpleProject
570e54c437e9e8100f4af4479d98fad259663f51
af51a41119205e21958a1002057ba29300d8bac1
refs/heads/master
2020-08-15T01:17:16.726109
2019-11-17T18:00:07
2019-11-17T18:00:07
215,258,252
0
0
null
null
null
null
UTF-8
C++
false
false
557
h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "BehaviorTree/Tasks/BTTask_BlackboardBase.h" #include "Boss/BasicBoss.h" #include "BTT_SelectBossAttack.generated.h" /** * */ UCLASS() class SIMPLEPROJECT_API UBTT_SelectBossAttack : public UBTTask_BlackboardBase { GENERATED_BODY() public: UPROPERTY(BlueprintReadOnly, EditAnywhere) EBossState SelectedState; virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) override; };
[ "juno870502@naver.com" ]
juno870502@naver.com
fe2edf828fc8eabfeff61f50fa5620360e185caf
13688b7981908e126087814b4528f5ef5cc63ad2
/torch/csrc/distributed/rpc/tensorpipe_utils.cpp
03d056198a29598640f534903bce6363a5816a26
[ "BSD-3-Clause", "BSD-2-Clause", "LicenseRef-scancode-generic-cla", "BSL-1.0", "Apache-2.0" ]
permissive
shrutiramesh1988/pytorch
be34bb0c674bf27dc847b13a40b982d3d550b787
be2a4294244bc79a3f2f60f712e83a9214dfd8e2
refs/heads/master
2021-07-08T21:27:28.917944
2021-03-31T15:21:52
2021-03-31T15:21:52
233,527,778
0
0
NOASSERTION
2020-01-13T06:35:32
2020-01-13T06:35:31
null
UTF-8
C++
false
false
9,678
cpp
#include <torch/csrc/distributed/rpc/tensorpipe_utils.h> #ifdef USE_TENSORPIPE #ifdef USE_CUDA_NOT_ROCM #include <c10/core/DeviceGuard.h> #include <c10/cuda/CUDACachingAllocator.h> #endif #include <tensorpipe/tensorpipe.h> namespace torch { namespace distributed { namespace rpc { namespace { // The TensorPipe agent splits the RPC message's information across multiple // payloads. This allows the agent to provide the data to TensorPipe without // performing a copy into a single contiguous buffer, and without storing it as // metadata, which is less efficient. // First come the rpc::Message::type() and ::id(). constexpr int kTpMessageTypeIdx = 0; constexpr int kTpMessageIdIdx = 1; // Then comes the rpc::Message::payload(); constexpr int kTpMessagePayloadIdx = 2; // Last comes the pickle of rpc::Message::tensors() (with the tensors themselves // stored as, well, tensors in the tensorpipe::Message). constexpr int kTpMessagePickleIdx = 3; inline c10::Device indexToDevice(c10::DeviceIndex index) { if (index == -1) { return c10::Device(at::kCPU); } else { return c10::Device(at::kCUDA, index); } } } // namespace std::tuple<tensorpipe::Message, TensorpipeWriteBuffers> tensorpipeSerialize( Message&& rpcMessage, std::vector<c10::DeviceIndex> deviceIndices, const std::shared_ptr<LazyStreamContext>& ctx) { tensorpipe::Message tpMessage; TensorpipeWriteBuffers buffers; // Metadata buffers.type = std::make_unique<MessageType>(rpcMessage.type()); buffers.id = std::make_unique<int64_t>(rpcMessage.id()); // kTpMessageTypeIdx = 0 tpMessage.payloads.push_back( tensorpipe::Message::Payload{buffers.type.get(), sizeof(MessageType)}); // kTpMessageIdIdx = 1 tpMessage.payloads.push_back( tensorpipe::Message::Payload{buffers.id.get(), sizeof(int64_t)}); // Payload buffers.payload = std::move(rpcMessage.payload()); // TensorPipe uses the same Message class for both reading and writing, thus // it uses non-const pointers even though it doesn't modify them when writing. // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast) char* payloadPtr = const_cast<char*>(buffers.payload.data()); // kTpMessagePayloadIdx = 2 tpMessage.payloads.push_back( tensorpipe::Message::Payload{payloadPtr, buffers.payload.size()}); // Tensors buffers.tensors = cloneSparseTensors(rpcMessage.tensors()).vec(); torch::jit::Pickler pickler([&](const void* buf, size_t sz) -> size_t { buffers.pickle.insert( buffers.pickle.end(), static_cast<const char*>(buf), static_cast<const char*>(buf) + sz); return sz; }); pickler.protocol(); pickler.pushIValue(buffers.tensors); pickler.stop(); // kTpMessagePickleIdx = 3 tpMessage.payloads.push_back(tensorpipe::Message::Payload{ buffers.pickle.data(), buffers.pickle.size()}); const auto& tensorDataVec = pickler.tensorData(); for (size_t i = 0; i < tensorDataVec.size(); ++i) { // This is different from jit::getWriteableTensorData as it avoids copying // tensor to CPU. const auto& tensorData = jit::getWriteableTensorData(tensorDataVec[i], /* toCpu */ false); // Enforce memory copy if tensor is created from torch::from_blob, means // that the tensor doesn't own the memory. std::string metadata = deviceIndices.empty() || deviceIndices[i] == -1 ? "" : std::to_string(deviceIndices[i]); if (!tensorData.storageHasDeleter()) { std::vector<char> storageData( tensorData.data(), tensorData.data() + tensorData.sizeInBytes()); tpMessage.tensors.push_back(tensorpipe::Message::Tensor{ tensorpipe::CpuBuffer{storageData.data(), storageData.size()}, std::move(metadata)}); buffers.copiedTensors.push_back(std::move(storageData)); } else { // TensorPipe uses the same Message class for both reading and writing, so // it uses non-const ptrs even though it doesn't modify them when writing. // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast) char* tensorPtr = const_cast<char*>(tensorData.data()); if (tensorDataVec[i].device().is_cpu()) { tpMessage.tensors.push_back(tensorpipe::Message::Tensor{ tensorpipe::CpuBuffer{tensorPtr, tensorData.sizeInBytes()}, std::move(metadata)}); #ifdef USE_CUDA_NOT_ROCM } else if (tensorDataVec[i].device().is_cuda()) { auto stream = ctx->getStream(tensorDataVec[i].device().index()); tpMessage.tensors.push_back(tensorpipe::Message::Tensor{ tensorpipe::CudaBuffer{ tensorPtr, tensorData.sizeInBytes(), stream.stream()}, std::move(metadata)}); // record tensor data ptrs on TensorPipe streams, so that the tensors // won't be destructed before TensorPipe finishing sending them. c10::cuda::CUDACachingAllocator::recordStream( tensorDataVec[i].storage().data_ptr(), stream); #endif } else { TORCH_CHECK( false, "Attempting to send a Tensor with unexpected device type ", tensorDataVec[i].device()); } } } return std::make_tuple(std::move(tpMessage), std::move(buffers)); } TensorpipeReadBuffers tensorpipeAllocate( tensorpipe::Message& tpMessage, const std::shared_ptr<LazyStreamContext>& ctx) { TensorpipeReadBuffers buffers; TORCH_INTERNAL_ASSERT( tpMessage.payloads.size() == 4, "message expected to contain 4 payloads, whereas it contained ", tpMessage.payloads.size(), " payloads"); TORCH_INTERNAL_ASSERT( tpMessage.payloads[kTpMessageTypeIdx].length == sizeof(MessageType), "first payload expected to contain ", sizeof(MessageType), " bytes, whereas it contained ", tpMessage.payloads[kTpMessageTypeIdx].length, " bytes"); buffers.type = std::make_unique<MessageType>(); tpMessage.payloads[kTpMessageTypeIdx].data = buffers.type.get(); TORCH_INTERNAL_ASSERT( tpMessage.payloads[kTpMessageIdIdx].length == sizeof(int64_t), "second payload expected to contain ", sizeof(int64_t), " bytes, whereas it contained ", tpMessage.payloads[kTpMessageIdIdx].length, " bytes"); buffers.id = std::make_unique<int64_t>(); tpMessage.payloads[kTpMessageIdIdx].data = buffers.id.get(); // FIXME The two resizes below zero out the vectors, which is not needed. buffers.payload.resize(tpMessage.payloads[kTpMessagePayloadIdx].length); tpMessage.payloads[kTpMessagePayloadIdx].data = buffers.payload.data(); buffers.pickle.resize(tpMessage.payloads[kTpMessagePickleIdx].length); tpMessage.payloads[kTpMessagePickleIdx].data = buffers.pickle.data(); for (auto& tensor : tpMessage.tensors) { if (tensor.buffer.deviceType() == tensorpipe::DeviceType::kCpu) { buffers.tensors.emplace_back(at::getCPUAllocator()->allocate( tensor.buffer.unwrap<tensorpipe::CpuBuffer>().length)); tensor.buffer.unwrap<tensorpipe::CpuBuffer>().ptr = buffers.tensors.back().get(); #ifdef USE_CUDA_NOT_ROCM } else if (tensor.buffer.deviceType() == tensorpipe::DeviceType::kCuda) { auto deviceIndex = std::stoi(tensor.metadata); auto stream = ctx->getStream(deviceIndex); // CUDACachingAllocator will call recordStream accordingly on the current // stream. at::cuda::CUDAStreamGuard guard(stream); buffers.tensors.emplace_back( c10::cuda::CUDACachingAllocator::get()->allocate( tensor.buffer.unwrap<tensorpipe::CudaBuffer>().length)); tensor.buffer.unwrap<tensorpipe::CudaBuffer>().ptr = buffers.tensors.back().get(); tensor.buffer.unwrap<tensorpipe::CudaBuffer>().stream = stream.stream(); #endif } else { TORCH_INTERNAL_ASSERT(false, "Unrecognized TensorPipe buffer type."); } } return buffers; } Message tensorpipeDeserialize( tensorpipe::Message&& message, TensorpipeReadBuffers&& buffers) { // Tensors std::vector<at::Tensor> tensors; const char* pickleData = buffers.pickle.data(); size_t pickleLen = buffers.pickle.size(); size_t picklePos = 0; auto pickleReadFunc = [&](char* buf, size_t n) -> size_t { if (picklePos >= pickleLen || n == 0) { return 0; } size_t toCopy = std::min(picklePos + n, pickleLen) - picklePos; memcpy(buf, pickleData + picklePos, toCopy); picklePos += toCopy; return toCopy; }; auto tensorReadFunc = [&](const std::string& ename) -> at::DataPtr { unsigned long index = std::stoul(ename); return std::move(buffers.tensors.at(index)); }; // No need to pass typeResolver here, as it always processes string and // tensors only torch::jit::Unpickler unpickler( pickleReadFunc, nullptr, nullptr, tensorReadFunc, {}, /* use_storage_device*/ true); auto ival = unpickler.parse_ivalue(); for (auto&& t : ival.toTensorList()) { tensors.emplace_back(std::move(t)); } for (size_t i = 0; i < message.tensors.size(); ++i) { auto& tensor = message.tensors[i]; if (!tensor.metadata.empty()) { TORCH_INTERNAL_ASSERT( tensors[i].device() == indexToDevice(std::stoi(tensor.metadata)), "Tensor ", i, " in message ", *buffers.id, " was expected to be received on device ", tensor.metadata, ", but got it on ", tensors[i].device()); } } return Message( std::move(buffers.payload), std::move(tensors), *buffers.type, *buffers.id); } } // namespace rpc } // namespace distributed } // namespace torch #endif // USE_TENSORPIPE
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
c4e7479972964546afcf9ec8ce17108f0cb76064
08b8cf38e1936e8cec27f84af0d3727321cec9c4
/data/crawl/squid/new_hunk_1157.cpp
5f326b8391c45cc678e285ce785de239497ab7cb
[]
no_license
ccdxc/logSurvey
eaf28e9c2d6307140b17986d5c05106d1fd8e943
6b80226e1667c1e0760ab39160893ee19b0e9fb1
refs/heads/master
2022-01-07T21:31:55.446839
2018-04-21T14:12:43
2018-04-21T14:12:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
391
cpp
debugs(84, DBG_CRITICAL, "WARNING: All " << hlp->childs.n_active << "/" << hlp->childs.n_max << " " << hlp->id_name << " processes are busy."); debugs(84, DBG_CRITICAL, "WARNING: " << hlp->stats.queue_size << " pending requests queued"); debugs(84, DBG_CRITICAL, "WARNING: Consider increasing the number of " << hlp->id_name << " processes in your config file."); } static void
[ "993273596@qq.com" ]
993273596@qq.com
411dcabf30c74ccd7f42d180aaedeab9054f57c3
d2f653983bf762869ccb8783394038609020c887
/src/XMLDataTypes.hpp
0b5c9760245c69b75f13be7c2b2946f5303ef66e
[]
no_license
stefanhepp/mscop-rmc
6487584507fd87dac2adac3e44bd684e3be225a2
bbe1b816101ac1b075f809a6c1eeeb47332d3de2
refs/heads/master
2016-09-15T17:43:22.366910
2014-03-10T06:01:00
2014-03-10T06:01:00
17,491,572
1
0
null
null
null
null
UTF-8
C++
false
false
2,271
hpp
/* * DataTypes.hpp * * Created on: Mar 4, 2014 * Author: ioan */ #ifndef XMLDATATYPES_HPP_ #define XMLDATATYPES_HPP_ #include <iostream> #include <ctime> #include <list> #include <string> struct _StationDuration_{ std::string _stationCode; int _drivingMinutes; /** * as a convention if the direction for the constructionYard is From then _direction is true * otherwise it is false; * */ bool _direction; }; struct _ConstructionYard_{ std::string _code; int _waitingMinutes; std::list<_StationDuration_> _stationDuration; }; struct _Order_{ std::string _orderCode; int _priority; std::string _preferredStationCode; float _volume; bool _maxVolumeAllowed; float _dischargeRate; int _pumpLength; std::string _startTime; time_t _unixTimeStamp; bool _isPickup; _ConstructionYard_ *_constructionYard; _Order_() : _priority(0), _volume(0), _maxVolumeAllowed(false) , _dischargeRate(0), _pumpLength(0), _unixTimeStamp(0), _isPickup(false), _constructionYard(0){ } ~_Order_() { if (_constructionYard) delete _constructionYard; } }; struct _Vehicle_{ std::string _vehicleCode; std::string _vehicleType; int _pumpLength; int _normalVolume; int _maximumVolume; float _dischargeRate; std::string _nextAvailableTime; time_t _nextAvailabelTimeStampUnix; }; struct _Station_{ std::string _stationCode; int _loadingMinutes; }; /* * struct that keeps the information regarding construction site => station duration * time from the station to the construction site and directions */ typedef struct _StationDuration_ XMLStationDuration; /* * struct that keeps the information regarding each of the stations */ typedef struct _Station_ XMLStation; /* * struct that keeps the information regarding each construction site. It contains a list of * StationDurations as member. */ typedef struct _ConstructionYard_ XMLConstructionYard; /* * Struct that keeps information regarding a single vehicle */ typedef struct _Vehicle_ XMLVehicle; /* * Struct that keeps the information regarding each order. Each of them has a member of type * ConstructionYard, in this way we keep track of what to be delivered and where */ typedef struct _Order_ XMLOrder; #endif /* XMLDATATYPES_HPP_ */
[ "stefan@stefant.org" ]
stefan@stefant.org
351e00c6da04b37effbbc9fe9b9b6b4abe5380a2
6cde110fa503c660c7fc32ca836c9a0ca94d6856
/voxels/voxel.cpp
d219c36437b5b817bf31569c35c01d5780f422ae
[]
no_license
eliseybg/Course-work-Minecraft
6e0edcfddb884af55248ec10dae52e440e20f6bc
582ba40b2c464180607a01e677ae6634f1743b7b
refs/heads/master
2023-02-17T11:05:59.458155
2021-01-20T16:28:16
2021-01-20T16:28:16
331,362,973
0
0
null
null
null
null
UTF-8
C++
false
false
21
cpp
#include "voxel.hpp"
[ "57315212+eliseybg@users.noreply.github.com" ]
57315212+eliseybg@users.noreply.github.com
16f9df389c5721f03b7aaa296a62b8e34e00e3fc
c0a32e2c6123b5aee91836c5771d019d9f8c1a96
/2020/5/cg/lab6/lab6minecraft/lab6/World/Block/Types/BWater.cpp
4529758f1f2585579f640ca685048b4dbb699bbe
[]
no_license
blackdrako/Study
7dfec76c321b47eea59be61f71c236b6c255be3e
460b414120fbfdc2956798ec2d5a1d3f6c5ea171
refs/heads/master
2021-06-21T21:43:22.013938
2021-05-14T09:53:24
2021-05-14T09:53:24
221,056,139
1
0
null
null
null
null
UTF-8
C++
false
false
119
cpp
#include "BWater.h" #include "../../World.h" namespace Block { BWater::BWater() : Type ("Water") { } }
[ "blackdrako@users.noreply.github.com" ]
blackdrako@users.noreply.github.com
63a5462c6ed2977183490f740e1340d7bc6ed34c
f1d0ea36f07c2ef126dec93208bd025aa78eceb7
/Zen/EnterprisePlugins/Session/SessionServer/I_SessionService.hpp
75398d5e072271d5cbf01d0749eb0b1373a6c4d0
[]
no_license
SgtFlame/indiezen
b7d6f87143b2f33abf977095755b6af77e9e7dab
5513d5a05dc1425591ab7b9ba1b16d11b6a74354
refs/heads/master
2020-05-17T23:57:21.063997
2016-09-05T15:28:28
2016-09-05T15:28:28
33,279,102
3
0
null
null
null
null
UTF-8
C++
false
false
3,203
hpp
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ // Zen Enterprise Framework // // Copyright (C) 2001 - 2010 Tony Richards // Copyright (C) 2008 - 2010 Matthew Alan Gray // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. // // Tony Richards trichards@indiezen.com // Matthew Alan Gray mgray@indiezen.org //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ #ifndef ZEN_ENTERPRISE_SESSION_SERVER_I_SESSION_SERVICE_HPP_INCLUDED #define ZEN_ENTERPRISE_SESSION_SERVER_I_SESSION_SERVICE_HPP_INCLUDED #include "Configuration.hpp" #include <Zen/EnterprisePlugins/Session/SessionClient/I_SessionService.hpp> //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ namespace Zen { namespace Enterprise { namespace Session { namespace Server { //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ class I_Session; /// Session Service interface. /// @see I_ApplicationServer::getApplication() to get an instance of an /// implementation of this interface. class SESSION_SERVER_DLL_LINK I_SessionService : public Zen::Enterprise::Session::Client::I_SessionService { /// @name Types /// @{ public: typedef Zen::Memory::managed_ptr<Server::I_Session> pServerSession_type; /// @} /// @name I_SessionService interface /// @{ public: /// Subscribe to a session service. /// If an existing subscription exists, it is replaced with the one obtained by this method. virtual void subscribe(Enterprise::Session::I_Session& _session, pEndpoint_type _pEndpoint, pResourceLocation_type _pLocation) = 0; /// Remotely terminate a session. /// This service must be in possession of a valid subscription before calling this method. /// @see subscribe(). virtual void terminateSession(pServerSession_type _pSession) = 0; /// @} /// @name 'Structors /// @{ public: I_SessionService(); virtual ~I_SessionService(); /// @} }; // interface I_SessionService //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ } // namespace Server } // namespace Session } // namespace Enterprise } // namespace Zen //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ #endif // ZEN_ENTERPRISE_SESSION_SERVER_I_SESSION_SERVICE_HPP_INCLUDED
[ "mgray@wintermute" ]
mgray@wintermute
203102ac83f60115c8515b255e3db96657ec018e
21bcedc4fa3f3b352f2a7952588d199a80f0d4a7
/src/blink/protorpc/RpcServer.h
9b930f591f567104f072b1239c5dab90a3a31724
[ "BSD-3-Clause" ]
permissive
liyuan989/blink
c1a4ae4cb92a567ecdf4a12f1db0bec22a6f962a
7a0d1367d800df78a404aeea13527cd9508fbf4d
refs/heads/master
2016-09-05T11:13:37.503470
2015-04-14T11:35:40
2015-04-14T11:35:40
29,411,173
13
2
null
null
null
null
UTF-8
C++
false
false
1,038
h
#ifndef __BLINK_PROTORPC_RPCSERVER_H__ #define __BLINK_PROTORPC_RPCSERVER_H__ #include <blink/Nocopyable.h> #include <blink/TcpServer.h> namespace google { namespace protobuf { class Service; } // namespace protobuf } // namespace google namespace blink { class RpcServer : Nocopyable { public: RpcServer(EventLoop* loop, const InetAddress& listen_addr, const string& name_arg); void setThreadNumer(int n) { server_.setThreadNumber(n); } const string& name() const { return server_.name(); } void registerService(::google::protobuf::Service* service); void start(); private: void onConnection(const TcpConnectionPtr& connection); // void onMessage(const TcpConnectionPtr& connection, // Buffer* buf, // Timestamp receive_time); TcpServer server_; std::map<std::string, ::google::protobuf::Service*> services_; }; } // namespace blink #endif
[ "liyuan989@gmail.com" ]
liyuan989@gmail.com
4cd598e67f1869b8813a5be48911d119487c0962
957bf6619d2d5edd789bfdf0bb147197a962fdf8
/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp
30613261183772ef17a761ad6a5b7d60c81024f6
[ "MIT" ]
permissive
gibtang/CCNSCoding
f03bf4bf7ae0cb6239141b73ac54106d61e90804
2c308c67752c8d5137a81ed4df316cc137015886
refs/heads/master
2021-04-09T16:59:49.425508
2014-04-14T02:21:53
2014-04-14T02:21:53
18,506,094
1
1
null
null
null
null
UTF-8
C++
false
false
4,266
cpp
#include "ProjectileController.h" #include "SceneController.h" #include "EnemyController.h" using namespace cocos2d; ProjectileController::ProjectileController(void) { _name = "ProjectileController"; } ProjectileController::~ProjectileController(void) { } bool ProjectileController::init() { return true; } void ProjectileController::onEnter() { auto winSize = Director::getInstance()->getVisibleSize(); auto origin = Director::getInstance()->getVisibleOrigin(); _owner->setPosition( Point(origin.x+20, origin.y+winSize.height/2) ); _owner->setTag(3); auto com = _owner->getParent()->getComponent("SceneController"); ((SceneController*)com)->getProjectiles()->addObject(_owner); } void ProjectileController::onExit() { } void ProjectileController::update(float delta) { auto com = _owner->getParent()->getComponent("SceneController"); auto _targets = ((SceneController*)com)->getTargets(); auto projectile = dynamic_cast<Sprite*>(_owner); auto projectileRect = Rect( projectile->getPosition().x - (projectile->getContentSize().width/2), projectile->getPosition().y - (projectile->getContentSize().height/2), projectile->getContentSize().width, projectile->getContentSize().height); auto targetsToDelete = Array::createWithCapacity(20); Object* jt = NULL; CCARRAY_FOREACH(_targets, jt) { auto target = dynamic_cast<Sprite*>(jt); auto targetRect = Rect( target->getPosition().x - (target->getContentSize().width/2), target->getPosition().y - (target->getContentSize().height/2), target->getContentSize().width, target->getContentSize().height); // if (Rect::RectIntersectsRect(projectileRect, targetRect)) if (projectileRect.intersectsRect(targetRect)) { targetsToDelete->addObject(target); } } CCARRAY_FOREACH(targetsToDelete, jt) { auto target = dynamic_cast<Sprite*>(jt); static_cast<EnemyController*>(target->getComponent("EnemyController"))->die(); } bool isDied = targetsToDelete->count() > 0; if (isDied) { die(); } } ProjectileController* ProjectileController::create(void) { ProjectileController * pRet = new ProjectileController(); if (pRet && pRet->init()) { pRet->autorelease(); } else { CC_SAFE_DELETE(pRet); } return pRet; } void freeFunction( Node *ignore ) { log("hello"); } void ProjectileController::move(float flocationX, float flocationY) { auto winSize = Director::getInstance()->getVisibleSize(); auto origin = Director::getInstance()->getVisibleOrigin(); // Determinie offset of location to projectile float offX = flocationX - _owner->getPosition().x; float offY = flocationY - _owner->getPosition().y; // Bail out if we are shooting down or backwards if (offX <= 0) return; // Ok to add now - we've double checked position // Determine where we wish to shoot the projectile to float realX = origin.x + winSize.width + (_owner->getContentSize().width/2); float ratio = offY / offX; float realY = (realX * ratio) + _owner->getPosition().y; Point realDest = Point(realX, realY); // Determine the length of how far we're shooting float offRealX = realX - _owner->getPosition().x; float offRealY = realY - _owner->getPosition().y; float length = sqrtf((offRealX * offRealX) + (offRealY*offRealY)); float velocity = 480/1; // 480pixels/1sec float realMoveDuration = length/velocity; auto callfunc = CallFuncN::create( CC_CALLBACK_1( SceneController::spriteMoveFinished, static_cast<SceneController*>( getOwner()->getParent()->getComponent("SceneController") ) ) ); // Move projectile to actual endpoint _owner->runAction( Sequence::create( MoveTo::create(realMoveDuration, realDest), callfunc, NULL) ); } void ProjectileController::die() { auto com = _owner->getParent()->getComponent("SceneController"); auto _projectiles = static_cast<SceneController*>(com)->getProjectiles(); _projectiles->removeObject(_owner); _owner->removeFromParentAndCleanup(true); }
[ "gibtang@gmail.com" ]
gibtang@gmail.com
8cb9ab7717066b61eef6bc3f2e632ea0697707c5
2c6a95057f85c8119e41c8e8e6cb9b1abc63ed3b
/old/DemiurgeCompiler/AstNodes/FunctionAst.cpp
7ab8e69496dcad08a17f096a5837cf0e6d6f9c7b
[]
no_license
traplol/demiurge-lang
b77b72687b559d30b8ded0a0c8126a74d732b156
1863be0e6870a4f5d548406fdc913bcb6d48a988
refs/heads/master
2016-09-15T17:28:39.790036
2015-08-08T22:04:58
2015-08-08T22:04:58
22,275,094
1
0
null
null
null
null
UTF-8
C++
false
false
4,097
cpp
#include "llvm/IR/Function.h" #include "llvm/IR/Verifier.h" #include "llvm/Support/raw_ostream.h" #include "llvm/PassManager.h" #include "FunctionAst.h" #include "../CodeGenerator/CodeGenerator.h" #include "../CodeGenerator/CodeGeneratorHelpers.h" #include "../DEFINES.h" using namespace llvm; FunctionAst::FunctionAst(PrototypeAst *prototype, const std::vector<IAstExpression*> &functionBody, int line, int column) : Prototype(prototype) , FunctionBody(functionBody) { Pos.LineNumber = line; Pos.ColumnNumber = column; } FunctionAst::~FunctionAst() { delete Prototype; while (!FunctionBody.empty()) delete FunctionBody.back(), FunctionBody.pop_back(); } PossiblePosition FunctionAst::getPos() const { return Pos; } PrototypeAst *FunctionAst::getPrototype() const { return Prototype; } Function *FunctionAst::Codegen(CodeGenerator *codegen) { codegen->clearNamedValues(); Function *func = this->Prototype->Codegen(codegen); codegen->setCurrentFunction(func); if (func == nullptr) { return Helpers::Error(this->Prototype->getPos(), "Failed to create function!"); } // Create our entry block BasicBlock *entryBB = BasicBlock::Create(codegen->getContext(), "entry", func); // head of the function //codegen->setReturnBlock(retBB); // save our return block to jump to. codegen->getBuilder().SetInsertPoint(entryBB); this->Prototype->CreateArgumentAllocas(codegen, func); Type *returnType = this->Prototype->getReturnType()->GetLLVMType(codegen); AllocaInst *retVal = nullptr; if (!func->getReturnType()->isVoidTy()) { // if the function is not void, create a pointer to the return value retVal = Helpers::CreateEntryBlockAlloca(codegen, func, COMPILER_RETURN_VALUE_STRING, returnType); codegen->setNamedValue(COMPILER_RETURN_VALUE_STRING, retVal); } codegen->setOutsideBlock(nullptr); // if the merge block is a nullptr we will know we are at depth 0 Helpers::EmitScopeBlock(codegen, this->FunctionBody); // Go back and look for any blocks without a terminator and branch it to the next block // this is typically used to jump back after a scope finishes. Helpers::LinkBlocksWithoutTerminator(codegen, func); BasicBlock *retBB = BasicBlock::Create(codegen->getContext(), "return", func); // where a return will be branched to on void return type. if (codegen->getBuilder().GetInsertBlock()->getTerminator() == nullptr) { // missing a terminator, try to branch to default return block. codegen->getBuilder().CreateBr(retBB); // Switch to the return block codegen->getBuilder().SetInsertPoint(retBB); // Load the return value and get ready to return it. if (func->getReturnType()->isVoidTy()) { codegen->getBuilder().CreateRetVoid(); } else if (retVal != nullptr) { Value *derefRetVal = codegen->getBuilder().CreateLoad(retVal, COMPILER_RETURN_VALUE_STRING); // return the function's return value. codegen->getBuilder().CreateRet(derefRetVal); } // if something else went wrong, we shouldn't reach this far retBB = codegen->getBuilder().GetInsertBlock(); } else { retBB->removeFromParent(); } if (codegen->getOutsideBlock() != nullptr && codegen->getOutsideBlock()->getTerminator() == nullptr) { // do some branch cleanup codegen->getOutsideBlock()->removeFromParent(); } if (verifyFunction(*func, &errs())) { // more branch cleanup if (codegen->getDumpOnFail()) { func->dump(); } func->eraseFromParent(); return Helpers::Error(this->Pos, "Error creating function body."); } else { // try to optimize the function by running the function pass manager //codegen->getTheFPM()->run(*func); } codegen->setCurrentFunction(nullptr); return func; // might as well return the generated function for potential closure support later. }
[ "max.mickey1991@gmail.com" ]
max.mickey1991@gmail.com
9952c0d45da5ace44640d0a3c7ca1c09ac69a1bd
a3186cf077aa320b38fd6e686a216ad937081f0a
/node_modules/nodegit/include/config_entry.h
660b761ec55149d7f23c7429779edb96440e2a75
[ "MIT" ]
permissive
Kly4/AWSomeButton
746023b316ff7fa23938fe0b343dc9c0d138bde3
ebabe0a0f304d933cf03451546219101b709af7f
refs/heads/master
2021-04-26T11:39:04.923461
2016-03-17T22:19:05
2016-03-17T22:19:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
904
h
#ifndef GITCONFIGENTRY_H #define GITCONFIGENTRY_H // generated from class_header.h #include <nan.h> #include <string> #include <queue> #include "async_baton.h" #include "promise_completion.h" extern "C" { #include <git2.h> } #include "../include/typedefs.h" using namespace node; using namespace v8; class GitConfigEntry : public Nan::ObjectWrap { public: static Nan::Persistent<Function> constructor_template; static void InitializeComponent (Local<v8::Object> target); git_config_entry *GetValue(); git_config_entry **GetRefValue(); void ClearValue(); static Local<v8::Value> New(void *raw, bool selfFreeing); bool selfFreeing; private: GitConfigEntry(git_config_entry *raw, bool selfFreeing); ~GitConfigEntry(); static NAN_METHOD(JSNewFunction); static NAN_METHOD(Name); static NAN_METHOD(Value); static NAN_METHOD(Level); git_config_entry *raw; }; #endif
[ "ashablygin@umass.edu" ]
ashablygin@umass.edu
931d832a953ed65f5fa8a2be017fd0a9233175d0
50355a8fed7687f8d0254748e0a3069c87a4a0f0
/FramebufferNativeWindow.cpp
9972d565aa1d41a7d0e556b3fbc645d420a29175
[ "Apache-2.0" ]
permissive
hampelratte/md86597_frameworks_base_libs_ui
55c69117b27dad6294cc892c1d37a4177e2b8b74
66209b3e23e9b4026be120734d44cbd324bbff5a
refs/heads/master
2016-09-11T02:00:23.850477
2012-10-03T17:46:31
2012-10-03T17:46:31
6,063,975
0
1
null
null
null
null
UTF-8
C++
false
false
14,431
cpp
/* ** ** Copyright 2007 The Android Open Source Project ** ** 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. */ #define LOG_TAG "FramebufferNativeWindow" #include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <cutils/log.h> #include <cutils/atomic.h> #include <utils/threads.h> #include <utils/RefBase.h> #include <ui/Rect.h> #include <ui/FramebufferNativeWindow.h> #include <EGL/egl.h> #include <pixelflinger/format.h> #include <pixelflinger/pixelflinger.h> #include <hardware/hardware.h> #include <hardware/gralloc.h> #include <private/ui/android_natives_priv.h> #include <sys/ioctl.h> #include <fcntl.h> // ---------------------------------------------------------------------------- namespace android { // ---------------------------------------------------------------------------- class NativeBuffer : public EGLNativeBase< android_native_buffer_t, NativeBuffer, LightRefBase<NativeBuffer> > { public: NativeBuffer(int w, int h, int f, int u) : BASE() { android_native_buffer_t::width = w; android_native_buffer_t::height = h; android_native_buffer_t::format = f; android_native_buffer_t::usage = u; } private: friend class LightRefBase<NativeBuffer>; ~NativeBuffer() { }; // this class cannot be overloaded }; /* * This implements the (main) framebuffer management. This class is used * mostly by SurfaceFlinger, but also by command line GL application. * * In fact this is an implementation of android_native_window_t on top of * the framebuffer. * * Currently it is pretty simple, it manages only two buffers (the front and * back buffer). * */ FramebufferNativeWindow::FramebufferNativeWindow() : BASE(), fbDev(0), grDev(0), mUpdateOnDemand(false) { hw_module_t const* module; if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module) == 0) { int stride; int err; err = framebuffer_open(module, &fbDev); LOGE_IF(err, "couldn't open framebuffer HAL (%s)", strerror(-err)); err = gralloc_open(module, &grDev); LOGE_IF(err, "couldn't open gralloc HAL (%s)", strerror(-err)); // bail out if we can't initialize the modules if (!fbDev || !grDev) return; mUpdateOnDemand = (fbDev->setUpdateRect != 0); // initialize the buffer FIFO mNumBuffers = 2; mNumFreeBuffers = 2; mBufferHead = mNumBuffers-1; buffers[0] = new NativeBuffer( fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB); buffers[1] = new NativeBuffer( fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB); err = grDev->alloc(grDev, fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB, &buffers[0]->handle, &buffers[0]->stride); LOGE_IF(err, "fb buffer 0 allocation failed w=%d, h=%d, err=%s", fbDev->width, fbDev->height, strerror(-err)); err = grDev->alloc(grDev, fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB, &buffers[1]->handle, &buffers[1]->stride); LOGE_IF(err, "fb buffer 1 allocation failed w=%d, h=%d, err=%s", fbDev->width, fbDev->height, strerror(-err)); const_cast<uint32_t&>(android_native_window_t::flags) = fbDev->flags; const_cast<float&>(android_native_window_t::xdpi) = fbDev->xdpi; const_cast<float&>(android_native_window_t::ydpi) = fbDev->ydpi; const_cast<int&>(android_native_window_t::minSwapInterval) = fbDev->minSwapInterval; const_cast<int&>(android_native_window_t::maxSwapInterval) = fbDev->maxSwapInterval; } else { LOGE("Couldn't get gralloc module"); } android_native_window_t::setSwapInterval = setSwapInterval; android_native_window_t::dequeueBuffer = dequeueBuffer; android_native_window_t::lockBuffer = lockBuffer; android_native_window_t::queueBuffer = queueBuffer; android_native_window_t::query = query; android_native_window_t::perform = perform; //[BEGIN] add by ethaen android_native_window_t::fd = getDeviceFD(); //END //[END] // [BEGIN] skyviia modify: fix lock display issue if framework reboot without unlock display. // fix me! #ifdef SV886X // if (ioctl(android_native_window_t::fd, SKYFB_UNLOCK_DISPLAY) == -1) { // LOGE("unlock display failed !\n"); // } else { // LOGI("unlock display OK !\n"); // } #endif // [END] } FramebufferNativeWindow::~FramebufferNativeWindow() { if (grDev) { if (buffers[0] != NULL) grDev->free(grDev, buffers[0]->handle); if (buffers[1] != NULL) grDev->free(grDev, buffers[1]->handle); gralloc_close(grDev); } if (fbDev) { framebuffer_close(fbDev); } } status_t FramebufferNativeWindow::setUpdateRectangle(const Rect& r) { if (!mUpdateOnDemand) { return INVALID_OPERATION; } return fbDev->setUpdateRect(fbDev, r.left, r.top, r.width(), r.height()); } status_t FramebufferNativeWindow::compositionComplete() { if (fbDev->compositionComplete) { return fbDev->compositionComplete(fbDev); } return INVALID_OPERATION; } int FramebufferNativeWindow::setSwapInterval( android_native_window_t* window, int interval) { framebuffer_device_t* fb = getSelf(window)->fbDev; return fb->setSwapInterval(fb, interval); } int FramebufferNativeWindow::dequeueBuffer(android_native_window_t* window, android_native_buffer_t** buffer) { FramebufferNativeWindow* self = getSelf(window); Mutex::Autolock _l(self->mutex); framebuffer_device_t* fb = self->fbDev; // wait for a free buffer while (!self->mNumFreeBuffers) { self->mCondition.wait(self->mutex); } // get this buffer self->mNumFreeBuffers--; int index = self->mBufferHead++; if (self->mBufferHead >= self->mNumBuffers) self->mBufferHead = 0; *buffer = self->buffers[index].get(); return 0; } int FramebufferNativeWindow::lockBuffer(android_native_window_t* window, android_native_buffer_t* buffer) { FramebufferNativeWindow* self = getSelf(window); Mutex::Autolock _l(self->mutex); // wait that the buffer we're locking is not front anymore while (self->front == buffer) { self->mCondition.wait(self->mutex); } return NO_ERROR; } int FramebufferNativeWindow::queueBuffer(android_native_window_t* window, android_native_buffer_t* buffer) { FramebufferNativeWindow* self = getSelf(window); Mutex::Autolock _l(self->mutex); framebuffer_device_t* fb = self->fbDev; buffer_handle_t handle = static_cast<NativeBuffer*>(buffer)->handle; int res = fb->post(fb, handle); self->front = static_cast<NativeBuffer*>(buffer); self->mNumFreeBuffers++; self->mCondition.broadcast(); return res; } int FramebufferNativeWindow::query(android_native_window_t* window, int what, int* value) { FramebufferNativeWindow* self = getSelf(window); Mutex::Autolock _l(self->mutex); framebuffer_device_t* fb = self->fbDev; switch (what) { case NATIVE_WINDOW_WIDTH: *value = fb->width; return NO_ERROR; case NATIVE_WINDOW_HEIGHT: *value = fb->height; return NO_ERROR; case NATIVE_WINDOW_FORMAT: *value = fb->format; return NO_ERROR; } *value = 0; return BAD_VALUE; } int FramebufferNativeWindow::perform(android_native_window_t* window, int operation, ...) { switch (operation) { case NATIVE_WINDOW_SET_USAGE: case NATIVE_WINDOW_CONNECT: case NATIVE_WINDOW_DISCONNECT: break; default: return NAME_NOT_FOUND; } return NO_ERROR; } // [BEGIN] skyviia modify: #ifdef SV886X void FramebufferNativeWindow::mapDisp2Params(void) { /* remove by ethan if (android_native_window_t::fd >= 0 && mFbAddr[0] != 0 && mFbAddr[1] != 0) { struct skyfb_api_display_parm param; param.display = SKYFB_DISP2; param.input_format = INPUT_FORMAT_ARGB; param.start_x = 0; //(sky_get_graphic_device_info.width - display2_width) / 2; //Original Point X position param.start_y = 0; //(sky_get_graphic_device_info.height - display2_height) / 2; //Original Point Y position param.width_in = mFb[mIndex].width; //display2_width; param.height_in = mFb[mIndex].height; //display2_height; param.stride = mFb[mIndex].width; //display2_width; param.alpha = 0x00; //Control by image alpha //0xff; param.y_addr = mFbAddr[mIndex]; //sky_get_graphic_device_info.fb_base_addr + sky_get_graphic_device_info.y_offset; param.u_addr = 0; //sky_get_graphic_device_info.fb_base_addr + sky_get_graphic_device_info.y_offset + 320 * 480; param.v_addr = 0; if (ioctl(android_native_window_t::fd, SKYFB_SET_DISPLAY_PARM, &param) == -1) { LOGD("mapDisp2Params() -> SKYFB_SET_DISPLAY_PARM failed\n"); } }*/ } void FramebufferNativeWindow::turnDisp2On(bool bTurnOn) { // Turn off display2 for now. /*if (android_native_window_t::fd >= 0) { struct skyfb_api_display_status d2status; d2status.display = SKYFB_DISP2; d2status.status = bTurnOn ? SKYFB_ON : SKYFB_OFF; if (ioctl(android_native_window_t::fd,SKYFB_SET_DISPLAY_STATUS, &d2status) == -1) { LOGD("turnDisp2On() -> SKYFB_SET_DISPLAY_STATUS failed\n"); } } */ } void FramebufferNativeWindow::setDisp2Addr(void) { /* if (android_native_window_t::fd >= 0 && mFbAddr[0] != 0 && mFbAddr[1] != 0) { struct skyfb_api_display_addr param; param.display = SKYFB_DISP2; //display1 or display2 param.y_addr = mFbAddr[mIndex]; //YCC420, ARGB param.u_addr = 0; //YCC420 param.v_addr = 0; //none use in ARGB and YCC420 mode if (ioctl(android_native_window_t::fd, SKYFB_SET_DISPLAY_ADDR, &param) == -1) { LOGD("setDisp2Addr() -> SKYFB_SET_DISPLAY_ADDR failed\n"); } } */ } void FramebufferNativeWindow::preResetAlpha(void) { /* if (android_native_window_t::fd >= 0) { struct skyfb_api_bitblt bb; bb.src_addr = mFbAddr[mIndex]; // + (r.left + android_native_buffer_t::stride * r.top) * bpp; bb.dst_addr = mFbAddr[1-mIndex]; // + (r.left + android_native_buffer_t::stride * r.top) * bpp; bb.width = mFb[1-mIndex].width; bb.height = mFb[1-mIndex].height; bb.src_stride = android_native_buffer_t::stride; bb.dst_stride = android_native_buffer_t::stride; bb.direction = 0;//BB_DIR_START_UL; bb.alpha_value_from = 0;//AV_FROM_REG; bb.alpha_value = 0x00; bb.alpha_blend_status = 1;//SKYFB_ON; bb.alpha_blend_from = 0; bb.alpha_blend_value = 0x00; if (ioctl(android_native_window_t::fd, SKYFB_2D_BITBLT, &bb) == -1) { LOGE("preResetAlpha() -> SKYFB_2D_BITBLT error!"); } }*/ } #endif // [BEGIN] set display mode int32_t FramebufferNativeWindow::setDisplayMode(int mode) { #ifdef SV886X int fd = android_native_window_t::fd; if (fd < 0) { return -errno; } if (ioctl(fd, SKYFB_SET_MODE_ONLY, &mode) != 0) { LOGE("Set Display Mode failed!"); return -errno; } // TODO: must notice this issue! //regetSurfaceInfo(); #else // running in the emulator! LOGD("set mode in emulator is forbidden!"); #endif return NO_ERROR; } // [BEGIN] set display mode uint32_t FramebufferNativeWindow::getDisplayMode() { #ifdef SV886X int fd = android_native_window_t::fd; if (fd < 0) { return -errno; } uint32_t mode; if (ioctl(fd, SKYFB_GET_MODE, &mode) != 0) { LOGE("Get Display Mode failed!"); return -errno; } // return uint32_t = (mode << 16) | format return mode; #else // running in the emulator! LOGD("get mode in emulator is forbidden!"); #endif return NO_ERROR; } // [BEGIN] Support hardware cursor int32_t FramebufferNativeWindow::setCursorBmp(uint8_t *bmpCursor, int size) { #ifdef SV886X int fd = android_native_window_t::fd; if (fd < 0) { return -errno; } if (ioctl(fd, SKYFB_CURSOR_SET_BITMAP, bmpCursor) == -1) { LOGE("Set cursor bitmap failed!"); return -errno; } #endif return NO_ERROR; } int32_t FramebufferNativeWindow::setCursorPos(int enable, int x, int y, int alpha) { #ifdef SV886X int fd = android_native_window_t::fd; if (fd < 0) { return -errno; } skyfb_api_cursor_parm params; params.status = enable; params.xpos = x; params.ypos = y; params.alpha = alpha; if (ioctl(fd, SKYFB_CURSOR_SET_PARM, &params) == -1) { LOGE("Not support set cursor parameter."); return -errno; } #endif return NO_ERROR; } //add by ethan int32_t FramebufferNativeWindow::getDeviceFD() { #ifdef SV886X char const * const device_template[] = { "/dev/graphics/fb%u", "/dev/fb%u", 0 }; int fd = -1; int i=0; char name[64]; while ((fd==-1) && device_template[i]) { snprintf(name, 64, device_template[i], 0); fd = open(name, O_RDWR, 0); } if (fd < 0) return -errno; else return fd; #endif return NO_ERROR; } // [END] // ---------------------------------------------------------------------------- }; // namespace android // ---------------------------------------------------------------------------- using namespace android; EGLNativeWindowType android_createDisplaySurface(void) { FramebufferNativeWindow* w; w = new FramebufferNativeWindow(); if (w->getDevice() == NULL) { // get a ref so it can be destroyed when we exit this block sp<FramebufferNativeWindow> ref(w); return NULL; } return (EGLNativeWindowType)w; }
[ "henrik.niehaus@gmx.de" ]
henrik.niehaus@gmx.de
9316d46414e4a2bddeede2c85f405e172eb5a379
d4b8199a117146535df82822c40009c3456138ab
/src/bdm/logger/logger.hxx
488a6f95d13f5e0d76e055ab5c955555d907e663
[ "MIT" ]
permissive
turenar/bdm
e55dd70263c557755dd49ac7222f9f81ad246ea5
4032a4e7da1508980ab5931a52bfbd7def42ee82
refs/heads/master
2021-05-13T21:26:34.206936
2018-01-11T10:05:52
2018-01-11T10:05:52
116,461,069
0
0
null
null
null
null
UTF-8
C++
false
false
664
hxx
#pragma once #include <g3log/g3log.hpp> #include "log_levels.hxx" #ifdef NDEBUG struct empty_stream { }; template<typename T> inline empty_stream& operator<<(empty_stream& st, T&) { return st; } #undef LOG #define LOG(level) (empty_stream()) #undef LOG_IF #define LOG_IF(level, boolean_expression) LOG(level) #undef CHECK #define CHECK(boolean_expression) (empty_stream()) #undef LOGF #define LOGF(level, printf_like_message, ...) LOG(level) #undef LOGF_IF #define LOGF_IF(level, boolean_expression, printf_like_message, ...) LOG(level) #undef CHECKF #define CHECKF(boolean_expression, printf_like_message, ...) CHECK(boolean_expression) #undef CHECK_F #endif
[ "eclair@turenar.xyz" ]
eclair@turenar.xyz
be34424608bc7124b924ae15f767951245b6ec69
cf7c928d6066da1ce15d2793dcf04315dda9b9ed
/Baekjoon_Online_Judge/단계/01 입출력과 사칙연산/Main_BOJ_1008_A_B.cpp
e9f6f6705f5f49e4e6077a7082c0c8f844b6a6f9
[]
no_license
refresh6724/APS
a261b3da8f53de7ff5ed687f21bb1392046c98e5
945e0af114033d05d571011e9dbf18f2e9375166
refs/heads/master
2022-02-01T23:31:42.679631
2021-12-31T14:16:04
2021-12-31T14:16:04
251,617,280
0
0
null
null
null
null
UTF-8
C++
false
false
124
cpp
#include <iostream> using namespace std; int main() { double a, b; cin >> a >> b; printf("%.12lf", a/b); return 0; }
[ "refresh6724@gmail.com" ]
refresh6724@gmail.com
55b35f1a2dad1430d2ccc3c02d673e9a5b6b1feb
948f4e13af6b3014582909cc6d762606f2a43365
/testcases/juliet_test_suite/testcases/CWE590_Free_Memory_Not_on_Heap/s02/CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_82.h
8323cb2cd917882cd6f8a1aafe0520723591c3a2
[]
no_license
junxzm1990/ASAN--
0056a341b8537142e10373c8417f27d7825ad89b
ca96e46422407a55bed4aa551a6ad28ec1eeef4e
refs/heads/master
2022-08-02T15:38:56.286555
2022-06-16T22:19:54
2022-06-16T22:19:54
408,238,453
74
13
null
2022-06-16T22:19:55
2021-09-19T21:14:59
null
UTF-8
C++
false
false
1,376
h
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_82.h Label Definition File: CWE590_Free_Memory_Not_on_Heap__delete_array.label.xml Template File: sources-sink-82.tmpl.h */ /* * @description * CWE: 590 Free Memory Not on Heap * BadSource: alloca Data buffer is allocated on the stack with alloca() * GoodSource: Allocate memory on the heap * Sinks: * BadSink : Print then free data * Flow Variant: 82 Data flow: data passed in a parameter to a virtual method called via a pointer * * */ #include "std_testcase.h" #include <wchar.h> namespace CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_82 { class CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_82_base { public: /* pure virtual function */ virtual void action(wchar_t * data) = 0; }; #ifndef OMITBAD class CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_82_bad : public CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_82_base { public: void action(wchar_t * data); }; #endif /* OMITBAD */ #ifndef OMITGOOD class CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_82_goodG2B : public CWE590_Free_Memory_Not_on_Heap__delete_array_wchar_t_alloca_82_base { public: void action(wchar_t * data); }; #endif /* OMITGOOD */ }
[ "yzhang0701@gmail.com" ]
yzhang0701@gmail.com
65fc733ba59aefaf6d07db12497f9dfb04584f0f
72843da20942b6075f83d31d737957f86191b01e
/Unclassified/Done/2634.cpp
487f8f053dd6d645849ca76aec4d2297e905ac79
[]
no_license
dtcxzyw/OI-Source
cb641f2c7e203a32073f4cae98e690f1cad3dc22
aa041e2af7e1546e8c7ac5a960a27a3489cfcff8
refs/heads/master
2021-12-17T17:52:05.043490
2021-12-17T12:52:52
2021-12-17T12:52:52
140,553,277
43
9
null
null
null
null
UTF-8
C++
false
false
959
cpp
#include <cstdio> int read(){ int res=0,c; do c=getchar(); while(c<'0'||c>'9'); while('0'<=c&&c<='9'){ res=res*10+c-'0'; c=getchar(); } return res; } const int size=20010; struct Edge{ int to,next,w; } E[size*2]; int last[size]={},cnt=0; void addEdge(int u,int v,int w){ ++cnt; E[cnt].to=v,E[cnt].next=last[u],E[cnt].w=w; last[u]=cnt; } int ans=0,dp[size][3]={}; void DFS(int u,int p){ dp[u][0]=1; for(int i=last[u];i;i=E[i].next){ int v=E[i].to; if(v!=p){ DFS(v,u); for(int j=0;j<3;++j) ans+=2*dp[u][(3-(j+E[i].w)%3)%3]*dp[v][j]; for(int j=0;j<3;++j) dp[u][(j+E[i].w)%3]+=dp[v][j]; } } } int gcd(int a,int b){ return b?gcd(b,a%b):a; } int main(){ int n=read(); int u,v,w; for(int i=1;i<n;++i){ u=read(); v=read(); w=read(); addEdge(u,v,w); addEdge(v,u,w); } DFS(1,0); int a=ans+n,b=n*n; int d=gcd(a,b); printf("%d/%d\n",a/d,b/d); return 0; }
[ "2601110573@qq.com" ]
2601110573@qq.com
b8cf5e7fae406aeb6a801d3549ccd3407e240a0a
daae83654cca2eb7b0cca39dc12551974b7b7a2b
/src/qt/aboutdialog.cpp
97e6fd04efaad770b335827e6cbaf3f54c8a4e38
[ "MIT" ]
permissive
harshalapawar/Cryptocoin
fb146f55238dd1f584c031a60c5ef7f350a9e28c
862fb7612f3acf1c6177d598564233a2e0695c15
refs/heads/master
2021-08-18T21:02:46.982816
2017-11-23T20:37:30
2017-11-23T20:37:30
111,843,134
0
0
null
null
null
null
UTF-8
C++
false
false
1,115
cpp
// Copyright (c) 2011-2013 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 "aboutdialog.h" #include "ui_aboutdialog.h" #include "clientmodel.h" #include "clientversion.h" // Copyright year (2009-this) // Todo: update this when changing our copyright comments in the source const int ABOUTDIALOG_COPYRIGHT_YEAR = 2014; AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog) { ui->setupUi(this); // Set current copyright year ui->copyrightLabel->setText(tr("Copyright") + QString(" &copy; 2009-%1 ").arg(COPYRIGHT_YEAR) + tr("The Bitcoin developers") + QString("<br>") + tr("Copyright") + QString(" &copy; ") + tr("2011-%1 The Cryptcoin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR)); } void AboutDialog::setModel(ClientModel *model) { if(model) { ui->versionLabel->setText(model->formatFullVersion()); } } AboutDialog::~AboutDialog() { delete ui; } void AboutDialog::on_buttonBox_accepted() { close(); }
[ "harshalapawar266@gmail.com" ]
harshalapawar266@gmail.com
745e5a6cf5bace12aa866f27a4e6a74828ded1ee
ea9698cd7a7d8ca56a4028bd77c56e89f499a24f
/runtime/vm/code_comments.cc
b4a8e033855a8e639dd4169c1b16ab4f16541aef
[ "BSD-3-Clause", "LicenseRef-scancode-unknown", "LicenseRef-scancode-unknown-license-reference" ]
permissive
MedRedha/sdk
e669c14a85008389c1cf1774475171d2ee552685
f8f0b845c2ff5d735ae9c26130c96919e7e5bea0
refs/heads/master
2020-07-26T03:48:56.719167
2019-09-14T19:31:25
2019-09-14T19:31:25
208,510,760
1
0
BSD-3-Clause
2019-09-14T22:18:27
2019-09-14T22:18:27
null
UTF-8
C++
false
false
790
cc
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include "vm/code_comments.h" namespace dart { #if !defined(DART_PRECOMPILED_RUNTIME) && !defined(PRODUCT) const Code::Comments& CreateCommentsFrom(compiler::Assembler* assembler) { const auto& comments = assembler->comments(); Code::Comments& result = Code::Comments::New(comments.length()); for (intptr_t i = 0; i < comments.length(); i++) { result.SetPCOffsetAt(i, comments[i]->pc_offset()); result.SetCommentAt(i, comments[i]->comment()); } return result; } #endif // !defined(DART_PRECOMPILED_RUNTIME) && !defined(PRODUCT) } // namespace dart
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
d2cf149aef340963111cb81a1b67e03211d45b44
a7a75c89f51319e0d831f6ef1de0c3c57d2e1429
/Build174/src/providers/gdal/moc_qgsgdalprovider.cxx
40d9f67b4f639ec39f95ecfb6910ba0c622a34cd
[]
no_license
cugxiangzhenwei/QGIS_174_VS2008
9e3a473a908680ddb8e4e20bba6661ba1faace63
31302feac99f87fa34f988d591084a4d244122e7
refs/heads/master
2021-01-10T12:39:31.928488
2016-01-17T06:47:35
2016-01-17T06:47:35
49,788,920
1
0
null
null
null
null
UTF-8
C++
false
false
3,205
cxx
/**************************************************************************** ** Meta object code from reading C++ file 'qgsgdalprovider.h' ** ** Created: Fri May 18 12:55:48 2012 ** by: The Qt Meta Object Compiler version 63 (Qt 4.8.1) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../../../../qgis-1.7.4/src/providers/gdal/qgsgdalprovider.h" #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'qgsgdalprovider.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 63 #error "This file was generated using the moc from 4.8.1. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_QgsGdalProvider[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 1, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 1, // signalCount // signals: signature, parameters, type, tag, flags 17, 16, 16, 16, 0x05, 0 // eod }; static const char qt_meta_stringdata_QgsGdalProvider[] = { "QgsGdalProvider\0\0statusChanged(QString)\0" }; void QgsGdalProvider::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); QgsGdalProvider *_t = static_cast<QgsGdalProvider *>(_o); switch (_id) { case 0: _t->statusChanged((*reinterpret_cast< QString(*)>(_a[1]))); break; default: ; } } } const QMetaObjectExtraData QgsGdalProvider::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject QgsGdalProvider::staticMetaObject = { { &QgsRasterDataProvider::staticMetaObject, qt_meta_stringdata_QgsGdalProvider, qt_meta_data_QgsGdalProvider, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &QgsGdalProvider::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *QgsGdalProvider::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *QgsGdalProvider::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_QgsGdalProvider)) return static_cast<void*>(const_cast< QgsGdalProvider*>(this)); return QgsRasterDataProvider::qt_metacast(_clname); } int QgsGdalProvider::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QgsRasterDataProvider::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } return _id; } // SIGNAL 0 void QgsGdalProvider::statusChanged(QString _t1) { void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 0, _a); } QT_END_MOC_NAMESPACE
[ "cugxiangzhenwei@sina.cn" ]
cugxiangzhenwei@sina.cn
f38a846c1244aec69457aba56c318134c1d7e5ec
071786e24b0ce33f1bd4662b9164974bcbdfb783
/src/atom_generator.h
bc3f5ae5b762945aba4f9c1b9145ed1527d5f3a1
[ "MIT" ]
permissive
WeirdConstructor/BukaLisp
d12180b1608ebbdd0ce8424e15557883f97ad228
7e4081e45abd8afa1873a666c8c519ce1f76f0f5
refs/heads/master
2023-03-05T08:12:11.699501
2021-02-18T04:06:54
2021-02-18T04:06:54
91,902,492
4
0
null
null
null
null
UTF-8
C++
false
false
7,741
h
// Copyright (C) 2017 Weird Constructor // For more license info refer to the the bottom of this file. #pragma once #include <memory> #include <vector> #include "parser.h" #include "atom.h" #include "atom_printer.h" namespace bukalisp { //--------------------------------------------------------------------------- class AtomGenerator : public bukalisp::SEX_Builder { private: GC *m_gc; bool m_include_debug_info; GC_ROOT_MEMBER(m_last); GC_ROOT_MEMBER(m_last_key); GC_ROOT_MEMBER_VEC(m_stack); GC_ROOT_MEMBER_MAP(m_refmap); int64_t m_next_label; public: AtomGenerator(GC *gc) : m_gc(gc), m_include_debug_info(true), GC_ROOT_MEMBER_INITALIZE_VEC(*gc, m_stack), GC_ROOT_MEMBER_INITALIZE(*gc, m_last), GC_ROOT_MEMBER_INITALIZE(*gc, m_last_key), GC_ROOT_MEMBER_INITALIZE_MAP(*gc, m_refmap), m_next_label(-1) { m_stack = gc->allocate_vector(10); m_refmap = gc->allocate_map(); } virtual ~AtomGenerator() { } void disable_debug_info() { m_include_debug_info = false; } void clear() { m_last.clear(); m_last_key.clear(); m_stack->clear(); m_refmap->clear(); } void start() { clear(); } Atom &root() { return m_last; } virtual void error(const std::string &what, const std::string &inp_name, size_t line, const std::string &tok) { throw BukaLISPException("reader", inp_name, line, tok, what); } virtual void label(int64_t lbl_id) { Atom a = m_refmap->at(Atom(T_INT, lbl_id)); add(a); } virtual void next_label(int64_t lbl_id) { m_next_label = lbl_id; } #define ON_NXT_LBL_SET_REFMAP(atom) \ if (m_next_label >= 0) \ { \ m_refmap->set(Atom(T_INT, m_next_label), (atom)); \ m_next_label = -1; \ } virtual void start_list() { AtomVec *new_vec = m_gc->allocate_vector(0); Atom new_vec_atom(T_VEC, new_vec); ON_NXT_LBL_SET_REFMAP(new_vec_atom); if (m_include_debug_info) { AtomVec *meta_info = m_gc->allocate_vector(2); meta_info->push(Atom(T_STR, m_gc->new_symbol(m_dbg_input_name))); meta_info->push(Atom(T_INT, m_dbg_line)); m_gc->set_meta_register(new_vec_atom, 0, Atom(T_VEC, meta_info)); } m_stack->push(new_vec_atom); } virtual void end_list() { m_last = *(m_stack->last()); m_stack->pop(); add(m_last); } virtual void start_map() { AtomMap *new_map = m_gc->allocate_map(); Atom new_map_atom(T_MAP, new_map); ON_NXT_LBL_SET_REFMAP(new_map_atom); if (m_include_debug_info) { AtomVec *meta_info = m_gc->allocate_vector(2); meta_info->push(Atom(T_STR, m_gc->new_symbol(m_dbg_input_name))); meta_info->push(Atom(T_INT, m_dbg_line)); m_gc->set_meta_register(new_map_atom, 0, Atom(T_VEC, meta_info)); } m_stack->push(new_map_atom); } virtual void start_kv_pair() { } virtual void end_kv_key() { m_stack->push(m_last); m_stack->push(Atom(T_INT, -1)); } virtual void end_kv_pair() { } virtual void end_map() { m_last = *(m_stack->last()); m_stack->pop(); add(m_last); } void add(Atom &a) { // std::cout << "ADD: " << a.to_write_str() << " | " << Atom(T_VEC, m_stack).to_write_str() << std::endl; if (m_stack->m_len > 0) { Atom *elem = m_stack->last(); if (elem->m_type == T_VEC) elem->m_d.vec->push(a); else if (elem->m_type == T_INT) { m_stack->pop(); if (elem->m_d.i == -1) { Atom key = *(m_stack->last()); m_stack->pop(); m_stack->last()->m_d.map->set(key, a); m_last = *(m_stack->last()); } } else m_last = a; } else m_last = a; } virtual void atom_string(const std::string &str) { Atom a(T_STR); a.m_d.sym = m_gc->new_symbol(str); ON_NXT_LBL_SET_REFMAP(a); add(a); } virtual void atom_symbol(const std::string &symstr) { Atom a(T_SYM); a.m_d.sym = m_gc->new_symbol(symstr); ON_NXT_LBL_SET_REFMAP(a); add(a); } virtual void atom_keyword(const std::string &symstr) { Atom a(T_KW); a.m_d.sym = m_gc->new_symbol(symstr); ON_NXT_LBL_SET_REFMAP(a); add(a); } virtual void atom_int(int64_t i) { Atom a(T_INT); a.m_d.i = i; ON_NXT_LBL_SET_REFMAP(a); add(a); } virtual void atom_dbl(double d) { Atom a(T_DBL); a.m_d.d = d; ON_NXT_LBL_SET_REFMAP(a); add(a); } virtual void atom_nil() { Atom a(T_NIL); ON_NXT_LBL_SET_REFMAP(a); add(a); } virtual void atom_bool(bool b) { Atom a(T_BOOL); a.m_d.b = b; ON_NXT_LBL_SET_REFMAP(a); add(a); } }; //--------------------------------------------------------------------------- } /****************************************************************************** * Copyright (C) 2017 Weird Constructor * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/
[ "weirdconstructor@gmail.com" ]
weirdconstructor@gmail.com
638b8d462e68199af7aa4641cbf45599d89585f1
7b93f65c8d36750afdd5add6b6676b1523e818ec
/cpp/robel_intro/chap10/Exception1e.cpp
99cb869315b08988c04a7f5f64dbd3e4b250c6ae
[]
no_license
DaisukeYamato/book
9cbb3620e5f297832a7c0dc4b35f38b61a6395ea
0308106dedf8a23b491aada942f781d2ab000b69
refs/heads/master
2021-01-22T13:13:02.365196
2015-08-26T00:12:56
2015-08-26T00:12:56
40,760,927
0
0
null
null
null
null
UTF-8
C++
false
false
468
cpp
#include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; int main() { try { ifstream file; file.open("text.txt"); if(!file.is_open()) { throw "cannot open file!!"; } string line; getline(file, line); if (file.fail()) { throw "cannot read from file!!"; } cout << line << endl; } catch(const char* error) { cerr << error << endl; return EXIT_FAILURE; } }
[ "yamato.hep.fermicern@gmail.com" ]
yamato.hep.fermicern@gmail.com
070fb5e3c92ac7d887fcad1efbb47470f705138c
0979c4763f5087733428a9c258f810e3ba615d88
/src/cpp-sqlite-db-adapter/TableRecord.cpp
2f16f9c25f750596c38a2e767d0ee9463aba9b09
[]
no_license
ibaiGilabert/CppSqlLiteDbAdapter
5e5261d5d20ca1940d89f20080801a7e0806532e
85e54a31201942191654a867605c2a6dc7bbf5d4
refs/heads/master
2020-03-20T21:58:31.592742
2018-10-18T09:39:31
2018-10-18T09:39:31
137,772,004
0
0
null
2018-10-17T17:36:19
2018-06-18T15:42:06
C++
UTF-8
C++
false
false
4,058
cpp
//#include "stdafx.h" #include "TableRecord.h" #include "Field.h" #include "FieldValue.h" #include "cpp-db-adapter/ITableRecordSet.h" #include <sqlite3.h> namespace systelab { namespace db { namespace sqlite { TableRecord::TableRecord(ITableRecordSet &recordSet, sqlite3_stmt *statement) : m_table(recordSet.getTable()) { unsigned int nFields = recordSet.getFieldsCount(); for (unsigned int i = 0; i < nFields; i++) { std::unique_ptr<IFieldValue> fieldValue; const IField &field = recordSet.getField(i); unsigned int fieldIndex = field.getIndex(); if (sqlite3_column_type(statement, fieldIndex) == SQLITE_NULL) { fieldValue.reset(new FieldValue(field)); } else { FieldTypes fieldType = field.getType(); switch (fieldType) { case BOOLEAN: { bool boolValue = (sqlite3_column_int(statement, fieldIndex) != 0); fieldValue.reset(new FieldValue(field, boolValue)); } break; case INT: { int intValue = sqlite3_column_int(statement, fieldIndex); fieldValue.reset(new FieldValue(field, intValue)); } break; case DOUBLE: { double doubleValue = sqlite3_column_double(statement, fieldIndex); fieldValue.reset(new FieldValue(field, doubleValue)); } break; case STRING: { const unsigned char *charValue = sqlite3_column_text(statement, fieldIndex); if (charValue) { std::string stringValue((char *)charValue); fieldValue.reset(new FieldValue(field, stringValue)); } else { fieldValue.reset(new FieldValue(field, std::string(""))); } } break; case DATETIME: { std::string stringValue( (char *)sqlite3_column_text(statement, fieldIndex)); fieldValue.reset(new FieldValue( field, boost::posix_time::from_iso_string(stringValue))); } break; case BINARY: { // TO DO } default: throw std::string("Unknown field type."); } } m_fieldValues.push_back(std::move(fieldValue)); } } TableRecord::TableRecord(ITable &table, std::vector<std::unique_ptr<IFieldValue>> &fieldValues) : m_table(table) { unsigned int nFieldValues = (unsigned int)fieldValues.size(); for (unsigned int i = 0; i < nFieldValues; i++) { m_fieldValues.push_back(std::move(fieldValues[i])); } } TableRecord::~TableRecord() {} ITable &TableRecord::getTable() const { return m_table; } unsigned int TableRecord::getFieldValuesCount() const { return (unsigned int)m_fieldValues.size(); } IFieldValue &TableRecord::getFieldValue(unsigned int index) const { if (index < m_fieldValues.size()) { return *(m_fieldValues[index].get()); } else { throw std::string("Invalid field value index"); } } IFieldValue &TableRecord::getFieldValue(const std::string &fieldName) const { unsigned int nFields = (unsigned int)m_fieldValues.size(); for (unsigned int i = 0; i < nFields; i++) { std::string value = m_fieldValues[i]->getField().getName(); if (m_fieldValues[i]->getField().getName() == fieldName) { return *(m_fieldValues[i].get()); } } throw std::string("The requested field value doesn't exist"); } bool TableRecord::hasFieldValue(const std::string &fieldName) const { unsigned int nFields = (unsigned int)m_fieldValues.size(); for (unsigned int i = 0; i < nFields; i++) { std::string value = m_fieldValues[i]->getField().getName(); if (m_fieldValues[i]->getField().getName() == fieldName) { return true; } } return false; } std::vector<IFieldValue *> TableRecord::getValuesList() const { std::vector<IFieldValue *> values; unsigned int nRecordFieldValues = getFieldValuesCount(); for (unsigned int i = 0; i < nRecordFieldValues; i++) { IFieldValue &recordFieldValue = getFieldValue(i); const IField &recordField = recordFieldValue.getField(); if (!recordField.isPrimaryKey()) { values.push_back(&recordFieldValue); } } return values; } } } }
[ "ibai.gilabert@gmail.com" ]
ibai.gilabert@gmail.com
cac9b279abec019ee92789df2c0ca114d28b2772
470eb725377cf594a471bf75f731738ec2d4882e
/Win8APPAssist/native/src/util/aes/aes.h
d633e54dcac587404a9ee7f5f679d3e5b09d1ee6
[]
no_license
force2008/win8AppAssist
f9d0c65c0b237e9d731ed2333639249f5c4b56fc
d50e3bb78a03f9e8273afba99d7c219a2b26cc06
refs/heads/master
2021-01-01T19:07:18.747983
2013-05-29T02:16:29
2013-05-29T02:16:29
null
0
0
null
null
null
null
GB18030
C++
false
false
1,639
h
/* * File AES.h * Author 刘乾发 * Email qfliu@corp.netease.com * Copyright (c) 2010-2012 网易杭州研究院 * Date 2010-08-04 * Comment AES加密解密算法 基于rijndael算法version3.0 */ #pragma once #include "..\intType.h" namespace native { #define AES_MAXKB (256/8) #define AES_MAXNR 14 class AES { public: AES(); virtual ~AES(); public: /*! @brief 处理加密原始密钥为轮密钥 @param [out] rk 轮密钥存放结构 @param [in] cipherKey 原始密钥数据 @param [in] keyBits 原始密钥长度 @return 加密所需对应轮数 */ static int MakeKeyEnc(uint32_t rk[/*4*(Nr + 1)*/], const uint8_t cipherKey[], int keyBits); /*! @brief 处理解密原始密钥为轮密钥 @param [out] rk 轮密钥存放结构 @param [in] cipherKey 原始密钥数据 @param [in] keyBits 原始密钥长度 @return 解密所需对应轮数 */ static int MakeKeyDec(uint32_t rk[/*4*(Nr + 1)*/], const uint8_t cipherKey[], int keyBits); /*! @brief 加密 @param [in] rk 密钥数据 @param [in] Nr 加密所需轮数 @param [in] pt 明文 @param [out] ct 加密中间数据(加密完成后存放密文) @return void */ static void Encrypt(const uint32_t rk[/*4*(Nr + 1)*/], int Nr, const uint8_t pt[16], uint8_t ct[16]); /*! @brief 解密 @param [in] rk 密钥数据 @param [in] Nr 解密所需轮数 @param [out] pt 解密中间数据(解密完成后存放明文) @param [in] ct 密文 @return void */ static void Decrypt(const uint32_t rk[/*4*(Nr + 1)*/], int Nr, const uint8_t ct[16], uint8_t pt[16]); }; }
[ "force2008@gmail.com" ]
force2008@gmail.com
2c953d756d20a284300a20b02c691c0bafb23859
4b2da0b07ec5452fa914ce2b77411e039343be67
/src/threadinterrupt.cpp
78b1d852c235c9969f4535da80f5aa7e97c342f7
[ "MIT" ]
permissive
zoowcash/zoowcash
5cbc19f9edfbf6007d44ce2c06e757fc4c3ccf92
d38dccfc7672be33bec3f865a69675ff7eeaae94
refs/heads/master
2020-05-22T05:05:05.886886
2019-05-12T08:21:25
2019-05-12T08:21:25
186,229,183
0
0
null
null
null
null
UTF-8
C++
false
false
1,208
cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2017 The Bitcoin Core developers // Copyright (c) 2019 The zoowcash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <threadinterrupt.h> CThreadInterrupt::operator bool() const { return flag.load(std::memory_order_acquire); } void CThreadInterrupt::reset() { flag.store(false, std::memory_order_release); } void CThreadInterrupt::operator()() { { std::unique_lock<std::mutex> lock(mut); flag.store(true, std::memory_order_release); } cond.notify_all(); } bool CThreadInterrupt::sleep_for(std::chrono::milliseconds rel_time) { std::unique_lock<std::mutex> lock(mut); return !cond.wait_for(lock, rel_time, [this]() { return flag.load(std::memory_order_acquire); }); } bool CThreadInterrupt::sleep_for(std::chrono::seconds rel_time) { return sleep_for(std::chrono::duration_cast<std::chrono::milliseconds>(rel_time)); } bool CThreadInterrupt::sleep_for(std::chrono::minutes rel_time) { return sleep_for(std::chrono::duration_cast<std::chrono::milliseconds>(rel_time)); }
[ "47944643+zoowcoin@users.noreply.github.com" ]
47944643+zoowcoin@users.noreply.github.com
5bc8826ffe6870d0784333201e5c61a6c3d53761
a7a75c89f51319e0d831f6ef1de0c3c57d2e1429
/QGisDev/include/ui/ui_qgsmergeattributesdialogbase.h
13471be1b67e70e0d53324119f0df1df1f24eb5c
[]
no_license
cugxiangzhenwei/QGIS_174_VS2008
9e3a473a908680ddb8e4e20bba6661ba1faace63
31302feac99f87fa34f988d591084a4d244122e7
refs/heads/master
2021-01-10T12:39:31.928488
2016-01-17T06:47:35
2016-01-17T06:47:35
49,788,920
1
0
null
null
null
null
UTF-8
C++
false
false
6,131
h
/******************************************************************************** ** Form generated from reading ui file 'qgsmergeattributesdialogbase.ui' ** ** Created: Tue Mar 13 10:23:55 2012 ** by: Qt User Interface Compiler version 4.5.3 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! ********************************************************************************/ #ifndef UI_QGSMERGEATTRIBUTESDIALOGBASE_H #define UI_QGSMERGEATTRIBUTESDIALOGBASE_H #include <QtCore/QVariant> #include <QtGui/QAction> #include <QtGui/QApplication> #include <QtGui/QButtonGroup> #include <QtGui/QDialog> #include <QtGui/QDialogButtonBox> #include <QtGui/QGridLayout> #include <QtGui/QHBoxLayout> #include <QtGui/QHeaderView> #include <QtGui/QLabel> #include <QtGui/QPushButton> #include <QtGui/QSpacerItem> #include <QtGui/QTableWidget> QT_BEGIN_NAMESPACE class Ui_QgsMergeAttributesDialogBase { public: QGridLayout *gridLayout; QTableWidget *mTableWidget; QHBoxLayout *horizontalLayout; QPushButton *mFromSelectedPushButton; QLabel *mTakeSelectedAttributesLabel; QSpacerItem *horizontalSpacer; QHBoxLayout *horizontalLayout_2; QPushButton *mRemoveFeatureFromSelectionButton; QLabel *mRemoveFeatureFromSelectionLabel; QSpacerItem *horizontalSpacer_2; QDialogButtonBox *buttonBox; void setupUi(QDialog *QgsMergeAttributesDialogBase) { if (QgsMergeAttributesDialogBase->objectName().isEmpty()) QgsMergeAttributesDialogBase->setObjectName(QString::fromUtf8("QgsMergeAttributesDialogBase")); QgsMergeAttributesDialogBase->resize(450, 382); gridLayout = new QGridLayout(QgsMergeAttributesDialogBase); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); mTableWidget = new QTableWidget(QgsMergeAttributesDialogBase); mTableWidget->setObjectName(QString::fromUtf8("mTableWidget")); gridLayout->addWidget(mTableWidget, 0, 0, 1, 1); horizontalLayout = new QHBoxLayout(); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); mFromSelectedPushButton = new QPushButton(QgsMergeAttributesDialogBase); mFromSelectedPushButton->setObjectName(QString::fromUtf8("mFromSelectedPushButton")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(mFromSelectedPushButton->sizePolicy().hasHeightForWidth()); mFromSelectedPushButton->setSizePolicy(sizePolicy); horizontalLayout->addWidget(mFromSelectedPushButton); mTakeSelectedAttributesLabel = new QLabel(QgsMergeAttributesDialogBase); mTakeSelectedAttributesLabel->setObjectName(QString::fromUtf8("mTakeSelectedAttributesLabel")); horizontalLayout->addWidget(mTakeSelectedAttributesLabel); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout->addItem(horizontalSpacer); gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1); horizontalLayout_2 = new QHBoxLayout(); horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); mRemoveFeatureFromSelectionButton = new QPushButton(QgsMergeAttributesDialogBase); mRemoveFeatureFromSelectionButton->setObjectName(QString::fromUtf8("mRemoveFeatureFromSelectionButton")); horizontalLayout_2->addWidget(mRemoveFeatureFromSelectionButton); mRemoveFeatureFromSelectionLabel = new QLabel(QgsMergeAttributesDialogBase); mRemoveFeatureFromSelectionLabel->setObjectName(QString::fromUtf8("mRemoveFeatureFromSelectionLabel")); horizontalLayout_2->addWidget(mRemoveFeatureFromSelectionLabel); horizontalSpacer_2 = new QSpacerItem(98, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout_2->addItem(horizontalSpacer_2); gridLayout->addLayout(horizontalLayout_2, 2, 0, 1, 1); buttonBox = new QDialogButtonBox(QgsMergeAttributesDialogBase); buttonBox->setObjectName(QString::fromUtf8("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); gridLayout->addWidget(buttonBox, 3, 0, 1, 1); #ifndef QT_NO_SHORTCUT mTakeSelectedAttributesLabel->setBuddy(mFromSelectedPushButton); mRemoveFeatureFromSelectionLabel->setBuddy(mRemoveFeatureFromSelectionButton); #endif // QT_NO_SHORTCUT QWidget::setTabOrder(mTableWidget, mFromSelectedPushButton); QWidget::setTabOrder(mFromSelectedPushButton, mRemoveFeatureFromSelectionButton); QWidget::setTabOrder(mRemoveFeatureFromSelectionButton, buttonBox); retranslateUi(QgsMergeAttributesDialogBase); QObject::connect(buttonBox, SIGNAL(accepted()), QgsMergeAttributesDialogBase, SLOT(accept())); QObject::connect(buttonBox, SIGNAL(rejected()), QgsMergeAttributesDialogBase, SLOT(reject())); QMetaObject::connectSlotsByName(QgsMergeAttributesDialogBase); } // setupUi void retranslateUi(QDialog *QgsMergeAttributesDialogBase) { QgsMergeAttributesDialogBase->setWindowTitle(QApplication::translate("QgsMergeAttributesDialogBase", "Merge feature attributes", 0, QApplication::UnicodeUTF8)); mFromSelectedPushButton->setText(QString()); mTakeSelectedAttributesLabel->setText(QApplication::translate("QgsMergeAttributesDialogBase", "Take attributes from selected feature", 0, QApplication::UnicodeUTF8)); mRemoveFeatureFromSelectionButton->setText(QString()); mRemoveFeatureFromSelectionLabel->setText(QApplication::translate("QgsMergeAttributesDialogBase", "Remove feature from selection", 0, QApplication::UnicodeUTF8)); Q_UNUSED(QgsMergeAttributesDialogBase); } // retranslateUi }; namespace Ui { class QgsMergeAttributesDialogBase: public Ui_QgsMergeAttributesDialogBase {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_QGSMERGEATTRIBUTESDIALOGBASE_H
[ "cugxiangzhenwei@sina.cn" ]
cugxiangzhenwei@sina.cn
6f597e66e6d6ba7af010dccec301674005ddfd93
9d0d9492c12b3e88303c87134d6c0536e727b34f
/t23_pure_virt_fcn_body_2.cpp
4b129cc709e567bb1b4b5f4d69041189774ef49a
[]
no_license
s-kramer/cpp_tests
361929b81b99fcb17da13014e78748f7578becc1
2d6d3404bc5d6405e0cba8159e1cce0248efc194
refs/heads/master
2021-01-10T03:54:39.174981
2017-08-07T08:16:14
2017-08-07T08:16:14
53,738,390
0
0
null
null
null
null
UTF-8
C++
false
false
563
cpp
#include <iostream> #include <boost/scoped_ptr.hpp> class Base { public: explicit Base (void) {}; ~Base () {}; virtual void identify(void) = 0; private: }; void Base::identify() { std::cout << "Abstract Base class pure function body here.\n"; } class Derived : public Base { public: explicit Derived (void) {}; ~Derived () {}; virtual void identify(void){ std::cout << "Derived class pure fcn implementation.\n";}; }; int main() { boost::scoped_ptr<Base> ptr(new Derived); ptr->Base::identify(); return 0; }
[ "sebastian.kramer@wp.pl" ]
sebastian.kramer@wp.pl
4d5d8ec9ea66250a7fd250dc7f6ba0ab0ee70366
051c898be81003a5c90f5a1ce77a252252774973
/preliminary/D/33908004.cpp
f9fc7042159465e2cd087bc0cf2ade72cf7df144
[]
no_license
mmatrosov/FKN2020
29caffa241882e672df654b4857b5674d5f96f6e
38bfa7811d4af175415f7cc4da81df44b5b4a74c
refs/heads/master
2022-12-27T19:15:05.849915
2020-10-16T07:12:27
2020-10-16T07:12:27
298,350,636
0
0
null
null
null
null
UTF-8
C++
false
false
834
cpp
#include <bits/stdc++.h> #define int long long int #define ld long double #define pb push_back #define pf push_front #define ft first #define sc second #define all(v) v.begin(), v.end() using namespace std; const int maxn = 100000, inf = 1e18; ld ang(ld xa, ld ya, ld xb, ld yb) { return abs(atan2(xa * yb - xb * ya, xa * xb + ya * yb)); } signed main() { ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); int xa, ya, xb, yb; cout.precision(16); cin >> xa >> ya >> xb >> yb; ld ans = sqrtl(xa * xa + ya * ya) + sqrtl(xb * xb + yb * yb); ld rd = max(sqrtl(xa * xa + ya * ya), sqrtl(xb * xb + yb * yb)) - min(sqrtl(xa * xa + ya * ya), sqrtl(xb * xb + yb * yb)); ld r = min(sqrtl(xa * xa + ya * ya), sqrtl(xb * xb + yb * yb)); ans = min(ans, ang(xa, ya, xb, yb) * r + rd); cout << ans; }
[ "mikhail.matrosov@gmail.com" ]
mikhail.matrosov@gmail.com
d92b599e250a7840260ff5c4b63cc928b4176a30
fc4abaa16d21820073ebf864ab30c38838a76414
/Containers/Algorithem.h
785945111081b63e1f1dec5ec1035cd9c2a70b8a
[]
no_license
TDWickersham/Templates
48ce7d775e85a306fb20f068b0d8c13717e1ca84
a3b0e077b0f5739e5e8cd82283eac6cde961283f
refs/heads/master
2021-08-28T16:43:47.390621
2017-12-12T20:11:33
2017-12-12T20:11:33
112,257,063
0
0
null
null
null
null
UTF-8
C++
false
false
454
h
#pragma once template<typename T, typename S> static S addRange(int* start, int* end) { S total = 0; T* iter = start; while (iter != end) { total += *iter; ++iter; } return total; } template<typename T, typename S> static S addRangeFinished(int* start, int* end) { S total = 0; T* iter = start; while (iter != end) { total += *iter; ++iter; } return total; } template<typename T> static T addRangeComplex(T start, T end) { }
[ "s179067@SEA-1A7525" ]
s179067@SEA-1A7525
a3fb013997ad6c99374e0a6cebce32df94cd6d9b
94e5a9e157d3520374d95c43fe6fec97f1fc3c9b
/Codeforces/Practice/231A.cpp
d2763a5d9016098e9fe1b7776a182c49eda40958
[ "MIT" ]
permissive
dipta007/Competitive-Programming
0127c550ad523884a84eb3ea333d08de8b4ba528
998d47f08984703c5b415b98365ddbc84ad289c4
refs/heads/master
2021-01-21T14:06:40.082553
2020-07-06T17:40:46
2020-07-06T17:40:46
54,851,014
8
4
null
2020-05-02T13:14:41
2016-03-27T22:30:02
C++
UTF-8
C++
false
false
269
cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int cnt = 0; for(int i=1; i<=n; i++) { int a,b,c; cin >> a >> b >> c; int kk = a+b+c; if( kk >= 2 ) cnt++; } cout << cnt << endl; }
[ "shubhashis.roy@selise.ch" ]
shubhashis.roy@selise.ch
e8825f57421b101fc71981fb83866927132c665a
31d51c412a99ecbc3e0e191c402cca3e858142bf
/computeCTR.cpp
29ccd9044dbc8300dd883e66291e284bacc5ad44
[]
no_license
marcopizzichemi/Macros
985579b70f88af99d56d187147936d7f872988b2
45e3a8d6b98b24ec071a56b0ead5a0ae6b3fa358
refs/heads/master
2020-04-15T14:28:41.910391
2018-10-15T09:24:20
2018-10-15T09:24:20
44,091,951
0
0
null
null
null
null
UTF-8
C++
false
false
10,946
cpp
// compile with // g++ -o ../build/computeCTR computeCTR.cpp `root-config --cflags --glibs` -Wl,--no-as-needed -lHist -lCore -lMathCore -lTree -lTreePlayer // small program to extract timing calibration and data #include "TROOT.h" #include "TFile.h" #include "TStyle.h" #include "TSystem.h" #include "TLegend.h" #include "TCanvas.h" #include "TH1F.h" #include "TH2F.h" #include "TH3I.h" #include "TString.h" #include "TApplication.h" #include "TLegend.h" #include "TTree.h" #include "TF2.h" #include "TGraph2D.h" #include "TGraph.h" #include "TSpectrum.h" #include "TSpectrum2.h" #include "TTreeFormula.h" #include "TMath.h" #include "TChain.h" #include "TCut.h" #include "TLine.h" #include "TError.h" #include "TEllipse.h" #include "TFormula.h" #include "TGraphErrors.h" #include "TGraph2DErrors.h" #include "TMultiGraph.h" #include "TCutG.h" #include "TGaxis.h" #include "TPaveStats.h" #include "TProfile.h" #include "TH1D.h" #include "TPaveText.h" #include "TGraphDelaunay.h" #include "TVector.h" #include "TNamed.h" #include "TPaveLabel.h" #include "THStack.h" #include <iostream> #include <fstream> #include <string> #include <sstream> #include <stdio.h> #include <getopt.h> #include <algorithm> // std::sort void extractCTR(TH1F* histo,double fitMin,double fitMax, int divs, double* res) { double f1min = histo->GetXaxis()->GetXmin(); double f1max = histo->GetXaxis()->GetXmax(); // std::cout << f1min << " " << f1max << std::endl; TF1* f1 = new TF1("f1","crystalball"); f1->SetParameters(histo->GetMaximum(),histo->GetMean(),histo->GetRMS(),1,3); histo->Fit(f1,"Q","",fitMin,fitMax); double min,max,min10,max10; // int divs = 3000; double step = (f1max-f1min)/divs; // is [0] the max of the function??? for(int i = 0 ; i < divs ; i++) { // std::cout << f1->Eval(f1min + i*step) << "\t" // << f1->Eval(f1min + (i+1)*step) << "\t" // << f1->GetParameter(0) << "\t" // << std::endl; if( (f1->Eval(f1min + i*step) < f1->GetParameter(0)/2.0) && (f1->Eval(f1min + (i+1)*step) > f1->GetParameter(0)/2.0) ) { min = f1min + (i+0.5)*step; // std::cout << f1->Eval(f1min + i*step) << " " // << f1->Eval(f1min + (i+1)*step) << " " // << f1->GetMaximum()/2.0 << " " // << min << std::endl; } if( (f1->Eval(f1min + i*step) > f1->GetParameter(0)/2.0) && (f1->Eval(f1min + (i+1)*step) < f1->GetParameter(0)/2.0) ) { max = f1min + (i+0.5)*step; } if( (f1->Eval(f1min + i*step) < f1->GetParameter(0)/10.0) && (f1->Eval(f1min + (i+1)*step) > f1->GetParameter(0)/10.0) ) { min10 = f1min + (i+0.5)*step; } if( (f1->Eval(f1min + i*step) > f1->GetParameter(0)/10.0) && (f1->Eval(f1min + (i+1)*step) < f1->GetParameter(0)/10.0) ) { max10 = f1min + (i+0.5)*step; } } res[0] = sqrt(2)*sqrt(pow((max-min),2)-pow(70e-12,2)); res[1] = sqrt(2)*sqrt(pow((max10-min10),2)-pow((70e-12/2.355)*4.29,2)); } void usage() { std::cout << "\t\t" << "[-i|--input] <temp.root> [-o|--output] <output.root> [-c|--calibration] calibration.root [--coincidence] coincidence.root [OPTIONS]" << std::endl << "\t\t" << "<temp.root> - complete dataset (analysis ttree) of run" << std::endl // << "\t\t" << "<output.root> - output file name" << std::endl // << "\t\t" << "<calibration.root> - calibration file " << std::endl // << "\t\t" << "<coincidence.root> - time calibration file " << std::endl // << "\t\t" << "--simulation - the datast is from a simulation (therefore the tagging photopeak is ignored)" << std::endl // << "\t\t" << "--length <value> - crystal length in mm, default = 15.0" << std::endl // << "\t\t" << "--doiFraction <value> - fraction of DOI length towards which the time stamps are corrected (from 0 to 1)" << std::endl // << "\t\t" << " - 0 = front of the crystal (DOI close to detector) " << std::endl // << "\t\t" << " - 1 = back of the crystal (DOI far from detector) " << std::endl // << "\t\t" << "--tagFwhm <value> - FWHM timing resolution of reference board, in ps - default = 70" << std::endl // << "\t\t" << "--rmsLow <value> - lower bound of CTR fit -> mean - rmsLow*mean - default = 1.75" << std::endl // << "\t\t" << "--rmsHigh <value> - upper bound of CTR fit -> mean + rmsHigh*mean - default = 1.75" << std::endl // << "\t\t" << "--histoMin <value> - lower limit of CTR spectra, in ns - default = -15" << std::endl // << "\t\t" << "--histoMax <value> - upper limit of CTR spectra, in ns - default = 15" << std::endl // << "\t\t" << "--histoBins <value> - n of bins for CTR spectra - default = 500" << std::endl // << "\t\t" << "--smooth <value> - n of iteration in CTR histograms smoothing - default = 0 (no smoothing)" << std::endl << "\t\t" << std::endl; } int main (int argc, char** argv) { if(argc < 2) { std::cout << argv[0] << std::endl; usage(); return 1; } std::string inputFileName = ""; std::string outputFileName = ""; double fitMin = -9.4e-9; double fitMax = -8.1e-9; int divs = 10000; // parse arguments static struct option longOptions[] = { { "input", required_argument, 0, 0 }, { "output", required_argument, 0, 0 }, { "fitMin", required_argument, 0, 0 }, { "fitMax", required_argument, 0, 0 }, { "divs", required_argument, 0, 0 }, { NULL, 0, 0, 0 } }; while(1) { int optionIndex = 0; int c = getopt_long(argc, argv, "i:o:", longOptions, &optionIndex); if (c == -1) { break; } if (c == 'i'){ inputFileName = (char *)optarg; } else if (c == 'o'){ outputFileName = (char *)optarg; } else if (c == 0 && optionIndex == 0){ inputFileName = (char *)optarg; } else if (c == 0 && optionIndex == 1){ outputFileName = (char *)optarg; } else if (c == 0 && optionIndex == 2){ fitMin = atof((char *)optarg); } else if (c == 0 && optionIndex == 3){ fitMax = atof((char *)optarg); } else if (c == 0 && optionIndex == 4){ divs = atoi((char *)optarg); } else { std::cout << "Usage: " << argv[0] << std::endl; usage(); return 1; } } // if() // maybe put a check on inputFileName and outputFileName not to be empty strings? //FEEDBACK TO USER std::cout << std::endl; std::cout << "ANALYSIS PARAMETERS: " << std::endl << "Input file = " << inputFileName << std::endl << "Output file = " << outputFileName << std::endl << "fitMin = " << fitMin << std::endl << "fitMax = " << fitMax << std::endl << "divs = " << divs << std::endl; std::cout << std::endl; TFile *_file0 = TFile::Open(inputFileName.c_str()); _file0->cd(); TList *listCry = _file0->GetListOfKeys(); std::cout << "testtttttttt" << std::endl; int nKeysCry = listCry->GetEntries(); std::cout << nKeysCry << std::endl; std::vector<std::string> keysCryName; std::vector<TCanvas*> canvas; std::vector<TH1F*> histograms; int bins = 40; double minCTR = 100; double maxCTR = 500; TH1F* noCorr = new TH1F("No Correction","No Correction",bins,minCTR,maxCTR); TH1F* centralCorr = new TH1F("Central Correction","Central Correction",bins,minCTR,maxCTR); TH1F* fullCorr = new TH1F("Full Correction","Full Correction",bins,minCTR,maxCTR); if(nKeysCry) //if directory not empty { for(int i = 0 ; i < nKeysCry ; i++){ keysCryName.push_back(listCry->At(i)->GetName()); } std::string basic_prefix("No correction"); std::string central_prefix("Central correction"); std::string all_prefix("Full correction"); // std::cout << "BASIC CTRs --------------------" << std::endl; for(unsigned int i = 0 ; i < keysCryName.size() ; i++) { if(!keysCryName[i].compare(0,basic_prefix.size(),basic_prefix)) // { TH1F* histo = (TH1F*) gDirectory->Get(keysCryName[i].c_str()); histo->GetXaxis()->SetTitle("Time [s]"); double ret[2]; extractCTR(histo,fitMin,fitMax,divs,ret); std::cout << histo->GetName() << "\t\t\t"; std::cout << ret[0]*1e12 << "\t" << ret[1]*1e12 << std::endl; noCorr->Fill(ret[0]*1e12); histograms.push_back(histo); } } // std::cout << "-------------------------------" << std::endl; std::cout << std::endl; // std::cout << "CENTRAL CTRs --------------------" << std::endl; for(unsigned int i = 0 ; i < keysCryName.size() ; i++) { if(!keysCryName[i].compare(0,central_prefix.size(),central_prefix)) // { TH1F* histo = (TH1F*) gDirectory->Get(keysCryName[i].c_str()); histo->GetXaxis()->SetTitle("Time [s]"); double ret[2]; extractCTR(histo,fitMin,fitMax,divs,ret); std::cout << histo->GetName() << "\t"; std::cout << ret[0]*1e12 << "\t" << ret[1]*1e12 << std::endl; centralCorr->Fill(ret[0]*1e12); histograms.push_back(histo); } } // std::cout << "-------------------------------" << std::endl; std::cout << std::endl; // std::cout << "ALL CTRs --------------------" << std::endl; for(unsigned int i = 0 ; i < keysCryName.size() ; i++) { if(!keysCryName[i].compare(0,all_prefix.size(),all_prefix)) // { TH1F* histo = (TH1F*) gDirectory->Get(keysCryName[i].c_str()); histo->GetXaxis()->SetTitle("Time [s]"); double ret[2]; extractCTR(histo,fitMin,fitMax,divs,ret); std::cout << histo->GetName() << "\t\t"; std::cout << ret[0]*1e12 << "\t" << ret[1]*1e12 << std::endl; fullCorr->Fill(ret[0]*1e12); histograms.push_back(histo); } } // std::cout << "-------------------------------" << std::endl; std::cout << std::endl; } TFile *outputFile = new TFile(outputFileName.c_str(),"RECREATE"); outputFile->cd(); noCorr->Write(); centralCorr->Write(); fullCorr->Write(); for(unsigned int i = 0; i < histograms.size() ; i++) { histograms[i]->Write(); } outputFile->Close(); _file0->Close(); }
[ "marco.pizzichemi@gmail.com" ]
marco.pizzichemi@gmail.com
c5cc430f2e366a55b2f079d5cabf40b3009b8395
58b589be581ab55e26b5dd600c89184c849f59d7
/src/apps/snakegame/GameMenuRenderer.cpp
71c02ea2f3870ab46187a48cececd9c1c35d7af4
[ "MIT" ]
permissive
kosua20/Rendu
02a0b9b39997b03f9c05138749f1f9bed0f223d9
6dd327cec52819ee0d04a4d8e8270dbe0a27b194
refs/heads/master
2023-08-31T17:11:39.583115
2023-07-09T20:58:17
2023-07-09T20:58:17
58,236,869
456
32
null
null
null
null
UTF-8
C++
false
false
4,771
cpp
#include "GameMenuRenderer.hpp" #include "resources/ResourcesManager.hpp" #include "graphics/GPU.hpp" #include "resources/Texture.hpp" #include "Common.hpp" GameMenuRenderer::GameMenuRenderer() : Renderer("Menu") { _buttonProgram = Resources::manager().getProgram("menu_button"); _backgroundProgram = Resources::manager().getProgram2D("passthrough"); _imageProgram = Resources::manager().getProgram("menu_image"); _fontProgram = Resources::manager().getProgram("font_sdf"); _button = Resources::manager().getMesh("rounded-button-out", Storage::GPU); _buttonIn = Resources::manager().getMesh("rounded-button-in", Storage::GPU); _toggle = Resources::manager().getMesh("rounded-checkbox-out", Storage::GPU); _toggleIn = Resources::manager().getMesh("rounded-checkbox-in", Storage::GPU); _quad = Resources::manager().getMesh("plane", Storage::GPU); } void GameMenuRenderer::drawMenu(const GameMenu & menu, const glm::vec2 & finalRes, float aspectRatio) const { static const std::unordered_map<MenuButton::State, glm::vec4> borderColors = { {MenuButton::State::OFF, glm::vec4(0.8f, 0.8f, 0.8f, 1.0f)}, {MenuButton::State::HOVER, glm::vec4(0.7f, 0.7f, 0.7f, 1.0f)}, {MenuButton::State::ON, glm::vec4(0.95f, 0.95f, 0.95f, 1.0f)}}; static const std::unordered_map<MenuButton::State, glm::vec4> innerColors = { {MenuButton::State::OFF, glm::vec4(0.9f, 0.9f, 0.9f, 0.5f)}, {MenuButton::State::HOVER, glm::vec4(1.0f, 1.0f, 1.0f, 0.5f)}, {MenuButton::State::ON, glm::vec4(0.95f, 0.95f, 0.95f, 0.5f)}}; static const glm::vec4 labelsColor = glm::vec4(0.3f, 0.0f, 0.0f, 1.0f); static const glm::vec4 labelsEdgeColor = glm::vec4(1.0f); static const float labelsEdgeWidth = 0.25f; GPU::setViewport(0, 0, int(finalRes[0]), int(finalRes[1])); // Background image. if(menu.backgroundImage) { _backgroundProgram->use(); _backgroundProgram->texture(menu.backgroundImage, 0); GPU::drawQuad(); } GPU::setDepthState(true, TestFunction::LESS, true); GPU::setCullState(false); GPU::setBlendState(true, BlendEquation::ADD, BlendFunction::SRC_ALPHA, BlendFunction::ONE_MINUS_SRC_ALPHA); // Images. _imageProgram->use(); for(const auto & image : menu.images) { _imageProgram->uniform("position", image.pos); _imageProgram->uniform("scale", image.scale); _imageProgram->uniform("depth", 0.95f); _imageProgram->texture(image.tid, 0); GPU::drawMesh(*_quad); } // Buttons. for(const auto & button : menu.buttons) { _buttonProgram->use(); _buttonProgram->uniform("position", button.pos); _buttonProgram->uniform("scale", button.scale); // Draw the inside half-transparent region. _buttonProgram->uniform("depth", 0.5f); _buttonProgram->uniform("color", innerColors.at(button.state)); GPU::drawMesh(*_buttonIn); // Draw the border of the button. _buttonProgram->uniform("depth", 0.9f); _buttonProgram->uniform("color", borderColors.at(button.state)); GPU::drawMesh(*_button); // Draw the text image. _imageProgram->use(); _imageProgram->uniform("position", button.pos); const glm::vec2 newScale = button.scale * 0.7f * glm::vec2(1.0f, button.size[1] / button.size[0]); _imageProgram->uniform("scale", newScale); _imageProgram->uniform("depth", 0.2f); _imageProgram->texture(button.tid, 0); GPU::drawMesh(*_quad); } // Toggles. for(const auto & toggle : menu.toggles) { _buttonProgram->use(); _buttonProgram->uniform("position", toggle.posBox); _buttonProgram->uniform("scale", toggle.scaleBox); _buttonProgram->uniform("depth", 0.9f); // Outside border. _buttonProgram->uniform("color", borderColors.at(MenuButton::State::OFF)); GPU::drawMesh(*_toggle); // If checked, fill the box. if(toggle.state == MenuButton::State::ON) { _buttonProgram->uniform("color", innerColors.at(MenuButton::State::OFF)); GPU::drawMesh(*_toggleIn); } // Text display. const glm::vec2 newScale = toggle.scale * 0.7f * glm::vec2(1.0f, toggle.size[1] / toggle.size[0]); _imageProgram->use(); _imageProgram->uniform("position", toggle.posImg); _imageProgram->uniform("scale", newScale); _imageProgram->uniform("depth", 0.2f); _imageProgram->texture(toggle.tid, 0); GPU::drawMesh(*_quad); } GPU::setDepthState(false); // Labels _fontProgram->use(); for(const auto & label : menu.labels) { _fontProgram->texture(label.tid, 0); _fontProgram->uniform("ratio", aspectRatio); _fontProgram->uniform("position", label.pos); _fontProgram->uniform("color", labelsColor); _fontProgram->uniform("edgeColor", labelsEdgeColor); _fontProgram->uniform("edgeWidth", labelsEdgeWidth); GPU::drawMesh(label.mesh); } GPU::setBlendState(false); } glm::vec2 GameMenuRenderer::getButtonSize() const { return glm::vec2(_button->bbox.getSize()); }
[ "kosua20@gmail.com" ]
kosua20@gmail.com
67248344ba6bd59cf701973bc353d8e6f250a448
b77d1df6660f2ac7627343a9978e62a91ab31cc1
/visual studio的代码/POJ/1001/源.cpp
55fdc0ed44cf0d1fb219b518f19db7c85cf698e6
[]
no_license
Dragon-qing/vs
6da7849c6ca6b174ed20be5c83330c9bd69e8243
bcf48dbce5c85ea6d15c3534017b686b4e63d307
refs/heads/master
2023-06-30T21:39:12.800910
2021-08-07T14:28:30
2021-08-07T14:28:30
393,031,140
0
0
null
null
null
null
UTF-8
C++
false
false
1,272
cpp
#include<stdio.h> #include<string.h> int output[120]; int m; void cal(int sum); int main() { char str[6]; int n; while (scanf("%s%d", str, &n) != EOF) { int length = strlen(str); int i; int point = 0; int sum=0; int temp; for (i = 0; i < length; i++) { if (str[i] == '.') { point = (length - i-1)*n; } else { sum = str[i] - '0' + sum * 10; } } memset(output, 0, sizeof(output)); output[0] = 1; m = 1; for (i = 0; i < n; i++) cal(sum); temp = 0; for (i = 0; i < m; i++) { if (output[i] != 0) { temp = i; break; } } if(temp-point>0) { for (i = m - 1; i >= point; i--) { printf("%d", output[i]); } } else { if (point > m)m = point; for (i = m - 1; i >= point;i--) printf("%d", output[i]); printf("."); for (; i >= temp; i--) printf("%d", output[i]); } printf("\n"); } return 0; } void cal(int sum) { int i; int p; int t; for (i = 0; i < m; i++) { output[i] = output[i] * sum; } for (i = 0; i < m - 1; i++) { if (output[i] >= 10) { output[i + 1] = output[i + 1]+output[i]/10; output[i] %= 10; } } p = m - 1; t = output[m - 1]; if (t >= 10) { while (t > 0) { output[p++]= t %10; t /= 10; } } m = p; }
[ "1259337898@qq.com" ]
1259337898@qq.com
5c17cd3de64ea35c0a9d3539991c7775591ca14e
18fad31a31d34188cc848c90df4cca3f87a34f2d
/centralized/utils/testcase.cpp
8d793ddc785b68c4b79062d16e27ab3ad49909a0
[]
no_license
DongCiLu/DecSearch
780592b938c27d5402046c556557f4bbd671731e
39b755ba15a99dc380ef1820c079ef41a4f1583b
refs/heads/master
2021-01-10T18:06:40.702325
2019-07-19T20:27:52
2019-07-19T20:27:52
54,991,238
1
1
null
2016-05-10T06:09:56
2016-03-29T16:19:45
C++
UTF-8
C++
false
false
2,502
cpp
#include <iostream> #include <fstream> #include <string> #include <queue> #include <vector> #include <unordered_set> #include <unordered_map> #include <sstream> #include <cstdlib> #include "Snap.h" using namespace std; const int NUM_SRC = 1000; const int NUM_DST = 1000; struct Testcase { int src; int dst; int dist; Testcase(int src, int dst, int dist) : src(src), dst(dst), dist(dist) {} }; int main(int argc, char **argv) { // read edge list cout << "1. Loading graph" << endl; PUNGraph net = TSnap::LoadEdgeList<PUNGraph>(argv[1], 0, 1); TSnap::PrintInfo(net); cout << "2. Select random source vertex and perform BFS" << endl; vector<Testcase> testcases; for (int i = 0; i < NUM_SRC; i ++) { int src = net->GetRndNId(); unordered_map<int, int> dset; // generate random dst for (int j = 0; j < NUM_DST; j ++) { int dst; do { dst = net->GetRndNId(); } while (dst == src || dset.find(dst) != dset.end()); dset.insert(make_pair(dst, -1)); } // perform BFS to find dist for each dst unordered_set<int> visited; queue<pair<int, int>> fifo; fifo.push(make_pair(src, 0)); visited.insert(src); while(!fifo.empty()) { int cur = fifo.front().first; int dist = fifo.front().second; fifo.pop(); if (dset.find(cur) != dset.end()) dset[cur] = dist; for (int i = 0; i < net->GetNI(cur).GetDeg(); i ++) { int nid = net->GetNI(cur).GetNbrNId(i); if (visited.find(nid) == visited.end()) { fifo.push(make_pair(nid, dist + 1)); visited.insert(nid); } } } // create testcases; for (auto entry: dset) { testcases.push_back(Testcase( src, entry.first, entry.second)); } cout << "." << flush; } cout << endl; cout << "3. Output to file" << endl; ofstream ofile(argv[2]); srand(time(NULL)); while(!testcases.empty()) { int r = rand() % testcases.size(); swap(testcases[r], testcases.back()); ofile << testcases.back().src << " " << testcases.back().dst << " " << testcases.back().dist << endl; testcases.pop_back(); } ofile.close(); return 0; }
[ "zlu12@vols.utk.edu" ]
zlu12@vols.utk.edu
c060abfa5218b84c3c318f8e5d01c66f284f900f
1005f450818900b923e345b73d77628f20d1875e
/thirdparty/asio/asio/file_base.hpp
0f273ee37294bacdef3a9e569f12f2f103b69e43
[ "MIT" ]
permissive
qicosmos/rest_rpc
c7ad37547a9dcb616832b32bc110a237977b8c74
93088a7e0f0ddb3786de40ed7b6311852644edbf
refs/heads/master
2023-08-23T06:56:42.464323
2023-07-04T02:57:13
2023-07-04T02:57:13
162,215,656
1,504
354
MIT
2023-07-05T03:37:24
2018-12-18T02:01:52
C++
UTF-8
C++
false
false
3,782
hpp
// // file_base.hpp // ~~~~~~~~~~~~~ // // Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef ASIO_FILE_BASE_HPP #define ASIO_FILE_BASE_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include "asio/detail/config.hpp" #if defined(ASIO_HAS_FILE) \ || defined(GENERATING_DOCUMENTATION) #if !defined(ASIO_WINDOWS) # include <fcntl.h> #endif // !defined(ASIO_WINDOWS) #include "asio/detail/push_options.hpp" namespace asio { /// The file_base class is used as a base for the basic_stream_file and /// basic_random_access_file class templates so that we have a common place to /// define flags. class file_base { public: #if defined(GENERATING_DOCUMENTATION) /// A bitmask type (C++ Std [lib.bitmask.types]). typedef unspecified flags; /// Open the file for reading. static const flags read_only = implementation_defined; /// Open the file for writing. static const flags write_only = implementation_defined; /// Open the file for reading and writing. static const flags read_write = implementation_defined; /// Open the file in append mode. static const flags append = implementation_defined; /// Create the file if it does not exist. static const flags create = implementation_defined; /// Ensure a new file is created. Must be combined with @c create. static const flags exclusive = implementation_defined; /// Open the file with any existing contents truncated. static const flags truncate = implementation_defined; #else enum flags { #if defined(ASIO_WINDOWS) read_only = 1, write_only = 2, read_write = 4, append = 8, create = 16, exclusive = 32, truncate = 64 #else // defined(ASIO_WINDOWS) read_only = O_RDONLY, write_only = O_WRONLY, read_write = O_RDWR, append = O_APPEND, create = O_CREAT, exclusive = O_EXCL, truncate = O_TRUNC #endif // defined(ASIO_WINDOWS) }; // Implement bitmask operations as shown in C++ Std [lib.bitmask.types]. friend flags operator&(flags x, flags y) { return static_cast<flags>( static_cast<unsigned int>(x) & static_cast<unsigned int>(y)); } friend flags operator|(flags x, flags y) { return static_cast<flags>( static_cast<unsigned int>(x) | static_cast<unsigned int>(y)); } friend flags operator^(flags x, flags y) { return static_cast<flags>( static_cast<unsigned int>(x) ^ static_cast<unsigned int>(y)); } friend flags operator~(flags x) { return static_cast<flags>(~static_cast<unsigned int>(x)); } friend flags& operator&=(flags& x, flags y) { x = x & y; return x; } friend flags& operator|=(flags& x, flags y) { x = x | y; return x; } friend flags& operator^=(flags& x, flags y) { x = x ^ y; return x; } #endif /// Basis for seeking in a file. enum seek_basis { #if defined(GENERATING_DOCUMENTATION) /// Seek to an absolute position. seek_set = implementation_defined, /// Seek to an offset relative to the current file position. seek_cur = implementation_defined, /// Seek to an offset relative to the end of the file. seek_end = implementation_defined #else seek_set = SEEK_SET, seek_cur = SEEK_CUR, seek_end = SEEK_END #endif }; protected: /// Protected destructor to prevent deletion through this type. ~file_base() { } }; } // namespace asio #include "asio/detail/pop_options.hpp" #endif // defined(ASIO_HAS_FILE) // || defined(GENERATING_DOCUMENTATION) #endif // ASIO_FILE_BASE_HPP
[ "qicosmos@163.com" ]
qicosmos@163.com
557da4f03d8eb74eb3ed12c917675f6b6d2d67e1
b88e2623de02f197ff72cc4e92fd9d970afbfa52
/src/integrate.cpp
bc06185a1eac986723b20e93df795c421daefb92
[]
no_license
hoergems/openrave_interface
dc4e9fa95671c5d5c03c1f2a8b16ada707d8810a
ec6828873cfc2a8e3896cf9a6041708a92201f65
refs/heads/master
2021-01-10T10:01:25.854816
2016-04-11T04:50:25
2016-04-11T04:50:25
51,899,580
0
0
null
null
null
null
UTF-8
C++
false
false
11,365
cpp
#include "include/integrate.hpp" using namespace boost::numeric::odeint; using std::endl; using std::cout; namespace shared{ template<class T> struct VecToList { static PyObject* convert(const std::vector<T>& vec) { boost::python::list* l = new boost::python::list(); for(size_t i = 0; i < vec.size(); i++) (*l).append(vec[i]); return l->ptr(); } }; Integrate::Integrate(): steady_states_setup_(false), g_(0.0), f_x_(0.0), f_y_(0.0), f_z_(0.0), f_roll_(0.0), f_pitch_(0.0), f_yaw_(0.0), viscous_(), acceleration_limit_(10000.0), rbdl_interface_(nullptr), body_name_(""), body_point_(), world_normal_(), last_t(0){ setupSteadyStates(); rho_vec_ = VectorXd(3); vel_ = VectorXd(3); } void Integrate::setGravityConstant(double g) { g_ = g; } void Integrate::setRBDLInterface(std::shared_ptr<shared::RBDLInterface> &rbdl_interface) { rbdl_interface_ = rbdl_interface; } std::shared_ptr<shared::RBDLInterface> Integrate::getRBDLInterface() { return rbdl_interface_; } void Integrate::setExternalForce(double &f_x, double &f_y, double &f_z, double &f_roll, double &f_pitch, double &f_yaw) { f_x_ = f_x; f_y_ = f_y; f_z_ = f_z; f_roll_ = f_roll; f_pitch_ = f_pitch; f_yaw_ = f_yaw; } void Integrate::setAccelerationLimit(double &accelerationLimit) { acceleration_limit_ = accelerationLimit; } void Integrate::setJointDamping(std::vector<double> &viscous) { viscous_.clear(); for (auto &k: viscous) { viscous_.push_back(k); } } double Integrate::factorial_(int num) const { double factor = 1; for (int i = 1; i < num + 1; i++) { factor = factor * i; } return factor; } MatrixXd Integrate::power_series_(MatrixXd &m, double t, int depth) const { MatrixXd A_t = -m * t; MatrixXd A_i = -m * t; MatrixXd term = MatrixXd::Identity(m.rows(), m.cols()); for (size_t i = 1; i < depth + 1; i++) { term = term + A_i / factorial_(i + 1); A_i = A_i * A_t; } return t * term; } void Integrate::calc_inverse_inertia_matrix(MatrixXd &M) const { M_inv_ = M.inverse(); } std::vector<double> Integrate::getResult() { return result_; } MatrixXd Integrate::get_end_effector_jacobian(const state_type &x, const state_type &rho, const state_type &zeta) const { return getEEJacobian(x, rho, zeta); } void Integrate::getProcessMatrices(std::vector<double> &x, std::vector<double> &rho, double t_e, std::vector<MatrixXd> &matrices) const { std::vector<double> zeta_nil; MatrixXd M = getM0(x, rho, zeta_nil); calc_inverse_inertia_matrix(M); MatrixXd AMatrix = getA0(x, rho, zeta_nil); MatrixXd BMatrix = getB0(x, rho, zeta_nil); MatrixXd VMatrix = getV0(x, rho, zeta_nil); MatrixXd A_matrx1 = (t_e * AMatrix).exp(); MatrixXd integral = power_series_(AMatrix, t_e, 20); MatrixXd B_matrx = A_matrx1 * integral * BMatrix; MatrixXd V_matrx = A_matrx1 * integral * VMatrix; matrices.push_back(A_matrx1); matrices.push_back(B_matrx); matrices.push_back(V_matrx); } std::vector<double> Integrate::getProcessMatricesVec(std::vector<double> &x, std::vector<double> &rho, double t_e) const { std::vector<MatrixXd> matrices; getProcessMatrices(x, rho, t_e, matrices); std::vector<double> res; for (size_t i = 0; i < matrices[0].size(); i++) { res.push_back(matrices[0](i)); } for (size_t i = 0; i < matrices[1].size(); i++) { res.push_back(matrices[1](i)); } for (size_t i = 0; i < matrices[2].size(); i++) { res.push_back(matrices[2](i)); } return res; } std::vector<double> Integrate::getProcessMatricesSteadyStatesVec(std::vector<double> &x, double t_e) const { std::vector<double> rho_nil; std::vector<double> zeta_nil; std::pair<int, std::vector<double>> closest_steady_state = getClosestSteadyState(x); for (size_t i = 0; i < closest_steady_state.second.size(); i++) { if (closest_steady_state.second[i] == -1) { closest_steady_state.second[i] = x[i]; } } std::pair<AB_funct, std::pair<AB_funct, AB_funct>> ab_functions = getClosestSteadyStateFunctions(closest_steady_state_.first); auto A = ab_functions.first; auto B = ab_functions.second.first; auto V = ab_functions.second.second; MatrixXd AMatrix = (this->*A)(closest_steady_state.second, rho_nil, zeta_nil); MatrixXd BMatrix = (this->*B)(closest_steady_state.second, rho_nil, zeta_nil); MatrixXd VMatrix = (this->*V)(closest_steady_state.second, rho_nil, zeta_nil); MatrixXd A_matrx1 = (t_e * AMatrix).exp(); MatrixXd integral = power_series_(AMatrix, t_e, 20); MatrixXd B_matrx = A_matrx1 * integral * BMatrix; MatrixXd B_matrx_temp = MatrixXd::Identity(B_matrx.rows(), B_matrx.cols() * 2); MatrixXd V_matrx_temp = MatrixXd::Identity(VMatrix.rows(), VMatrix.cols() * 2); for (size_t i = 0; i < B_matrx.rows(); i++) { for (size_t j = 0; j < B_matrx.cols(); j++) { B_matrx_temp(i, j) = B_matrx(i, j); V_matrx_temp(i, j) = VMatrix(i, j); } } std::vector<double> res; for (size_t i = 0; i < A_matrx1.size(); i++) { res.push_back(A_matrx1(i)); } for (size_t i = 0; i < B_matrx_temp.size(); i++) { res.push_back(B_matrx_temp(i)); } for (size_t i = 0; i < V_matrx_temp.size(); i++) { res.push_back(V_matrx_temp(i)); } return res; } void Integrate::do_integration_constraints(std::vector<double> &x, std::vector<double> &control, std::vector<double> &control_error, std::vector<double> &int_times, std::string &body_name, std::vector<double> &body_point, std::vector<double> &world_normal, std::vector<double> &result) const { body_name_ = body_name; body_point_ = body_point; world_normal_ = world_normal; last_dxdt.clear(); qdot_init.clear(); last_t = 0; result.clear(); double t0 = int_times[0]; double te = int_times[1]; double step_size = int_times[2]; rho_ = control; zeta_ = control_error; step_size_ = step_size; //////////////////////// std::vector<double> q; std::vector<double> qdot; std::vector<double> tau; VectorXd res = VectorXd::Zero(x.size() / 2); for (size_t i = 0; i < x.size() / 2; i++) { q.push_back(x[i]); qdot.push_back(x[i + x.size() / 2]); } rbdl_interface_->contact_impulse(q, qdot, tau, body_name, body_point, world_normal, res); for (size_t i = 0; i < x.size() / 2; i++) { x[i + x.size() / 2] = res[i]; } size_t k = integrate_const(bulirsch_stoer<state_type>() , std::bind(&Integrate::ode , this , pl::_1 , pl::_2 , pl::_3), x, t0 , te , step_size); result = x; } void Integrate::do_integration(std::vector<double> &x, std::vector<double> &control, std::vector<double> &control_error, std::vector<double> &int_times, std::vector<double> &result) const { body_point_.clear(); world_normal_.clear(); result.clear(); double t0 = int_times[0]; double te = int_times[1]; double step_size = int_times[2]; rho_ = control; zeta_ = control_error; size_t k = integrate_const(bulirsch_stoer<state_type>() , std::bind(&Integrate::ode , this , pl::_1 , pl::_2 , pl::_3), x , t0 , te , step_size); result = x; } void Integrate::setupSteadyStates() const { } std::pair<Integrate::AB_funct, std::pair<Integrate::AB_funct, Integrate::AB_funct>> Integrate::getClosestSteadyStateFunctions(int &idx) const { return std::make_pair(a_map_.find(idx)->second, std::make_pair(b_map_.find(idx)->second, v_map_.find(idx)->second)); } std::pair<int, std::vector<double>> Integrate::getClosestSteadyState(const state_type &x) const { int min_idx = 0; double dist = 0.0; double min_dist = 10000000.0; double steady_state_val = 0.0; for (size_t i = 0; i < steady_states_.size(); i++) { dist = 0.0; for (size_t j = 0; j < steady_states_[i].size(); j++) { if (steady_states_[i][j] == -1) { steady_state_val = x[j]; } else { steady_state_val = steady_states_[i][j]; } dist += std::pow(x[j] - steady_state_val, 2); } dist = std::sqrt(dist); if (dist < min_dist) { min_dist = dist; min_idx = i; } } return std::make_pair(min_idx, steady_states_[min_idx]); } void Integrate::ode_contact(const state_type &x, state_type &dxdt, double t) const { VectorXd res = VectorXd::Zero(x.size() / 2); dxdt.clear(); std::vector<double> q; std::vector<double> rho; for (size_t i = 0; i < x.size() / 2; i++) { q.push_back(x[i]); dxdt.push_back(x[i + x.size() / 2]); rho.push_back(rho_[i] + zeta_[i]); } //rbdl_interface_->forward_dynamics_constraints(q, dxdt, rho, body_name_, body_point_, world_normal_, res); for (size_t i = 0; i < x.size() / 2; i++) { dxdt.push_back(res[i]); } return; } void Integrate::ode(const state_type &x , state_type &dxdt , double t) const { dxdt.clear(); VectorXd res = VectorXd::Zero(x.size() / 2); std::vector<double> q; std::vector<double> rho; for (size_t i = 0; i < x.size() / 2; i++) { q.push_back(x[i]); dxdt.push_back(x[i + x.size() / 2]); rho.push_back(rho_[i] + zeta_[i]); } if (body_point_.size() > 0) { rbdl_interface_->forward_dynamics_constraints(q, dxdt, rho, body_name_, body_point_, world_normal_, res); } else { rbdl_interface_->forward_dynamics(q, dxdt, rho, res); } for (size_t i = 0; i < x.size() / 2; i++) { dxdt.push_back(res(i)); } return; } BOOST_PYTHON_MODULE(libintegrate) { using namespace boost::python; class_<std::vector<double> > ("v_double") .def(vector_indexing_suite<std::vector<double> >()); class_<Integrate>("Integrate", init<>()) .def("doIntegration", &Integrate::do_integration) .def("getResult", &Integrate::getResult) .def("getProcessMatricesSteadyStates", &Integrate::getProcessMatricesSteadyStatesVec) .def("getProcessMatrices", &Integrate::getProcessMatricesVec) .def("setGravityConstant", &Integrate::setGravityConstant) ; } MatrixXd Integrate::getA0(const state_type &x, const state_type &rho, const state_type &zeta) const{ MatrixXd m(6, 6); return m; } MatrixXd Integrate::getB0(const state_type &x, const state_type &rho, const state_type &zeta) const{ MatrixXd m(6, 3); return m; } MatrixXd Integrate::getV0(const state_type &x, const state_type &rho, const state_type &zeta) const{ MatrixXd m(6, 3); return m; } MatrixXd Integrate::getM0(const state_type &x, const state_type &rho, const state_type &zeta) const{ MatrixXd m(3, 3); return m; } MatrixXd Integrate::getF0(const state_type &x, const state_type &rho, const state_type &zeta) const{ VectorXd m(6); return m; } MatrixXd Integrate::getEEJacobian(const state_type &x, const state_type &rho, const state_type &zeta) const{ MatrixXd m(6, 3); return m; } }
[ "hoergems@gmail.com" ]
hoergems@gmail.com
2ce9a3be1b048aa2c0b4f4504180a59a0356f9c7
6ee6cc888f0a82e36fd1687fed4a109f0cb800a7
/leetcode/312.cpp
195c70c9678f41e36df09fccb7d011a52a8c4a1a
[]
no_license
Rayleigh0328/OJ
1977e3dfc05f96437749b6259eda4d13133d2c87
3d7caaf356c69868a2f4359377ec75e15dafb4c3
refs/heads/master
2021-01-21T04:32:03.645841
2019-12-01T06:33:44
2019-12-01T06:33:44
49,385,474
1
0
null
null
null
null
UTF-8
C++
false
false
897
cpp
class Solution { public: int maxCoins(vector<int>& nums) { int n = nums.size()+2; int* p = new int [n]; p[0] = p[n-1] = 1; for (int i=1;i<n-1;++i) p[i] = nums[i-1]; int** f = new int* [n]; for (int i=0;i<n;++i) f[i] = new int [n]; for (int i=0;i<n;++i) for (int j=0;j<n;++j) f[i][j] = 0; for (int t=0; t<n;++t) for (int i=1;i<n-1;++i) if (i+t < n-1) for (int j=i;j<=i+t;++j) f[i][i+t] = max(f[i][i+t], (i<=j-1?f[i][j-1]:0) + (j+1<=i+t?f[j+1][i+t]:0) + p[j]*p[i-1]*p[i+t+1]); /* for (int i=0;i<n;++i) { for (int j=0;j<n;++j) cout << "\t" << f[i][j]; cout << endl; } */ return f[1][n-2]; } };
[ "j4bian@uwaterloo.ca" ]
j4bian@uwaterloo.ca
9b107b720ce498f461da5503e16338990f8c1d76
3239d1f0223da3bf99305a9cec6733555171abf5
/MV200/Parameter.h
bc34a02824ac5a7b0f57b910a3287c8401150eda
[]
no_license
qq77457051/crpAlynasis
5f757e2ff53fe957a2aa9e3ba087a6f2d1086e8c
6f4036464eb2006d2e1b70d7152d619146d1280a
refs/heads/master
2023-03-20T10:35:50.334423
2017-10-27T10:27:44
2017-10-27T10:27:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
16,285
h
#ifndef GPARAMETER_H #define GPARAMETER_H #include <QObject> #include <QVector> #include <QMapIterator> #include "ParamDefine.h" #include "Object/SQLite/sqlite.h" //常规项目 结构体保存各个项目的参数(包括Logic5P、项目其他参数) struct ProjectParamS { bool isDiluentPorj; //是否为稀释项目(0:非稀释项目,1:稀释项目) QString Param_unit; //项目单位 (是否有用,待定) int Param_accuracy; //项目精度 double Param_lowLinear; //线性下限 double Param_factorK; //K因数值 double Param_bloodFactor; //全血因子(全血模式有效,非全血则为1) int Param_lightPos1; //测光点1 int Param_lightPos2; //测光点2 int Param_Reagent_R0; //R0试剂ID(试剂表,0:未选择试剂位) int Param_Reagent_R1; //R1试剂ID(试剂表,0:未选择试剂位) int Param_Reagent_R2; //R2试剂ID(试剂表,0:未选择试剂位) int Param_SVol; //样本量(ul) int Param_R0Vol; //探针吸R0量(ul) int Param_R1Vol; //探针吸R1量(ul) int Param_RSVol; //探针吸稀释后的样本量(ul)样本转移量 int Param_R2Vol; //探针吸R2量(ul) double Param_R0; //参数R0 double Param_K; //参数K double Param_a; //参数a double Param_b; //参数b double Param_c; //参数c double Param_R; //参数-最大幅度 double Param_C; //参数-最大浓度 bool isLogic5P2; //是否有第二段曲线 double Param2_R0; //参数R0 double Param2_K; //参数K double Param2_a; //参数a double Param2_b; //参数b double Param2_c; //参数c double Param2_R; //参数-最大幅度 double Param2_C; //参数-最大浓度 }; //组合项目 struct CombineProject { //int CombID; //组合项目ID QString CombProjectNameEn; //组合项目简称 QString CombProjectNameCn; //组合项目全称 QString CombProjectMember; //项目成员,以“+”为间隔,如(CCP+hs-CRP) QString CombProjectMemberID; //项目id,以“-”为间隔,如(1-2-3) }; //计算项目 struct CalculateProject { //int CalculateID; //计算项目ID QString CalculateProjectNameEn; //计算项目简称 QString CalculateProjectNameCn; //计算项目全称 QString ProjectList; //项目列表,以“+”为分隔 如:TP+hs-CRP QString CalculateProjectExpression; //表达式,如:{TP}-{ALB} QString Unit; //项目单位 int Accracy; //小数位数 double Range1; //参考范围1 double Range2; //参考范围2 QString CalculateProjectExpressionNO; //编号表达式,如:1-2 }; //质控项目参数队列 struct QCParam { int Proj_id; //项目id QString ProjName; //项目名称 double TargetValue; //靶值 double SD; //标准差 double TargetUpperL; //靶值上限 double TargetLowerL; //靶值下限 }; //质控液 struct QCLiquid { int id; //质控液ID QString Name; //质控液名称 int SampleType; //质控液样本类型 QString BatchNo; //批号 QString ValidDate; //有效期 QString BarCode; //条码 QCParam Param[PROJECT_COUNT]; //项目参数 }; //状态枚举表(对应数据库状态表的id) enum StateTable { State_IDLE = 1, //空闲 State_APPLICATE = 2, //已申请 State_WAIT = 3, //待测试(等待) State_TESTING = 4, //测试中 State_ADD_DILUENT = 5, //加稀释液(R0) State_ADD_SAMPLE = 6, //加样本 State_ADD_R1 = 7, //加R1 State_ADD_RS = 8, //加稀释样本(RS) State_ADD_R2 = 9, //加R2 State_DIRTY = 10, //脏杯(反应杯) State_FINISHED = 11, //完成(测试完成) State_CLEAN = 12, //清洗(反应杯) State_ERROR = 13, //出错 State_BLANK = 14, //空跑 State_unFINISHED = 15, //未完成 State_noSAMPLE = 16, //缺少样本 State_END1 = 17, //测试加样完成(END1) State_END2 = 18, //测试采光完成(END2) State_BLANKOUT = 19, //取消/作废 State_noREAGENT = 20 //缺少试剂(20170706新增) //有新状态,则往后添加 }; class GParameter : public QObject { Q_OBJECT public: explicit GParameter(QObject *parent = 0); /*************************************************************************************************************************/ /**Build类型(发布版、研发版)**/ bool get_isRelease(); //0:研发版,即供公司内部使用。1:发布版,即供客户端使用。 void set_isRelease(bool flag); /*************************************************************************************************************************/ /**用户信息**/ QString getCompanyName_En(); //公司英文名称 QString getCompanyName_Cn(); //公司中文名称 void setUserName(QString); //设置用户名 QString getUserName(); //获取用户名 void setUserID(int id); //设置用户ID int getUserID(); //获取用户ID QString getHospitalName(); //获取医院名称(打印表头) void setHospitalName(QString name); QString getMachineName(); //机器名称,MV200 QString getTCPServerIP(); //tcp服务器ip void setTCPServerIP(QString ip); int getTCPServerPort(); //端口 int setTCPServerPort(int port); int get_isLISAutoStart(); //是否开机自动连接LIS服务器 void set_isLISAutoStart(int flag); QString get_LIS_IP(); //LIS ip void set_LIS_IP(QString ip); int get_LIS_Port(); //LIS 端口 void set_LIS_Port(int port); int get_ACKTime(); //ACK超时 void set_ACKTime(int time); /*************************************************************************************************************************/ /**开机流程**/ void set_isSelfCheck(int isCheck); //设置开机是否自检 int get_isSelfCheck(); //获取开机是否自检 /*************************************************************************************************************************/ /**项目信息**/ ProjectParamS getProjectParam(int id); //查询id项目的项目参数 void setProjectParam(int id, ProjectParamS param);//新增/修改项目参数 void removeProjectParam(int id); //移除项目参数(删除项目时用到) QVector<QString> get_ProjectName(); //MV100测试项目名称 QMap<int, QString> getProjectMap(); //项目名称<id, 项目> void setProjectMap(QMap<int, QString> map); int appendProjectMap(int id, QString name); //追加项目 int removeProjectMap(int id); //移除Map中的项目 int getProject_id(QString project); QString getPorject_Name(int id); QMap<int, int> getMapReagentSlot(); //试剂仓信息映射<试剂瓶号,项目id> void setMapReagentSlot(QMap<int, int> map); void setMapReagentSlot(int key, int value);//设置key位置的项目id为value int getMapReagentSlotValue(int rNo); //获取试剂位对应的项目ID void ReleaseReagentNo(int rNo); //释放rNo试剂位 int ReleaseAllReagent(); //释放全部试剂位 bool getReagentNoState(int rNo); //查看rNo试剂位的状态(是否已经占用,0:未占用,1:已占用) int getReagentPosCount(int pID); //查看项目对应的试剂位置个数 //组合项目 QString getCombProjectMember(int id); //获取组合项目的成员名称组合 QString getCombProjectMemberID(int id); //获取组合项目的成员项目id组合 QVector<QString> getCombineProjectName(); //组合项目的名称 void setCombineProjectMap(QMap<int, CombineProject> map);//组合项目 void setCombineProject(int id, CombineProject param); //新增/修改组合项目 int removeCombineProject(int id); //移除组合项目 int isComgineProjectExist(QString name); //查看name组合项目是否已经存在(若存在,则返回组合项目的id) //计算项目 int getCalculateProjectAccracy(int id); //计算项目的精度(小数位数) int getCalculateProject_id(QString name); //获取计算项目的id QString getCalculateProjectExpression(int id); //获取计算项目表达式 QStringList getCalculateProjectList(int id); //获取计算项目的子项目列表 QString getCalculateProjectExpressionNO(int id); //获取计算项目编号表达式(未使用) QVector<QString> getCalculateProjectName(); //计算项目的名称 CalculateProject getCalculateProjectParam(int id); //获取指定id的计算项目的参数 void setCalculateProjectMap(QMap<int, CalculateProject> map);//计算项目 void setCalculateProject(int id, CalculateProject param); //新增/修改计算项目 int removeCalculateProject(int id); //移除计算项目 int isCalculateProjectExist(QString name); //查看name计算项目是否已经存在(若存在,则返回计算项目的id) //质控液 void ResetQcLiquidMap(); //重置质控液映射 void setQCLiquidMap(QMap<int, QCLiquid> map); //质控液(质控液id, 质控液参数) QMap<int, QCLiquid> getQCLiquidMap(); QStringList getQcLiquidName(); //质控液名称 int insertQcLiquidMap(int id, QCLiquid qc); //添加质控液参数 int removeQcLiquidMap(int id); //移除质控液 int updateQcLiquidMap(int id, QCLiquid param); //更新质控液参数 QCLiquid getQCParam(int id); //相应质控液的参数 QCParam *getQcProjParam(int id); //质控液对应的项目参数 QStringList getQcProject(QString name); //质控液对应的项目名称 int getQcLiquidID(QString name); //质控液id //加样针到试剂瓶底的步数 void setProbe2Bottom(int step); int getProbe2Bottom(); QStringList getSampleTypeList(); //样本类型 void setSampleTypeList(QStringList list); int getSampleNo(); //样本编号(记录作用) void setSampleNo(int no); /*************************************************************************************************************************/ /**周期参数**/ int getCycleTime(); //每个周期的时间长度 void setCycleTime(int time); /*************************************************************************************************************************/ /**系统参数**/ bool get_isLiquidAlarmStop(); //液体状态报警是否要停机 void set_isLiquidAlarmStop(bool flag); int get_LessWaterTimes(); //提示“缺少去离子水”后最多能运行的次数 void set_LessWaterTimes(int times); int get_LessCleanLiquidTimes(); //提示“缺少清洗液”后最多能运行的次数 void set_LessCleanLiquidTimes(int times); int get_Full_L_WasteTimes(); //提示“低浓度废液满”后最多能运行的次数 void set_Full_L_WasteTimes(int times); int get_Full_H_WasteTimes(); //提示“高浓度废液满”后最多能运行的次数 void set_Full_H_WasteTimes(int times); bool get_isAutoSaveResult(); //结果是否自动保存到数据库 void set_isAutoSaveResult(bool flag); void setCupDirtyAD(int value); //设置脏杯的AD值 int getCupDirtyAD(); //清洗机构-清水吸液量(但实际上是控泵阀的开关时间) int getWaterVol(); void setWaterVol(int vol); //清洗机构-清液吸液量(但实际上是控泵阀的开关时间) int getCleanLiquidVol(); void setCleanLiquidVol(int vol); private: /*************************************************************************************************************************/ /**Build类型(发布版、研发版)**/ bool isRelease; //0:研发版,即供公司内部使用。1:发布版,即供客户端使用。 /*************************************************************************************************************************/ /**用户信息**/ QString UserName; //用户名 int UserID; //用户ID QString HospitalName;//获取医院名称 QString MachineName; //机器名称,MV200 QString CompanyName; //公司名称(英文) QString CompanyName2;//公司名称(中文) int Port; //端口(中位机) QString Host_IP; //tcp服务器ip(中位机) QString LIS_IP; //LIS ip int LIS_Port; //LIS 端口 int ACKTime; //ACK超时 int isLISAutoStart; //是否开机自动连接LIS服务器 /*************************************************************************************************************************/ /**开机流程**/ int isSelfCheck; //开机是否自检 /*************************************************************************************************************************/ /**项目信息**/ //常规项目 QMap<int, QString> ProjectMap; //项目名称 <id, 项目> QMap<int, ProjectParamS> *MapProjectParamS; //项目参数映射<项目id, 参数表> //有点重复 ?? (在项目参数中包含了, 待修改) QMap<int, int> MapReagentSlot; //试剂仓信息映射<试剂瓶号,项目id> 目前用处:在设置项目对应的试剂位置时,不允许不同项目使用同一个试剂位 //组合项目 QMap<int, CombineProject> CombineProjectMap; //组合项目(项目id, 项目参数) //计算项目 QMap<int, CalculateProject> CalculateProjectMap; //计算项目(项目id, 项目参数) //质控液 QCParam *QcParam; //质控液对应的项目参数 QMap<int, QCLiquid> QCLiquidMap; //质控液(质控液id, 质控液参数) QStringList QcLiquidNameList; //质控液名称列表 //加样针复位位置到试剂瓶底的步数(计算试剂余量) int Probe2Bottom; QStringList SampleTypeList; //样本类型 int SampleNo; //样本编号(记录作用,申请样本测试用) /*************************************************************************************************************************/ /**周期参数**/ int CycleTime; //每个周期的时间长度 /*************************************************************************************************************************/ /**系统参数**/ bool isLiquidAlarmStop; //液体状态报警是否要停机 int LessWaterTimes; //提示“缺少去离子水”后最多能运行的次数 int LessCleanLiquidTimes; //提示“缺少清洗液”后最多能运行的次数 int Full_L_WasteTimes; //提示“低浓度废液满”后最多能运行的次数 int Full_H_WasteTimes; //提示“高浓度废液满”后最多能运行的次数 bool isAutoSaveResult; //结果是否自动保存到数据库 int CupDirtyAD; //脏杯的AD值 //清洗机构-清水吸液量 int WaterVol; //清洗机构-清液吸液量 int CleanLiquidVol; signals: void sig_newProject(); //信号:添加了新的测试项目 void sig_newCombineProject(); //信号:添加了新的组合项目 void sig_newCalculateProject(); //信号:添加了新的计算项目 void sig_UpdateQcLiquidName(); //信号:更新质控液列表 public slots: }; extern GParameter * gParameter; #endif // GPARAMETER_H
[ "474007782@qq.com" ]
474007782@qq.com
2753aa7039c676ea3316969c4601c3b43f20824f
b25795509f9545ea6b9f947492b39e518add0396
/ACM/南工大ACM-回溯法/0-1背包.cpp
ca938e4cc520f027c6dcf29a0a16bd5fa84a887e
[]
no_license
Autokaka/C-Single-Ranking
370e09a5d96212dc0fdef71b4cfe2bd6389c5e22
111808c552ee81a6109406e770970560501cea79
refs/heads/master
2022-01-11T09:43:02.585962
2019-07-15T04:48:12
2019-07-15T04:48:12
176,041,920
0
0
null
null
null
null
GB18030
C++
false
false
1,123
cpp
#include <bits/stdc++.h> using namespace std; #define rep(x, y, z) for(int (x) = (y); (x) < (z); (x)++) #define N 15 int x[N], ret[N], n, W, cur = 0, ans = 0, ans1 = 0, rest;//x[i] = 0不取第i个物品; x[i] = 1取. cur当前背包已存放物品的重量; rest没有考虑的物品的价值总量 struct node { int weight, value; } goods[N]; void dfs(int dep) { int i; if (dep >= N) { if (ans1 > ans) { ans = ans1; for (i = 0; i < n; i++) ret[i] = x[i]; } return; } //加入第dep个物品 if (cur + goods[dep].weight <= W) { x[dep] = 1; ans1 += goods[dep].value; cur += goods[dep].weight; dfs(dep + 1); cur -= goods[dep].weight;//一定记得回溯以后要减回去 ans1 -= goods[dep].value; } //不加入 rest -= goods[dep].value; if (rest + ans1 > ans) { x[dep] = 0; dfs(dep + 1); } rest += goods[dep].value; } int main() { int i; cin >> n >> W; for (i = 0; i < n; i++) { cin >> goods[i].weight >> goods[i].value; rest += goods[i].value; } dfs(0); for (i = 0; i < n; i++) if (ret[i]) cout << i + 1 << " "; cout << ans << endl; return 0; }
[ "qq1909698494@gmail.com" ]
qq1909698494@gmail.com
22d7eed253cd5a670aec56782e13b3ada7852694
ba316d9b90e0078275891ed0b9be7f7fd55fb6f8
/test/work_queue_for_tests_schedule_work.cpp
e3eeb84c902ab749206a7be7a5ec494892464c47
[]
no_license
o-peregudov/mqmx
32a706a5eb8c733735a1cc4744b2973fd07676aa
f462bfe465310948dc7263f82a7af0b300969adb
refs/heads/master
2021-01-16T23:52:33.847232
2016-10-12T18:08:29
2016-10-12T18:08:29
59,597,636
0
0
null
null
null
null
UTF-8
C++
false
false
1,221
cpp
#include "mqmx/testing/work_queue_for_tests.h" #include "test/FakeIt/single_header/standalone/fakeit.hpp" #undef NDEBUG #include <cassert> struct work_interface { virtual bool do_something (const mqmx::work_queue::work_id_type) = 0; virtual ~work_interface () { } }; int main () { using namespace mqmx; using namespace fakeit; using mock_type = Mock<work_interface>; mock_type mock; When (Method (mock, do_something)).AlwaysReturn (true); { testing::work_queue_for_tests sut; status_code ec = ExitStatus::Success; work_queue::work_id_type work_id = work_queue::INVALID_WORK_ID; work_queue::client_id_type client_id = sut.get_client_id (); std::tie (ec, work_id) = sut.schedule_work ( client_id, std::bind (&work_interface::do_something, &(mock.get ()), std::placeholders::_1)); assert (ec == ExitStatus::Success); assert (work_id != work_queue::INVALID_WORK_ID); sut.forward_time (); ec = sut.cancel_work (work_id); assert (ec == ExitStatus::NotFound); Verify (Method (mock, do_something).Using (work_id)) .Once (); } VerifyNoOtherInvocations (mock); return 0; }
[ "o.peregudov@gmail.com" ]
o.peregudov@gmail.com
d46f0c0bc08b50b3db3fcb40ae0deaec13126cf2
dc7d429b74a6be2b411cea21ba06ca5bfcaf0f88
/atlantis_fw/AsicFwS2/include/matrix.h
b3e5a12dea672c229d6f9c1733286e41c671b345
[]
no_license
hoantien/Light_code
620b458dace18f749d068e3d74303dd6875b2ca8
9b83bbb88c1c403d73c7c45c44389c006fe0d0e6
refs/heads/master
2020-03-08T10:25:30.436400
2018-04-04T15:10:58
2018-04-04T15:10:58
128,072,987
1
1
null
null
null
null
UTF-8
C++
false
false
44,545
h
// we want to have support for the following: // matrix3x3f, matrix4x4f, vec2f, vec3f, vec4f // plus, minus, multiplication, inverse, transpose #ifndef __MATRIX_H__ #define __MATRIX_H__ #ifdef __cplusplus #include <cstdlib> #include <algorithm> // has compile problem... #include <cmath> namespace ltaf { // lt auto focus // ----------------------------------------------------------- // Vec2 class // ----------------------------------------------------------- template<typename T> class Vec2 { public: Vec2() {} Vec2( T t ) : _x( t ), _y( t ) {} Vec2( T x, T y ) : _x( x ), _y( y ) {} Vec2( const Vec2 & t ) : _x( t._x ), _y( t._y ) {} template<typename U> explicit Vec2( const Vec2<U> & t ) : _x( static_cast<T>( t.x() ) ) , _y( static_cast<T>( t.y() ) ) {} Vec2 & operator=( const Vec2 & t ) { _x = t._x; _y = t._y; return *this; } Vec2 & operator/=( const Vec2 & t ) { _x /= t._x; _y /= t._y; return *this; } Vec2 & operator%=( const Vec2 & t ) { _x %= t._x; _y %= t._y; return *this; } Vec2 & operator*=( const Vec2 & t ) { _x *= t._x; _y *= t._y; return *this; } Vec2 & operator+=( const Vec2 & t ) { _x += t._x; _y += t._y; return *this; } Vec2 & operator-=( const Vec2 & t ) { _x -= t._x; _y -= t._y; return *this; } Vec2 & operator&=( const Vec2 & t ) { _x &= t._x; _y &= t._y; return *this; } Vec2 & operator|=( const Vec2 & t ) { _x |= t._x; _y |= t._y; return *this; } Vec2 & operator>>=( int t ) { _x >>= t; _y >>= t; return *this; } Vec2 & operator<<=( int t ) { _x <<= t; _y <<= t; return *this; } Vec2 operator-() const { return { -_x, -_y}; } template<typename U> Vec2<typename std::common_type<T, U>::type> operator+( const Vec2<U> & t ) const { return { _x + t.x(), _y + t.y() }; } template<typename U> Vec2<typename std::common_type<T, U>::type> operator-( const Vec2<U> & t ) const { return { _x - t.x(), _y - t.y() }; } template<typename U> Vec2<typename std::common_type<T, U>::type> operator*( const Vec2<U> & t ) const { return { _x * t.x(), _y * t.y() }; } template<typename U> Vec2<typename std::common_type<T, U>::type> operator/( const Vec2<U> & t ) const { return { _x / t.x(), _y / t.y() }; } template < typename U, typename = typename std::enable_if < std::is_integral<T>::value && std::is_integral<U>::value >::type > Vec2<typename std::common_type<T, U>::type> operator%( const Vec2<U> & t ) const { return { _x % t.x(), _y % t.y() }; } template < typename U, typename = typename std::enable_if < std::is_arithmetic<U>::value >::type > Vec2<typename std::common_type<T, U>::type> operator+( U t ) const { return { _x + t, _y + t }; } template < typename U, typename = typename std::enable_if < std::is_arithmetic<U>::value >::type > Vec2<typename std::common_type<T, U>::type> operator-( U t ) const { return { _x - t, _y - t }; } template < typename U, typename = typename std::enable_if < std::is_arithmetic<U>::value >::type > Vec2<typename std::common_type<T, U>::type> operator*( U t ) const { return { _x * t, _y * t }; } template < typename U, typename = typename std::enable_if < std::is_arithmetic<U>::value >::type > Vec2<typename std::common_type<T, U>::type> operator/( U t ) const { return { _x / t, _y / t }; } template < typename U, typename = typename std::enable_if < std::is_integral<T>::value && std::is_integral<U>::value >::type > Vec2<typename std::common_type<T, U>::type> operator%( U t ) const { return { _x % t, _y % t }; } T min() const { return std::min( _x, _y ); } T max() const { return std::max( _x, _y ); } T sum() const { return _x + _y; } T dot( const Vec2<T> & t ) const { return _x * t.x() + _y * t.y(); } Vec2 abs() const { return { std::abs( _x ), std::abs( _y ) }; } const T & x() const { return _x; } const T & y() const { return _y; } void setX( T x ) { _x = x; } void setY( T y ) { _y = y; } private: T _x, _y; }; // basic add/sub/mul/div operators template < typename T, typename U, typename = typename std::enable_if < std::is_arithmetic<T>::value >::type > Vec2<typename std::common_type<T, U>::type> operator+( T a, const Vec2<U> & b ) { return b + a; } template < typename T, typename U, typename = typename std::enable_if < std::is_arithmetic<T>::value >::type > Vec2<typename std::common_type<T, U>::type> operator*( T a, const Vec2<U> & b ) { return b * a; } template < typename T, typename U, typename = typename std::enable_if < std::is_arithmetic<T>::value >::type > Vec2<typename std::common_type<T, U>::type> operator-( T a, const Vec2<U> & b ) { return Vec2<T>( a ) - b; } template < typename T, typename U, typename = typename std::enable_if < std::is_arithmetic<T>::value >::type > Vec2<typename std::common_type<T, U>::type> operator/( T a, const Vec2<U> & b ) { return Vec2<T>( a ) / b; } // basic math functions template<typename T> T min( const Vec2<T> & t ) { return t.min(); } template<typename T> T max( const Vec2<T> & t ) { return t.max(); } template<typename T> T sum( const Vec2<T> & t ) { return t.sum(); } template<typename T> T dot( const Vec2<T> & a, const Vec2<T> & b ) { return a.dot( b ); } template<typename T> Vec2<T> min( const Vec2<T> & a, const Vec2<T> & b ) { return { std::min( a.x(), b.x() ), std::min( a.y(), b.y() ) }; } template<typename T> Vec2<T> abs( const Vec2<T> & t ) { return t.abs(); } // template<typename T> // Vec2<T> sign( const Vec2<T> & t ) { return t.sign(); } template<typename T> typename std::enable_if<std::is_floating_point<T>::value, T>::type length( const Vec2<T> & a ) { return std::sqrt( dot( a, a ) ); } template<typename T> typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type sqrt( const Vec2<T> & a ) { return { std::sqrt( a.x() ), std::sqrt( a.y() ) }; } template<typename T> typename std::enable_if<std::is_floating_point<T>::value, T>::type squaredSum( const Vec2<T> & a ) { return dot( a, a ); } template<typename T> typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type normalize( const Vec2<T> & a ) { return a / length( a ); } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type // pow( const Vec2<T> & a, const Vec2<T> & b ) // { return { std::pow( a.x(), b.x() ), std::pow( a.y(), b.y() ) }; } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type // pow( const Vec2<T> & a, T b ) // { return { std::pow( a.x(), b ), std::pow( a.y(), b ) }; } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type // pow( T a, const Vec2<T> & b ) // { return { std::pow( a, b.x() ), std::pow( a, b.y() ) }; } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type // floor( const Vec2<T> & a ) // { return { std::floor( a.x() ), std::floor( a.y() ) }; } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec2<T> >::type // ceil( const Vec2<T> & a ) // { return { std::ceil( a.x() ), std::ceil( a.y() ) }; } // ----------------------------------------------------------- // Vec3 class // ----------------------------------------------------------- template<typename T> class Vec3 { public: Vec3() {} Vec3( T t ) : _x( t ), _y( t ), _z( t ) {} Vec3( T x, T y, T z ) : _x( x ), _y( y ), _z( z ) {} Vec3( const Vec3 & t ) : _x( t._x ), _y( t._y ), _z( t._z ) {} template<typename U> explicit Vec3( const Vec3<U> & t ) : _x( static_cast<T>( t.x() ) ) , _y( static_cast<T>( t.y() ) ) , _z( static_cast<T>( t.z() ) ) {} Vec3 & operator=( const Vec3 & t ) { _x = t._x; _y = t._y; _z = t._z; return *this; } Vec3 & operator/=( const Vec3 & t ) { _x /= t._x; _y /= t._y; _z /= t._z; return *this; } Vec3 & operator%=( const Vec3 & t ) { _x %= t._x; _y %= t._y; _z %= t._z; return *this; } Vec3 & operator*=( const Vec3 & t ) { _x *= t._x; _y *= t._y; _z *= t._z; return *this; } Vec3 & operator+=( const Vec3 & t ) { _x += t._x; _y += t._y; _z += t._z; return *this; } Vec3 & operator-=( const Vec3 & t ) { _x -= t._x; _y -= t._y; _z -= t._z; return *this; } Vec3 & operator&=( const Vec3 & t ) { _x &= t._x; _y &= t._y; _z &= t._z; return *this; } Vec3 & operator|=( const Vec3 & t ) { _x |= t._x; _y |= t._y; _z |= t._z; return *this; } Vec3 & operator>>=( int t ) { _x >>= t; _y >>= t; _z >>= t; return *this; } Vec3 & operator<<=( int t ) { _x <<= t; _y <<= t; _z <<= t; return *this; } Vec3 operator-() const { return { -_x, -_y, -_z }; } template<typename U > Vec3<typename std::common_type<T, U>::type> operator+( const Vec3<U> & t ) const { return { _x + t.x(), _y + t.y(), _z + t.z() }; } template<typename U> Vec3<typename std::common_type<T, U>::type> operator-( const Vec3<U> & t ) const { return { _x - t.x(), _y - t.y(), _z - t.z() }; } template<typename U> Vec3<typename std::common_type<T, U>::type> operator*( const Vec3<U> & t ) const { return { _x * t.x(), _y * t.y(), _z * t.z() }; } template<typename U> Vec3<typename std::common_type<T, U>::type> operator/( const Vec3<U> & t ) const { return { _x / t.x(), _y / t.y(), _z / t.z() }; } template < typename U, typename = typename std::enable_if < std::is_integral<T>::value && std::is_integral<U>::value >::type > Vec3<typename std::common_type<T, U>::type> operator%( const Vec3<U> & t ) const { return { _x % t.x(), _y % t.y(), _z % t.z() }; } template < typename U, typename = typename std::enable_if < std::is_arithmetic<U>::value >::type > Vec3<typename std::common_type<T, U>::type> operator+( U t ) const { return { _x + t, _y + t, _z + t }; } template < typename U, typename = typename std::enable_if < std::is_arithmetic<U>::value >::type > Vec3<typename std::common_type<T, U>::type> operator-( U t ) const { return { _x - t, _y - t, _z - t }; } template < typename U, typename = typename std::enable_if < std::is_arithmetic<U>::value >::type > Vec3<typename std::common_type<T, U>::type> operator*( U t ) const { return { _x * t, _y * t, _z * t }; } template < typename U, typename = typename std::enable_if < std::is_arithmetic<U>::value >::type > Vec3<typename std::common_type<T, U>::type> operator/( U t ) const { return { _x / t, _y / t, _z / t }; } template < typename U, typename = typename std::enable_if < std::is_integral<T>::value && std::is_integral<U>::value >::type > Vec3<typename std::common_type<T, U>::type> operator%( U t ) const { return { _x % t, _y % t, _z % t }; } Vec3<bool> operator==( const Vec3 & t ) const { return { _x == t._x, _y == t._y, _z == t._z }; } Vec3<bool> operator!=( const Vec3 & t ) const { return { _x != t._x, _y != t._y, _z != t._z }; } Vec3<bool> operator>=( const Vec3 & t ) const { return { _x >= t._x, _y >= t._y, _z >= t._z }; } Vec3<bool> operator>( const Vec3 & t ) const { return { _x > t._x, _y > t._y, _z > t._z }; } Vec3<bool> operator<=( const Vec3 & t ) const { return { _x <= t._x, _y <= t._y, _z <= t._z }; } Vec3<bool> operator<( const Vec3 & t ) const { return { _x < t._x, _y < t._y, _z < t._z }; } T min() const { return std::min( std::min( _x, _y ), _z ); } T max() const { return std::max( std::max( _x, _y ), _z ); } T sum() const { return _x + _y + _z; } T dot( const Vec3<T> & t ) const { return _x * t.x() + _y * t.y() + _z * t.z(); } // cross product in right-hand side coordinate (i.e. if this=(1,0,0), t=(0,1,0), out=(0,0,1)). Vec3<T> cross( const Vec3<T> & t ) const { return Vec3<T> {_y * t.z() - _z * t.y(), _z * t.x() - _x * t.z(), _x * t.y() - _y * t.x()};} Vec3 abs() const { return { std::abs( _x ), std::abs( _y ), std::abs( _z ) }; } const T & x() const { return _x; } const T & y() const { return _y; } const T & z() const { return _z; } void setX( T x ) { _x = x; } void setY( T y ) { _y = y; } void setZ( T z ) { _z = z; } Vec3 & normalize() { T len = length(*this); _x /= len; _y /= len; _z /= len; return *this; } private: T _x, _y, _z; }; // basic math functions template<typename T> T min( const Vec3<T> & t ) { return t.min(); } template<typename T> T max( const Vec3<T> & t ) { return t.max(); } template<typename T> T sum( const Vec3<T> & t ) { return t.sum(); } template<typename T> T dot( const Vec3<T> & a, const Vec3<T> & b ) { return a.dot( b ); } template<typename T> Vec3<T> cross( const Vec3<T> & a, const Vec3<T> & b ) { return a.cross( b ); } template<typename T> Vec3<T> min( const Vec3<T> & a, const Vec3<T> & b ) { return { std::min( a.x(), b.x() ), std::min( a.y(), b.y() ), std::min( a.z(), b.z() ) }; } // template<typename T, typename U> // typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type // min( U a, const Vec3<T> & b ) // { return min( Vec3<T>( a ), b ); } // template<typename T, typename U> // typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type // min( const Vec3<T> & a, U b ) // { return min( a, Vec3<T>( b ) ); } // template<typename T> // Vec3<T> max( const Vec3<T> & a, const Vec3<T> & b ) // { return { max( a.x(), b.x() ), max( a.y(), b.y() ), max( a.z(), b.z() ) }; } // template<typename T, typename U> // typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type // max( U a, const Vec3<T> & b ) // { return max( Vec3<T>( a ), b ); } // template<typename T, typename U> // typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type // max( const Vec3<T> & a, U b ) // { return max( a, Vec3<T>( b ) ); } // template<typename T> // Vec3<T> clamp( const Vec3<T> & t, const Vec3<T> & min_t, const Vec3<T> & max_t ) // { return min( max( t, min_t ), max_t ); } // template<typename T, typename U> // typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type // clamp( const Vec3<T> & t, U min_t, const Vec3<T> & max_t ) // { return clamp( t, Vec3<T>( min_t ), max_t ); } // template<typename T, typename U> // typename std::enable_if<std::is_arithmetic<U>::value, Vec3<T> >::type // clamp( const Vec3<T> & t, const Vec3<T> & min_t, U max_t ) // { return clamp( t, min_t, Vec3<T>( max_t ) ); } // template<typename T, typename U, typename V> // typename std::enable_if < std::is_arithmetic<U>::value && std::is_arithmetic<V>::value, Vec3<T> >::type // clamp( const Vec3<T> & t, U min_t, V max_t ) // { return clamp( t, Vec3<T>( min_t ), Vec3<T>( max_t ) ); } template<typename T> Vec3<T> abs( const Vec3<T> & t ) { return t.abs(); } // template<typename T> // Vec3<T> sign( const Vec3<T> & t ) { return t.sign(); } template<typename T> typename std::enable_if<std::is_floating_point<T>::value, T>::type length( const Vec3<T> & a ) { return std::sqrt( dot( a, a ) ); } template<typename T> typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type sqrt( const Vec3<T> & a ) { return { std::sqrt( a.x() ), std::sqrt( a.y() ), std::sqrt( a.z() ) }; } template<typename T> typename std::enable_if<std::is_floating_point<T>::value, T>::type squaredSum( const Vec3<T> & a ) { return dot( a, a ); } template<typename T> typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type normalize( const Vec3<T> & a ) { return a / length( a ); } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type // pow( const Vec3<T> & a, const Vec3<T> & b ) // { return { std::pow( a.x(), b.x() ), std::pow( a.y(), b.y() ), std::pow( a.z(), b.z() ) }; } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type // pow( const Vec3<T> & a, T b ) // { return { std::pow( a.x(), b ), std::pow( a.y(), b ), std::pow( a.z(), b ) }; } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type // pow( T a, const Vec3<T> & b ) // { return { std::pow( a, b.x() ), std::pow( a, b.y() ), std::pow( a, b.z() ) }; } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type // floor( const Vec3<T> & a ) // { return { std::floor( a.x() ), std::floor( a.y() ), std::floor( a.z() ) }; } // template<typename T> // typename std::enable_if<std::is_floating_point<T>::value, Vec3<T> >::type // ceil( const Vec3<T> & a ) // { return { std::ceil( a.x() ), std::ceil( a.y() ), std::ceil( a.z() ) }; } // ----------------------------------------------------------- // Vec4 class // ----------------------------------------------------------- template<typename T> class Vec4 { public: Vec4() {} Vec4( T t ) : _x( t ), _y( t ), _z( t ), _a( t ) {} Vec4( T x, T y, T z, T a ) : _x( x ), _y( y ), _z( z ), _a ( a ){} Vec4( const Vec4 & t ) : _x( t._x ), _y( t._y ), _z( t._z ), _a( t._a ) {} template<typename U> explicit Vec4( const Vec4<U> & t ) : _x( static_cast<T>( t.x() ) ) , _y( static_cast<T>( t.y() ) ) , _z( static_cast<T>( t.z() ) ) , _a( static_cast<T>( t.a() ) ) {} Vec4 & operator=( const Vec4 & t ) { _x = t._x; _y = t._y; _z = t._z; _a = t._a; return *this; } Vec4 & operator/=( const Vec4 & t ) { _x /= t._x; _y /= t._y; _z /= t._z; _a /= t._a; return *this; } Vec4 & operator%=( const Vec4 & t ) { _x %= t._x; _y %= t._y; _z %= t._z; _a %= t._a; return *this; } Vec4 & operator*=( const Vec4 & t ) { _x *= t._x; _y *= t._y; _z *= t._z; _a *= t._a; return *this; } Vec4 & operator+=( const Vec4 & t ) { _x += t._x; _y += t._y; _z += t._z; _a += t._a; return *this; } Vec4 & operator-=( const Vec4 & t ) { _x -= t._x; _y -= t._y; _z -= t._z; _a -= t._a; return *this; } Vec4 operator-() const { return { -_x, -_y, _z, _a}; } Vec4<bool> operator==( const Vec4 & t ) const { return { _x == t._x, _y == t._y, _z == t._z, _a == t._a }; } Vec4<bool> operator!=( const Vec4 & t ) const { return { _x != t._x, _y != t._y, _z != t._z, _a != t._a }; } Vec4<bool> operator>=( const Vec4 & t ) const { return { _x >= t._x, _y >= t._y, _z >= t._z, _a >= t._a }; } Vec4<bool> operator>( const Vec4 & t ) const { return { _x > t._x, _y > t._y, _z > t._z, _a > t._a }; } Vec4<bool> operator<=( const Vec4 & t ) const { return { _x <= t._x, _y <= t._y, _z <= t._z, _a <= t._a }; } Vec4<bool> operator<( const Vec4 & t ) const { return { _x < t._x, _y < t._y, _z < t._z, _a < t._a }; } T min() const { return std::min( std::min( std::min( _x, _y ), _z ), _a); } T max() const { return std::max( std::max( std::max( _x, _y ), _z ), _a); } T sum() const { return _x + _y + _z + _a; } T dot( const Vec4<T> & t ) const { return _x * t.x() + _y * t.y() + _z * t.z() + _a * t.a(); } Vec4 abs() const { return { std::abs( _x ), std::abs( _y ), std::abs( _z ), std::abs( _a ) }; } const T & x() const { return _x; } const T & y() const { return _y; } const T & z() const { return _z; } const T & a() const { return _a; } void setX( T x ) { _x = x; } void setY( T y ) { _y = y; } void setZ( T z ) { _z = z; } void setA( T a ) { _a = a; } private: T _x, _y, _z, _a; }; using Vec2f = Vec2<float>; using Vec2d = Vec2<double>; using Vec3u16 = Vec3<std::uint16_t>; using Vec3f = Vec3<float>; using Vec3d = Vec3<double>; using Vec4f = Vec4<float>; using Vec4d = Vec4<double>; // ----------------------------------------------------------- // Matrix class // ----------------------------------------------------------- namespace Internal { template<typename T, int R, int C> class MatrixStorage { public: MatrixStorage() {} protected: T _data[R * C]; }; #if 0 /// Some Matrix types require aligned storage due to SIMD acceleration template<> class MatrixStorage<float, 4, 4> { public: MatrixStorage() {} protected: alignas( 16 ) float _data[16]; }; #endif } // Internal namespace template<typename T, int R, int C, bool RowMajor = true> class Matrix : public Internal::MatrixStorage<T, R, C> { //static_assert( std::is_floating_point<T>::value, "Matrix template class requires floating point type!" ); static constexpr int kSize = R * C; static inline constexpr int Idx( int row, int col ) { return RowMajor ? row * C + col : col * R + row; } public: using ScalarType = T; static constexpr int kRows = R; static constexpr int kCols = C; Matrix() { } Matrix( const Matrix<T, R, C, true> & src ) { *this = src; } Matrix( const Matrix<T, R, C, false> & src ) { *this = src; } /// Input in row-major order. Matrix( std::initializer_list<T> list ) { *this = list; } /// Input in row-major order. explicit Matrix( const std::vector<T> & data ) { *this = data; } /// Input in row-major order. explicit Matrix( const T * ptr ) { for( int i = 0; i < R; ++i ) { for( int j = 0; j < C; ++j ) { this->_data[Idx( i, j )] = ptr[i * C + j]; } } } // generic size/type converting constructor // performs matrix truncation/expansion if necessary template<typename U, int M, int N, bool D> explicit Matrix( const Matrix<U, M, N, D> & src ) { constexpr int kMinRow = M < R ? M : R; constexpr int kMinCol = N < C ? N : C; for( int i = 0; i < kMinRow; ++i ) { for( int j = 0; j < kMinCol; ++j ) { this->_data[Idx( i, j )] = static_cast<T>( src( i, j ) ); } for( int j = kMinCol; j < C; ++j ) { this->_data[Idx( i, j )] = i == j ? T{1} : T{0}; } } for( int i = kMinRow; i < R; ++i ) { for( int j = 0; j < C; ++j ) { this->_data[Idx( i, j )] = i == j ? T{1} : T{0}; } } } template<int M, int N, bool D> Matrix & operator=( const Matrix<T, M, N, D> & src ) { static_assert( R == M && C == N, "matrix size mismatch!" ); if( RowMajor == D ) { // same element ordering, just copy the elements const T * src_ptr = src.data(); for( int i = 0; i < kSize; ++i ) { this->_data[i] = src_ptr[i]; } } else { // different element ordering requires a transpose for( int i = 0; i < R; ++i ) { for( int j = 0; j < C; ++j ) { this->_data[Idx( i, j )] = src( i, j ); } } } return *this; } /// Input in row-major order. Matrix & operator=( const std::vector<T> & src ) { //if( src.size() != kSize ) //{ LT_THROW( "source data and matrix size mismatch!" ); } auto it = src.begin(); for( int i = 0; i < R; ++i ) { for( int j = 0; j < C; ++j, ++it ) { this->_data[Idx( i, j )] = *it; } } return *this; } /// Input in row-major order. Matrix & operator=( const std::initializer_list<T> src ) { //if( src.size() != kSize ) //{ LT_THROW( "source data and matrix size mismatch!" ); } auto it = src.begin(); for( int i = 0; i < R; ++i ) { for( int j = 0; j < C; ++j, ++it ) { this->_data[Idx( i, j )] = *it; } } return *this; } Matrix & operator=( T scalar ) { for( int i = 0; i < kSize; ++i ) { this->_data[i] = scalar; } return *this; } template<typename U, int M, int N, bool D> bool operator==( const Matrix<U, M, N, D> & mat ) const { static_assert( R == M && C == N, "matrix size mismatch!" ); for( int i = 0; i < R; ++i ) { for( int j = 0; j < C; ++j ) { if( this->_data[Idx( i, j )] != mat( i, j ) ) { return false; } } } return true; } template<typename U, int M, int N, bool D> bool operator!=( const Matrix<U, M, N, D> & mat ) const { return !( *this == mat ); } const T * data() const { return this->_data; } T * data() { return this->_data; } T & operator()( int r, int c ) { return this->_data[Idx( r, c )]; } const T & operator()( int r, int c ) const { return this->_data[Idx( r, c )]; } template<int M, int N, bool D> Matrix<T, R, N> operator*( const Matrix<T, M, N, D> & mat ) const { static_assert( C == M, "invalid matrix product!" ); Matrix<T, R, N> rval; // XXX: is this code actually more SIMD-friendly than a naive implementation? for( int i = 0; i < R; ++i ) { // set 1st row for( int j = 0; j < N; ++j ) { rval( i, j ) = this->_data[Idx( i, 0 )] * mat( 0, j ); } // accum n-th row for( int k = 1; k < M; ++k ) { for( int j = 0; j < N; ++j ) { rval( i, j ) += this->_data[Idx( i, k )] * mat( k, j ); } } } return rval; } template<int M, int N, bool D> Matrix & operator *=( const Matrix<T, M, N, D> & mat ) { *this = *this * mat; return *this; } template<int M, int N, bool D> Matrix & operator +=( const Matrix<T, M, N, D> & mat ) { static_assert( R == M && C == N, "matrix size mismatch!" ); for( int i = 0; i < R; ++i ) { for( int j = 0; j < C; ++j ) { this->_data[Idx( i, j )] += mat( i, j ); } } return *this; } template<int M, int N, bool D> Matrix & operator -=( const Matrix<T, M, N, D> & mat ) { static_assert( R == M && C == N, "matrix size mismatch!" ); for( int i = 0; i < R; ++i ) { for( int j = 0; j < C; ++j ) { this->_data[Idx( i, j )] -= mat( i, j ); } } return *this; } Matrix & operator *=( T scalar ) { for( int i = 0; i < kSize; ++i ) { this->_data[i] *= scalar; } return *this; } Matrix & operator +=( T scalar ) { for( int i = 0; i < kSize; ++i ) { this->_data[i] += scalar; } return *this; } Matrix & operator /=( T scalar ) { scalar = 1.0f / scalar; for( int i = 0; i < kSize; ++i ) { this->_data[i] *= scalar; } return *this; } Matrix & operator -=( T scalar ) { for( int i = 0; i < kSize; ++i ) { this->_data[i] -= scalar; } return *this; } template<int M, int N, bool D> Matrix operator+( const Matrix<T, M, N, D> & mat ) const { Matrix rval{*this}; rval += mat; return rval; } template<int M, int N, bool D> Matrix operator-( const Matrix<T, M, N, D> & mat ) const { Matrix rval{*this}; rval -= mat; return rval; } Matrix operator*( T scalar ) const { Matrix rval{*this}; rval *= scalar; return rval; } Matrix operator+( T scalar ) const { Matrix rval{*this}; rval += scalar; return rval; } Matrix operator-( T scalar ) const { Matrix rval{*this}; rval -= scalar; return rval; } Matrix operator/( T scalar ) const { Matrix rval{*this}; rval /= scalar; return rval; } Matrix<T, 1, C> row( int i ) const { Matrix<T, 1, C> rval; for( int j = 0; j < C; ++j ) { rval( 0, j ) = this->_data[Idx( i, j )]; } return rval; } Matrix<T, 1, C> column( int i ) const { Matrix<T, R, 1> rval; for( int j = 0; j < R; ++j ) { rval( j, 0 ) = this->_data[Idx( j, i )]; } return rval; } Matrix & swapRow( int i, int j ) { using std::swap; for( int k = 0; k < C; ++k ) { swap( this->_data[Idx( i, k )], this->_data[Idx( j, k )] ); } return *this; } Matrix & swapColumn( int i, int j ) { using std::swap; for( int k = 0; k < R; ++k ) { swap( this->_data[Idx( k, i )], this->_data[Idx( k, j )] ); } return *this; } T sum() const { T sum = this->_data[0]; for( int j = 1; j < kSize; ++j ) { sum += this->_data[j]; } return sum; } Matrix & setIdentity() { for( int i = 0; i < R; ++i ) { for( int j = 0; j < C; ++j ) { this->_data[Idx( i, j )] = i == j ? T{1} : T{0}; } } return *this; } const Matrix < T, C, R, !RowMajor > & transpose() const { return *reinterpret_cast < const Matrix < T, C, R, !RowMajor > * >( this ); } // friend std::ostream & operator<<( std::ostream & os, const Matrix & m ) // { // std::stringstream sb; // sb << std::endl << "[ "; // for( int i = 0; i < R; ++i ) // { // for( int j = 0; j < C; ++j ) { sb << m( i, j ) << " "; } // if( i != R - 1 ) { sb << std::endl; } // } // sb << "]" << std::endl; // return os << sb.rdbuf(); // } static constexpr bool IsRowMajor() { return RowMajor; } static Matrix Identity() { Matrix rval; return rval.setIdentity(); } }; template<typename T, int R, int C, bool D> Matrix < T, C, R, !D > transpose( const Matrix<T, R, C, D> & mat ) { // simply copy the data and flip the matrix ordering Matrix < T, C, R, !D > rval; T * dst = rval.data(); const T * src = mat.data(); for( int i = 0; i < R * C; ++i ) { dst[i] = src[i]; } return rval; } template<typename T, int N, bool D> Matrix<T, N, N, D> inverse( const Matrix<T, N, N, D> & mat ); template<typename T, int N, bool D> T determinant( const Matrix<T, N, N, D> & mat ); // scalar-matrix operators template<typename T, typename U, int R, int C, bool D> typename std::enable_if<std::is_arithmetic<T>::value, Matrix<U, R, C, D> >::type operator+( T a, const Matrix<U, R, C, D> & b ) { return b + a; } template<typename T, typename U, int R, int C, bool D> typename std::enable_if<std::is_arithmetic<T>::value, Matrix<U, R, C, D> >::type operator-( T a, const Matrix<U, R, C, D> & b ) { Matrix<U, R, C, D> rval; for( int i = 0; i < R; ++i ) { for( int j = 0; j < C; ++j ) { rval( i, j ) = U( a ) - b( i, j ); } } return rval; } template<typename T, typename U, int R, int C, bool D> typename std::enable_if<std::is_arithmetic<T>::value, Matrix<U, R, C, D> >::type operator*( T a, const Matrix<U, R, C, D> & b ) { return b * a; } using Matrix2x2f = Matrix<float, 2, 2>; using Matrix3x3f = Matrix<float, 3, 3>; using Matrix4x4f = Matrix<float, 4, 4>; using Matrix2x2d = Matrix<double, 2, 2>; using Matrix3x3d = Matrix<double, 3, 3>; using Matrix4x4d = Matrix<double, 4, 4>; // optimized implementation of matrix-vector operations // mind the order of color channels in memory is BGRA, i.e., // blue channel corresponds to the first matrix dimension! template<bool D> Vec4f operator*( const Matrix<float, 4, 4, D> & mat, const Vec4f & vec ) { return { mat( 0, 0 ) * vec.x() + mat( 0, 1 ) * vec.y() + mat( 0, 2 ) * vec.z() + mat( 0, 3 ) * vec.a(), mat( 1, 0 ) * vec.x() + mat( 1, 1 ) * vec.y() + mat( 1, 2 ) * vec.z() + mat( 1, 3 ) * vec.a(), mat( 2, 0 ) * vec.x() + mat( 2, 1 ) * vec.y() + mat( 2, 2 ) * vec.z() + mat( 2, 3 ) * vec.a(), mat( 3, 0 ) * vec.x() + mat( 3, 1 ) * vec.y() + mat( 3, 2 ) * vec.z() + mat( 3, 3 ) * vec.a() }; } template<bool D> Vec4f operator*( const Vec4f & vec, const Matrix<float, 4, 4, D> & mat ) { return { mat( 0, 0 ) * vec.x() + mat( 1, 0 ) * vec.y() + mat( 2, 0 ) * vec.z() + mat( 3, 0 ) * vec.a(), mat( 0, 1 ) * vec.x() + mat( 1, 1 ) * vec.y() + mat( 2, 1 ) * vec.z() + mat( 3, 1 ) * vec.a(), mat( 0, 2 ) * vec.x() + mat( 1, 2 ) * vec.y() + mat( 2, 2 ) * vec.z() + mat( 3, 2 ) * vec.a(), mat( 0, 3 ) * vec.x() + mat( 1, 3 ) * vec.y() + mat( 2, 3 ) * vec.z() + mat( 3, 3 ) * vec.a() }; } // Vec3 left- and right-hand side multiplication operator template<typename T, typename U, bool D> Vec3<typename std::common_type<T, U>::type> operator*( const Matrix<T, 3, 3, D> & mat, const Vec3<U> & vec ) { return { mat( 0, 0 ) * vec.x() + mat( 0, 1 ) * vec.y() + mat( 0, 2 ) * vec.z(), mat( 1, 0 ) * vec.x() + mat( 1, 1 ) * vec.y() + mat( 1, 2 ) * vec.z(), mat( 2, 0 ) * vec.x() + mat( 2, 1 ) * vec.y() + mat( 2, 2 ) * vec.z() }; } template<typename T, typename U, bool D> Vec3<typename std::common_type<T, U>::type> operator*( const Vec3<T> & vec, const Matrix<U, 3, 3, D> & mat ) { return { mat( 0, 0 ) * vec.x() + mat( 1, 0 ) * vec.y() + mat( 2, 0 ) * vec.z(), mat( 0, 1 ) * vec.x() + mat( 1, 1 ) * vec.y() + mat( 2, 1 ) * vec.z(), mat( 0, 2 ) * vec.x() + mat( 1, 2 ) * vec.y() + mat( 2, 2 ) * vec.z() }; } // mat3x3 and vec2 special multiplication operation used in roitransfer /// Return H * p for 2D p, p is made homogeneous, division in the end. template<typename T, typename U, bool D> Vec2<typename std::common_type<T, U>::type> operator*( const Matrix<T, 3, 3, D> & h, const Vec2<U> & p ) { T w_inv = T{1} / ( h(2, 0) * p.x() + h(2, 1) * p.y() + h(2, 2) ); return { ( h(0, 0) * p.x() + h(0, 1) * p.y() + h(0, 2) ) * w_inv, ( h(1, 0) * p.x() + h(1, 1) * p.y() + h(1, 2) ) * w_inv }; } // Vec2 multiplication operator //right hand template<typename T, typename U, bool D> Vec2<typename std::common_type<T, U>::type> operator*( const Matrix<T, 2, 2, D> & mat, const Vec2<U> & vec ) { return { mat( 0, 0 ) * vec.x() + mat( 0, 1 ) * vec.y(), mat( 1, 0 ) * vec.x() + mat( 1, 1 ) * vec.y() }; } //left hand template<typename T, typename U, bool D> Vec2<typename std::common_type<T, U>::type> operator*( const Vec2<U> & vec, const Matrix<T, 2, 2, D> & mat ) { return { mat( 0, 0 ) * vec.x() + mat( 1, 0 ) * vec.y(), mat( 0, 1 ) * vec.x() + mat( 1, 1 ) * vec.y() }; } // Create a diagonal matrix from a vector inline Matrix4x4f diagonal( const Vec4f & vec ) { return { vec.x(), 0.0f, 0.0f, 0.0f, 0.0f, vec.y(), 0.0f, 0.0f, 0.0f, 0.0f, vec.z(), 0.0f, 0.0f, 0.0f, 0.0f, vec.a() }; } template<typename T> Matrix<T, 3, 3> diagonal( const Vec3<T> & vec ) { return { vec.x(), T{0}, T{0}, T{0}, vec.y(), T{0}, T{0}, T{0}, vec.z() }; } template<typename T> Matrix<T, 2, 2> diagonal( const Vec2<T> & vec ) { return { vec.x(), T{0}, T{0}, vec.y(), }; } // ------------------------------------ // determinant, inverse, etc // ------------------------------------ template<typename T, int N> struct MatrixDeterminant { }; template<typename T> struct MatrixDeterminant<T, 2> { T operator()( const T * mat ) const { return mat[0] * mat[3] - mat[1] * mat[2]; } }; template<typename T> struct MatrixDeterminant<T, 3> { T operator()( const T * mat ) const { return + mat[0] * ( mat[4] * mat[8] - mat[7] * mat[5] ) - mat[1] * ( mat[3] * mat[8] - mat[5] * mat[6] ) + mat[2] * ( mat[3] * mat[7] - mat[4] * mat[6] ); } }; template<typename T> struct MatrixDeterminant<T, 4> { T operator()( const T * mat ) const { T dst[4]; T tmp[12]; // calculate pairs for first 8 elements (cofactors) tmp[0] = mat[10] * mat[15]; tmp[1] = mat[11] * mat[14]; tmp[2] = mat[9] * mat[15]; tmp[3] = mat[11] * mat[13]; tmp[4] = mat[9] * mat[14]; tmp[5] = mat[10] * mat[13]; tmp[6] = mat[8] * mat[15]; tmp[7] = mat[11] * mat[12]; tmp[8] = mat[8] * mat[14]; tmp[9] = mat[10] * mat[12]; tmp[10] = mat[8] * mat[13]; tmp[11] = mat[9] * mat[12]; // calculate first 8 elements (cofactors) dst[0] = tmp[0] * mat[5] + tmp[3] * mat[6] + tmp[4] * mat[7]; dst[0] -= tmp[1] * mat[5] + tmp[2] * mat[6] + tmp[5] * mat[7]; dst[1] = tmp[1] * mat[4] + tmp[6] * mat[6] + tmp[9] * mat[7]; dst[1] -= tmp[0] * mat[4] + tmp[7] * mat[6] + tmp[8] * mat[7]; dst[2] = tmp[2] * mat[4] + tmp[7] * mat[5] + tmp[10] * mat[7]; dst[2] -= tmp[3] * mat[4] + tmp[6] * mat[5] + tmp[11] * mat[7]; dst[3] = tmp[5] * mat[4] + tmp[8] * mat[5] + tmp[11] * mat[6]; dst[3] -= tmp[4] * mat[4] + tmp[9] * mat[5] + tmp[10] * mat[6]; // calculate determinant return mat[0] * dst[0] + mat[1] * dst[1] + mat[2] * dst[2] + mat[3] * dst[3]; } }; template<typename T, int N> struct SquareMatrixInverter { }; template<typename T> struct SquareMatrixInverter<T, 2> { void run( T * mat ) const { const T det = mat[0] * mat[3] - mat[1] * mat[2]; const T invdet = T{1} / det; T tmp[4]; tmp[0] = mat[3]; tmp[1] = -mat[1]; tmp[2] = -mat[2]; tmp[3] = mat[0]; for( int i = 0; i < 4; ++i ) { mat[i] = tmp[i] * invdet; } } }; template<typename T> struct SquareMatrixInverter<T, 3> { void run( T * mat ) const { const T det = + mat[0] * ( mat[4] * mat[8] - mat[7] * mat[5] ) - mat[1] * ( mat[3] * mat[8] - mat[5] * mat[6] ) + mat[2] * ( mat[3] * mat[7] - mat[4] * mat[6] ); const T invdet = T{1} / det; T tmp[9]; tmp[0] = mat[4] * mat[8] - mat[7] * mat[5]; tmp[1] = -( mat[1] * mat[8] - mat[2] * mat[7] ); tmp[2] = mat[1] * mat[5] - mat[2] * mat[4]; tmp[3] = -( mat[3] * mat[8] - mat[5] * mat[6] ); tmp[4] = mat[0] * mat[8] - mat[2] * mat[6]; tmp[5] = -( mat[0] * mat[5] - mat[3] * mat[2] ); tmp[6] = mat[3] * mat[7] - mat[6] * mat[ 4]; tmp[7] = -( mat[0] * mat[7] - mat[6] * mat[1] ); tmp[8] = mat[0] * mat[4] - mat[3] * mat[1]; for( int i = 0; i < 9; ++i ) { mat[i] = tmp[i] * invdet; } } }; template<typename T> struct SquareMatrixInverter<T, 4> { void run( T * mat ) const { T dst[16]; T tmp[12]; // calculate pairs for first 8 elements (cofactors) tmp[0] = mat[10] * mat[15]; tmp[1] = mat[11] * mat[14]; tmp[2] = mat[9] * mat[15]; tmp[3] = mat[11] * mat[13]; tmp[4] = mat[9] * mat[14]; tmp[5] = mat[10] * mat[13]; tmp[6] = mat[8] * mat[15]; tmp[7] = mat[11] * mat[12]; tmp[8] = mat[8] * mat[14]; tmp[9] = mat[10] * mat[12]; tmp[10] = mat[8] * mat[13]; tmp[11] = mat[9] * mat[12]; // calculate first 8 elements (cofactors) dst[0] = tmp[0] * mat[5] + tmp[3] * mat[6] + tmp[4] * mat[7]; dst[0] -= tmp[1] * mat[5] + tmp[2] * mat[6] + tmp[5] * mat[7]; dst[4] = tmp[1] * mat[4] + tmp[6] * mat[6] + tmp[9] * mat[7]; dst[4] -= tmp[0] * mat[4] + tmp[7] * mat[6] + tmp[8] * mat[7]; dst[8] = tmp[2] * mat[4] + tmp[7] * mat[5] + tmp[10] * mat[7]; dst[8] -= tmp[3] * mat[4] + tmp[6] * mat[5] + tmp[11] * mat[7]; dst[12] = tmp[5] * mat[4] + tmp[8] * mat[5] + tmp[11] * mat[6]; dst[12] -= tmp[4] * mat[4] + tmp[9] * mat[5] + tmp[10] * mat[6]; // calculate determinant const T det = mat[0] * dst[0] + mat[1] * dst[4] + mat[2] * dst[8] + mat[3] * dst[12]; const T inv_det = T{1} / det; dst[1] = tmp[1] * mat[1] + tmp[2] * mat[2] + tmp[5] * mat[3]; dst[1] -= tmp[0] * mat[1] + tmp[3] * mat[2] + tmp[4] * mat[3]; dst[5] = tmp[0] * mat[0] + tmp[7] * mat[2] + tmp[8] * mat[3]; dst[5] -= tmp[1] * mat[0] + tmp[6] * mat[2] + tmp[9] * mat[3]; dst[9] = tmp[3] * mat[0] + tmp[6] * mat[1] + tmp[11] * mat[3]; dst[9] -= tmp[2] * mat[0] + tmp[7] * mat[1] + tmp[10] * mat[3]; dst[13] = tmp[4] * mat[0] + tmp[9] * mat[1] + tmp[10] * mat[2]; dst[13] -= tmp[5] * mat[0] + tmp[8] * mat[1] + tmp[11] * mat[2]; // calculate pairs for second 8 elements (cofactors) tmp[0] = mat[2] * mat[7]; tmp[1] = mat[3] * mat[6]; tmp[2] = mat[1] * mat[7]; tmp[3] = mat[3] * mat[5]; tmp[4] = mat[1] * mat[6]; tmp[5] = mat[2] * mat[5]; tmp[6] = mat[0] * mat[7]; tmp[7] = mat[3] * mat[4]; tmp[8] = mat[0] * mat[6]; tmp[9] = mat[2] * mat[4]; tmp[10] = mat[0] * mat[5]; tmp[11] = mat[1] * mat[4]; // calculate second 8 elements (cofactors) dst[2] = tmp[0] * mat[13] + tmp[3] * mat[14] + tmp[4] * mat[15]; dst[2] -= tmp[1] * mat[13] + tmp[2] * mat[14] + tmp[5] * mat[15]; dst[3] = tmp[2] * mat[10] + tmp[5] * mat[11] + tmp[1] * mat[9]; dst[3] -= tmp[4] * mat[11] + tmp[0] * mat[9] + tmp[3] * mat[10]; dst[6] = tmp[1] * mat[12] + tmp[6] * mat[14] + tmp[9] * mat[15]; dst[6] -= tmp[0] * mat[12] + tmp[7] * mat[14] + tmp[8] * mat[15]; dst[7] = tmp[8] * mat[11] + tmp[0] * mat[8] + tmp[7] * mat[10]; dst[7] -= tmp[6] * mat[10] + tmp[9] * mat[11] + tmp[1] * mat[8]; dst[10] = tmp[2] * mat[12] + tmp[7] * mat[13] + tmp[10] * mat[15]; dst[10] -= tmp[3] * mat[12] + tmp[6] * mat[13] + tmp[11] * mat[15]; dst[11] = tmp[6] * mat[9] + tmp[11] * mat[11] + tmp[3] * mat[8]; dst[11] -= tmp[10] * mat[11] + tmp[2] * mat[8] + tmp[7] * mat[9]; dst[14] = tmp[5] * mat[12] + tmp[8] * mat[13] + tmp[11] * mat[14]; dst[14] -= tmp[4] * mat[12] + tmp[9] * mat[13] + tmp[10] * mat[14]; dst[15] = tmp[10] * mat[10] + tmp[4] * mat[8] + tmp[9] * mat[9]; dst[15] -= tmp[8] * mat[9] + tmp[11] * mat[10] + tmp[5] * mat[8]; // calculate matrix inverse for( int i = 0; i < 16; i++ ) { mat[i] = dst[i] * inv_det; } } }; template<typename T, int N, bool D> Matrix<T, N, N, D> inverse( const Matrix<T, N, N, D> & mat ) { Matrix<T, N, N, D> rval( mat ); SquareMatrixInverter<T, N> inverter; inverter.run( rval.data() ); return rval; } template<typename T, int N, bool D> T determinant( const Matrix<T, N, N, D> & mat ) { MatrixDeterminant<T, N> det; return det( mat.data() ); } template Matrix<float, 2, 2, true> inverse( const Matrix<float, 2, 2, true> & ); template Matrix<float, 3, 3, true> inverse( const Matrix<float, 3, 3, true> & ); template Matrix<float, 4, 4, true> inverse( const Matrix<float, 4, 4, true> & ); template Matrix<float, 2, 2, false> inverse( const Matrix<float, 2, 2, false> & ); template Matrix<float, 3, 3, false> inverse( const Matrix<float, 3, 3, false> & ); template Matrix<float, 4, 4, false> inverse( const Matrix<float, 4, 4, false> & ); template Matrix<double, 2, 2, true> inverse( const Matrix<double, 2, 2, true> & ); template Matrix<double, 3, 3, true> inverse( const Matrix<double, 3, 3, true> & ); template Matrix<double, 4, 4, true> inverse( const Matrix<double, 4, 4, true> & ); template Matrix<double, 2, 2, false> inverse( const Matrix<double, 2, 2, false> & ); template Matrix<double, 3, 3, false> inverse( const Matrix<double, 3, 3, false> & ); template Matrix<double, 4, 4, false> inverse( const Matrix<double, 4, 4, false> & ); template float determinant( const Matrix<float, 2, 2, true> & ); template float determinant( const Matrix<float, 3, 3, true> & ); template float determinant( const Matrix<float, 4, 4, true> & ); template float determinant( const Matrix<float, 2, 2, false> & ); template float determinant( const Matrix<float, 3, 3, false> & ); template float determinant( const Matrix<float, 4, 4, false> & ); template double determinant( const Matrix<double, 2, 2, true> & ); template double determinant( const Matrix<double, 3, 3, true> & ); template double determinant( const Matrix<double, 4, 4, true> & ); template double determinant( const Matrix<double, 2, 2, false> & ); template double determinant( const Matrix<double, 3, 3, false> & ); template double determinant( const Matrix<double, 4, 4, false> & ); } // end namespace ltaf #endif // #ifdef c++ #endif //#define __MATRIX_H__
[ "hoantien05@gmail.com" ]
hoantien05@gmail.com
04cdea0a0756db0d76285001781246c7dafe7f90
b2949ea1148236fefd080212431d599ba63cca53
/Fireworks/src/Platform/OpenGL/OpenGLShader.cpp
2cf015bfe49778b4eb76c191ea52223d5ca3e4f4
[ "Apache-2.0" ]
permissive
chris-luafau/Fireworks
640d96e4c000e6ac028dea6a64845c8ed4f77d23
9572f7cf464036e7488a088d352c7f41d8b5b6a6
refs/heads/main
2023-02-06T19:46:47.355615
2020-12-23T20:32:52
2020-12-23T20:32:52
306,455,381
0
0
null
null
null
null
UTF-8
C++
false
false
5,463
cpp
#include "fzpch.h" #include "OpenGLShader.h" #include "glad/glad.h" #include <glm/gtc/type_ptr.hpp> // value_ptr() namespace Fireworks { OpenGLShader::OpenGLShader(const std::string& vertexSrc, const std::string& fragmentSrc) { // Create an empty vertex shader handle GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER); // Send the vertex shader source code to GL // Note that std::string's .c_str is NULL character terminated. const GLchar* source = vertexSrc.c_str(); glShaderSource(vertexShader, 1, &source, 0); // Compile the vertex shader glCompileShader(vertexShader); // Check to see if the vertex shader compiled successfully. GLint isCompiled = 0; glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &isCompiled); if (isCompiled == GL_FALSE) { GLint maxLength = 0; glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &maxLength); // The maxLength includes the NULL character std::vector<GLchar> infoLog(maxLength); glGetShaderInfoLog(vertexShader, maxLength, &maxLength, &infoLog[0]); // We don't need the shader anymore. glDeleteShader(vertexShader); // Log the error to the console and exit. FZ_CORE_ERROR("{0}", infoLog.data()); FZ_CORE_ASSERT(false, "Vertex shader compilation failed."); return; } // Create an empty fragment shader handle GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); // Send the fragment shader source code to GL // Note that std::string's .c_str is NULL character terminated. source = fragmentSrc.c_str(); glShaderSource(fragmentShader, 1, &source, 0); // Compile the fragment shader glCompileShader(fragmentShader); // Check to see if the fragment shader compiled successfully. glGetShaderiv(fragmentShader, GL_COMPILE_STATUS, &isCompiled); if (isCompiled == GL_FALSE) { GLint maxLength = 0; glGetShaderiv(fragmentShader, GL_INFO_LOG_LENGTH, &maxLength); // The maxLength includes the NULL character std::vector<GLchar> infoLog(maxLength); glGetShaderInfoLog(fragmentShader, maxLength, &maxLength, &infoLog[0]); // We don't need the shader anymore. glDeleteShader(fragmentShader); // Either of them. Don't leak shaders. glDeleteShader(vertexShader); // Log the error to the console and exit. FZ_CORE_ERROR("{0}", infoLog.data()); FZ_CORE_ASSERT(false, "Fragment shader compilation failed."); return; } // Vertex and fragment shaders are successfully compiled. // Now time to link them together into a program. // Get a program object. // Save the ID to our member variable for later use. m_RendererID = glCreateProgram(); GLuint program = m_RendererID; // Attach our shaders to our program glAttachShader(program, vertexShader); glAttachShader(program, fragmentShader); // Link our program glLinkProgram(program); // Check to see if the shader linked successfully. // Note the different functions here: glGetProgram* instead of glGetShader*. GLint isLinked = 0; glGetProgramiv(program, GL_LINK_STATUS, (int*)&isLinked); if (isLinked == GL_FALSE) { GLint maxLength = 0; glGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxLength); // The maxLength includes the NULL character std::vector<GLchar> infoLog(maxLength); glGetProgramInfoLog(program, maxLength, &maxLength, &infoLog[0]); // We don't need the program anymore. glDeleteProgram(program); // Don't leak shaders either. glDeleteShader(vertexShader); glDeleteShader(fragmentShader); // Log the error to the console and exit. FZ_CORE_ERROR("{0}", infoLog.data()); FZ_CORE_ASSERT(false, "Shader link failed."); return; } // Always detach shaders after a successful link. glDetachShader(program, vertexShader); glDetachShader(program, fragmentShader); } OpenGLShader::~OpenGLShader() { glDeleteProgram(m_RendererID); } void OpenGLShader::Bind() const { glUseProgram(m_RendererID); } void OpenGLShader::Unbind() const { glUseProgram(0); } void OpenGLShader::UploadUniformInt(const std::string& name, int value) { GLint location = glGetUniformLocation(m_RendererID, name.c_str()); glUniform1i(location, value); } void OpenGLShader::UploadUniformFloat(const std::string& name, float value) { GLint location = glGetUniformLocation(m_RendererID, name.c_str()); glUniform1f(location, value); } void OpenGLShader::UploadUniformFloat2(const std::string& name, const glm::vec2& values) { GLint location = glGetUniformLocation(m_RendererID, name.c_str()); glUniform2f(location, values.x, values.y); } void OpenGLShader::UploadUniformFloat3(const std::string& name, const glm::vec3& values) { GLint location = glGetUniformLocation(m_RendererID, name.c_str()); glUniform3f(location, values.x, values.y, values.z); } void OpenGLShader::UploadUniformFloat4(const std::string& name, const glm::vec4& values) { GLint location = glGetUniformLocation(m_RendererID, name.c_str()); glUniform4f(location, values.x, values.y, values.z, values.w); } void OpenGLShader::UploadUniformMat3(const std::string& name, const glm::mat4& matrix) { GLint location = glGetUniformLocation(m_RendererID, name.c_str()); glUniformMatrix3fv(location, 1, GL_FALSE, glm::value_ptr(matrix)); } void OpenGLShader::UploadUniformMat4(const std::string& name, const glm::mat4& matrix) { GLint location = glGetUniformLocation(m_RendererID, name.c_str()); glUniformMatrix4fv(location, 1, GL_FALSE, glm::value_ptr(matrix)); } }
[ "31860645+chris-luafau@users.noreply.github.com" ]
31860645+chris-luafau@users.noreply.github.com
745c0f283c6850ed596d1ea63ff2cf11f426b0e4
93409e882a893eff3d6a535d6ac94c57aca98e46
/source/FPIdle.cpp
21bec48b72544d65132bea5966d53528467adc57
[]
no_license
begner/CUELegendKeys
e62f44e89189a7b2fe840014be70038552962918
2ebee4a18bb0bfb9fec73739b37e79c4b3f0bef6
refs/heads/master
2021-01-20T15:36:24.974091
2016-11-17T20:11:46
2016-11-17T20:11:46
65,309,600
1
0
null
null
null
null
UTF-8
C++
false
false
1,269
cpp
#include "FPIdle.h" FPIdle::FPIdle(HWND uiHWND) : FPScreenMirror(uiHWND) { NuLogger::getInstance()->log("Setup FrameProcessing Idle"); desktopWindow = GetDesktopWindow(); FPScreenMirror::setCaptureWindow(desktopWindow); FPScreenMirror::setOffset(RECT{ 100, 200, 100, 0 }); FPScreenMirror::setUIDimensions(209, 287, 363, 204); FPScreenMirror::reinitialize(); } FPIdle::~FPIdle() { } int FPIdle::getWindowBackgroundResource() { if (mode == FP_IDLE_MODE_OFF) { return IDB_WINDOW_BACKGROUND_IDLE; } else { return IDB_WINDOW_BACKGROUND_IDLE_MIRROR; } } void FPIdle::setCaptureWindow(HWND currentProcess) { } bool FPIdle::process() { if (mode == FP_IDLE_MODE_OFF) { // IDLE Mode does not need to be limitless enableFpsLimit(true); setFpsLimit(Settings::getInstance()->getValue("IdleMode", "IdleFPSLimit", (int)2)); PerformanceStart(); // copy background to UI getBackgroundMat()->copyTo(drawUI); PerformanceDraw(getBackgroundMat()->cols - 130, 20); drawToWindow(&drawUI); PerformanceStop(); return true; } else { setFpsLimit(Settings::getInstance()->getValue("IdleMode", "ScreenMirrorFPSLimit", (int)15)); return FPScreenMirror::process(); } } void FPIdle::setMode(int setMode) { mode = setMode; }
[ "ben@egner.it" ]
ben@egner.it
e4970481cf9b427d4c34c721edeef44a81e6e6fd
08c59366b00b1c68ec07d2358e0bbf93be1dba47
/include/Engine/Util/Condition.h
e43e4ee9d590a0b71154ceaa3d9f0c9930dd4d0a
[]
no_license
minad/isometric
835c9ba5bbedaa029706a86d7f806813075590c8
382d9c30c6714b3fc65e7e3eca936892997c94fa
refs/heads/master
2023-08-22T17:50:43.961618
2017-03-07T00:32:34
2017-03-07T00:32:34
84,135,423
0
0
null
null
null
null
UTF-8
C++
false
false
807
h
#ifndef _Engine_Util_Condition_h #define _Engine_Util_Condition_h #include "Engine/Util/Mutex.h" #include "SDLWrapper.h" namespace Engine { namespace Util { class Condition { public: Condition() { cond = SDL::createCond(); } ~Condition() { SDL::destroyCond(cond); } void wait(const Mutex& mutex) { SDL::condWait(cond, mutex.mutex); } bool waitTimeout(const Mutex& mutex, int timeout) { return (SDL::condWaitTimeout(cond, mutex.mutex, timeout) == 0); } void signal(bool all = false) { if (all) SDL::condBroadcast(cond); else SDL::condSignal(cond); } private: SDL::Cond* cond; }; } // namespace Util } // namespace Engine #endif // _Engine_Util_Condition_h
[ "mail@daniel-mendler.de" ]
mail@daniel-mendler.de
ff6e58a9ce1bc8232cfafa3d924e2185ad3ccc36
08307bdd77ea10309b496c676f14ff492f380177
/InstantMessaging/InstantMessagingDlg.h
1e5865dd3ad522eb976bb9b9193934348a6688f2
[]
no_license
asdlei99/InstantMessaging
78a38e6155345ff994d4d39ef85ecfc2a77641af
079d3912b87150bd42a591f12d9606b3b96064ab
refs/heads/master
2020-12-11T09:55:48.393995
2018-02-27T14:26:11
2018-02-27T14:26:11
null
0
0
null
null
null
null
GB18030
C++
false
false
9,925
h
// InstantMessagingDlg.h : header file // #if !defined(AFX_INSTANTMESSAGINGDLG_H__7D41D06C_C73A_4AE1_9284_440FC1479084__INCLUDED_) #define AFX_INSTANTMESSAGINGDLG_H__7D41D06C_C73A_4AE1_9284_440FC1479084__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 ///////////////////////////////////////////////////////////////////////////// // CInstantMessagingDlg dialog #include "AdvButton.h" #include "DialogSetting.h" #include "FriendsListCtrl.h" #include "ChatRoomServerDlg.h" #include "ChatRoomClientDlg.h" #include "ChatDlg.h" #include "ShareScreenClientDlg.h" #include "ShareScreenServerDlg.h" #include "SendFilesServerDlg.h" #include "SendFilesClientDlg.h" #include "WhiteBoardServerDlg.h" #include "WhiteBoardClientDlg.h" #include "VideoChatDlg.h" #include "VideoChatListenSocket.h" class CListeningSocket; LRESULT WINAPI EncodeCallback( HWND hWnd, LPVIDEOHDR lpVHdr ); BYTE _clip255( LONG v ); void YUY2_RGB( BYTE *YUY2buff, BYTE *RGBbuff, DWORD dwSize ); class CInstantMessagingDlg : public CDialog { // Construction public: CInstantMessagingDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CInstantMessagingDlg) enum { IDD = IDD_INSTANTMESSAGING_DIALOG }; CComboBox m_comboxIP; CFriendsListCtrl m_listCtrlFriends; CStatic m_staticFace; CEdit m_editNickName; CComboBox m_comboxState; CComboBox m_comboxFriend; CAdvButton m_btnWhiteBoard; CAdvButton m_btnShareScreen; CAdvButton m_btnSendFiles; CAdvButton m_btnChatRoom; CAdvButton m_btnAddFriend; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CInstantMessagingDlg) public: virtual BOOL PreTranslateMessage(MSG* pMsg); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: HICON m_hIcon; NOTIFYICONDATA m_nid; /// 最小化是托盘所需结构体 CBitmap m_bmpFace; /// 头像 WORD m_wVirtualKeyCode; /// 热键虚拟器码 WORD m_wModifiers; /// 热键修改值 WORD m_wFace; /// 头像 WORD m_wState; /// 状态 CString m_strNickName; /// 昵称 BOOL m_bCamera; /// 摄像头 BOOL m_bAutoAddFriends; /// 自动加为好友 CStringList m_strlstIP; /// 自己的IP列表 CStringList m_strlstRequest; /// 请求加为好友的IP列表 CStringList m_strlstKeepConnent; /// 保持连接的IP列表 CStringList m_strlstChatRoomRequest; /// 请求加入聊天室的IP列表 CListeningSocket *m_pLisSocket; /// 监听socket CArray< USER, USER > m_arrFriends; /// 好友列表 CChatRoomServerDlg m_dlgCRServer; /// 聊天室服务器 CArray< CChatRoomClientDlg *, CChatRoomClientDlg * > m_arrCRClient; /// 聊天室的客户端列表 CArray< CChatDlg *, CChatDlg *> m_arrChatDlg; /// 聊天对话框的列表 CMapStringToPtr m_mapIPToData; /// 聊天ip到数据的map CMapStringToString m_mapIPToTime; /// 聊天ip到时间的map CMapStringToOb m_mapIPToChat; /// 聊天IP到聊天(时间和内容)的map CMapStringToString m_mapSendChatMessage; /// 发送聊天消息的map CArray< int, int > m_arrMessageArrive; /// 保存有消息到达的用户序号 CImageList m_imageListMA; /// 保存有消息到达的用户头像 int m_nTrayShowIndex; /// 托盘显示的序号 CSendFilesServerDlg m_dlgSendFilesServer; /// 发送文件服务器对话框 CSendFilesClientDlg m_dlgSendFilesClient; /// 发送文件服务器对话框 CShareScreenServerDlg m_dlgSSServer; /// 共享屏幕服务器对话框 CShareScreenClientDlg m_dlgSSClient; /// 共享屏幕客户端对话框 CStringList m_strlstShareScreenRequest; /// 请求加入共享屏幕的IP列表 CWhiteBoardServerDlg m_dlgWhiteBoardServer; /// 白板服务器对话框 CStringList m_strlstWhiteBoardRequest; /// 请求加入白板的IP列表 CWhiteBoardClientDlg m_dlgWhiteBoardClient; /// 白板客户端对话框 CArray< CVideoChatDlg *, CVideoChatDlg *> m_arrVideoChatDlg; /// 视频聊天对话框的列表 BOOL m_bConnectCamera; /// 连接上视频 CStringList m_strlstVideoChatRequest; /// 请求视频聊天的IP列表 int m_nMaxUDPDG; /// UDP包支持的最大数据值 HWAVEIN m_hWaveIn; PWAVEHDR m_pWaveHdr1; PWAVEHDR m_pWaveHdr2; char *m_pBuffer1; char *m_pBuffer2; WAVEFORMATEX m_WaveForm; DWORD m_dwTickTime; /// 记录开始录音的时刻 CVideoChatListenSocket *m_pVideoChatListenSocket; /// 视频聊天的监听socket public: CSocket m_pSocket; /// 添加网段用户的socket HWND m_hWndVideo; /// 视频的窗口句柄 private: /// 初始化程序 void Init(); /// 鼠标在托盘区的消息响应函数 LRESULT OnShellNotifyProc( WPARAM wParam, LPARAM lParam ); /// 热键响应函数 LRESULT OnHotkey( WPARAM wParam, LPARAM lParam ); void SetState(); void SendOffLineMessage(); void AddRequest( const USER user ); void AddFriend( const USER user ); void DeleteFriend( const USER user ); void KeepConnect( CString strIP ); /// 响应加入聊天室的请求 void OnAddToChatRoomRequest( const USER userServer ); /// 向指定IP、PORT发送指定用户和数据 void SendUserCommandToIP( CONTROLCOMMAND command, LPCSTR szIP, UINT nPort, const USER *pUser ); /// 为接收聊天消息作准备 void PrepareChatMessage( LPCSTR szReceive, LPCSTR szIP ); /// 接收聊天消息 void ReceiveChatMessage( LPCSTR szReceive, LPCSTR szIP ); /// 从历史记录中删除指定记录 void DeleteHistory( int nIndex, const CString strHistory ); /// 开始发送数据 void SendChatMessage( LPCSTR szReceive, LPCSTR szIP ); /// 把指定ip的用户的头像加入到托盘动态显示 void AddTrayIcon( LPCSTR szIP ); /// 回应是否接收传输的文件 void SendFilesResponse( LPCSTR szReceive, LPCSTR szIP ); /// 响应加入共享屏幕的请求 void OnAddToShareScreenRequest( const USER userServer ); /// 响应加入白板的请求 void OnAddToWhiteBoardRequest( const USER userServer ); /// 响应视频聊天请求 void OnAddToVideoChatRequest( const USER user ); /// user拒绝视频 void DenyAddToVideoChatRequest( const USER user ); /// 允许加入视频聊天 void AllowAddToVideoChatRequest( const USER user ); /// user断开视频连接 void UserDisconnectFromVideoChat( const USER user ); public: WORD GetFace(){ return m_wFace; } CString GetNickName(){ return m_strNickName; } BOOL HasCamera(){ return m_bCamera; } WORD GetVirtualKeyCode(){ return m_wVirtualKeyCode; } WORD GetModifiers(){ return m_wModifiers; } BOOL GetAutoAddFriends(){ return m_bAutoAddFriends; } int GetMaxUDPDG(){ return m_nMaxUDPDG; } void SetFace( WORD wFace ); void SetNickName( const CString strNickName ); void SetHotKey( WORD wVirtualKeyCode, WORD wModifiers ); void SetAutoAddFriends( BOOL bAutoAddFriends ); void SetMaxUDPDG( int nMaxUDPDG ){ m_nMaxUDPDG = nMaxUDPDG; } void OnListeningReceive(); void DeleteFriend( int nIndex ); void GetFriendsArray( CArray< USER, USER > &arrFriends ){ arrFriends.Copy( m_arrFriends ); } void SendFriendMessage( const USER user, CONTROLCOMMAND command ); /// 从列表中删除聊天室客户端 void DelCRClientFromList( LPCSTR szIP ); /// 和第nIndex个好友聊天 void OnChat( UINT nIndex ); /// 关闭聊天窗口 void OnCloseChatDlg( LPCSTR szIP ); /// 发送聊天消息 void SendPreChatMessage( const USER userChat, CString strTime, CString strSend ); /// 向指定IP用户发送传送文件的通知 void SendFilesNotify( LPCSTR szIP, CString strFile, DWORD dwLength ); /// 拒绝接收文件 void DenyReceiveFile( CString strFilePath, LPCSTR szIP ); /// 由IP得到USER void GetUserFromIP( LPCSTR szIP, USER &user ); /// 得到自己IP列表框的IP CString GetComboBoxIP(); /// 和第nIndex个好友视频聊天 void OnVideoChat( UINT nIndex ); /// 得到打开的视频聊在对话框列表 void GetVideoChatDlgArray( CArray< CVideoChatDlg *, CVideoChatDlg *> &arrVideoChatDlg ){ arrVideoChatDlg.Copy( m_arrVideoChatDlg ); } /// 关闭视频聊天窗口 void CloseVideoChatDlg( const USER user ); /// 视频聊天时更新画面 void UpdateVideoPicture( DWORD dwTickCount, const BITMAPINFO bmpInfo, unsigned char *pData, DWORD dwBufferSize ); /// 接受视频聊天的socket void OnAcceptVideoChat(); // Generated message map functions //{{AFX_MSG(CInstantMessagingDlg) virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); afx_msg void OnOk(); virtual void OnCancel(); afx_msg void OnDestroy(); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnRButtonUp(UINT nFlags, CPoint point); afx_msg void OnExit(); afx_msg void OnSetting(); afx_msg void OnSelchangeComboState(); afx_msg void OnState(); afx_msg void OnBtnAddfriend(); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnBtnChatroom(); afx_msg void OnChatroom(); afx_msg void OnBtnSendfiles(); afx_msg void OnSendfiles(); afx_msg void OnReceivefiles(); afx_msg void OnAddSection(); afx_msg void OnBtnSharescreen(); afx_msg void OnSharescreen(); afx_msg void OnBtnWhiteboard(); afx_msg void OnWhiteboard(); afx_msg LRESULT WaveInOpen( WPARAM wParam, LPARAM lParam ) ; afx_msg LRESULT WaveInData( WPARAM wParam, LPARAM lParam ) ; afx_msg LRESULT WaveInClose( WPARAM wParam, LPARAM lParam ) ; //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_INSTANTMESSAGINGDLG_H__7D41D06C_C73A_4AE1_9284_440FC1479084__INCLUDED_)
[ "1369212327@qq.com" ]
1369212327@qq.com
1ae5d622751dacbd34ca9053d5e2f957062e91ea
1d1790e544ce2764b57015551bc8ce3822af43e3
/main.cpp
64e8f493671761c75ff17b7922278f1717a62724
[]
no_license
AhmedSakrr/ReinDamit
bbc10ca89d33a90b352ead3114ab7745b9e2798f
6645d749101032142d258b3beb2a59f77dbdaba6
refs/heads/master
2022-03-24T04:53:25.685114
2019-12-22T17:48:51
2019-12-22T17:48:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,443
cpp
#include "rein.h" #include <fstream> #include <iostream> int inject(HWND parent, char* file[], char* proc[]); char szDllFile[300]; char szProc[100]; LRESULT CALLBACK MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_CLOSE: case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, uMsg, wParam, lParam); } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int cmdShow) { std::ifstream config; config.open("rein.conf"); if (config.is_open()){ if (!config.eof()) { config >> szDllFile; } if (!config.eof()) { config >> szProc; } } config.close(); WNDCLASS wc; MSG msg; HWND hWnd; CHAR className[] = "text"; wc = {}; wc.lpfnWndProc = MessageHandler; wc.style = CS_HREDRAW | CS_VREDRAW; wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.hInstance = hInstance; wc.lpszClassName = className; hWnd = CreateWindow(className, className, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, 0, 0, hInstance, 0); ShowWindow(hWnd, cmdShow); SetForegroundWindow(hWnd); SetFocus(hWnd); UpdateWindow(hWnd); while (true) { BOOL res = GetMessage(&msg, 0, 0, 0); if (res > 0) { TranslateMessage(&msg); DispatchMessage(&msg); } else { return res; } } } int inject(HWND parent, char* file[], char* proc[]){ PROCESSENTRY32 PE32{ 0 }; PE32.dwSize = sizeof(PE32); HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if (hSnap == INVALID_HANDLE_VALUE) { DWORD Error = GetLastError(); MessageBox(parent, "Error: Invalid Handle", "There was a Problem loading the process list", MB_OK | MB_ICONERROR); return 1; } else { BOOL bRet = Process32First(hSnap, &PE32); DWORD PID = 0; while (bRet) { if (!strcmp(*proc, PE32.szExeFile)) { PID = PE32.th32ProcessID; break; } bRet = Process32Next(hSnap, &PE32); } CloseHandle(hSnap); HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID); if (hProc) { if (ReinManuell(hProc, *file)) { MessageBox(parent, "SUCCESS!", "DLL was injected", MB_OK | MB_ICONHAND); } else { DWORD Error = GetLastError(); MessageBox(parent, "Error:", "Was not able to inject :'(", MB_OK | MB_ICONERROR); } }else { DWORD Error = GetLastError(); MessageBox(parent, "Error:", "was not able to open the process", MB_OK | MB_ICONERROR); } CloseHandle(hProc); } return 0; }
[ "Erarnitox@gmail.com" ]
Erarnitox@gmail.com
4b5e4058126991b9975f3af40e34e850d2fd8c36
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5669245564223488_0/C++/abczz/B.cpp
6f7c2214b6ccde059841bd8bb74b32d2c7915c06
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
C++
false
false
2,537
cpp
#include <functional> #include <algorithm> #include <stdexcept> #include <iostream> #include <sstream> #include <fstream> #include <numeric> #include <iomanip> #include <utility> #include <cstdlib> #include <cstring> #include <cassert> #include <cctype> #include <cstdio> #include <vector> #include <string> #include <bitset> #include <cmath> #include <queue> #include <stack> #include <ctime> #include <list> #include <map> #include <set> #define REP(i,n) for(int i=0;i<(n);i++) #define TR(i,x) for(__typeof(x.begin()) i=x.begin();i!=x.end();i++) #define ALL(x) x.begin(),x.end() #define SORT(x) sort(ALL(x)) #define CLEAR(x) memset(x,0,sizeof(x)) #define FILL(x,c) memset(x,c,sizeof(x)) #define SIZE(x) (int)(x).size() #define MP make_pair #define PB push_back using namespace std; typedef long long LL; typedef pair<int,int> PII; const int MOD = 1e9+7; int n; string s[110]; bool Check(int per[]) { string t = ""; REP(i, n) t += s[per[i]]; //cout << "t = " << t << endl; int p[200]; FILL(p, 0xff); REP(i, t.length()) { if (p[t[i]] == -1) { p[t[i]] = i; } else { if (p[t[i]] + 1 != i) { return false; } else { p[t[i]] = i; } } } return true; } bool Gao(string &str) { int p[200]; FILL(p, 0xff); string x = ""; REP(i, str.length()) { if (p[str[i]] == -1) { p[str[i]] = i; x += str[i]; } else { if (p[str[i]] + 1 != i) { return false; } else { p[str[i]] = i; } } } str = x; return true; } void Solve() { cin >> n; bool flag = true; REP(i, n) { cin >> s[i]; flag = Gao(s[i]); } int cnt = 0; if (!flag) { cout << 0 << endl; return; } int p[100]; REP(i, n) p[i] = i; do { if (Check(p)) { ++cnt; } } while (next_permutation(p, p + n)); cout << cnt << endl; } int main() { // freopen("B-small-attempt0.in","r",stdin);freopen("B-small-attempt0.out","w",stdout); freopen("B-small-attempt1.in","r",stdin);freopen("B-small-attempt1.out","w",stdout); // freopen("B-small-attempt2.in","r",stdin);freopen("B-small-attempt2.out","w",stdout); // freopen("B-large.in","r",stdin);freopen("B-large.out","w",stdout); int cas; cin >> cas; for (int T = 1; T <= cas; ++T) { printf("Case #%d: ", T); Solve(); } return 0; }
[ "eewestman@gmail.com" ]
eewestman@gmail.com
d44e663f52f113a9facff1ab5d2d99ae5ea07514
2e1e1555dc6bcf2eb267d41c40bc4d3e56596bae
/sippet/message/headers/alert_info.h
89face28b8f61c738c197c868c93c116c027f77e
[ "LicenseRef-scancode-warranty-disclaimer", "BSD-3-Clause" ]
permissive
Jenuce/sippet
a57370998769329b6c60fb9c0526e23d87fe1d9d
c6f4b0e9723f56cfb6d345d307a48f1ff0eb2c65
refs/heads/master
2020-12-11T01:41:38.150948
2015-10-07T11:58:32
2015-10-07T11:58:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,483
h
// Copyright (c) 2013 The Sippet 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 SIPPET_MESSAGE_HEADERS_ALERT_INFO_H_ #define SIPPET_MESSAGE_HEADERS_ALERT_INFO_H_ #include <string> #include "sippet/message/header.h" #include "sippet/message/headers/bits/has_multiple.h" #include "sippet/message/headers/bits/has_parameters.h" #include "sippet/message/headers/bits/single_value.h" #include "sippet/base/raw_ostream.h" #include "url/gurl.h" namespace sippet { class AlertParam : public single_value<GURL>, public has_parameters { public: AlertParam(); AlertParam(const AlertParam &other); explicit AlertParam(const single_value::value_type &type); ~AlertParam(); AlertParam &operator=(const AlertParam &other); void print(raw_ostream &os) const; }; inline raw_ostream &operator<<(raw_ostream &os, const AlertParam &p) { p.print(os); return os; } class AlertInfo : public Header, public has_multiple<AlertParam> { private: DISALLOW_ASSIGN(AlertInfo); AlertInfo(const AlertInfo &other); AlertInfo *DoClone() const override; public: AlertInfo(); ~AlertInfo() override; scoped_ptr<AlertInfo> Clone() const { return scoped_ptr<AlertInfo>(DoClone()); } void print(raw_ostream &os) const override; }; } // End of sippet namespace #endif // SIPPET_MESSAGE_HEADERS_ALERT_INFO_H_
[ "guibv@yahoo.com" ]
guibv@yahoo.com
0f446c6d77dcbbf94a6e55e8e1adf037327c7c70
b367fe5f0c2c50846b002b59472c50453e1629bc
/xbox_leak_may_2020/xbox trunk/xbox/private/test/multimedia/dsptest/dsptest.h
779ce35042fe33d41157071fc9d92b3b92ce0853
[]
no_license
sgzwiz/xbox_leak_may_2020
11b441502a659c8da8a1aa199f89f6236dd59325
fd00b4b3b2abb1ea6ef9ac64b755419741a3af00
refs/heads/master
2022-12-23T16:14:54.706755
2020-09-27T18:24:48
2020-09-27T18:24:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,901
h
#ifndef _DSPTEST_H_ #define _DSPTEST_H_ #define MAX_FREQUENCY_BINS 512 #define M_PI 3.14159265358979323846 typedef enum { DRAW_SPECTRUM = 0, DRAW_CYCLES, MAX_SCREENS } SCREENS; // // defines that control what the app does // //#define SRC_TEST 1 //#define BREAK_ON_START #define DOWNLOAD_SCRATCH_IMAGE #define USE_DSOUND #define TRACK_TOTAL_GP_USAGE 1 #define DSP_CLOCK_133 1 //#define DSP_CLOCK_160 1 //#define DSP_CLOCK_200 1 //#define ENABLE_DOLBY_DOWNLOAD 1 //************************************************************* extern HRESULT DirectSoundLoadEncoder ( LPCVOID pvImageBuffer, DWORD dwImageSize, LPVOID * ppvScratchData, LPDIRECTSOUND * ppDirectSound ); extern HRESULT LoadDolbyCode(); extern HRESULT LoadReverbParameters(); extern HRESULT CreateSineWaveBuffer( double dFrequency, LPDIRECTSOUNDBUFFER8 * ppBuffer ); extern HRESULT SetFXOscillatorParameters(LPDIRECTSOUND pDirectSound,DWORD dwEffectIndex,FLOAT Frequency); extern HRESULT LoadWaveFile(LPCSTR pszFileName,LPCWAVEFORMATEX * ppwfxFormat,XFileMediaObject ** ppMediaObject); extern HRESULT PlayLoopingBuffer ( LPCSTR pszFile, LPDIRECTSOUNDBUFFER *pBuffer, DWORD dwFlags ); #ifdef DSP_CLOCK_160 // 160Mhz #define MAX_GP_IDLE_CYCLES 106720 // 32 samples at 160Mhz (or 667us*160Mhz) #define MAX_EP_IDLE_CYCLES 853333 // 256 samples at 160Mhz (or 667us*160Mhz) #endif #ifdef DSP_CLOCK_200 // 200Mhz #define MAX_GP_IDLE_CYCLES 133333 // 32 samples at 200Mhz #define MAX_EP_IDLE_CYCLES 1066666 // 256 samples at 200Mhz #endif #ifdef DSP_CLOCK_133 // 133 Mhz #define MAX_GP_IDLE_CYCLES 88666 // 32 samples at 133Mhz #define MAX_EP_IDLE_CYCLES 709333 // 256 samples at 133Mhz #endif //#define MAX_EP_IDLE_CYCLES 10000 //----------------------------------------------------------------------------- // Name: class CXBoxSample // Desc: Main class to run this application. Most functionality is inherited // from the CXBApplication base class. //----------------------------------------------------------------------------- class CXBoxSample : public CXBApplication { public: CXBoxSample(); virtual HRESULT Initialize(); virtual HRESULT Render(); virtual HRESULT FrameMove(); HRESULT RenderSpectrum(); HRESULT RenderDSPUsage(); HRESULT FourierTransform(); HRESULT DownloadScratch(PCHAR pszScratchFile); HRESULT UpdateReverb(); HRESULT VerifySRCEffect(LPDSMIXBINS pDsMixBins); // Font and help CXBFont m_Font; CXBHelp m_Help; FLOAT m_fEPCycles; FLOAT m_fEPMinCycles; FLOAT m_fEPMaxCycles; DWORD m_dwDelta; FLOAT m_fGPCycles; DWORD m_dwGPMinCycles; DWORD m_dwGPMaxCycles; DWORD m_dwCount; DWORD m_dwCurrentEnv; CHAR m_szCurrentReverb[256]; // Draw help? BOOL m_bDrawHelp; BOOL m_bDoDFT; DWORD m_dwScreenSelected; HRESULT m_hOpenResult; LPDIRECTSOUND m_pDirectSound; LPDIRECTSOUNDBUFFER m_pDSBuffer; LPDIRECTSOUNDBUFFER m_pOscillatorBuffer0; LPDIRECTSOUNDBUFFER m_pOscillatorBuffer1; LPDIRECTSOUNDBUFFER m_pOscillatorBuffer2; FLOAT m_fMaxLevels[6]; // // DFT stuff // LPDSEFFECTIMAGEDESC m_pEffectsImageDesc; PDWORD m_pdwAudioData; DWORD m_dwEffectIndex; DOUBLE m_fMaxMagnitude; DOUBLE m_aFrequencyBins[MAX_FREQUENCY_BINS]; DOUBLE m_aMagnitudeBins[MAX_FREQUENCY_BINS]; DOUBLE m_aPhaseBins[MAX_FREQUENCY_BINS]; }; #endif
[ "benjamin.barratt@icloud.com" ]
benjamin.barratt@icloud.com
0a7ac693707721a5311e4dcea7a46179be1bf6e8
98b6c7cedf3ab2b09f16b854b70741475e07ab64
/www.cplusplus.com-20180131/reference/type_traits/is_nothrow_default_constructible/is_nothrow_default_constructible.cpp
9a4ec4031bd631d82a08e277d0878224a16789ee
[]
no_license
yull2310/book-code
71ef42766acb81dde89ce4ae4eb13d1d61b20c65
86a3e5bddbc845f33c5f163c44e74966b8bfdde6
refs/heads/master
2023-03-17T16:35:40.741611
2019-03-05T08:38:51
2019-03-05T08:38:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
625
cpp
// is_nothrow_default_constructible example #include <iostream> #include <type_traits> struct A { }; struct B { B(){} }; struct C { C() noexcept {} }; int main() { std::cout << std::boolalpha; std::cout << "is_nothrow_default_constructible:" << std::endl; std::cout << "int: " << std::is_nothrow_default_constructible<int>::value << std::endl; std::cout << "A: " << std::is_nothrow_default_constructible<A>::value << std::endl; std::cout << "B: " << std::is_nothrow_default_constructible<B>::value << std::endl; std::cout << "C: " << std::is_nothrow_default_constructible<C>::value << std::endl; return 0; }
[ "zhongtao.chen@yourun.com" ]
zhongtao.chen@yourun.com
ecc1699e5d4b59edeed938e7410cd622e504745a
82730ea9d814a8478a674c563b256fcfb8f07b4f
/BorderGen/ClosureDetDlg.h
663294d6583db56249c780e1a2108683fabf552f
[]
no_license
zjustarstar/BorderGen
7d7fa9d9a72302e3836e5c9d556638009370d718
f0ca5ec13ec21a5bb70faed118ac525c5b61702b
refs/heads/master
2021-07-16T07:14:33.817142
2020-06-11T10:06:07
2020-06-11T10:06:07
175,133,493
0
0
null
null
null
null
GB18030
C++
false
false
809
h
#pragma once #include <opencv2\opencv.hpp> using namespace std; using namespace cv; // CClosureDetDlg 对话框 class CClosureDetDlg : public CDialogEx { DECLARE_DYNAMIC(CClosureDetDlg) public: CClosureDetDlg(CWnd* pParent = NULL); // 标准构造函数 virtual ~CClosureDetDlg(); // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_DIALOG_CLOSURE_DETECTOR }; #endif protected: CString m_strFilePath; //文件夹路径; CEdit m_editFilePath; CListBox m_lbFiles; string getSaveFileName(CString strFile); void ListAllFiles(CString strFilePath); virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedButtonBrowser(); afx_msg void OnBnClickedButtonStartdetect(); virtual BOOL OnInitDialog(); };
[ "philous@163.com" ]
philous@163.com
6e92622216710e1a5917261c8daace1f6f9838de
be04d41cc516caec667467787a238e1463b815eb
/src/py/wrapper_b1580b6f5457571a867a2347d7b1f865.cpp
72548ee8b932fde1b82a00264b253bc6ca6d84e3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
nikhilkalige/ClangLite
9f0db6088dee83f89996d4c01da9979c39b3862c
dcb6d7385cca25c0a888bb56ae3ec1eb951cd752
refs/heads/master
2020-04-21T23:48:28.409657
2019-02-20T08:14:21
2019-02-20T08:14:21
169,958,200
0
0
Apache-2.0
2019-02-10T08:37:14
2019-02-10T08:37:14
null
UTF-8
C++
false
false
1,342
cpp
#include "_clanglite.h" bool (::clang::FileID::*method_pointer_a2de043c5e1b5973bd96085e9ca023a7)()const= &::clang::FileID::isValid; bool (::clang::FileID::*method_pointer_8bf8694510d856cf9efe8860ebb4a64f)()const= &::clang::FileID::isInvalid; class ::clang::FileID (*method_pointer_aab4faec1936510eb177541ad22621a6)()= ::clang::FileID::getSentinel; unsigned int (::clang::FileID::*method_pointer_c9e884cb5b3e578a9ab51a03e5baa5b5)()const= &::clang::FileID::getHashValue; namespace autowig { } void wrapper_b1580b6f5457571a867a2347d7b1f865(pybind11::module& module) { pybind11::class_<class ::clang::FileID, autowig::HolderType< class ::clang::FileID >::Type > class_b1580b6f5457571a867a2347d7b1f865(module, "FileID", "An opaque identifier used by SourceManager which refers to a source file\n(MemoryBuffer) along with its #include path and #line data.\n\n"); class_b1580b6f5457571a867a2347d7b1f865.def("is_valid", method_pointer_a2de043c5e1b5973bd96085e9ca023a7, ""); class_b1580b6f5457571a867a2347d7b1f865.def("is_invalid", method_pointer_8bf8694510d856cf9efe8860ebb4a64f, ""); class_b1580b6f5457571a867a2347d7b1f865.def_static("get_sentinel", method_pointer_aab4faec1936510eb177541ad22621a6, ""); class_b1580b6f5457571a867a2347d7b1f865.def("get_hash_value", method_pointer_c9e884cb5b3e578a9ab51a03e5baa5b5, ""); }
[ "pfernique@gmail.com" ]
pfernique@gmail.com
672b3aea545f807138cbafb94d0205c016eab6a1
444a6f3fb2c9d9dc042ffd54838bc3dc172ec531
/src/include/units/physical/si/electric_charge.h
1bdc153b26fcef4ffd43530d72c625c06a2cfbe8
[ "MIT" ]
permissive
rtobar/units
ef5a86bdb73c896eac92698d9a8386e11c6dfe48
5dd9eaac87a50adc62b170987ebac2d1344d63c5
refs/heads/master
2022-09-11T17:37:57.868428
2020-05-24T20:49:53
2020-05-24T20:49:53
266,679,421
1
0
MIT
2020-05-25T04:03:18
2020-05-25T04:03:18
null
UTF-8
C++
false
false
1,913
h
// The MIT License (MIT) // // Copyright (c) 2018 Mateusz Pusz // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #pragma once #include <units/physical/dimensions.h> #include <units/physical/si/current.h> #include <units/physical/si/time.h> #include <units/quantity.h> namespace units::physical::si { struct coulomb : named_unit<coulomb, "C", prefix> {}; struct dim_electric_charge : physical::dim_electric_charge<dim_electric_charge, coulomb, dim_time, dim_electric_current> {}; template<Unit U, Scalar Rep = double> using electric_charge = quantity<dim_electric_charge, U, Rep>; inline namespace literals { // C constexpr auto operator"" q_C(unsigned long long l) { return electric_charge<coulomb, std::int64_t>(l); } constexpr auto operator"" q_C(long double l) { return electric_charge<coulomb, long double>(l); } } // namespace literals } // namespace units::physical::si
[ "mateusz.pusz@gmail.com" ]
mateusz.pusz@gmail.com
fe6353ff743799cdd644a9c1cc6f39cbb5e0fbbe
3326db8648ecd23fabebbdece3a0db662b409664
/Codeforces/Educational Round 49/A.cpp
906f0790418872d43d80038d480cb14e4b4c5038
[]
no_license
fazlerahmanejazi/Competitive-Programming
96b9e934a72a978a9cae69ae50dd02ee84b6ca87
796021cdc7196d84976ee7c9e565c9e7feefce09
refs/heads/master
2021-11-10T08:23:31.128762
2019-12-24T22:11:12
2019-12-24T22:11:12
117,171,389
3
1
null
2021-10-30T20:31:10
2018-01-12T00:39:16
C++
UTF-8
C++
false
false
976
cpp
#include <bits/stdc++.h> using namespace std ; #define inf 0x3f3f3f3f #define INF 1000111000111000111LL #define mod 1000000007 #define pi acos(-1.0) #define eps 1e-8 #define endl '\n' #define mp make_pair #define mt make_tuple #define pb push_back #define fi first #define se second #define all(cc) (cc).begin(),(cc).end() using lli = long long int ; using pii = pair<int, int> ; using vi = vector<int> ; using vb = vector<bool> ; using vvi = vector<vector<int>> ; using vlli = vector<long long int> ; using vpii = vector<pair<int, int>> ; int main() { ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ; int T ; cin>> T ; while(T--) { int n, x ; string s ; bool pos=true ; cin>> n >> s ; for(int i=0 ; i<n ; i++) if(abs(s[i]-s[n-i-1])!=2 && abs(s[i]-s[n-i-1])) pos=false ; if(pos) cout<< "YES" << endl ; else cout<< "NO" << endl ; } }
[ "ahmed.belal98@gmail.com" ]
ahmed.belal98@gmail.com
5b20e8122fad1449a590077b796fe76ce3aa6b28
d3f69957671777e6a8b2b12e87c80a85068109c5
/sfz/sfz.cpp
70c21fad999e002f1e71403fc66b450cdb6a55c1
[]
no_license
lilslsls/sfz
0e1afa246d88ae78b90f153d8d4b10f62e36151e
2012d5a6146fc82dad586e8b68674d3370e9eb70
refs/heads/master
2021-01-24T18:06:26.916234
2017-03-08T05:40:33
2017-03-08T05:40:33
84,396,277
0
0
null
null
null
null
GB18030
C++
false
false
9,992
cpp
//--------------------------------------【程序说明】------------------------------------------ - //程序说明:《OpenCV3编程入门》OpenC3版书本配套示例程序70 //程序描述:查找并绘制轮廓综合示例 //开发测试所用操作系统: Windows 7 64bit //开发测试所用IDE版本:Visual Studio 2010 //开发测试所用OpenCV版本: 3.0 beta //2014年11月 Created by @浅墨_毛星云 //2014年12月 Revised by @浅墨_毛星云 //------------------------------------------------------------------------------------------------ // //-------------------------------- - 【头文件、命名空间包含部分】---------------------------- //描述:包含程序所使用的头文件和命名空间 //------------------------------------------------------------------------------------------------ #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> using namespace cv; using namespace std; void OstuBeresenThreshold(const Mat &in, Mat &out); bool isEligible(const RotatedRect &candidate); //---------------------------------- - 【宏定义部分】-------------------------------------------- //描述:定义一些辅助宏 //------------------------------------------------------------------------------------------------ //#include<opencvcv.h> #include<opencv/highgui.h> #include<opencv/cxcore.h> /*#include iostream */ #include <stdio.h > #include<opencv2/imgproc/imgproc.hpp> #include<opencv2/highgui/highgui.hpp> using namespace std; using namespace cv; int getColSum(Mat src, int col) { int sum = 0; int height = src.rows; int width = src.cols; for (int i = 0; i< height; i++) { sum = sum + src.at <uchar>(i, col); } return sum; } int getRowSum(Mat src, int row) { int sum = 0; int height = src.rows; int width = src.cols; for (int i = 0; i< width; i++) { sum += src.at <uchar>(row, i); } return sum; } void cutTop(Mat& src, Mat& dstImg)//上下切割 { int top, bottom; top = 0; bottom = src.rows; int i; for (i = 0; i< src.rows; i++) { int colValue = getRowSum(src, i); //cout i th colValue endl; if (colValue>0) { top = i; break; } } for (; i <src.rows; i++) { int colValue = getRowSum(src, i); //cout i th colValue endl; if (colValue == 0) { bottom = i; break; } } int height = bottom - top; Rect rect(0, top, src.cols, height); dstImg = src(rect).clone(); } int cutLeft(Mat& src, Mat& leftImg, Mat& rightImg)//左右切割 { int left, right; left = 0; right = src.cols; int colValue = 0; int i; for (i = 0; i< src.cols; i++) { colValue = getColSum(src, i); //cout i th colValue endl; if (colValue>0) { left = i; break; } } if (left == 0 && colValue == 0) { return 1; } for (; i< src.cols; i++) { int colValue = getColSum(src, i); //cout i th colValue endl; if (colValue == 0) { right = i; break; } } int width = right - left; Rect rect(left, 0, width, src.rows); leftImg = src(rect).clone(); Rect rectRight(right, 0, src.cols - right, src.rows); rightImg = src(rectRight).clone(); cutTop(leftImg, leftImg); return 0; } void getPXSum(Mat &src, int &a)//获取所有像素点和 { threshold(src, src, 100, 255, CV_THRESH_BINARY_INV); a = 0; for (int i = 0; i< src.rows; i++) { for (int j = 0; j< src.cols; j++) { a += src.at <uchar>(i, j); } } } int getSubtract(Mat &src, int TemplateNum) //两张图片相减 { Mat img_result(32, 48, CV_8UC3); int min = 1000000; int serieNum = 0; for (int i = 0; i< TemplateNum; i++) { char name[20]; sprintf_s(name, "CUserssDesktop5%d.jpg", i); char name[100]; char windowname[100]; sprintf(name, "CUserssDesktop2%d.jpg", i); cout<< name <<endl; Mat Template = imread(name, CV_LOAD_IMAGE_GRAYSCALE); threshold(Template, Template, 100, 255, CV_THRESH_BINARY); threshold(src, src, 100, 255, CV_THRESH_BINARY); resize(src, src, Size(32, 48), 0, 0, CV_INTER_LINEAR); resize(Template, Template, Size(32, 48), 0, 0, CV_INTER_LINEAR); imshow(src, src); imshow(temp, Template); cout<< src.size() << src.type() << endl; cout << Template.size() << Template.type() << endl; imshow(name, Template); absdiff(Template, src, img_result); imshow(diff, img_result); waitKey(); int diff = 0; getPXSum(img_result, diff); if (diff< min) { min = diff; serieNum = i; } int xxxx = 0; } printf("最小距离是%d", min); printf("匹配到第%d个模板匹配的数字是%dn", serieNum, serieNum); return serieNum; } int main() { Mat threshold_R = imread("D://身份证8.jpg", CV_LOAD_IMAGE_GRAYSCALE); resize(threshold_R, threshold_R, Size(1200, 700), 0, 0, CV_INTER_LINEAR); int blockSize = 25; int constValue = 10; Mat img_gray; adaptiveThreshold(threshold_R, img_gray, 255, CV_ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY_INV, blockSize, constValue); Mat threshold = Matzeros(threshold_R.rows, threshold_R.cols, CV_8UC3); OstuBeresenThreshold(threshold_R, threshold); //二值化 threshold_R = threshold_R 119; imshow("二值化", img_gray); medianBlur(img_gray, img_gray, 15); namedWindow("中值滤波", WINDOW_NORMAL); imshow("中值滤波", img_gray); Mat imgInv(cvScalar(255)); Mat threshold_Inv = imgInv - img_gray; //黑白色反转,即背景为黑色 namedWindow("背景反转", WINDOW_NORMAL); imshow("背景反转", threshold_Inv); Mat threshold_Inv; Mat element = getStructuringElement(MORPH_RECT, Size(70, 50)); //闭形态学的结构元素 morphologyEx(img_gray, threshold_Inv, CV_MOP_CLOSE, element); namedWindow("闭", WINDOW_NORMAL); imshow("闭", threshold_Inv); imwrite("E计算机视觉源码 身份证识别Id_recognition", threshold_Inv); waitKey(0); vector vector Point contours; cout <<contours.size() << endl; vectorVec4i hierarchy; findContours(threshold_Inv, contours, hierarchy, RETR_EXTERNAL, CHAIN_APPROX_SIMPLE); //只检测外轮廓对候选的轮廓进行进一步筛选 int index = 0; cout << contours.size() << endl; for (; index = 0; index = hierarchy[index][0]) { Scalar color(rand() & 255, rand() & 255, rand() & 255); //此句代码的OpenCV2版为: //drawContours(dstImage, contours, index, color, CV_FILLED, 8, hierarchy); //此句代码的OpenCV3版为: drawContours(threshold, contours, index, color, FILLED, 8, hierarchy); } //【7】显示最后的轮廓图 imshow("轮廓图", threshold); waitKey(0); vector vector Point iterator itc = contours.begin(); RotatedRect mr = minAreaRect(Mat(itc)); vector RotatedRect rects; while (itc != contours.end()) { RotatedRect mr = minAreaRect(Mat(itc)); //返回每个轮廓的最小有界矩形区域 if (!isEligible(mr)) //判断矩形轮廓是否符合要求 { itc = contours.erase(itc); } else { rects.push_back(mr); ++itc; } } //测试是否找到了号码区域 cout << rects.size() << endl; Point2f vertices[4]; rects[0].points(vertices); for (int i = 0; i 4; i++) line(threshold_R, vertices[i], vertices[(i + 1) % 4], Scalar(0, 0, 0)); //画黑色线条 namedWindow("背景反转", WINDOW_NORMAL); imshow("背景反转", threshold_R); waitKey(0); Rect brect = rects[0].boundingRect(); Mat src = threshold_R(brect); imshow("Test_Rplane", src); imwrite("CUserssDesktop身份证号1.jpg", src); int blockSize1 = 25; int constValue1 = 10; Mat img_gray1; adaptiveThreshold(src, img_gray1, 255, CV_ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY_INV, blockSize1, constValue1); imshow("二值化", img_gray1); Mat out; medianBlur(img_gray, out, 15); medianBlur(img_gray1, out, 11); medianBlur(out, out, 5); imshow("中值滤波3", out); Mat leftImg, rightImg; int res = cutLeft(out, leftImg, rightImg); int i = 0; cout res; while (res == 0) { char nameLeft[10]; sprintf(nameLeft, %d, i); char nameRight[10]; sprintf(nameRight, %dRight, i); i++; imshow(nameLeft, leftImg); stringstream ss; ss nameLeft; imwrite("CUserssDesktop7 + ss.str() + .jpg", leftImg); ss nameLeft; Mat srcTmp = rightImg; getSubtract(leftImg, 10); res = cutLeft(srcTmp, leftImg, rightImg); } waitKey(0); return 0; } bool isEligible(const RotatedRect &candidate) { float error = 0.5; const float aspect = 4.5 0.3; //长宽比 int min = 10 aspect 100; //最小区域 int max = 50 aspect 50; //最大区域 float rmin = aspect - aspecterror; //考虑误差后的最小长宽比 float rmax = aspect + aspecterror; //考虑误差后的最大长宽比 int area = candidate.size.height candidate.size.width; float r = (float)candidate.size.width(float)candidate.size.height; if (r 1) r = 1 r; if ((area min area max) (r rmin r rmax)) //满足该条件才认为该candidate为车牌区域 return false; else return true; } void OstuBeresenThreshold(const Mat &in, Mat &out) //输入为单通道 { double ostu_T = threshold(in, out, 0, 255, CV_THRESH_OTSU); //otsu获得全局阈值 double min; double max; minMaxIdx(in, &min, &max); const double CI = 0.12; double beta = CI(max - min + 1) 128; double beta_lowT = (1 - beta)ostu_T; double beta_highT = (1 + beta)ostu_T; Mat doubleMatIn; in.copyTo(doubleMatIn); int rows = doubleMatIn.rows; int cols = doubleMatIn.cols; double Tbn; for (int i = 0; i <rows; ++i) { //获取第 i行首像素指针 uchar p = doubleMatIn.ptruchar(i); uchar outPtr = out.ptruchar(i); //对第i 行的每个像素(byte)操作 for (int j = 0; j< cols; ++j) { if (i 2 irows - 3 j2 jrows - 3) { if (p[j] = beta_lowT) outPtr[j] = 0; else outPtr[j] = 255; } else { Tbn = sum(doubleMatIn(Rect(i - 2, j - 2, 5, 5)))[0] 25; // 窗口大小2525 if (p[j] beta_lowT(p[j] Tbn && (beta_lowT = p[j] && p[j] = beta_highT))) outPtr[j] = 0; if (p[j] beta_highT(p[j] = Tbn && (beta_lowT = p[j] && p[j] = beta_highT))) outPtr[j] = 255; } } } }
[ "李爽@DESKTOP-R1CM8GA" ]
李爽@DESKTOP-R1CM8GA
116a5e0a1205c2e5317e100651c1acfd4541c6f1
458414e3ea47a784759a7e2c3c37c97b098baf14
/main/cppsrc/MyQRectF.cpp
66ec483538152f44ae3508626cbc51eebd591f53
[]
no_license
blazern/kovtun-method
24fab1eee4a027cc2cde66ea6c238963f828d647
e1d027d445b66c924262c6dea4e676863b3c4775
refs/heads/master
2021-01-15T23:07:28.913847
2014-02-28T16:41:31
2014-02-28T16:41:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,228
cpp
#include "MyQRectF.h" #include <QDebug> namespace KovtunMethod { MyQRectF::MyQRectF(const MyQRectF & other) : QRectF(other), name(other.name), neighbors(other.neighbors), color(other.color), colorInitialized(other.colorInitialized), parentsGravityCenter(copy(other.parentsGravityCenter)), grandParentsGravityCenter(copy(other.grandParentsGravityCenter)) { } MyQRectF::~MyQRectF() { for (auto & neighbor : neighbors) { neighbor->neighbors.remove(this); } if (parentsGravityCenter != nullptr) { delete parentsGravityCenter; } if (grandParentsGravityCenter != nullptr) { delete grandParentsGravityCenter; } } MyQRectF::MyQRectF( const QPointF & topLeft, const QPointF & bottomRight, const QString & name, const QPointF * parentsGravityCenter, const QPointF * grandParentsGravityCenter) : QRectF(topLeft, bottomRight), name(name), neighbors(), color(0, 0, 0), colorInitialized(false), parentsGravityCenter(copy(parentsGravityCenter)), grandParentsGravityCenter(copy(grandParentsGravityCenter)) { } MyQRectF::MyQRectF( const qreal x, const qreal y, const qreal width, const qreal height, const QString & name, const QPointF * parentsGravityCenter, const QPointF * grandParentsGravityCenter) : QRectF(x, y, width, height), name(name), neighbors(), color(0, 0, 0), colorInitialized(false), parentsGravityCenter(copy(parentsGravityCenter)), grandParentsGravityCenter(copy(grandParentsGravityCenter)) { } QPointF * MyQRectF::copy(const QPointF * point) const { return point == nullptr ? nullptr : new QPointF(*point); } void MyQRectF::addNeighbor(MyQRectF & other) { neighbors.insert(&other); other.neighbors.insert(this); } const QColor & MyQRectF::getColor() const { return color; } void MyQRectF::setColor(const QColor & color) { colorInitialized = true; this->color = color; } bool MyQRectF::isColorInitialized() const { return colorInitialized; } } //uint qHash(const KovtunMethod::MyQRectF & rectangle) //{ // return qHash(rectangle.getName()); //}
[ "blazer007@yandex.ru" ]
blazer007@yandex.ru
3492f9ffeace7cc3ccc67a09fce32a5fa7307373
8535f518a05f5267671cc3547048c42278e2e6af
/Vehicle.cpp
f500fa42b62b06d15f257818f337110aca1f92e8
[]
no_license
cgprats/COP3503_Lab01
7163c58251958aed81d127e6573e9505571dbc7e
ccb62d9dd77a88d7f7d14067e41bb3a08186eb2e
refs/heads/master
2022-12-15T22:40:05.952068
2020-03-30T22:54:13
2020-03-30T22:54:13
297,393,172
0
0
null
null
null
null
UTF-8
C++
false
false
830
cpp
#include "Vehicle.h" #include <iostream> #include <string> #include <vector> using namespace std; Vehicle::Vehicle() { _make = "COP3503"; _model = "Rust Bucket"; _year = 1900; _price = 0; _mileage = 0; /*this->make = _make; this->model = _model; this->year = _year; this->price = _price; this->mileage = _mileage;*/ } Vehicle::Vehicle(string make, string model, int year, float price, int mileage) { _make = make; _model = model; _year = year; _price = price; _mileage = mileage; } float Vehicle::GetPrice() { return _price; } string Vehicle::GetYearMakeModel() { string yearMakeModel = to_string(_year) + " " + _make + " " + _model; return yearMakeModel; } void Vehicle::Display() { cout << to_string(_year) << " " << _make << " " << _model << " " << to_string(_price) << " " << to_string(_mileage) << endl; }
[ "christopher@noreply.example.com" ]
christopher@noreply.example.com
3b089921a49480a1e3e52cfe0a9ad5b213540f2b
4d803e91a03b7e45b46274c8ab06f21fc27b995b
/lab07/lab07.cpp
2c1667f31b8131cd61303e50958ecd8070aacf13
[]
no_license
faisal07m/mp
a2218916566502a251821050dcc207a5eaa4d4cd
e6f3153cabeb450d9658ea3ec9feda8f6dcf3c10
refs/heads/master
2020-04-08T04:21:48.864140
2020-02-16T22:31:47
2020-02-16T22:31:47
159,013,287
0
0
null
null
null
null
UTF-8
C++
false
false
4,779
cpp
/* n = 3000, threads = 40 time in seconds ------------------------------------------------------------------------------------------------------------------------------------------- Chunk | Default | 2 | 8 | 32 | 128 | Single Thread (default Chunk) Static (Gauss TIME sec) 2.224242e+00 2.559708e+00 2.191239e+00 2.334189e+00 2.693574e+00 1.057281e+01 (back sub TIME sec) 9.880314e-02 1.174744e-01 1.055908e-01 9.576066e-02 1.027680e-01 1.470342e-02 (total TIME sec) 2.323054e+00 2.677189e+00 2.296837e+00 2.429958e+00 2.796349e+00 1.058752e+01 Dynamic (Gauss TIME sec) 2.811208e+00 2.784184e+00 2.666185e+00 2.670090e+00 3.145072e+00 1.059340e+01 (back sub TIME sec) 6.028012e-01 3.655285e-01 1.851279e-01 1.270579e-01 1.157399e-01 6.475342e-02 (total TIME sec) 3.414019e+00 3.149723e+00 2.851323e+00 2.797158e+00 3.260819e+00 1.065816e+01 Guided (Gauss TIME sec) 2.664658e+00 2.647170e+00 2.665661e+00 2.761532e+00 3.125653e+00 1.055963e+01 (back sub TIME sec) 2.839649e-01 2.652135e-01 2.122728e-01 1.625099e-01 1.227327e-01 1.480821e-02 (total TIME sec) 2.948632e+00 2.912393e+00 2.877944e+00 2.924050e+00 3.248396e+00 1.057445e+01 Clearly with 40 threads the program performed alot faster than single threaded computation. Following is the speedup calculation:- Scheduler (total time) | Multi-Threaded(Default Chunk) Single Thread(Deafult chunk) | Multi-Threaded Speedup Static 2.323054e+00 < 1.058752e+01 8.264466 seconds faster Dynamic 3.414019e+00 < 1.065816e+01 7.244141 seconds faster guided 2.948632e+00 < 1.057445e+01 7.625818 seconds faster ------------------------------------------------------------------------------------------------------------------------------------------ */ #include <iostream> #include <time.h> #include<cstdlib> #include<stdio.h> #include <cmath> #include<omp.h> using namespace std; int main(int argc , char *argv[]) { int n= atoi(argv[1]); int threads = omp_get_max_threads(); int chunk ; //atoi(argv[2]); //printf("%d",threads); //omp_set_num_threads(threads); double time1,time2,time3,t_time_s,t_time_e; double A[n][n+1] ; for (int i=0; i<n; i++) { for (int j=0; j<n; j++) { if(i==j){ A[i][j]=(double)n/10; } else{ unsigned int seed = (unsigned) time(NULL); seed= seed + j; A[i][j]=(double)rand_r(&seed)/(RAND_MAX); //printf("\n %lf rand",A[i][j]); } } } for (int i=0; i<n; i++) { A[i][n]=1; } //printf("\n threads %d \n", omp_get_max_threads()); //elimination Ref:- https://en.wikipedia.org/wiki/Gaussian_elimination without pivot double f=0.0; int i=0,j=0; t_time_s=omp_get_wtime(); time1= omp_get_wtime(); for (int k=0; k<n; k++) { #pragma omp parallel default(none) num_threads(threads) shared(chunk,A,n,k,f) private(i,j) { #pragma omp for schedule(static) //pragma omp for schedule(dynamic,chunk) //#pragma omp for schedule(guided,chunk) for (i=k+1; i<n; i++) { f = A[i][k]/A[k][k]; //put 0 for lower triangle A[i][k] = 0; for (j=k+1; j<=n; j++) A[i][j] -= A[k][j]*f; } } } time2=omp_get_wtime() - time1; //back substitution double x[n]; time3= omp_get_wtime(); #pragma omp parallel default(none) num_threads(threads) shared(A,n,x,chunk) private(i,j) for (int i = n-1; i >= 0; i--) { #pragma omp single x[i] = A[i][n]; #pragma omp for schedule(static) //#pragma omp for schedule(dynamic,chunk) //#pragma omp for schedule(guided,chunk) for (int j=i+1; j<n; j++) { x[i] -= A[i][j]*x[j]; } #pragma omp single x[i] = x[i]/A[i][i]; } double time4 = omp_get_wtime() - time3; t_time_e = omp_get_wtime() - t_time_s; double arr[n]; double max = arr[0]; for (int i=0; i<n; i++) { arr[i]=abs(x[i]-1); } for(int i = 1; i<n; i++) { if(arr[i] > max) max = arr[i]; } printf("Max error in solution %e\n",max); printf("Time for Gaussian elim : %e seconds\n",time2); printf("Time back sub : %e seconds\n",time4); printf("Total Time : %e seconds\n",t_time_e); return 0; }
[ "faisalm@ln-0002.cm.cluster" ]
faisalm@ln-0002.cm.cluster
4aca26ae8468dc3f191cf9ea0d1ab3e426166e0c
5e3e50634c2cac6f85ff4f8c9ae385a62d2886d0
/white/equation/main.cpp
b47578e60797c0fef547b404c75f2b6c5a84abb3
[]
no_license
asek-ll/cpp-belt
642ffe84c932c6684a5e355eacac68f580351a44
86d010c1421ab093d56e3c7a688181d883401662
refs/heads/master
2023-04-07T18:36:13.330862
2023-04-03T19:49:18
2023-04-03T19:49:18
205,446,333
0
0
null
null
null
null
UTF-8
C++
false
false
502
cpp
#include <iostream> #include <cmath> using namespace std; int main() { double a, b, c; cin >> a >> b >> c; if (a == 0.0) { if (b != 0.0) { cout << -c/b; } } else { double d = b*b - 4 * a * c; if (d == 0.0) { cout << (-b / (2 * a)); } if (d > 0) { double sqrtd = sqrt(d); cout << ((-b - sqrtd) / (2 * a)) << ' ' << ((-b + sqrtd) / (2 * a)); } } cout << endl; return 0; }
[ "sopplet@gmail.com" ]
sopplet@gmail.com
2da06283e4a66d38bc3e37bd49a43ef923b642ce
dd6147bf9433298a64bbceb7fdccaa4cc477fba6
/8304/Butko_Artem/lab6/SOURCE/Game/GameField/Field/Field.cpp
a545d111977075529f275ae55c9016314d1b5cfa
[]
no_license
moevm/oop
64a89677879341a3e8e91ba6d719ab598dcabb49
faffa7e14003b13c658ccf8853d6189b51ee30e6
refs/heads/master
2023-03-16T15:48:35.226647
2020-06-08T16:16:31
2020-06-08T16:16:31
85,785,460
42
304
null
2023-03-06T23:46:08
2017-03-22T04:37:01
C++
UTF-8
C++
false
false
16,198
cpp
// // Created by Artem Butko on 14/05/2020. // #include "Field.h" Field::Field(int height, int width, int numberOfPlayers) { this->height = height; this->width = width; this->objCount = 0; this->objLimit = width * height; this->numberOfPlayers = numberOfPlayers; basesOnField.resize(numberOfPlayers); for (int i = 0; i != numberOfPlayers; ++i) basesOnField[numberOfPlayers] = nullptr; this->logging = new LoggingProxy; int land; int neutral; std::srand(unsigned(std::time(nullptr))); field = new Tale*[height]; for (int i = 0; i < height; ++i) field[i] = new Tale[width]; for (int i = 0; i < height; ++i) for (int j = 0; j < width; ++j) { land = rand() % 4; if (land == 0) field[i][j].landscape = landscapeFactory.getForest(); else if (land == 1) field[i][j].landscape = landscapeFactory.getMountain(); else if (land == 2) field[i][j].landscape = landscapeFactory.getWater(); else field[i][j].landscape = nullptr; neutral = rand() % 16; if (neutral == 0) field[i][j].neutral = neutralFactory.createTrap(); else if (neutral == 1) field[i][j].neutral = neutralFactory.createAidKit(); else if (neutral == 2) field[i][j].neutral = neutralFactory.createCurse(); else if (neutral == 3) field[i][j].neutral = neutralFactory.createPotion(); else field[i][j].neutral = nullptr; field[i][j].object = nullptr; field[i][j].x = i; field[i][j].y = j; field[i][j].isBrightView = false; field[i][j].isDarkView = false; field[i][j].isUndeadView = false; } } Field::Field(const Field &other) { height = other.height; width = other.width; objLimit = other.objLimit; objCount = other.objCount; field = new Tale*[height]; for (int i = 0; i < height; ++i) field[i] = new Tale[width]; for (int i = 0; i < height; ++i) for (int j = 0; j < width; ++j) field[i][j] = other.field[i][j]; } Field::Field(Field&& other) { height = other.height; width = other.width; objLimit = other.objLimit; objCount = other.objCount; field = new Tale*[height]; for (int i = 0; i < height; ++i) field[i] = new Tale[width]; for (int i = 0; i < height; ++i) for (int j = 0; j < width; ++j) field[i][j] = other.field[i][j]; for (int i = 0; i < other.height; ++i) delete[] other.field[i]; delete[] other.field; } Field& Field::operator=(const Field& other) { this->height = other.height; this->width = other.width; this->base = other.base; this->field = new Tale*[height]; for (int i = 0; i < height; ++i) { field[i] = new Tale[width]; for (int j = 0; j < width; ++j) field[i][j] = other.field[i][j]; } return *this; }; int Field::addObject(Object *object, int x, int y) { if (objCount > objLimit) { std::cout << "ERROR: limit of objects on the field is exceeded!" << std::endl; return 1; } if (field[x][y].object != nullptr) { std::cout << "ERROR: this tale is not empty!" << std::endl; return 1; } field[x][y].object = object; field[x][y].x = x; field[x][y].y = y; field[x][y].object->x = x; field[x][y].object->y = y; std::cout << field[x][y].object->baseID << std::endl; logging->loggingGetUnit(field[x][y].object, x, y); objCount++; return 0; } int Field::moveObject(int x, int y, int i, int j) { /*TODO выход за границы поля*/ if (field[x][y].object != nullptr && field[i][j].object == nullptr && field[x][y].object->id != 'B') { if (field[x][y].object->id == 'M' || field[x][y].object->id == 'W' || field[x][y].object->id == 'K' || field[x][y].object->id == 'S' || field[x][y].object->id == 'A' || field[x][y].object->id == 'C') { if (field[i][j].neutral != nullptr) { field[i][j].neutral->action->impact(field[x][y].object); std::cout << "UNIT on neutral object " << field[i][j].neutral->id << "!" << std::endl; field[x][y].object->getInformation(); field[i][j].neutral = nullptr; } if (field[i][j].landscape != nullptr) { std::cout << "UNIT on landscape " << field[i][j].landscape->getID() << "!" << std::endl; field[i][j].landscape->getEffect(field[x][y].object); field[x][y].object->getInformation(); } logging->loggingMoveUnit(field[x][y].object, x, y, i, j); } field[i][j].object = field[x][y].object; field[x][y].object = nullptr; if (field[i][j].object->health.get() < 0) { std::cout << field[i][j].object->id << " is dead!" << std::endl; field[i][j].object->death(); this->deleteObject(i, j); } } else { std::cout << "ERROR: impossible to move!" << std::endl; return 1; } return 0; } int Field::deleteObject(int x, int y) { if (field[x][y].object != nullptr) { field[x][y].object = nullptr; objCount --; } else { std::cout << "ERROR: impossible to delete!" << std::endl; return 1; } return 0; } void Field::show(char side) { std::cout << "[\\]"; for (int i = 0; i < width; ++i) std::cout << "[" << i << "]"; std::cout << "--Y" << std::endl; for (int i = 0; i < height; ++i) { std::cout << "[" << i << "]"; for (int j = 0; j < width; ++j) { bool isNeutral = (field[i][j].neutral != nullptr); bool isObject = (field[i][j].object != nullptr); bool isLandscape = (field[i][j].landscape != nullptr); if (side == 'M') { if (isNeutral) std::cout << "[" << field[i][j].neutral->id << "]"; else if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U')) std::cout << "{" << field[i][j].object->id << "}"; else std::cout << "[ ]"; if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U')) { field[i][j].isBrightView = true; field[i][j].isUndeadView = true; field[i][j].isDarkView = true; } } else if (side == 'B') { bool isVision = field[i][j].isBrightView; if (!isVision) std::cout << "( )"; else if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U')) std::cout << "{" << field[i][j].object->id << "}"; else if (isLandscape && isObject && field[i][j].object != nullptr) std::cout << field[i][j].landscape->getID() << field[i][j].object->id << field[i][j].landscape->getID(); else if (!isLandscape && isObject && field[i][j].object != nullptr) std::cout << "[" << field[i][j].object->id << "]"; else if (isLandscape && isNeutral) std::cout << field[i][j].landscape->getID() << field[i][j].neutral->id << field[i][j].landscape->getID(); else if (!isLandscape && isNeutral) std::cout << "[" << field[i][j].neutral->id << "]"; else if (isLandscape) std::cout << field[i][j].landscape->getID() << " " << field[i][j].landscape->getID(); else std::cout << "[ ]"; } else if (side == 'D') { bool isVision = field[i][j].isDarkView; if (!isVision) std::cout << "( )"; else if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U')) std::cout << "{" << field[i][j].object->id << "}"; else if (isLandscape && isObject && field[i][j].object != nullptr) std::cout << field[i][j].landscape->getID() << field[i][j].object->id << field[i][j].landscape->getID(); else if (!isLandscape && isObject && field[i][j].object != nullptr) std::cout << "[" << field[i][j].object->id << "]"; else if (isLandscape && isNeutral) std::cout << field[i][j].landscape->getID() << field[i][j].neutral->id << field[i][j].landscape->getID(); else if (!isLandscape && isNeutral) std::cout << "[" << field[i][j].neutral->id << "]"; else if (isLandscape) std::cout << field[i][j].landscape->getID() << " " << field[i][j].landscape->getID(); else std::cout << "[ ]"; } else if (side == 'U') { bool isVision = field[i][j].isUndeadView; if (!isVision) std::cout << "( )"; else if (isObject && (field[i][j].object->id == 'B' || field[i][j].object->id == 'D'|| field[i][j].object->id == 'U')) std::cout << "{" << field[i][j].object->id << "}"; else if (isLandscape && isObject) std::cout << field[i][j].landscape->getID() << field[i][j].object->id << field[i][j].landscape->getID(); else if (!isLandscape && isObject) std::cout << "[" << field[i][j].object->id << "]"; else if (isLandscape && isNeutral) std::cout << field[i][j].landscape->getID() << field[i][j].neutral->id << field[i][j].landscape->getID(); else if (!isLandscape && isNeutral) std::cout << "[" << field[i][j].neutral->id << "]"; else if (isLandscape) std::cout << field[i][j].landscape->getID() << " " << field[i][j].landscape->getID(); else std::cout << "[ ]"; } } std::cout << std::endl; } std::cout << "| "<< std::endl; std::cout << "X" << std::endl; } Field::~Field() { for (int i = 0; i < height; ++i) delete[] field[i]; delete[] field; } FieldIterator *Field::iterator() { return (new FieldIterator(*this)); } FieldIterator *Field::end() { auto* end = new FieldIterator(*this); end->end(); return end; } FieldIterator* Field::begin() { auto* begin = new FieldIterator(*this); begin->begin(); return begin; } int Field::createBase(int x, int y, int unitLimit, char id, int number) { if (x + 1 < height && y + 1 < width && x >= 0 && y >= 0) { if (field[x][y].object == nullptr && field[x + 1][y + 1].object == nullptr && field[x][y + 1].object == nullptr && field[x + 1][y].object == nullptr) { basesOnField[number] = new Base(this, x, y, unitLimit); basesOnField[number]->x = x; basesOnField[number]->y = y; basesOnField[number]->id = id; field[x][y].object = basesOnField[number]; field[x + 1][y].object = field[x][y].object; field[x][y + 1].object = field[x][y].object; field[x + 1][y + 1].object = field[x][y].object; logging->loggingCreateBase(basesOnField[number]); field[x][y].landscape = nullptr; field[x + 1][y].landscape = nullptr; field[x][y + 1].landscape = nullptr; field[x + 1][y + 1].landscape = nullptr; field[x][y].neutral = nullptr; field[x + 1][y].neutral = nullptr; field[x][y + 1].neutral = nullptr; field[x + 1][y + 1].neutral = nullptr; if (number == 0) { field[x + 2][y].isBrightView = true; field[x + 2][y + 1].isBrightView = true; field[x + 2][y + 2].isBrightView = true; field[x + 1][y + 2].isBrightView = true; field[x][y + 2].isBrightView = true; } else if (number == 1) { field[x - 1][y].isDarkView = true; field[x - 1][y + 1].isDarkView = true; field[x - 1][y - 1].isDarkView = true; field[x][y - 1].isDarkView = true; field[x + 1][y - 1].isDarkView = true; } else if (number == 2) { field[x - 1][y].isUndeadView = true; field[x - 1][y + 1].isUndeadView = true; field[x - 1][y + 2].isUndeadView = true; field[x][y + 2].isUndeadView = true; field[x + 1][y + 2].isUndeadView = true; } } } return 0; } void Field::immediateDeath(int x, int y) { field[x][y].object->death(); this->deleteObject(x, y); } void Field::makeDamage(int x, int y, int i, int j) { if (field[i][j].object != nullptr && field[x][y].object != nullptr && (field[x][y].object->id == 'M' || field[x][y].object->id == 'W' || field[x][y].object->id == 'K' || field[x][y].object->id == 'S' || field[x][y].object->id == 'A' || field[x][y].object->id == 'C' )) { static_cast<IUnit*>(field[x][y].object)->makeDamage(static_cast<IUnit*>(field[x][y].object)->damage.getDamage(), field[i][j].object); logging->loggingAttackUnit(field[x][y].object, x, y, i, j); if (field[i][j].object->health.get() < 0) { std::cout << field[i][j].object->id << " is dead!" << std::endl; field[i][j].object->death(); this->deleteObject(i, j); } else field[i][j].object->getInformation(); } else std::cout << "ERROR: impossible to attack!" << std::endl; } Object *Field::getObject(int x, int y) { if(field[x][y].object != nullptr) return field[x][y].object; else return nullptr; } Snapshot* Field::createSnapshot(std::string mode) { Snapshot* snap; if (mode == "save") { if (base != nullptr) snap = new Snapshot(this, height, width, objLimit, objCount, base->unitLimit, base->unitCount); snap = new Snapshot(this, height, width, objLimit, objCount, 0, 0); } else { snap = new Snapshot(this); } return snap; } void Field::getVision(char side, int x, int y) { if (side == 'B') { field[x][y].isBrightView = true; if (x + 1 < height) field[x + 1][y].isBrightView = true; if (x - 1 >= 0) field [x - 1][y].isBrightView = true; if (y + 1 < width) field[x][y + 1].isBrightView = true; if (y - 1 >= 0) field[x][y - 1].isBrightView = true; if (x + 1 < height && y - 1 >= 0) field[x + 1][y - 1].isBrightView = true; if (x + 1 < height && y + 1 < width) field[x + 1][y + 1].isBrightView = true; if (x - 1 >= height && y - 1 >= 0) field[x - 1][y - 1].isBrightView = true; if (x - 1 < height && y + 1 < width) field[x - 1][y + 1].isBrightView = true; } else if (side == 'D') { field[x][y].isDarkView = true; if (x + 1 < height) field[x + 1][y].isDarkView = true; if (x - 1 >= 0) field [x - 1][y].isDarkView = true; if (y + 1 < width) field[x][y + 1].isDarkView = true; if (y - 1 >= 0) field[x][y - 1].isDarkView = true; if (x + 1 < height && y - 1 >= 0) field[x + 1][y - 1].isDarkView = true; if (x + 1 < height && y + 1 < width) field[x + 1][y + 1].isDarkView = true; if (x - 1 >= height && y - 1 >= 0) field[x - 1][y - 1].isDarkView = true; if (x - 1 < height && y + 1 < width) field[x - 1][y + 1].isDarkView = true; } else { field[x][y].isUndeadView = true; if (x + 1 < height) field[x + 1][y].isUndeadView = true; if (x - 1 >= 0) field[x - 1][y].isUndeadView = true; if (y + 1 < width) field[x][y + 1].isUndeadView = true; if (y - 1 >= 0) field[x][y - 1].isUndeadView = true; if (x + 1 < height && y - 1 >= 0) field[x + 1][y - 1].isUndeadView = true; if (x + 1 < height && y + 1 < width) field[x + 1][y + 1].isUndeadView = true; if (x - 1 >= height && y - 1 >= 0) field[x - 1][y - 1].isUndeadView = true; if (x - 1 < height && y + 1 < width) field[x - 1][y + 1].isUndeadView = true; } }
[ "artembutko2000@yandex.com" ]
artembutko2000@yandex.com
33cbc75e975bd1ede1c5a115f0101891ed826b37
9506a40845f40f9f79e20ac87191c5b0d1ef6d7c
/contests/round655/c.cpp
cefcce5dafe3cbd246d6f1f51539eddc27613891
[]
no_license
anish-rajan/Cp-algos
9ab16374a154fe9598a49405d1a2b3bf10013320
9bcb7264769536cc4ff877a3b6d2f156fddee50a
refs/heads/master
2022-12-14T09:44:31.960833
2020-09-10T12:01:14
2020-09-10T12:01:14
265,180,210
2
0
null
null
null
null
UTF-8
C++
false
false
2,774
cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; #define mp make_pair #define v vector #define inp_push(no, v) \ ll no; \ cin >> no; \ v.push_back(no); #define pb push_back #define fi first #define se second #define ALL(v) v.begin(), v.end() #define UN(v) sort((v).begin(), (v).end()), v.erase(unique(v.begin(), v.end()), v.end()) #define N 300005 #define mod 1000000009 #define INF INT64_MAX //////////////////////////IMPORTANT FUNCTIONS///////////////////////////////////////////// /* Guidlines berfore submitting solution 1. Check N value before submitting 2. Check all constant kind of values you are using. Might give WA. Think 3. Check mod value */ v<ll> fact(N); v<ll> prime_check(1e6 + 2); v<ll> primes; long long powmod(long long x, long long y, long long m) { long long res = 1LL; while (y) { if (y & 1) res = (res * x) % m; x = (x * x) % m; y /= 2; } return res; } void init_fact() { fact[0] = 1; for (ll i = 1; i < N; i++) { fact[i] = (fact[i - 1] * i) % mod; } } ll C(ll n, ll r) { if (n < r) return 0; ll temp = fact[n] * powmod(fact[r], mod - 2, mod) % mod; temp *= powmod(fact[n - r], mod - 2, mod); temp %= mod; return temp; } void Sieve() { for (ll i = 2; i <= 1e6 + 1; i++) { if (prime_check[i]) continue; primes.pb(i); for (ll j = 2 * i; j <= 1e6 + 2; j += i) prime_check[j] = i; } } ll phi(ll n) { ll i, res = n; for (i = 2; i * i <= n; i++) if (n % i == 0) { while (n % i == 0) n /= i; res -= res / i; } if (n > 1) res -= res / n; return res; } /////////////////////////////////////START CODE HERE///////////////////////////////////////////// ll t; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // init_fact(); // Sieve(); cin >> t; while (t--) { ll n; cin >> n; v<ll> a(n + 1); for (ll i = 1; i <= n; i++) cin >> a[i]; ll maxpos = 0, eq = 0, ans = 0, neq = 0; for (ll i = 1; i <= n; i++) { if (a[i] != i) { maxpos = max(a[i], maxpos); neq++; } else eq++, maxpos = max(maxpos, i); if (maxpos == i) { if (eq > 0 && neq > 0) ans += 2; else if (neq > 0) ans++; eq = 0, neq = 0; } } cout << min(2LL, ans) << "\n"; } }
[ "anishrajan2000@gmail.com" ]
anishrajan2000@gmail.com
1fdf60a2b2b78e50b221564b50e78b92718126b7
d657d42eba1a5cf80f39719859cb6944e28f0aa0
/Exercícios Aulas Práticas Resolvidos/Exercicios Vetores Saul Delabrida/17.cpp
eebd45409570c0eba188a3e3be99658a787fae8a
[]
no_license
fonte-nele/BCC201-Introducao-Programacao
ef6b700f2caea2806d57901d9eace1fac85d29a5
18383ae82b49595c25add46bfa2e8fcef83afdf1
refs/heads/master
2020-06-08T16:17:37.457370
2019-06-22T17:29:53
2019-06-22T17:29:53
193,261,398
0
0
null
null
null
null
UTF-8
C++
false
false
243
cpp
#include <iostream> using namespace std; int main() { int i; int v[50]; v[1]=v[0]=1; for (i=2; i< 50; i++) { v[i] = v[i-1] + v[i-2]; } cout<<"A serie de Fibonacci eh:\n"; for (i=0; i<50; i++) { cout << v[i] <<endl; } return 0; }
[ "felipephontinelly@hotmail.com" ]
felipephontinelly@hotmail.com
0cb062b229fe2902e6297e4832ca5cd6ebc8223e
d0fb46aecc3b69983e7f6244331a81dff42d9595
/edas/include/alibabacloud/edas/model/ListServiceGroupsRequest.h
fd25bd1901d2f7fcf3db366d4a6659692128b2ff
[ "Apache-2.0" ]
permissive
aliyun/aliyun-openapi-cpp-sdk
3d8d051d44ad00753a429817dd03957614c0c66a
e862bd03c844bcb7ccaa90571bceaa2802c7f135
refs/heads/master
2023-08-29T11:54:00.525102
2023-08-29T03:32:48
2023-08-29T03:32:48
115,379,460
104
82
NOASSERTION
2023-09-14T06:13:33
2017-12-26T02:53:27
C++
UTF-8
C++
false
false
1,212
h
/* * Copyright 2009-2017 Alibaba Cloud All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ALIBABACLOUD_EDAS_MODEL_LISTSERVICEGROUPSREQUEST_H_ #define ALIBABACLOUD_EDAS_MODEL_LISTSERVICEGROUPSREQUEST_H_ #include <string> #include <vector> #include <alibabacloud/core/RoaServiceRequest.h> #include <alibabacloud/edas/EdasExport.h> namespace AlibabaCloud { namespace Edas { namespace Model { class ALIBABACLOUD_EDAS_EXPORT ListServiceGroupsRequest : public RoaServiceRequest { public: ListServiceGroupsRequest(); ~ListServiceGroupsRequest(); private: }; } } } #endif // !ALIBABACLOUD_EDAS_MODEL_LISTSERVICEGROUPSREQUEST_H_
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
67a969aa49492048d27fbc99bacc714227a8619c
80d2e21257efa70c9bdb88589a9a013a82367f7c
/Fraudulent Activity Notifications.cpp
79326013a26c09b932578bbe6820dfbed7826756
[]
no_license
saiful130104/Hackerrank
bd7c299296642a10d85f52edd0db5f99f25149b7
7e4537a3df89b42586e13423e849eaed4419db0f
refs/heads/master
2020-05-18T19:33:36.109240
2019-08-22T05:45:02
2019-08-22T05:45:02
184,610,884
0
1
null
2020-04-10T20:50:39
2019-05-02T16:01:10
C++
UTF-8
C++
false
false
1,385
cpp
#include <bits/stdc++.h> using namespace std; int main() { int n,day; cin>>n>>day; int cnt[202] , ara[n+2]; memset(cnt,0,sizeof(cnt)); int sum = 0; for(int i=1; i<=day; i++) { cin>>ara[i]; cnt[ara[i]]++; } for(int i=day+1; i<=n; i++) { cin>>ara[i]; if(day%2) { int th = day/2 + 1; for(int j=0; j<=200; j++) { if(cnt[j]>=th) { if(j*2<=ara[i]) sum++; break; } th-=cnt[j]; } } else { int th = day/2; for(int j=0; j<=200; j++) { if(cnt[j]>=th) { if(cnt[j]>th) { if(j*2<=ara[i]) sum++; } else { int v = j; while(cnt[++j]==0); v+=j; if(v<=ara[i]) sum++; } break; } th-=cnt[j]; } } cnt[ara[i-day]]--; cnt[ara[i]]++; } cout<<sum<<endl; return 0; }
[ "isaifulislam123@yahoo.com" ]
isaifulislam123@yahoo.com
80d6498db105251b6c16dbffc11e9135f25ff81c
acae90de027aff37db6edd18cdae5a602e57dd2f
/chapter7_01/calc_info.cpp
013c6d612efefeb5419d711822045b19df698856
[]
no_license
koo-mingi/C-chapter7-
a0f78964dcee9d18dfe7c96a72f0e6ef9d6753d9
a44b29bbb53a8a72c31c838b5f63b912c31143a6
refs/heads/master
2022-09-27T08:45:46.673871
2020-06-05T03:39:36
2020-06-05T03:39:36
269,523,651
0
0
null
null
null
null
UTF-8
C++
false
false
698
cpp
#include "weightmanage.h" void weight::calc_info(char *irum, int gender) { // 배열에 값을 담을려면 strcpy_s를 사용. "="는 못 씀. // strcpy_s(배열,포인터); strcpy_s(customer_irum, irum); strcpy_s(customer_irum, irum); this->gender = gender; } void weight::calc_stweight(int h, int w) { customer_height = h; customer_weight = w; double stdweight = 0; //적정 몸무게 //남자(1 또는 3) (키 - 100)*0.9 //여자(2 또는 4) (키 - 110)*0.9 if (gender == 1 || gender == 3) { stdweight = (customer_height - 100) *0.9; } else if(gender == 2 || gender == 4){ stdweight = (customer_height - 110)*0.9; } customer_opt = customer_weight - stdweight; }
[ "ekzmfldks295@gmail.com" ]
ekzmfldks295@gmail.com
2d0dff031a598a3f8d4b3832c7565a959911bfc9
d29633365ed7e99dfd6413bb126a9cb5d6edd832
/SolidSphere.h
ad799515fbda5936485255e9d35e2082ad7e136d
[]
no_license
benjaminjoo/3D-Software-Rasterizer
440e8ff9148fc1427b9ca48de66a34096b1d19ad
a0acba3ec00ac4b4020f9fb3bd9fe54c58cda692
refs/heads/master
2020-07-31T15:24:20.276260
2020-04-13T23:16:30
2020-04-13T23:16:30
210,650,527
0
0
null
null
null
null
UTF-8
C++
false
false
737
h
#pragma once #include "Definitions.h" #include "SolidBody.h" class SolidSphere: public SolidBody { float radius = 0.5f; float radiusSquared = 0.25f; int resol = 12; public: SolidSphere(); SolidSphere(float, float, float, Uint32); SolidSphere(float, float, float, float, float, float, float, float, float, Uint32, int, float, int); SolidSphere(float, float, float, float, float, float, float, float, float, Uint32, int, float, int, bool); ~SolidSphere(); void setRadius(float); float getRadius(); int getTotalVert(); int getTotalPoly(); void getVertexData(vect3*); void getTriangleData(triangle3dV*); bool intersect(const vect3& eye_centre, const vect3& eye_direction, float& depth); void explode(); };
[ "benjamin.joo.sd@gmail.com" ]
benjamin.joo.sd@gmail.com
4f6e20fb67e641a3362ca6ca6cf42c329e745ffc
a8fe43a526965f4ff272eec6baaacb931ee98e80
/tests/strings.cpp
eff76a1519a43f5702ca7daa3a32811f9992f9ff
[ "MIT" ]
permissive
matusnovak/wrenbind17
39b50de9d3fa01724d9c031e70ea23cca3386f53
4ae1512bbc7b7ce89e50f7979471a1076643b798
refs/heads/master
2023-06-25T03:12:45.094594
2023-05-07T16:32:26
2023-05-07T16:32:26
188,119,425
62
7
MIT
2023-06-14T14:44:17
2019-05-22T22:00:01
C++
UTF-8
C++
false
false
987
cpp
#include <catch2/catch.hpp> #include <wrenbind17/wrenbind17.hpp> namespace wren = wrenbind17; TEST_CASE("Char strings as array") { const std::string code = R"( class Main { static main(arg) { return arg } } )"; wren::VM vm; vm.runFromSource("main", code); auto main = vm.find("main", "Main").func("main(_)"); auto res = main("Hello World!"); REQUIRE(res.is<std::string>()); REQUIRE(res.as<std::string>() == "Hello World!"); } TEST_CASE("Char strings as pointer") { const std::string code = R"( class Main { static main(arg) { return arg } } )"; wren::VM vm; vm.runFromSource("main", code); auto main = vm.find("main", "Main").func("main(_)"); const char* ptr = "Hello World!"; auto res = main(ptr); REQUIRE(res.is<std::string>()); REQUIRE(res.as<std::string>() == "Hello World!"); }
[ "email@matusnovak.com" ]
email@matusnovak.com
47ef14e6431fd96c303f2e6623a3bd47aa2d5b03
74ac82edc17b8b9a026d23f669bdbaf9ddb8c9a0
/projects/lib/LC3/LC3MachineFunctionInfo.cpp
1386241e5fe8d1fb9169ed1c614ef943b8c2cc23
[]
no_license
FeifeiWang7/ECE566
f53022680f315aba991748b7e15711afde971605
31305c20ad4fcd8fb2f528b5c12a7ef86f9072a4
refs/heads/master
2021-01-23T09:27:17.177952
2015-09-16T01:47:17
2015-09-16T01:47:17
27,697,803
0
1
null
null
null
null
UTF-8
C++
false
false
440
cpp
//===-- LC3MachineFunctionInfo.cpp - LC3 Machine Function Info --------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "LC3MachineFunctionInfo.h" using namespace llvm; void LC3MachineFunctionInfo::anchor() { }
[ "fwang12@ncsu.edu" ]
fwang12@ncsu.edu
e11e3cc9d88766e78dd7f578463636119016474b
19e3050d541b895728d1abf2488d54a9d07862c1
/Emu installer/SynthesisDrive/include/wpilibc/athena/include/VictorSP.h
d971fdb93b091ef139ddb6594d876c11c483d622
[ "Apache-2.0" ]
permissive
colins8/synthesis
fd22490ce244139fb91037472d6153dc1257f7f2
6f1a34d583c88492f988ed664b278c466de466bf
refs/heads/master
2020-03-17T00:43:03.302610
2018-05-10T03:38:21
2018-05-10T03:38:21
null
0
0
null
null
null
null
UTF-8
C++
false
false
747
h
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2008-2017 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ #pragma once #include "PWMSpeedController.h" namespace frc { /** * Vex Robotics Victor SP Speed Controller */ class VictorSP : public PWMSpeedController { public: explicit VictorSP(int channel); virtual ~VictorSP() = default; }; } // namespace frc
[ "choquerlauren@gmail.com" ]
choquerlauren@gmail.com
22dfa14883ee8f747dafc1797175a9d206f7c7eb
21022df6d610b7dcdda8ee5d67c21bda0a7706c8
/C++/insertion_sort.cpp
7fa999fbafac69735e79b5796957483cfd332cd9
[]
no_license
EdPom/practicing_algorithm
f28417b2686d052f76c9fc161837b25799980283
c06e88c22ac2f7257b5e87844bd930456e14e0bc
refs/heads/master
2021-01-22T05:43:10.592854
2012-03-03T05:32:30
2012-03-03T05:32:30
2,901,408
0
0
null
null
null
null
UTF-8
C++
false
false
955
cpp
// Name : Insertion Sort // Dependency : vector // Requirement : operator > defined for members in vvector #include <iostream> #include <vector> using namespace std; template <class T> void insertion_sort(vector<T>& array){ if(array.size() < 2){ return; } for(int i = 1; i < array.size(); i++){ for(int j = i - 1; j >= 0; j--){ if(array[j] > array[j + 1]){ swap(array[j], array[j + 1]); }else{ break; } } } } int main(int argc, char** argv){ vector<int> vec; for(int i = 100; i > 0; i--){ vec.push_back(i); } insertion_sort(vec); int j = 1; int k = 0; for(vector<int>::iterator it = vec.begin(); it < vec.end(); it++){ k++; cout << *it << " "; if(k == j){ j *= 2; k = 0; cout << endl; } } cout << endl; return 0; }
[ "shiveringpen@gmail.com" ]
shiveringpen@gmail.com
c47cf3333123b3ae84d4216395335b37cc603b99
5cace7eef01377e4b661a3fa269e7b882e89a57f
/2DGameEngine/src/rendering/textures/animations/AnimatedTexturedModel.cpp
7f666577f406f8d10180604a2e91141737afd32c
[ "Apache-2.0" ]
permissive
pbeaulieu26/2DGameEngine
c1d9c864aa5c0f38b368afe84bf8b3c743f13162
898a7d92d91cd77b51bf71245e78dcc33e344bc5
refs/heads/master
2022-04-03T19:44:05.613892
2020-02-16T18:24:10
2020-02-16T18:24:10
185,702,338
0
0
null
null
null
null
UTF-8
C++
false
false
52
cpp
#include "pch.h" #include "AnimatedTexturedModel.h"
[ "mathieu.favreau@usherbrooke.ca" ]
mathieu.favreau@usherbrooke.ca
e5c657bf9568b89e3d9fef6567b8d99098b952db
6d241b3146ecb542bc0cc469777c2175e2a341e5
/344A.cpp
f7eec66a7d471be3d28685f7a7acd1ae01e0c5ee
[]
no_license
jagadeeshnelaturu/codeforces_solutions
d0a84f4c6e3ce94b6c8ee48b5139e4b5352eb902
9e058517d86d05b4770bfa1a4b2269edf796acac
refs/heads/master
2020-05-17T16:24:01.504974
2015-09-09T17:35:15
2015-09-09T17:35:15
42,130,641
0
0
null
null
null
null
UTF-8
C++
false
false
340
cpp
#include <iostream> int main() { int n; std::cin >> n; char left, right, rightmost = '$'; // dummy value of rightmost int numGroups = 0; for(int i = 0; i < n; ++i) { std::cin >> left >> right; if((i == 0) || (left == rightmost)) { ++numGroups; rightmost = right; } } std::cout << numGroups << '\n'; }
[ "jagadeesh@nsl-43.cse.iitb.ac.in" ]
jagadeesh@nsl-43.cse.iitb.ac.in
309de37b210572748aff16b34feac15eaa889611
b835e8841d4a6edab02d5d198e8874ae88218b0c
/firmware/CFunDCMotor/CFunDCMotor.cpp
d346828f6ca237ac4130406901720a5c1a74cd3a
[]
no_license
syjsu/scratch_master_flash
d97d5660fd74e937a38a3b47677025433f34dec5
989c9add3df9598a318cc1803d2f5b3effc5408f
refs/heads/master
2020-03-17T13:39:55.182256
2016-11-09T03:14:40
2016-11-09T03:14:40
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,590
cpp
#include "CFunDCMotor.h" CFunDCMotor::CFunDCMotor(): CFunPort(0) { } CFunDCMotor::CFunDCMotor(uint8_t port): CFunPort(port) { } void CFunDCMotor::motorrun(uint8_t d,uint8_t s) { if(d == 1) { CFunPort::aWrite1(s); CFunPort::dWrite3(HIGH); } else { CFunPort::aWrite1(s); CFunPort::dWrite3(LOW); } } void CFunDCMotor::motorstop() { CFunDCMotor::motorrun(1,0); } void CFunDCMotor::carstop() { pinMode(5,OUTPUT); pinMode(6,OUTPUT); pinMode(7,OUTPUT); pinMode(8,OUTPUT); digitalWrite(7,HIGH); digitalWrite(8,HIGH); analogWrite(5,0); analogWrite(6,0); } void CFunDCMotor::forward(uint8_t speed) { pinMode(5,OUTPUT); pinMode(6,OUTPUT); pinMode(7,OUTPUT); pinMode(8,OUTPUT); digitalWrite(7,HIGH); digitalWrite(8,HIGH); analogWrite(5,speed); analogWrite(6,speed); } void CFunDCMotor::back(uint8_t speed) { pinMode(5,OUTPUT); pinMode(6,OUTPUT); pinMode(7,OUTPUT); pinMode(8,OUTPUT); digitalWrite(7,LOW); digitalWrite(8,LOW); analogWrite(5,speed); analogWrite(6,speed); } void CFunDCMotor::turnleft(uint8_t speed) { pinMode(5,OUTPUT); pinMode(6,OUTPUT); pinMode(7,OUTPUT); pinMode(8,OUTPUT); digitalWrite(7,LOW); digitalWrite(8,HIGH); analogWrite(5,speed); analogWrite(6,speed); } void CFunDCMotor::turnright(uint8_t speed) { pinMode(5,OUTPUT); pinMode(6,OUTPUT); pinMode(7,OUTPUT); pinMode(8,OUTPUT); digitalWrite(7,HIGH); digitalWrite(8,LOW); analogWrite(5,speed); analogWrite(6,speed); }
[ "xuhaiyang88@163.com" ]
xuhaiyang88@163.com
18b2982fe15e226f50e1865a427b9d508c1a0387
fc9e460e3ed8f0ec0c7ff8b390660c8f964109c6
/firstrepo/lab-03-composite-and-strategy-pattern-2mememachines/sub.cpp
03512832399be976b9aa7e23885e8ab0febcac88
[]
no_license
jterr005/firstrepo
acee6819e67281a402f7080390728c0ce217f25d
3c7193466a54e9272b74118ad1dc4d36fa622823
refs/heads/master
2021-09-08T04:29:29.010204
2018-03-07T01:30:51
2018-03-07T01:30:51
105,844,153
0
0
null
null
null
null
UTF-8
C++
false
false
230
cpp
#include "sub.h" using namespace std; Sub::Sub(Base* left, Base* right) { this->left = left; this->right = right; } double Sub::evaluate() { double LS = left->evaluate(); double RS = right->evaluate(); return (LS - RS); }
[ "jterr005@hammer.cs.ucr.edu" ]
jterr005@hammer.cs.ucr.edu