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
34c9d16fdc519a4f60e8db55d65be4458507dcde
558dfa3cc4ae01d499af84ab90322efcbdffcb97
/examples/SerialTouchscreen/SerialTouchscreen.ino
a6ceb2754a0a20489ed3a9a4c546bc6907e14afd
[ "MIT" ]
permissive
hdznrrd/FourWireResistiveTouchscreen
7918cf8c2c1e8ee282f68db77b6a6067bff745b4
84018cbcffca2cdf4aa19a6cb7c84640b51eb7a3
refs/heads/master
2016-09-05T14:19:25.464610
2013-05-12T19:04:00
2013-05-12T19:04:00
null
0
0
null
null
null
null
UTF-8
C++
false
false
816
ino
#include <FourWireResistiveTouchscreen.h> FourWireResistiveTouchscreen ts(3, 1, 0, 2); void setup() { Serial.begin(115200); } void loop() { int coordssum[3] = {0,0,0}; FourWireResistiveTouchscreen::Measurement m = {0,0,0}; // discard one ts.getPosition(m); // ensure that we have 4 successfull samples with finger-down state byte samples = 4; while(samples > 0) { ts.getPosition(m); if(m.pressure > 300) { coordssum[0] += m.x; coordssum[1] += m.y; coordssum[2] += m.pressure; } else { // finger was lifted, start over return; } --samples; } // report x,y,pressure Serial.print(coordssum[0]/4); Serial.print(","); Serial.print(coordssum[1]/4); Serial.print(","); Serial.println(coordssum[2]/4); }
[ "hadez@nrrd.de" ]
hadez@nrrd.de
e4e0f5e7ec4003a669d5645aff138f7514d5a01b
381834707691d460a2d4a9ec19cd01665a1314bf
/Evaluation/ScanResult.h
69831d801202c8e35ada72c628a751e98e8be20e
[]
no_license
NOVACProject/NovacViewer
c55ead5e6a19b3721a2a47159de53a6de24d4b53
944d64023583234dedeca85d95e12b30bba0653b
refs/heads/master
2020-04-25T05:11:59.110922
2019-02-25T15:54:37
2019-02-25T15:54:37
172,534,636
0
1
null
null
null
null
UTF-8
C++
false
false
22,499
h
#pragma once #include "../Common/Spectra/Spectrum.h" #include "../Common/WindFieldAndPlumeHeight.h" #include "EvaluationResult.h" #include "Evaluation.h" #include "FluxResult.h" namespace Evaluation { /** <b>CScanResult</b> is a class designed to handle the results from evaluating a set of spectra (e.g. a scan). It contains a set of CEvaluationResult's which describes the result of evaluating each spectrum. The CScanResult also handles information about the whole set of evaluation results such as the offset or the calculated flux of the scan, or a judgement wheather each evaluated spectrum is judged to be an ok spectrum or not. */ class CScanResult { public: CScanResult(void); ~CScanResult(void); // ---------------------------------------------------------------------- // ---------------------- PUBLIC DATA ----------------------------------- // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // --------------------- PUBLIC METHODS --------------------------------- // ---------------------------------------------------------------------- /** Appends the result to the list of calculated results */ int AppendResult(const CEvaluationResult &evalRes, const CSpectrumInfo &specInfo); /** Removes the spectrum number 'specIndex' from the list of calcualted results */ int RemoveResult(unsigned int specIndex); /** Applies the given correction to all or some evaluated references. @param corretionToApply - the correction to apply... @param parameters - The parameters for the corrections @param nParameters - the number of parameters (i.e. the length of the array 'parameters') @param specie - The name of the specie for which to apply the correction, if NULL then correction will be applied to all species. @return zero if all is ok, otherwise a non-zero value */ int ApplyCorrection(CORRECTION correctionToApply, double *parameters, long nParameters, CString *specie = NULL); /** Intializes the memory arrays to have, initially, space for 'specNum' spectra. */ void InitializeArrays(long specNum); /** Retrieves the evaluation result for spectrum number 'specIndex' from the list of calculated results. @return - NULL if specIndex is out of bounds... */ const CEvaluationResult *GetResult(unsigned int specIndex) const; /** Adds spectrum number 'specIndex' into the list of spectra in the .pak -file which are corrupted and could not be evaluated */ void MarkAsCorrupted(unsigned int specIndex); /** Retrieves how many spectra are corrupted in the scan */ int GetCorruptedNum() const; /** Stores the information about the sky-spectrum used */ void SetSkySpecInfo(const CSpectrumInfo &skySpecInfo); /** Stores the information about the dark-spectrum used */ void SetDarkSpecInfo(const CSpectrumInfo &darkSpecInfo); /** Stores the information about the offset-spectrum used */ void SetOffsetSpecInfo(const CSpectrumInfo &offsetSpecInfo); /** Stores the information about the dark-current-spectrum used */ void SetDarkCurrentSpecInfo(const CSpectrumInfo &darkCurSpecInfo); /** Check the last spectrum point for goodness of fit. The parameters 'deltaLimit', 'upperLimit' and 'lowerLimit' are for development purposes only. */ bool CheckGoodnessOfFit(const CSpectrumInfo& info, float chi2Limit = -1, float upperLimit = -1, float lowerLimit = -1); /** Check spectrum number 'index' for goodness of fit. The parameters 'deltaLimit', 'upperLimit' and 'lowerLimit' are for development purposes only. */ bool CheckGoodnessOfFit(const CSpectrumInfo& info, int index, float chi2Limit = -1, float upperLimit = -1, float lowerLimit = -1); /** Gets the offset of the scan. The offset is calculated as the average of the three lowest columns values (bad values are skipped). After this function has been called the actual offset can be retrieved by a call to 'GetOffset'. @param specie - The name of the specie for which the offset should be found. @return 0 on success. @return 1 - if any error occurs. */ int CalculateOffset(const CString &specie); /** Calculate the flux in this scan, using the supplied compass direction and coneAngle. The result is saved in the private parameter 'm_flux', whose vale can be retrieved by a call to 'GetFlux()' @param spec - the spectrometer with which the scan was collected. @return 0 if all is ok. @return 1 if any error occurs. */ int CalculateFlux(const CString &specie, const CWindFieldAndPlumeHeight &wind, double compass, double coneAngle = 90.0, double tilt = 0.0); /** Tries to find a plume in the last scan result. If the plume is found this function returns true, and the centre of the plume (in scanAngles) is given in 'plumeCentre', the width of the plume (in scanAngles) is given in 'plumeWidth' and the estimated completeness of the plume is given in 'plumeCompleteness' (ranging from 0.0 to 1.0) */ bool CalculatePlumeCentre(const CString &specie, double &plumeCentre_alpha, double &plumeCentre_phi, double &plumeCompleteness, double &plumeEdge_low, double &plumeEdge_high); /** Tries to find a plume in the last scan result. If the plume is found this function returns true. The result of the calculations is stored in the member-variables 'm_plumeCentre' and 'm_plumeCompleteness' */ bool CalculatePlumeCentre(const CString &specie); /** Tries to calculate the local wind-direction when this scan was collected. If succesful, this function returns 'true' and the result is saved in 'm_windDirection' If plumeHeight is specified, this value will be used as plume-height otherwise the plume height will be taken from the default wind-field for this volcano.*/ bool CalculateWindDirection(double plumeCentre, double plumeHeight = -1); /** Checks the kind of measurement that we have here and sets the flag 'm_measurementMode' to the appropriate value... */ MEASUREMENT_MODE CheckMeasurementMode(); MEASUREMENT_MODE GetMeasurementMode() const; /** Returns true if this is a flux measurement */ bool IsFluxMeasurement(); /** Returns true if this is a wind-speed measurement */ bool IsWindMeasurement() const; /** Returns true if this is a wind-speed measurement of Gothenburg type */ bool IsWindMeasurement_Gothenburg() const; /** Returns true if this is a wind-speed measurement of Heidelberg type */ bool IsWindMeasurement_Heidelberg() const; /** Returns true if this is a stratospheric mode measurement */ bool IsStratosphereMeasurement() const; /** Returns true if this is a direct-sun mode measurement */ bool IsDirectSunMeasurement() const; /** Returns true if this is a lunar mode measurement */ bool IsLunarMeasurement() const; /** Returns true if this is a composition mode measurement */ bool IsCompositionMeasurement() const; /** Calculates the maximum good column value in the scan, corrected for the offset. NB!! The function 'CalculateOffset' must have been called before this function is called. */ double GetMaxColumn(const CString &specie) const; /** Returns the calculated flux */ double GetFlux() const {return m_flux.m_flux; } /** Returns true if the automatic judgment considers this flux measurement to be a good measurement */ bool IsFluxOk() const {return m_flux.m_fluxOk; } /** Set the flux to the given value. ONLY USED FOR READING EVALUATION-LOGS */ void SetFlux(double flux) {this->m_flux.m_flux = flux; } /** returns the offset of the measurement */ SpecData GetOffset() const {return m_offset; } /** returns the temperature of the system at the time of the measurement */ double GetTemperature() const {return m_skySpecInfo.m_temperature; } /** Returns the calculated wind-direction */ double GetCalculatedWindDirection() const { return m_windDirection; } /** Returns the calculated plume-centre position */ double GetCalculatedPlumeCentre(int motor = 0) const {return m_plumeCentre[motor]; } /** Returns the calculated plume edges */ void GetCalculatedPlumeEdges(double &lowEdge, double &highEdge) const; /** Returns the calculated plume-completeness */ double GetCalculatedPlumeCompleteness() const {return m_plumeCompleteness; } /** Sets the offset of the measurement */ void SetOffset(double offset) {m_offset = offset; } /** returns the number of spectra evaluated */ long GetEvaluatedNum() const {return m_specNum; } /** Returns the latitude of the system */ double GetLatitude() const; /** Returns the longitude of the system */ double GetLongitude() const; /** Returns the altitude of the system */ double GetAltitude() const; /** Returns the compass-direction of the system */ double GetCompass() const; /** Returns the cone angle of the scanning instrument */ double GetConeAngle() const; /** Returns the pitch (tilt) of the scanning instrument */ double GetPitch() const; /** Returns the roll (scan-angle offset) of the scanning instrument */ double GetRoll() const; /** Returns the battery-voltage of the sky spectrum */ float GetBatteryVoltage() const; /** Returns the name of the requested spectrum */ CString GetName(int index) const; /** Returns the serial-number of the spectrometer that collected this scan */ CString GetSerial() const; /** returns the goodness of fit for the fitting of the evaluated spectrum number 'index'. This function is the complementary of IsBad(unsigned long index)*/ int IsOk(unsigned long index) const {return m_spec[index].IsOK(); } /** returns the goodness of fit for the fitting of the evaluated spectrum number 'index'. This function is the complementary of IsOK(unsigned long index). */ int IsBad(unsigned long index) const {return m_spec[index].IsBad(); } /** returns true if the evaluated spectrum number 'index' is marked as deleted */ int IsDeleted(unsigned long index) const {return m_spec[index].IsDeleted(); } /** Marks the desired spectrum with the supplied mark_flag. Mark flag must be MARK_BAD_EVALUATION, or MARK_DELETED @return SUCCESS on success. */ RETURN_CODE MarkAs(unsigned long index, int MARK_FLAG); /** Removes the desired mark from the desired spectrum Mark flag must be MARK_BAD_EVALUATION, or MARK_DELETED @return SUCCESS on success. */ RETURN_CODE RemoveMark(unsigned long index, int MARK_FLAG); /** Returns a reference to the desired spectrum info-structure */ const CSpectrumInfo &GetSpectrumInfo(unsigned long index) const; /** Returns a reference to the spectrum info-structure of the sky-spectrum used */ const CSpectrumInfo &GetSkySpectrumInfo() const; /** Returns a reference to the spectrum info-structure of the dark-spectrum used */ const CSpectrumInfo &GetDarkSpectrumInfo() const; /** returns the scan angle of evaluated spectrum number 'index'. @param index - the zero based index into the list of evaluated spectra */ float GetScanAngle(unsigned long index) const { return (IsValidSpectrumIndex(index)) ? m_specInfo[index].m_scanAngle : 0; } /** returns the azimuth angle (the angle of the second motor) of evaluated spectrum number 'index'. @param index - the zero based index into the list of evaluated spectra */ float GetScanAngle2(unsigned long index) const { return (IsValidSpectrumIndex(index)) ? m_specInfo[index].m_scanAngle2 : 0; } /** returns the time (UMT) when evaluated spectrum number 'index' was started. @param index - the zero based index into the list of evaluated spectra */ const CSpectrumTime *GetStartTime(unsigned long index) const {return (IsValidSpectrumIndex(index)) ? &m_specInfo[index].m_startTime : NULL; } /** returns the time and date (UMT) when evaluated spectrum number 'index' was started. @param index - the zero based index into the list of evaluated spectra. @return SUCCESS if the index is valid */ RETURN_CODE GetStartTime(unsigned long index, CDateTime &time) const; /** returns the time and date (UMT) when the sky-spectrum was started. */ void CScanResult::GetSkyStartTime(CDateTime &t) const; /** return the time (UMT) when evaluated spectrum number 'index' was stopped @param index - the zero based index into the list of evaluated spectra */ const CSpectrumTime *GetStopTime(unsigned long index) const {return (IsValidSpectrumIndex(index)) ? &m_specInfo[index].m_stopTime : NULL; } /** returns the time and date (UMT) when evaluated spectrum number 'index' was stopped. @param index - the zero based index into the list of evaluated spectra. @return SUCCESS if the index is valid */ RETURN_CODE GetStopTime(unsigned long index, CDateTime &time) const; /** returns the date (UMT) when the evaluated spectrum number 'index' was collected @param index - the zero-based index into the list of evaluated spectra. */ RETURN_CODE GetDate(unsigned long index, unsigned short date[3]) const; /** returns the evaluated column for specie number 'specieNum' and spectrum number 'specNum' @param specieNum - the zero based index into the list of species to evaluate for @param spectrumNum - the zero based index into the list of evaluated spectra.*/ double GetColumn(unsigned long spectrumNum, unsigned long specieNum) const; /** returns the error for the evaluated column for specie number 'specieNum' and spectrum number 'specNum' @param specieNum - the zero based index into the list of species to evaluate for @param spectrumNum - the zero based index into the list of evaluated spectra.*/ double GetColumnError(unsigned long spectrumNum, unsigned long specieNum) const; /** returns the SHIFT parameter for specie number 'specieNum' and spectrum number 'specNum' @param specieNum - the zero based index into the list of species to evaluate for @param spectrumNum - the zero based index into the list of evaluated spectra.*/ double GetShift(unsigned long spectrumNum, unsigned long specieNum) const; /** returns the error for the SHIFT parameter for specie number 'specieNum' and spectrum number 'specNum' @param specieNum - the zero based index into the list of species to evaluate for @param spectrumNum - the zero based index into the list of evaluated spectra.*/ double GetShiftError(unsigned long spectrumNum, unsigned long specieNum) const; /** returns the SQUEEZE parameter for specie number 'specieNum' and spectrum number 'specNum' @param specieNum - the zero based index into the list of species to evaluate for @param spectrumNum - the zero based index into the list of evaluated spectra.*/ double GetSqueeze(unsigned long spectrumNum, unsigned long specieNum) const; /** returns the error for the SQUEEZE parameter for specie number 'specieNum' and spectrum number 'specNum' @param specieNum - the zero based index into the list of species to evaluate for @param spectrumNum - the zero based index into the list of evaluated spectra.*/ double GetSqueezeError(unsigned long spectrumNum, unsigned long specieNum) const; /** @return the delta of the fit for spectrum number 'spectrumNum' @param spectrumNum - the spectrum number (zero-based) for which the delta value is desired */ double GetDelta(unsigned long spectrumNum) const; /** @return the chi-square of the fit for spectrum number 'spectrumNum' @param spectrumNum - the spectrum number (zero-based) for which the delta value is desired */ double GetChiSquare(unsigned long spectrumNum) const; /** returns the number of spectra averaged to get evaluated spectrum number 'spectrumNum' @return the number of spectra averaged. */ long GetSpecNum(unsigned long spectrumNum) const {return (IsValidSpectrumIndex(spectrumNum)) ? m_specInfo[spectrumNum].m_numSpec: 0; } /** returns the expsure time of evaluated spectrum number 'spectrumNum' in ms */ long GetExposureTime(unsigned long spectrumNum) const {return (IsValidSpectrumIndex(spectrumNum)) ? m_specInfo[spectrumNum].m_exposureTime: 0; } /** returns the peak intensity of evaluated spectrum number 'spectrumNum' (the maximum intensity of the whole spectrum). */ float GetPeakIntensity(unsigned long spectrumNum) const {return (IsValidSpectrumIndex(spectrumNum)) ? m_specInfo[spectrumNum].m_peakIntensity: 0; } /** returns the fit intensity of evaluated spectrum number 'spectrumNum' (the maximum intensity int the fit region of the spectrum). */ float GetFitIntensity(unsigned long spectrumNum) const {return (IsValidSpectrumIndex(spectrumNum)) ? m_specInfo[spectrumNum].m_fitIntensity: 0; } /** returns the electronic offset in spectrum number 'spectrumNum' */ float GetElectronicOffset(unsigned long spectrumNum) const {return (IsValidSpectrumIndex(spectrumNum)) ? m_specInfo[spectrumNum].m_offset: 0; } /** returns true if the spectra have been evaluated for the supplied specie. @param specie - a string containing the name of the specie to search for, e.g. "SO2" (case insensitive)*/ bool IsEvaluatedSpecie(const CString &specie) const {return (-1 != GetSpecieIndex(specie)); } /** returns the number of species that were used in the evaluation of a given spectrum */ int GetSpecieNum(unsigned long spectrumNum) const {return (IsValidSpectrumIndex(spectrumNum)) ? m_spec[spectrumNum].m_speciesNum : 0; } /** returns the specie name */ const CString GetSpecieName(unsigned long spectrumNum, unsigned long specieNum) const {return (IsValidSpectrumIndex(spectrumNum)) ? m_spec[spectrumNum].m_ref[specieNum].m_specieName : 0; } /** Sets the type of the instrument used */ void SetInstrumentType(INSTRUMENT_TYPE type); /** Returns the type of the instrument used */ INSTRUMENT_TYPE GetInstrumentType() const; /** Assignment operator */ CScanResult &operator=(const CScanResult &s2); /** Getting the estimated geometrical error */ double GetGeometricalError() const; /** Getting the scattering Error */ double GetScatteringError() const; /** Getting the spectroscopical error */ double GetSpectroscopicalError() const; /** Getting the estimated geometrical error */ void SetGeometricalError(double err); /** Getting the scattering Error */ void SetScatteringError(double err); /** Getting the spectroscopical error */ void SetSpectroscopicalError(double err); private: // ---------------------------------------------------------------------- // --------------------- PRIVATE DATA ----------------------------------- // ---------------------------------------------------------------------- /** The offset in the measurement */ SpecData m_offset; /** The calculated flux and the parameters used to calculate the flux */ CFluxResult m_flux; /** The estimated error (in percent) in the geometrical setup for this flux-calculation. */ double m_geomError; /** The estimated error (in percent) due to scattering inside or below the plume for this flux-calculation */ double m_scatteringError; /** The estimated error (in percent) of the spectral results due to incertainties in cross-sections, slit-functions, stray-light etc. */ double m_spectroscopyError; /** The calculated wind-direction. This is set to -999 if unknown */ double m_windDirection; /** The scan-angle for the calculated plume-centre. Set to -999 if unknown */ double m_plumeCentre[2]; /** The calculated edges of the plume. Set to -999 if unknown */ double m_plumeEdge[2]; /** The calculated completness of the plume. Set to -999 if unknown */ double m_plumeCompleteness; /** result of evaluating the spectra */ CArray<CEvaluationResult, CEvaluationResult&> m_spec; /** information about the collected spectra */ CArray<CSpectrumInfo, CSpectrumInfo&> m_specInfo; /** information about the sky-spectrum used */ CSpectrumInfo m_skySpecInfo; /** information about the dark-spectrum used, if any */ CSpectrumInfo m_darkSpecInfo; /** information about the offset-spectrum used, if any */ CSpectrumInfo m_offsetSpecInfo; /** information about the dark-current spectrum used, if any */ CSpectrumInfo m_darkCurSpecInfo; /** A list of which spectra were corrupted and could not be evaluated */ CArray <unsigned int, unsigned int &> m_corruptedSpectra; int m_corruptedNum; /** The number of evaluations */ unsigned long m_specNum; /** The type of the instrument used for this scan */ INSTRUMENT_TYPE m_instrumentType; /** Flag to signal if this is a wind measurement, a scan, or something else. */ MEASUREMENT_MODE m_measurementMode; // ---------------------------------------------------------------------- // -------------------- PRIVATE METHODS --------------------------------- // ---------------------------------------------------------------------- /** Returns the index, i, into 'm_evaluated[x].m_ref[i]' that corresponds to the gas 'specie' @param specie - the gas to search for e.g. SO2 (case insensitive). @return the zero-based index of the specie. @return -1 if specie not found.*/ int GetSpecieIndex(const CString &specie) const; /** makes a sanity check of the parameters and returns fit parameter number 'index'. @param specIndex - the zero based into the list of evaluated spectra. @param specieIndex - the zero based into the list of species to evaluate for. @param fitParameter - a parameter to return. @return NaN if any parameter is wrong */ double GetFitParameter(unsigned long spectrumNum, unsigned long specieIndex, FIT_PARAMETER parameter) const; /** returns true if the given index is a valid spectrum index */ inline bool IsValidSpectrumIndex(unsigned long spectrumNum) const { return (spectrumNum >= 0 && spectrumNum < m_specNum) ? true : false; } }; }
[ "mattias42@gmail.com" ]
mattias42@gmail.com
195c7d3a51e313163df7564fe9eb62a0aa92d83a
3051050dc3dee97dc60ef78d31ff500b6e93d0fb
/chrome/browser/ash/app_list/search/federated_metrics_manager_unittest.cc
568e6cddce48d222cd808c17775a51d63b9e6f57
[ "BSD-3-Clause" ]
permissive
weblifeio/chromium
cd249e1c9418dcf0792bd68bbdcd2a6e56af0e2e
74ac962b3a95c88614f734066ab2cc48b572359c
refs/heads/main
2023-06-09T19:45:03.535378
2023-05-26T19:16:31
2023-05-26T19:16:31
177,631,387
0
0
null
2019-03-25T17:15:48
2019-03-25T17:15:47
null
UTF-8
C++
false
false
12,747
cc
// Copyright 2023 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ash/app_list/search/federated_metrics_manager.h" #include <memory> #include "ash/constants/ash_features.h" #include "ash/public/cpp/app_list/app_list_metrics.h" #include "ash/system/federated/federated_service_controller.h" #include "base/run_loop.h" #include "base/strings/strcat.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/threading/thread.h" #include "chrome/browser/ash/app_list/app_list_notifier_impl.h" #include "chrome/browser/ash/app_list/search/search_features.h" #include "chrome/browser/ash/app_list/search/test/search_metrics_test_util.h" #include "chrome/browser/ash/app_list/test/test_app_list_controller.h" #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" #include "chromeos/ash/components/dbus/federated/federated_client.h" #include "chromeos/ash/services/federated/public/cpp/fake_service_connection.h" #include "mojo/core/embedder/embedder.h" #include "mojo/core/embedder/scoped_ipc_support.h" #include "testing/gtest/include/gtest/gtest.h" namespace app_list::test { namespace { using ash::FederatedClient; using ash::federated::FakeServiceConnectionImpl; using ash::federated::ScopedFakeServiceConnectionForTest; using ash::federated::ServiceConnection; using federated::FederatedMetricsManager; using testing::HasSubstr; class TestFederatedServiceController : public ash::federated::FederatedServiceController { public: TestFederatedServiceController() = default; TestFederatedServiceController(const TestFederatedServiceController&) = delete; TestFederatedServiceController& operator=( const TestFederatedServiceController&) = delete; // ash::federated::FederatedServiceController: bool IsServiceAvailable() const override { return true; } }; // Parameterized by feature kLauncherQueryFederatedAnalyticsPHH. class FederatedMetricsManagerTest : public testing::Test, public ::testing::WithParamInterface<bool> { public: FederatedMetricsManagerTest() : scoped_fake_for_test_(&fake_service_connection_), app_list_notifier_(&app_list_controller_) { std::vector<base::test::FeatureRef> enabled_features = { ash::features::kFederatedService}; std::vector<base::test::FeatureRef> disabled_features; if (GetParam()) { enabled_features.push_back( search_features::kLauncherQueryFederatedAnalyticsPHH); } else { disabled_features.push_back( search_features::kLauncherQueryFederatedAnalyticsPHH); } scoped_feature_list_.InitWithFeatures(enabled_features, disabled_features); } FederatedMetricsManagerTest(const FederatedMetricsManagerTest&) = delete; FederatedMetricsManagerTest& operator=(const FederatedMetricsManagerTest&) = delete; // testing::Test: void SetUp() override { // Set up federated service connection. FederatedClient::InitializeFake(); histogram_tester_ = std::make_unique<base::HistogramTester>(); } void TearDown() override { FederatedClient::Shutdown(); } base::HistogramTester* histogram_tester() { return histogram_tester_.get(); } void SetChromeMetricsEnabled(bool value) { chrome_metrics_enabled_ = value; ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting( &chrome_metrics_enabled_); } void InitFederatedMetricsManager() { metrics_manager_ = std::make_unique<FederatedMetricsManager>( &app_list_notifier_, &federated_service_controller_); } void ExpectNoFederatedLogs() { const std::string histograms = histogram_tester()->GetAllHistogramsRecorded(); EXPECT_THAT( histograms, Not(AnyOf( HasSubstr(app_list::federated::kHistogramInitStatus), HasSubstr(app_list::federated::kHistogramSearchSessionConclusion), HasSubstr(app_list::federated::kHistogramReportStatus)))); // TODO(b/262611120): Check emptiness of federated service storage, once // this functionality is available. } protected: std::unique_ptr<base::HistogramTester> histogram_tester_; std::unique_ptr<FederatedMetricsManager> metrics_manager_; private: base::test::TaskEnvironment task_environment_; base::test::ScopedFeatureList scoped_feature_list_; FakeServiceConnectionImpl fake_service_connection_; ScopedFakeServiceConnectionForTest scoped_fake_for_test_; ::test::TestAppListController app_list_controller_; AppListNotifierImpl app_list_notifier_; TestFederatedServiceController federated_service_controller_; bool chrome_metrics_enabled_; }; INSTANTIATE_TEST_SUITE_P(LauncherQueryFA, FederatedMetricsManagerTest, testing::Bool()); TEST_P(FederatedMetricsManagerTest, ChromeMetricsConsentDisabled) { SetChromeMetricsEnabled(false); InitFederatedMetricsManager(); // Simulate various user search activities. metrics_manager_->OnSearchSessionStarted(); metrics_manager_->OnSearchSessionEnded(u"fake_query"); metrics_manager_->OnSearchSessionStarted(); std::vector<Result> shown_results; Result launched_result = CreateFakeResult(Type::EXTENSION_APP, "fake_id"); std::u16string query = u"fake_query"; metrics_manager_->OnSeen(Location::kAnswerCard, shown_results, query); metrics_manager_->OnLaunch(Location::kList, launched_result, shown_results, query); metrics_manager_->OnSearchSessionEnded(u"fake_query"); ExpectNoFederatedLogs(); ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting(nullptr); } TEST_P(FederatedMetricsManagerTest, Quit) { SetChromeMetricsEnabled(true); InitFederatedMetricsManager(); metrics_manager_->OnSearchSessionStarted(); // Search session ends without user taking other action (e.g. without // launching a result). metrics_manager_->OnSearchSessionEnded(u"fake_query"); base::RunLoop().RunUntilIdle(); const bool launcher_fa_enabled = GetParam(); if (launcher_fa_enabled) { histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramInitStatus, app_list::federated::FederatedMetricsManager::InitStatus::kOk, 1); histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramSearchSessionConclusion, ash::SearchSessionConclusion::kQuit, 1); histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramReportStatus, app_list::federated::FederatedMetricsManager::ReportStatus::kOk, 1); // TODO(b/262611120): Check contents of logged example, once this // functionality is available. } else { ExpectNoFederatedLogs(); } ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting(nullptr); } TEST_P(FederatedMetricsManagerTest, Launch) { SetChromeMetricsEnabled(true); InitFederatedMetricsManager(); metrics_manager_->OnSearchSessionStarted(); std::vector<Result> shown_results; Result launched_result = CreateFakeResult(Type::EXTENSION_APP, "fake_id"); std::u16string query = u"fake_query"; metrics_manager_->OnLaunch(Location::kList, launched_result, shown_results, query); metrics_manager_->OnSearchSessionEnded(query); base::RunLoop().RunUntilIdle(); const bool launcher_fa_enabled = GetParam(); if (launcher_fa_enabled) { histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramInitStatus, app_list::federated::FederatedMetricsManager::InitStatus::kOk, 1); histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramSearchSessionConclusion, ash::SearchSessionConclusion::kLaunch, 1); histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramReportStatus, app_list::federated::FederatedMetricsManager::ReportStatus::kOk, 1); // TODO(b/262611120): Check contents of logged example, once this // functionality is available. } else { ExpectNoFederatedLogs(); } ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting(nullptr); } TEST_P(FederatedMetricsManagerTest, AnswerCardSeen) { SetChromeMetricsEnabled(true); InitFederatedMetricsManager(); metrics_manager_->OnSearchSessionStarted(); std::vector<Result> shown_results; std::u16string query = u"fake_query"; metrics_manager_->OnSeen(Location::kAnswerCard, shown_results, query); metrics_manager_->OnSearchSessionEnded(query); base::RunLoop().RunUntilIdle(); const bool launcher_fa_enabled = GetParam(); if (launcher_fa_enabled) { histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramInitStatus, app_list::federated::FederatedMetricsManager::InitStatus::kOk, 1); histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramSearchSessionConclusion, ash::SearchSessionConclusion::kAnswerCardSeen, 1); histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramReportStatus, app_list::federated::FederatedMetricsManager::ReportStatus::kOk, 1); // TODO(b/262611120): Check contents of logged example, once this // functionality is available. } else { ExpectNoFederatedLogs(); } ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting(nullptr); } TEST_P(FederatedMetricsManagerTest, AnswerCardSeenThenListResultLaunched) { SetChromeMetricsEnabled(true); InitFederatedMetricsManager(); // Tests that a Launch event takes precedence over an AnswerCardSeen event, // within the same search session. metrics_manager_->OnSearchSessionStarted(); std::vector<Result> shown_results; std::u16string query = u"fake_query"; metrics_manager_->OnSeen(Location::kAnswerCard, shown_results, query); Result launched_result = CreateFakeResult(Type::EXTENSION_APP, "fake_id"); metrics_manager_->OnLaunch(Location::kList, launched_result, shown_results, query); metrics_manager_->OnSearchSessionEnded(query); base::RunLoop().RunUntilIdle(); const bool launcher_fa_enabled = GetParam(); if (launcher_fa_enabled) { histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramInitStatus, app_list::federated::FederatedMetricsManager::InitStatus::kOk, 1); histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramSearchSessionConclusion, ash::SearchSessionConclusion::kLaunch, 1); histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramReportStatus, app_list::federated::FederatedMetricsManager::ReportStatus::kOk, 1); // TODO(b/262611120): Check contents of logged example, once this // functionality is available. } else { ExpectNoFederatedLogs(); } ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting(nullptr); } TEST_P(FederatedMetricsManagerTest, ZeroState) { SetChromeMetricsEnabled(true); InitFederatedMetricsManager(); // Note: metrics_manager_->OnSearchSession{Started,Ended}() are not expected // to be called during zero state search. // Simulate a series of user actions in zero state search. An empty query // indicates zero state search. std::vector<Result> shown_results; std::u16string empty_query = u""; metrics_manager_->OnSeen(Location::kContinue, shown_results, empty_query); metrics_manager_->OnSeen(Location::kRecentApps, shown_results, empty_query); Result launched_result = CreateFakeResult(Type::EXTENSION_APP, "fake_id"); metrics_manager_->OnLaunch(Location::kRecentApps, launched_result, shown_results, empty_query); base::RunLoop().RunUntilIdle(); const bool launcher_fa_enabled = GetParam(); if (launcher_fa_enabled) { histogram_tester()->ExpectUniqueSample( app_list::federated::kHistogramInitStatus, app_list::federated::FederatedMetricsManager::InitStatus::kOk, 1); // Zero state search should not trigger any logging on user action. histogram_tester()->ExpectTotalCount( app_list::federated::kHistogramSearchSessionConclusion, 0); histogram_tester()->ExpectTotalCount( app_list::federated::kHistogramReportStatus, 0); // Do not expect that any examples were logged to the federated service. // TODO(b/262611120): Check contents of federated service storage, once this // functionality is available. } else { ExpectNoFederatedLogs(); } ChromeMetricsServiceAccessor::SetMetricsAndCrashReportingForTesting(nullptr); } } // namespace } // namespace app_list::test
[ "chromium-scoped@luci-project-accounts.iam.gserviceaccount.com" ]
chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
f4045211f3d2baf451dfbe415469e2769bebf3ae
dbcb13588e1846378babab1abc1bf534c1dc3a68
/Project_Alarm-Clock/src/Functions_Called_From_Main/loop_functions.cpp
88062b3e198e4ca7b72a8cb9bf1c7bcea32a1280
[]
no_license
NitschkeM/dat112_Cpp_Arduino-projects
0dae1e2e122991dad0bca42db337330078773e6a
13d600b0b2a37f2803ca2da5cd8933c6cc5959dc
refs/heads/master
2020-03-25T06:29:44.686770
2018-08-04T06:59:24
2018-08-04T06:59:24
143,505,544
0
0
null
null
null
null
UTF-8
C++
false
false
1,645
cpp
// loop_functions.cpp -- implements functions used by loop() in main.cpp. // #include <Arduino.h> #include "loop_functions.hpp" #include "Utility_Functions_And_Constants/utility_funcs.hpp" #include "Utility_Functions_And_Constants/edit_time_function.hpp" void enterSetAlarmMode(LcdClass &lcd, TimeClass &alarm_time){ letUserEditTimeObject(lcd, alarm_time); updateEeprom(alarm_time.getRawTime()); informUserAlarmHasBeenSet(lcd); } void enterSetTimeMode(LcdClass &lcd, TimeClass &current_time){ letUserEditTimeObject(lcd, current_time); informUserTimeHasBeenSet(lcd); } // Set value of alarm_time object and EEPROM to (-1). void disableAlarm(LcdClass &lcd, TimeClass &alarm_time){ long value_of_inactive_alarm = -1L; // TODO: Consider creating a constant representing a non-active alarm (-1). // Update EEPROM and alarm_time object. updateEeprom(value_of_inactive_alarm); alarm_time.setRawTime(value_of_inactive_alarm); informUserAlarmIsDisabled(lcd); } // Sound alarm, then wait for user action: Snooze, silence, or disable alarm. void enterSoundTheAlarmMode(LcdClass &lcd, TimeClass &alarm_time, int &snooze_countdown){ startAlarmSound(); lcd.writeTimeToScreen("Alarm !!! "); while(1){ if (snoozeAlarmBtnWasClicked()){ startSnoozeCountdown(snooze_countdown); informUserSnoozeWasSet(lcd); break; } else if (silenceAlarmBtnWasClicked()){ informUserAlarmWasSilenced(lcd); break; } else if (disableAlarmBtnWasClicked()){ disableAlarm(lcd, alarm_time); break; } } // All actions stops the alarm sound. stopAlarmSound(); }
[ "mariun11@uia.no" ]
mariun11@uia.no
8fb8b222cf3ace37bac8eb5000b9a5bee2f0859f
bab3717d3e6b231ed7d14f210d0ee40e3514ded4
/build-Sort001-Desktop_Qt_5_5_1_clang_64bit-Debug/ui_sortdialog.h
702aab3cc4bff4feff7fca4f0a0d1ee7b42a0005
[]
no_license
QiuZidane/MacProjects_QT
dc333c45878e528728a6b8b1651bd557c947cb12
a20bc37bbe138a29c5768b10917817a8ca471389
refs/heads/master
2021-01-10T16:08:28.958481
2016-01-12T14:37:57
2016-01-12T14:37:57
49,431,214
0
0
null
null
null
null
UTF-8
C++
false
false
10,644
h
/******************************************************************************** ** Form generated from reading UI file 'sortdialog.ui' ** ** Created by: Qt User Interface Compiler version 5.5.1 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ #ifndef UI_SORTDIALOG_H #define UI_SORTDIALOG_H #include <QtCore/QVariant> #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QButtonGroup> #include <QtWidgets/QComboBox> #include <QtWidgets/QDialog> #include <QtWidgets/QFormLayout> #include <QtWidgets/QGroupBox> #include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QPushButton> #include <QtWidgets/QSpacerItem> #include <QtWidgets/QVBoxLayout> QT_BEGIN_NAMESPACE class Ui_SortDialog { public: QFormLayout *formLayout_4; QVBoxLayout *verticalLayout; QPushButton *pushButton; QPushButton *pushButton_2; QPushButton *pushButton_3; QSpacerItem *verticalSpacer; QSpacerItem *verticalSpacer_2; QGroupBox *secondaryGroupBox; QFormLayout *formLayout_2; QComboBox *comboBox_3; QLabel *label_4; QComboBox *comboBox_4; QLabel *label_3; QGroupBox *tertiaryGroupBox; QFormLayout *formLayout_3; QLabel *label_5; QComboBox *comboBox_5; QLabel *label_6; QComboBox *comboBox_6; QGroupBox *primaryGroupBox; QFormLayout *formLayout; QLabel *label; QComboBox *comboBox; QLabel *label_2; QComboBox *comboBox_2; QPushButton *pushButton_4; void setupUi(QDialog *SortDialog) { if (SortDialog->objectName().isEmpty()) SortDialog->setObjectName(QStringLiteral("SortDialog")); SortDialog->resize(459, 400); formLayout_4 = new QFormLayout(SortDialog); formLayout_4->setSpacing(6); formLayout_4->setContentsMargins(11, 11, 11, 11); formLayout_4->setObjectName(QStringLiteral("formLayout_4")); verticalLayout = new QVBoxLayout(); verticalLayout->setSpacing(6); verticalLayout->setObjectName(QStringLiteral("verticalLayout")); pushButton = new QPushButton(SortDialog); pushButton->setObjectName(QStringLiteral("pushButton")); verticalLayout->addWidget(pushButton); pushButton_2 = new QPushButton(SortDialog); pushButton_2->setObjectName(QStringLiteral("pushButton_2")); verticalLayout->addWidget(pushButton_2); pushButton_3 = new QPushButton(SortDialog); pushButton_3->setObjectName(QStringLiteral("pushButton_3")); verticalLayout->addWidget(pushButton_3); verticalSpacer = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); verticalLayout->addItem(verticalSpacer); formLayout_4->setLayout(0, QFormLayout::FieldRole, verticalLayout); verticalSpacer_2 = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); formLayout_4->setItem(1, QFormLayout::LabelRole, verticalSpacer_2); secondaryGroupBox = new QGroupBox(SortDialog); secondaryGroupBox->setObjectName(QStringLiteral("secondaryGroupBox")); formLayout_2 = new QFormLayout(secondaryGroupBox); formLayout_2->setSpacing(6); formLayout_2->setContentsMargins(11, 11, 11, 11); formLayout_2->setObjectName(QStringLiteral("formLayout_2")); comboBox_3 = new QComboBox(secondaryGroupBox); comboBox_3->setObjectName(QStringLiteral("comboBox_3")); formLayout_2->setWidget(0, QFormLayout::FieldRole, comboBox_3); label_4 = new QLabel(secondaryGroupBox); label_4->setObjectName(QStringLiteral("label_4")); formLayout_2->setWidget(2, QFormLayout::LabelRole, label_4); comboBox_4 = new QComboBox(secondaryGroupBox); comboBox_4->setObjectName(QStringLiteral("comboBox_4")); formLayout_2->setWidget(2, QFormLayout::FieldRole, comboBox_4); label_3 = new QLabel(secondaryGroupBox); label_3->setObjectName(QStringLiteral("label_3")); formLayout_2->setWidget(0, QFormLayout::LabelRole, label_3); formLayout_4->setWidget(2, QFormLayout::LabelRole, secondaryGroupBox); tertiaryGroupBox = new QGroupBox(SortDialog); tertiaryGroupBox->setObjectName(QStringLiteral("tertiaryGroupBox")); formLayout_3 = new QFormLayout(tertiaryGroupBox); formLayout_3->setSpacing(6); formLayout_3->setContentsMargins(11, 11, 11, 11); formLayout_3->setObjectName(QStringLiteral("formLayout_3")); label_5 = new QLabel(tertiaryGroupBox); label_5->setObjectName(QStringLiteral("label_5")); formLayout_3->setWidget(0, QFormLayout::LabelRole, label_5); comboBox_5 = new QComboBox(tertiaryGroupBox); comboBox_5->setObjectName(QStringLiteral("comboBox_5")); formLayout_3->setWidget(0, QFormLayout::FieldRole, comboBox_5); label_6 = new QLabel(tertiaryGroupBox); label_6->setObjectName(QStringLiteral("label_6")); formLayout_3->setWidget(1, QFormLayout::LabelRole, label_6); comboBox_6 = new QComboBox(tertiaryGroupBox); comboBox_6->setObjectName(QStringLiteral("comboBox_6")); formLayout_3->setWidget(1, QFormLayout::FieldRole, comboBox_6); formLayout_4->setWidget(3, QFormLayout::LabelRole, tertiaryGroupBox); primaryGroupBox = new QGroupBox(SortDialog); primaryGroupBox->setObjectName(QStringLiteral("primaryGroupBox")); formLayout = new QFormLayout(primaryGroupBox); formLayout->setSpacing(6); formLayout->setContentsMargins(11, 11, 11, 11); formLayout->setObjectName(QStringLiteral("formLayout")); label = new QLabel(primaryGroupBox); label->setObjectName(QStringLiteral("label")); formLayout->setWidget(0, QFormLayout::LabelRole, label); comboBox = new QComboBox(primaryGroupBox); comboBox->setObjectName(QStringLiteral("comboBox")); formLayout->setWidget(0, QFormLayout::FieldRole, comboBox); label_2 = new QLabel(primaryGroupBox); label_2->setObjectName(QStringLiteral("label_2")); formLayout->setWidget(1, QFormLayout::LabelRole, label_2); comboBox_2 = new QComboBox(primaryGroupBox); comboBox_2->setObjectName(QStringLiteral("comboBox_2")); formLayout->setWidget(1, QFormLayout::FieldRole, comboBox_2); formLayout_4->setWidget(0, QFormLayout::LabelRole, primaryGroupBox); pushButton_4 = new QPushButton(SortDialog); pushButton_4->setObjectName(QStringLiteral("pushButton_4")); formLayout_4->setWidget(2, QFormLayout::FieldRole, pushButton_4); QWidget::setTabOrder(pushButton_2, pushButton_3); QWidget::setTabOrder(pushButton_3, pushButton); QWidget::setTabOrder(pushButton, comboBox); QWidget::setTabOrder(comboBox, comboBox_2); QWidget::setTabOrder(comboBox_2, comboBox_3); QWidget::setTabOrder(comboBox_3, comboBox_4); QWidget::setTabOrder(comboBox_4, comboBox_5); QWidget::setTabOrder(comboBox_5, comboBox_6); retranslateUi(SortDialog); QObject::connect(pushButton, SIGNAL(clicked()), SortDialog, SLOT(accept())); QObject::connect(pushButton_2, SIGNAL(clicked()), SortDialog, SLOT(reject())); QObject::connect(pushButton_3, SIGNAL(toggled(bool)), secondaryGroupBox, SLOT(setVisible(bool))); QObject::connect(pushButton_3, SIGNAL(toggled(bool)), tertiaryGroupBox, SLOT(setVisible(bool))); QObject::connect(pushButton_4, SIGNAL(clicked()), SortDialog, SLOT(show())); QMetaObject::connectSlotsByName(SortDialog); } // setupUi void retranslateUi(QDialog *SortDialog) { SortDialog->setWindowTitle(QApplication::translate("SortDialog", "SortDialog", 0)); pushButton->setText(QApplication::translate("SortDialog", "Ok", 0)); pushButton_2->setText(QApplication::translate("SortDialog", "Cancel", 0)); pushButton_3->setText(QApplication::translate("SortDialog", "&More", 0)); secondaryGroupBox->setTitle(QApplication::translate("SortDialog", "&Primary Key", 0)); comboBox_3->clear(); comboBox_3->insertItems(0, QStringList() << QApplication::translate("SortDialog", "None", 0) << QApplication::translate("SortDialog", "haah", 0) << QApplication::translate("SortDialog", "hehe", 0) ); label_4->setText(QApplication::translate("SortDialog", "TextLabel", 0)); comboBox_4->clear(); comboBox_4->insertItems(0, QStringList() << QApplication::translate("SortDialog", "UPUPUPUP", 0) << QApplication::translate("SortDialog", "DOWNDDDDDDD", 0) ); label_3->setText(QApplication::translate("SortDialog", "TextLabel", 0)); tertiaryGroupBox->setTitle(QApplication::translate("SortDialog", "&Primary Key", 0)); label_5->setText(QApplication::translate("SortDialog", "TextLabel", 0)); comboBox_5->clear(); comboBox_5->insertItems(0, QStringList() << QApplication::translate("SortDialog", "None", 0) << QApplication::translate("SortDialog", "haah", 0) << QApplication::translate("SortDialog", "hehe", 0) ); label_6->setText(QApplication::translate("SortDialog", "TextLabel", 0)); comboBox_6->clear(); comboBox_6->insertItems(0, QStringList() << QApplication::translate("SortDialog", "UPUPUPUP", 0) << QApplication::translate("SortDialog", "DOWNDDDDDDD", 0) ); primaryGroupBox->setTitle(QApplication::translate("SortDialog", "&Primary Key", 0)); label->setText(QApplication::translate("SortDialog", "TextLabel", 0)); comboBox->clear(); comboBox->insertItems(0, QStringList() << QApplication::translate("SortDialog", "None", 0) << QApplication::translate("SortDialog", "haah", 0) << QApplication::translate("SortDialog", "hehe", 0) ); label_2->setText(QApplication::translate("SortDialog", "TextLabel", 0)); comboBox_2->clear(); comboBox_2->insertItems(0, QStringList() << QApplication::translate("SortDialog", "UPUPUPUP", 0) << QApplication::translate("SortDialog", "DOWNDDDDDDD", 0) ); pushButton_4->setText(QApplication::translate("SortDialog", "PushButton", 0)); } // retranslateUi }; namespace Ui { class SortDialog: public Ui_SortDialog {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_SORTDIALOG_H
[ "qiusd@sdc.icbc.com.cn" ]
qiusd@sdc.icbc.com.cn
9c42a5654f5358810b15a66e79977607fb6a34f8
486b15bc1abf2cda3fcb733b6d31a6b9364020eb
/hardware/mc_driver/include/avidbots_mc_driver/roboteq_drive_system_motor.h
4636e59ac352a696cda2c88124ed1db09fb195d6
[]
no_license
xnvst/robotics
376f6a6f6a95cca8ce7606f4e74b4abb94687334
8e12abe1e2d6d618118aadc8d8858df78cd74f08
refs/heads/master
2021-01-16T00:09:33.455018
2019-04-14T19:40:24
2019-04-14T19:40:24
99,957,587
0
0
null
null
null
null
UTF-8
C++
false
false
1,337
h
/* * ______ __ __ __ * /\ _ \ __ /\ \/\ \ /\ \__ * \ \ \L\ \ __ __ /\_\ \_\ \ \ \____ ___\ \ ,_\ ____ * \ \ __ \/\ \/\ \\/\ \ /'_` \ \ '__`\ / __`\ \ \/ /',__\ * \ \ \/\ \ \ \_/ |\ \ \/\ \L\ \ \ \L\ \/\ \L\ \ \ \_/\__, `\ * \ \_\ \_\ \___/ \ \_\ \___,_\ \_,__/\ \____/\ \__\/\____/ * \/_/\/_/\/__/ \/_/\/__,_ /\/___/ \/___/ \/__/\/___/ * Copyright 2014, Avidbots Corp. * @name roboteq_drive_system_motor.h * @brief Motor controller class for RoboteQ drive system motor drivers * @author Joseph Duchesne */ #ifndef AVIDBOTS_MC_DRIVER_ROBOTEQ_DRIVE_SYSTEM_MOTOR_H #define AVIDBOTS_MC_DRIVER_ROBOTEQ_DRIVE_SYSTEM_MOTOR_H // Standard #include <string> #include <stdint.h> // Boost #include <boost/lockfree/spsc_queue.hpp> // ROS #include <ros/ros.h> // Local #include "avidbots_library/socket_can/socket_can_open.h" #include "avidbots_mc_driver/motor_driver.h" class RoboteqDriveSystemMotor : public MotorDriver { private: public: virtual int Init(SocketCANOpenProtocol& can_socket, bool read_voltage); virtual int SetRPM(); virtual int RefreshReadings(int sequence); virtual void SetManualOverride(bool manual_override); virtual int SetShutdown(bool on); }; #endif // AVIDBOTS_MC_DRIVER_ROBOTEQ_DRIVE_SYSTEM_MOTOR_H
[ "ynttmp@gmail.com" ]
ynttmp@gmail.com
d7508b4cef0941d00cc40848fadb2ba437586f8d
f33bbddc37b0ccc731681bf2aca6ea731f309a16
/filesystem/VideoDatabaseDirectory/DirectoryNodeRecentlyAddedEpisodes.h
5061c2918bd08ff8b72bd5b7037a041af87cc82a
[]
no_license
zseymour/xbmc-database-4.0
23068629de932be00346a7d9505b113222fb8531
05e5f229fdd1bbbb6b192a94d9e57c0630e40bae
refs/heads/master
2020-05-29T23:57:58.170026
2013-09-23T00:02:42
2013-09-23T00:02:42
10,737,119
1
0
null
null
null
null
UTF-8
C++
false
false
1,043
h
#pragma once /* * Copyright (C) 2005-2013 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "DirectoryNode.h" namespace XFILE { namespace VIDEODATABASEDIRECTORY { class CDirectoryNodeRecentlyAddedEpisodes : public CDirectoryNode { public: CDirectoryNodeRecentlyAddedEpisodes(const CStdString& strEntryName, CDirectoryNode* pParent); }; } }
[ "adamsey16@gmail.com" ]
adamsey16@gmail.com
3fbbddb319eca74c9ec6c24d701499eaf9bfe470
b50b3e68c4e25660590add970e208ed82be2ceab
/SWIG/NavalLetter_wrap.cxx
74b8991554376c045c68537d1340a449c8cc79db
[]
no_license
wilselby/NavalLetterFormat
66d1bd7053f814f295bf948d6f810acca561c313
15e3a9e119b8bed4f1173d5c49fca17ebdce89ca
refs/heads/master
2020-05-30T06:29:48.149739
2014-12-25T06:31:29
2014-12-25T06:31:29
23,989,610
0
2
null
null
null
null
UTF-8
C++
false
false
436,741
cxx
/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.2 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. * ----------------------------------------------------------------------------- */ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE #ifdef __cplusplus /* SwigValueWrapper is described in swig.swg */ template<typename T> class SwigValueWrapper { struct SwigMovePointer { T *ptr; SwigMovePointer(T *p) : ptr(p) { } ~SwigMovePointer() { delete ptr; } SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } } pointer; SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); SwigValueWrapper(const SwigValueWrapper<T>& rhs); public: SwigValueWrapper() : pointer(0) { } SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } operator T&() const { return *pointer.ptr; } T *operator&() { return pointer.ptr; } }; template <typename T> T SwigValueInit() { return T(); } #endif /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ----------------------------------------------------------------------------- */ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # elif defined(__HP_aCC) /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) # define SWIGINLINE inline # else # define SWIGINLINE # endif #endif /* attribute recognised by some compilers to avoid 'unused' warnings */ #ifndef SWIGUNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif # elif defined(__ICC) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif #endif #ifndef SWIG_MSC_UNSUPPRESS_4505 # if defined(_MSC_VER) # pragma warning(disable : 4505) /* unreferenced local function has been removed */ # endif #endif #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) # else # define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif #endif /* internal SWIG method */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED #endif /* internal inline SWIG method */ #ifndef SWIGINTERNINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE #endif /* exporting methods */ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) # ifndef GCC_HASCLASSVISIBILITY # define GCC_HASCLASSVISIBILITY # endif #endif #ifndef SWIGEXPORT # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # if defined(STATIC_LINKED) # define SWIGEXPORT # else # define SWIGEXPORT __declspec(dllexport) # endif # else # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) # define SWIGEXPORT __attribute__ ((visibility("default"))) # else # define SWIGEXPORT # endif # endif #endif /* calling conventions for Windows */ #ifndef SWIGSTDCALL # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL # endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) # define _CRT_SECURE_NO_DEPRECATE #endif /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) # define _SCL_SECURE_NO_DEPRECATE #endif #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) /* Use debug wrappers with the Python release dll */ # undef _DEBUG # include <Python.h> # define _DEBUG #else # include <Python.h> #endif /* ----------------------------------------------------------------------------- * swigrun.swg * * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ #define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE # define SWIG_QUOTE_STRING(x) #x # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) #else # define SWIG_TYPE_TABLE_NAME #endif /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for creating a static or dynamic library from the SWIG runtime code. In 99.9% of the cases, SWIG just needs to declare them as 'static'. But only do this if strictly necessary, ie, if you have problems with your compiler or suchlike. */ #ifndef SWIGRUNTIME # define SWIGRUNTIME SWIGINTERN #endif #ifndef SWIGRUNTIMEINLINE # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE #endif /* Generic buffer size */ #ifndef SWIG_BUFFER_SIZE # define SWIG_BUFFER_SIZE 1024 #endif /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 /* Flags/methods for returning states. The SWIG conversion methods, as ConvertPtr, return an integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code } else { //fail code } Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { // success code } else { // fail code } which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); if (SWIG_IsOK(res)) { // success code if (SWIG_IsNewObj(res) { ... delete *ptr; } else { ... } } else { // fail code } I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if (<obj is ok>) { if (<need new object>) { *ptr = <ptr to new allocated object>; return SWIG_NEWOBJ; } else { *ptr = <ptr to old object>; return SWIG_OLDOBJ; } } else { return SWIG_BADOBJ; } } Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this int food(double) int fooi(int); and you call food(1) // cast rank '1' (1 -> 1.0) fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) /* The CastRankLimit says how many bits are used for the cast rank */ #define SWIG_CASTRANKLIMIT (1 << 8) /* The NewMask denotes the object was created (using new/malloc) */ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) /* The TmpMask is for in/out typemaps that use temporal objects */ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) /* Simple returning values */ #define SWIG_BADOBJ (SWIG_ERROR) #define SWIG_OLDOBJ (SWIG_OK) #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) /* Check, add and del mask methods */ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank # define SWIG_TypeRank unsigned long # endif # ifndef SWIG_MAXCASTRANK /* Default cast allowed */ # define SWIG_MAXCASTRANK (2) # endif # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) SWIGINTERNINLINE int SWIG_AddCast(int r) { return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; } SWIGINTERNINLINE int SWIG_CheckState(int r) { return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; } #else /* no cast-rank mode */ # define SWIG_AddCast(r) (r) # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) #endif #include <string.h> #ifdef __cplusplus extern "C" { #endif typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); /* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ struct swig_cast_info *cast; /* linked list of types that can cast into this type */ void *clientdata; /* language specific type data */ int owndata; /* flag if the structure owns the clientdata */ } swig_type_info; /* Structure to store a type and conversion function used for casting */ typedef struct swig_cast_info { swig_type_info *type; /* pointer to type that is equivalent to this type */ swig_converter_func converter; /* function to cast the void pointers */ struct swig_cast_info *next; /* pointer to next cast in linked list */ struct swig_cast_info *prev; /* pointer to the previous cast */ } swig_cast_info; /* Structure used to store module information * Each module generates one structure like this, and the runtime collects * all of these structures and stores them in a circularly linked list.*/ typedef struct swig_module_info { swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ size_t size; /* Number of types in this module */ struct swig_module_info *next; /* Pointer to next element in circularly linked list */ swig_type_info **type_initial; /* Array of initially generated type structures */ swig_cast_info **cast_initial; /* Array of initially generated casting structures */ void *clientdata; /* Language specific module data */ } swig_module_info; /* Compare two type names skipping the space characters, therefore "char*" == "char *" and "Class<int>" == "Class<int >", etc. Return 0 when the two name types are equivalent, as in strncmp, but skipping ' '. */ SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2) { for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { while ((*f1 == ' ') && (f1 != l1)) ++f1; while ((*f2 == ' ') && (f2 != l2)) ++f2; if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; } return (int)((l1 - f1) - (l2 - f2)); } /* Check type equivalence in a name list like <name1>|<name2>|... Return 0 if equal, -1 if nb < tb, 1 if nb > tb */ SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb) { int equiv = 1; const char* te = tb + strlen(tb); const char* ne = nb; while (equiv != 0 && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } equiv = SWIG_TypeNameComp(nb, ne, tb, te); if (*ne) ++ne; } return equiv; } /* Check type equivalence in a name list like <name1>|<name2>|... Return 0 if not equal, 1 if equal */ SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb) { return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; } /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { if (strcmp(iter->type->name, c) == 0) { if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ iter->prev->next = iter->next; if (iter->next) iter->next->prev = iter->prev; iter->next = ty->cast; iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; return iter; } iter = iter->next; } } return 0; } /* Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { if (iter->type == from) { if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ iter->prev->next = iter->next; if (iter->next) iter->next->prev = iter->prev; iter->next = ty->cast; iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; return iter; } iter = iter->next; } } return 0; } /* Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* Dynamic pointer casting. Down an inheritance hierarchy */ SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { swig_type_info *lastty = ty; if (!ty || !ty->dcast) return ty; while (ty && (ty->dcast)) { ty = (*ty->dcast)(ptr); if (ty) lastty = ty; } return lastty; } /* Return the name associated with this type */ SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty) { return ty->name; } /* Return the pretty name associated with this type, that is an unmangled type name in a form presentable to the user. */ SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type) { /* The "str" field contains the equivalent pretty names of the type, separated by vertical-bar characters. We choose to print the last name, as it is often (?) the most specific. */ if (!type) return NULL; if (type->str != NULL) { const char *last_name = type->str; const char *s; for (s = type->str; *s; s++) if (*s == '|') last_name = s+1; return last_name; } else return type->name; } /* Set the clientdata field for a type */ SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { swig_cast_info *cast = ti->cast; /* if (ti->clientdata == clientdata) return; */ ti->clientdata = clientdata; while (cast) { if (!cast->converter) { swig_type_info *tc = cast->type; if (!tc->clientdata) { SWIG_TypeClientData(tc, clientdata); } } cast = cast->next; } } SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { SWIG_TypeClientData(ti, clientdata); ti->owndata = 1; } /* Search for a swig_type_info structure only by mangled name Search is a O(log #types) We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { swig_module_info *iter = start; do { if (iter->size) { size_t l = 0; size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { int compare = strcmp(name, iname); if (compare == 0) { return iter->types[i]; } else if (compare < 0) { if (i) { r = i - 1; } else { break; } } else if (compare > 0) { l = i + 1; } } else { break; /* should never happen */ } } while (l <= r); } iter = iter->next; } while (iter != end); return 0; } /* Search for a swig_type_info structure for either a mangled name or a human readable name. It first searches the mangled names of the types, which is a O(log #types) If a type is not found it then searches the human readable names, which is O(#types). We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { /* STEP 1: Search the name field using binary search */ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); if (ret) { return ret; } else { /* STEP 2: If the type hasn't been found, do a complete search of the str field (the human readable name) */ swig_module_info *iter = start; do { size_t i = 0; for (; i < iter->size; ++i) { if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) return iter->types[i]; } iter = iter->next; } while (iter != end); } /* neither found a match */ return 0; } /* Pack binary data into a string */ SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; const unsigned char *u = (unsigned char *) ptr; const unsigned char *eu = u + sz; for (; u != eu; ++u) { unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } return c; } /* Unpack binary data from a string */ SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { unsigned char *u = (unsigned char *) ptr; const unsigned char *eu = u + sz; for (; u != eu; ++u) { char d = *(c++); unsigned char uu; if ((d >= '0') && (d <= '9')) uu = ((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) uu = ((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) uu |= (d - '0'); else if ((d >= 'a') && (d <= 'f')) uu |= (d - ('a'-10)); else return (char *) 0; *u = uu; } return c; } /* Pack 'void *' into a string buffer. */ SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { char *r = buff; if ((2*sizeof(void *) + 2) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,&ptr,sizeof(void *)); if (strlen(name) + 1 > (bsz - (r - buff))) return 0; strcpy(r,name); return buff; } SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { *ptr = (void *) 0; return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sizeof(void *)); } SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { char *r = buff; size_t lname = (name ? strlen(name) : 0); if ((2*sz + 2 + lname) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,ptr,sz); if (lname) { strncpy(r,name,lname+1); } else { *r = 0; } return buff; } SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { memset(ptr,0,sz); return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sz); } #ifdef __cplusplus } #endif /* Errors in SWIG */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 #define SWIG_IndexError -4 #define SWIG_TypeError -5 #define SWIG_DivisionByZero -6 #define SWIG_OverflowError -7 #define SWIG_SyntaxError -8 #define SWIG_ValueError -9 #define SWIG_SystemError -10 #define SWIG_AttributeError -11 #define SWIG_MemoryError -12 #define SWIG_NullReferenceError -13 /* Compatibility macros for Python 3 */ #if PY_VERSION_HEX >= 0x03000000 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) #define PyInt_Check(x) PyLong_Check(x) #define PyInt_AsLong(x) PyLong_AsLong(x) #define PyInt_FromLong(x) PyLong_FromLong(x) #define PyInt_FromSize_t(x) PyLong_FromSize_t(x) #define PyString_Check(name) PyBytes_Check(name) #define PyString_FromString(x) PyUnicode_FromString(x) #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) #define PyString_AsString(str) PyBytes_AsString(str) #define PyString_Size(str) PyBytes_Size(str) #define PyString_InternFromString(key) PyUnicode_InternFromString(key) #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x) #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) #endif #ifndef Py_TYPE # define Py_TYPE(op) ((op)->ob_type) #endif /* SWIG APIs for compatibility of both Python 2 & 3 */ #if PY_VERSION_HEX >= 0x03000000 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat #else # define SWIG_Python_str_FromFormat PyString_FromFormat #endif /* Warning: This function will allocate a new string in Python 3, * so please call SWIG_Python_str_DelForPy3(x) to free the space. */ SWIGINTERN char* SWIG_Python_str_AsChar(PyObject *str) { #if PY_VERSION_HEX >= 0x03000000 char *cstr; char *newstr; Py_ssize_t len; str = PyUnicode_AsUTF8String(str); PyBytes_AsStringAndSize(str, &cstr, &len); newstr = (char *) malloc(len+1); memcpy(newstr, cstr, len+1); Py_XDECREF(str); return newstr; #else return PyString_AsString(str); #endif } #if PY_VERSION_HEX >= 0x03000000 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) #else # define SWIG_Python_str_DelForPy3(x) #endif SWIGINTERN PyObject* SWIG_Python_str_FromChar(const char *c) { #if PY_VERSION_HEX >= 0x03000000 return PyUnicode_FromString(c); #else return PyString_FromString(c); #endif } /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) # define PyOS_snprintf _snprintf # else # define PyOS_snprintf snprintf # endif #endif /* A crude PyString_FromFormat implementation for old Pythons */ #if PY_VERSION_HEX < 0x02020000 #ifndef SWIG_PYBUFFER_SIZE # define SWIG_PYBUFFER_SIZE 1024 #endif static PyObject * PyString_FromFormat(const char *fmt, ...) { va_list ap; char buf[SWIG_PYBUFFER_SIZE * 2]; int res; va_start(ap, fmt); res = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); } #endif /* Add PyObject_Del for old Pythons */ #if PY_VERSION_HEX < 0x01060000 # define PyObject_Del(op) PyMem_DEL((op)) #endif #ifndef PyObject_DEL # define PyObject_DEL PyObject_Del #endif /* A crude PyExc_StopIteration exception for old Pythons */ #if PY_VERSION_HEX < 0x02020000 # ifndef PyExc_StopIteration # define PyExc_StopIteration PyExc_RuntimeError # endif # ifndef PyObject_GenericGetAttr # define PyObject_GenericGetAttr 0 # endif #endif /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented # define Py_NotImplemented PyExc_RuntimeError # endif #endif /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} # endif #endif /* PySequence_Size for old Pythons */ #if PY_VERSION_HEX < 0x02000000 # ifndef PySequence_Size # define PySequence_Size PySequence_Length # endif #endif /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static PyObject *PyBool_FromLong(long ok) { PyObject *result = ok ? Py_True : Py_False; Py_INCREF(result); return result; } #endif /* Py_ssize_t for old Pythons */ /* This code is as recommended by: */ /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) typedef int Py_ssize_t; # define PY_SSIZE_T_MAX INT_MAX # define PY_SSIZE_T_MIN INT_MIN typedef inquiry lenfunc; typedef intargfunc ssizeargfunc; typedef intintargfunc ssizessizeargfunc; typedef intobjargproc ssizeobjargproc; typedef intintobjargproc ssizessizeobjargproc; typedef getreadbufferproc readbufferproc; typedef getwritebufferproc writebufferproc; typedef getsegcountproc segcountproc; typedef getcharbufferproc charbufferproc; static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) { long result = 0; PyObject *i = PyNumber_Int(x); if (i) { result = PyInt_AsLong(i); Py_DECREF(i); } return result; } #endif #if PY_VERSION_HEX < 0x02050000 #define PyInt_FromSize_t(x) PyInt_FromLong((long)x) #endif #if PY_VERSION_HEX < 0x02040000 #define Py_VISIT(op) \ do { \ if (op) { \ int vret = visit((op), arg); \ if (vret) \ return vret; \ } \ } while (0) #endif #if PY_VERSION_HEX < 0x02030000 typedef struct { PyTypeObject type; PyNumberMethods as_number; PyMappingMethods as_mapping; PySequenceMethods as_sequence; PyBufferProcs as_buffer; PyObject *name, *slots; } PyHeapTypeObject; #endif #if PY_VERSION_HEX < 0x02030000 typedef destructor freefunc; #endif #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ (PY_MAJOR_VERSION > 3)) # define SWIGPY_USE_CAPSULE # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) #endif #if PY_VERSION_HEX < 0x03020000 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) #endif /* ----------------------------------------------------------------------------- * error manipulation * ----------------------------------------------------------------------------- */ SWIGRUNTIME PyObject* SWIG_Python_ErrorType(int code) { PyObject* type = 0; switch(code) { case SWIG_MemoryError: type = PyExc_MemoryError; break; case SWIG_IOError: type = PyExc_IOError; break; case SWIG_RuntimeError: type = PyExc_RuntimeError; break; case SWIG_IndexError: type = PyExc_IndexError; break; case SWIG_TypeError: type = PyExc_TypeError; break; case SWIG_DivisionByZero: type = PyExc_ZeroDivisionError; break; case SWIG_OverflowError: type = PyExc_OverflowError; break; case SWIG_SyntaxError: type = PyExc_SyntaxError; break; case SWIG_ValueError: type = PyExc_ValueError; break; case SWIG_SystemError: type = PyExc_SystemError; break; case SWIG_AttributeError: type = PyExc_AttributeError; break; default: type = PyExc_RuntimeError; } return type; } SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char* mesg) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { PyErr_SetString(PyExc_RuntimeError, mesg); } } #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS # endif #endif #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) # if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ # define SWIG_PYTHON_USE_GIL # endif # endif # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ # ifndef SWIG_PYTHON_INITIALIZE_THREADS # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() # endif # ifdef __cplusplus /* C++ code */ class SWIG_Python_Thread_Block { bool status; PyGILState_STATE state; public: void end() { if (status) { PyGILState_Release(state); status = false;} } SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} ~SWIG_Python_Thread_Block() { end(); } }; class SWIG_Python_Thread_Allow { bool status; PyThreadState *save; public: void end() { if (status) { PyEval_RestoreThread(save); status = false; }} SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} ~SWIG_Python_Thread_Allow() { end(); } }; # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() # else /* C code */ # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) # endif # else /* Old thread way, not implemented, user must provide it */ # if !defined(SWIG_PYTHON_INITIALIZE_THREADS) # define SWIG_PYTHON_INITIALIZE_THREADS # endif # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) # define SWIG_PYTHON_THREAD_BEGIN_BLOCK # endif # if !defined(SWIG_PYTHON_THREAD_END_BLOCK) # define SWIG_PYTHON_THREAD_END_BLOCK # endif # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) # define SWIG_PYTHON_THREAD_BEGIN_ALLOW # endif # if !defined(SWIG_PYTHON_THREAD_END_ALLOW) # define SWIG_PYTHON_THREAD_END_ALLOW # endif # endif #else /* No thread support */ # define SWIG_PYTHON_INITIALIZE_THREADS # define SWIG_PYTHON_THREAD_BEGIN_BLOCK # define SWIG_PYTHON_THREAD_END_BLOCK # define SWIG_PYTHON_THREAD_BEGIN_ALLOW # define SWIG_PYTHON_THREAD_END_ALLOW #endif /* ----------------------------------------------------------------------------- * Python API portion that goes into the runtime * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif /* ----------------------------------------------------------------------------- * Constant declarations * ----------------------------------------------------------------------------- */ /* Constant Types */ #define SWIG_PY_POINTER 4 #define SWIG_PY_BINARY 5 /* Constant information structure */ typedef struct swig_const_info { int type; char *name; long lvalue; double dvalue; void *pvalue; swig_type_info **ptype; } swig_const_info; /* ----------------------------------------------------------------------------- * Wrapper of PyInstanceMethod_New() used in Python 3 * It is exported to the generated module, used for -fastproxy * ----------------------------------------------------------------------------- */ #if PY_VERSION_HEX >= 0x03000000 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { return PyInstanceMethod_New(func); } #else SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) { return NULL; } #endif #ifdef __cplusplus } #endif /* ----------------------------------------------------------------------------- * pyrun.swg * * This file contains the runtime support for Python modules * and includes code for managing global variables and pointer * type checking. * * ----------------------------------------------------------------------------- */ /* Common SWIG API */ /* for raw pointers */ #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) #ifdef SWIGPYTHON_BUILTIN #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) #else #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) #endif #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) #define swig_owntype int /* for raw packed data */ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) /* for class or struct pointers */ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) /* for C or C++ function pointers */ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) /* for C++ member pointers, ie, member methods */ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) /* Runtime API */ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) #define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) #define SWIG_fail goto fail /* Runtime API implementation */ /* Error manipulation */ SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { SWIG_PYTHON_THREAD_BEGIN_BLOCK; PyErr_SetObject(errtype, obj); Py_DECREF(obj); SWIG_PYTHON_THREAD_END_BLOCK; } SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { SWIG_PYTHON_THREAD_BEGIN_BLOCK; PyErr_SetString(errtype, msg); SWIG_PYTHON_THREAD_END_BLOCK; } #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) /* Set a constant value */ #if defined(SWIGPYTHON_BUILTIN) SWIGINTERN void SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { PyObject *s = PyString_InternFromString(key); PyList_Append(seq, s); Py_DECREF(s); } SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { #if PY_VERSION_HEX < 0x02030000 PyDict_SetItemString(d, (char *)name, obj); #else PyDict_SetItemString(d, name, obj); #endif Py_DECREF(obj); if (public_interface) SwigPyBuiltin_AddPublicSymbol(public_interface, name); } #else SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { #if PY_VERSION_HEX < 0x02030000 PyDict_SetItemString(d, (char *)name, obj); #else PyDict_SetItemString(d, name, obj); #endif Py_DECREF(obj); } #endif /* Append a value to the result obj */ SWIGINTERN PyObject* SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { #if !defined(SWIG_PYTHON_OUTPUT_TUPLE) if (!result) { result = obj; } else if (result == Py_None) { Py_DECREF(result); result = obj; } else { if (!PyList_Check(result)) { PyObject *o2 = result; result = PyList_New(1); PyList_SetItem(result, 0, o2); } PyList_Append(result,obj); Py_DECREF(obj); } return result; #else PyObject* o2; PyObject* o3; if (!result) { result = obj; } else if (result == Py_None) { Py_DECREF(result); result = obj; } else { if (!PyTuple_Check(result)) { o2 = result; result = PyTuple_New(1); PyTuple_SET_ITEM(result, 0, o2); } o3 = PyTuple_New(1); PyTuple_SET_ITEM(o3, 0, obj); o2 = result; result = PySequence_Concat(o2, o3); Py_DECREF(o2); Py_DECREF(o3); } return result; #endif } /* Unpack the argument tuple */ SWIGINTERN int SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) { if (!args) { if (!min && !max) { return 1; } else { PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", name, (min == max ? "" : "at least "), (int)min); return 0; } } if (!PyTuple_Check(args)) { if (min <= 1 && max >= 1) { int i; objs[0] = args; for (i = 1; i < max; ++i) { objs[i] = 0; } return 2; } PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); return 0; } else { Py_ssize_t l = PyTuple_GET_SIZE(args); if (l < min) { PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", name, (min == max ? "" : "at least "), (int)min, (int)l); return 0; } else if (l > max) { PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", name, (min == max ? "" : "at most "), (int)max, (int)l); return 0; } else { int i; for (i = 0; i < l; ++i) { objs[i] = PyTuple_GET_ITEM(args, i); } for (; l < max; ++l) { objs[l] = 0; } return i + 1; } } } /* A functor is a function object with one single object argument */ #if PY_VERSION_HEX >= 0x02020000 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); #else #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); #endif /* Helper for static pointer initialization for both C and C++ code, for example static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); */ #ifdef __cplusplus #define SWIG_STATIC_POINTER(var) var #else #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var #endif /* ----------------------------------------------------------------------------- * Pointer declarations * ----------------------------------------------------------------------------- */ /* Flags for new pointer objects */ #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) #ifdef __cplusplus extern "C" { #endif /* How to access Py_None */ #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # ifndef SWIG_PYTHON_NO_BUILD_NONE # ifndef SWIG_PYTHON_BUILD_NONE # define SWIG_PYTHON_BUILD_NONE # endif # endif #endif #ifdef SWIG_PYTHON_BUILD_NONE # ifdef Py_None # undef Py_None # define Py_None SWIG_Py_None() # endif SWIGRUNTIMEINLINE PyObject * _SWIG_Py_None(void) { PyObject *none = Py_BuildValue((char*)""); Py_DECREF(none); return none; } SWIGRUNTIME PyObject * SWIG_Py_None(void) { static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); return none; } #endif /* The python void return value */ SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void) { PyObject *none = Py_None; Py_INCREF(none); return none; } /* SwigPyClientData */ typedef struct { PyObject *klass; PyObject *newraw; PyObject *newargs; PyObject *destroy; int delargs; int implicitconv; PyTypeObject *pytype; } SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); /* the newraw method and newargs arguments used to create a new raw instance */ if (PyClass_Check(obj)) { data->newraw = 0; data->newargs = obj; Py_INCREF(obj); } else { #if (PY_VERSION_HEX < 0x02020000) data->newraw = 0; #else data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); #endif if (data->newraw) { Py_INCREF(data->newraw); data->newargs = PyTuple_New(1); PyTuple_SetItem(data->newargs, 0, obj); } else { data->newargs = obj; } Py_INCREF(data->newargs); } /* the destroy method, aka as the C++ delete method */ data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); if (PyErr_Occurred()) { PyErr_Clear(); data->destroy = 0; } if (data->destroy) { int flags; Py_INCREF(data->destroy); flags = PyCFunction_GET_FLAGS(data->destroy); #ifdef METH_O data->delargs = !(flags & (METH_O)); #else data->delargs = 0; #endif } else { data->delargs = 0; } data->implicitconv = 0; data->pytype = 0; return data; } } SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } /* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD void *ptr; swig_type_info *ty; int own; PyObject *next; #ifdef SWIGPYTHON_BUILTIN PyObject *dict; #endif } SwigPyObject; SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { #if PY_VERSION_HEX >= 0x03000000 res = PyUnicode_Format(ofmt,args); #else res = PyString_Format(ofmt,args); #endif Py_DECREF(ofmt); } Py_DECREF(args); } } return res; } SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v) { return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * SwigPyObject_hex(SwigPyObject *v) { return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS SwigPyObject_repr(SwigPyObject *v) #else SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v); if (v->next) { # ifdef METH_NOARGS PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); # else PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); # endif # if PY_VERSION_HEX >= 0x03000000 PyObject *joined = PyUnicode_Concat(repr, nrep); Py_DecRef(repr); Py_DecRef(nrep); repr = joined; # else PyString_ConcatAndDel(&repr,nrep); # endif } return repr; } SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } /* Added for Python 3.x, would it also be useful for Python 2.x? */ SWIGRUNTIME PyObject* SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) { PyObject* res; if( op != Py_EQ && op != Py_NE ) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); return res; } SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); #ifdef SWIGPYTHON_BUILTIN static swig_type_info *SwigPyObject_stype = 0; SWIGRUNTIME PyTypeObject* SwigPyObject_type(void) { SwigPyClientData *cd; assert(SwigPyObject_stype); cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; assert(cd); assert(cd->pytype); return cd->pytype; } #else SWIGRUNTIME PyTypeObject* SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); return type; } #endif SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op) { #ifdef SWIGPYTHON_BUILTIN PyTypeObject *target_tp = SwigPyObject_type(); if (PyType_IsSubtype(op->ob_type, target_tp)) return 1; return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); #else return (Py_TYPE(op) == SwigPyObject_type()) || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); #endif } SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v) { SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { /* we need to create a temporary object to carry the destroy operation */ PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); PyObject *mself = PyCFunction_GET_SELF(destroy); res = ((*meth)(mself, v)); } Py_XDECREF(res); } #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) else { const char *name = SWIG_TypePrettyName(ty); printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); } #endif } Py_XDECREF(next); PyObject_DEL(v); } SWIGRUNTIME PyObject* SwigPyObject_append(PyObject* v, PyObject* next) { SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; Py_INCREF(next); return SWIG_Py_Void(); } SWIGRUNTIME PyObject* #ifdef METH_NOARGS SwigPyObject_next(PyObject* v) #else SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; } else { return SWIG_Py_Void(); } } SWIGINTERN PyObject* #ifdef METH_NOARGS SwigPyObject_disown(PyObject *v) #else SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS SwigPyObject_acquire(PyObject *v) #else SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) #elif (PY_VERSION_HEX < 0x02050000) if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) #else if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) #endif { return NULL; } else { SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { SwigPyObject_acquire(v); } else { SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { SwigPyObject_acquire(v,args); } else { SwigPyObject_disown(v,args); } #endif } return obj; } } #ifdef METH_O static PyMethodDef swigobject_methods[] = { {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } #endif SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ /* nb_divide removed in Python 3 */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ #endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ (unaryfunc)0, /*nb_negative*/ (unaryfunc)0, /*nb_positive*/ (unaryfunc)0, /*nb_absolute*/ (inquiry)0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_VERSION_HEX < 0x03000000 0, /*nb_coerce*/ #endif (unaryfunc)SwigPyObject_long, /*nb_int*/ #if PY_VERSION_HEX < 0x03000000 (unaryfunc)SwigPyObject_long, /*nb_long*/ #else 0, /*nb_reserved*/ #endif (unaryfunc)0, /*nb_float*/ #if PY_VERSION_HEX < 0x03000000 (unaryfunc)SwigPyObject_oct, /*nb_oct*/ (unaryfunc)SwigPyObject_hex, /*nb_hex*/ #endif #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ #endif }; static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif (char *)"SwigPyObject", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */ 0, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ #else (cmpfunc)SwigPyObject_compare, /* tp_compare */ #endif (reprfunc)SwigPyObject_repr, /* tp_repr */ &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ swigobject_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 0, /* tp_version */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; swigpyobject_type = tmp; type_init = 1; #if PY_VERSION_HEX < 0x02020000 swigpyobject_type.ob_type = &PyType_Type; #else if (PyType_Ready(&swigpyobject_type) < 0) return NULL; #endif } return &swigpyobject_type; } SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; sobj->own = own; sobj->next = 0; } return (PyObject *)sobj; } /* ----------------------------------------------------------------------------- * Implements a simple Swig Packed type, and use it instead of string * ----------------------------------------------------------------------------- */ typedef struct { PyObject_HEAD void *pack; swig_type_info *ty; size_t size; } SwigPyPacked; SWIGRUNTIME int SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("<Swig Packed ", fp); if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { fputs("at ", fp); fputs(result, fp); } fputs(v->ty->name,fp); fputs(">", fp); return 0; } SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name); } else { return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name); } } SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; int s = (i < j) ? -1 : ((i > j) ? 1 : 0); return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); } SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); SWIGRUNTIME PyTypeObject* SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); return type; } SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == SwigPyPacked_TypeOnce()) || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v) { if (SwigPyPacked_Check(v)) { SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); } SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX>=0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif (char *)"SwigPyPacked", /* tp_name */ sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX>=0x03000000 0, /* tp_reserved in 3.0.1 */ #else (cmpfunc)SwigPyPacked_compare, /* tp_compare */ #endif (reprfunc)SwigPyPacked_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ swigpacked_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 0, /* tp_version */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; swigpypacked_type = tmp; type_init = 1; #if PY_VERSION_HEX < 0x02020000 swigpypacked_type.ob_type = &PyType_Type; #else if (PyType_Ready(&swigpypacked_type) < 0) return NULL; #endif } return &swigpypacked_type; } SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { memcpy(pack, ptr, size); sobj->pack = pack; sobj->ty = ty; sobj->size = size; } else { PyObject_DEL((PyObject *) sobj); sobj = 0; } } return (PyObject *) sobj; } SWIGRUNTIME swig_type_info * SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { if (SwigPyPacked_Check(obj)) { SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; } else { return 0; } } /* ----------------------------------------------------------------------------- * pointers/data manipulation * ----------------------------------------------------------------------------- */ SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { return SWIG_Python_str_FromChar("this"); } static PyObject *swig_this = NULL; SWIGRUNTIME PyObject * SWIG_This(void) { if (swig_this == NULL) swig_this = _SWIG_This(); return swig_this; } /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ /* TODO: I don't know how to implement the fast getset in Python 3 right now */ #if PY_VERSION_HEX>=0x03000000 #define SWIG_PYTHON_SLOW_GETSET_THIS #endif SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { PyObject *obj; if (SwigPyObject_Check(pyobj)) return (SwigPyObject *) pyobj; #ifdef SWIGPYTHON_BUILTIN (void)obj; # ifdef PyWeakref_CheckProxy if (PyWeakref_CheckProxy(pyobj)) { pyobj = PyWeakref_GET_OBJECT(pyobj); if (pyobj && SwigPyObject_Check(pyobj)) return (SwigPyObject*) pyobj; } # endif return NULL; #else obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) if (PyInstance_Check(pyobj)) { obj = _PyInstance_Lookup(pyobj, SWIG_This()); } else { PyObject **dictptr = _PyObject_GetDictPtr(pyobj); if (dictptr != NULL) { PyObject *dict = *dictptr; obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; } else { #ifdef PyWeakref_CheckProxy if (PyWeakref_CheckProxy(pyobj)) { PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; } #endif obj = PyObject_GetAttr(pyobj,SWIG_This()); if (obj) { Py_DECREF(obj); } else { if (PyErr_Occurred()) PyErr_Clear(); return 0; } } } #else obj = PyObject_GetAttr(pyobj,SWIG_This()); if (obj) { Py_DECREF(obj); } else { if (PyErr_Occurred()) PyErr_Clear(); return 0; } #endif if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } return (SwigPyObject *)obj; #endif } /* Acquire a pointer value */ SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; return oldown; } } return 0; } /* Convert a pointer value */ SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { int res; SwigPyObject *sobj; int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; if (!obj) return SWIG_ERROR; if (obj == Py_None && !implicit_conv) { if (ptr) *ptr = 0; return SWIG_OK; } res = SWIG_ERROR; sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { void *vptr = sobj->ptr; if (ty) { swig_type_info *to = sobj->ty; if (to == ty) { /* no type cast needed */ if (ptr) *ptr = vptr; break; } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; *ptr = SWIG_TypeCast(tc,vptr,&newmemory); if (newmemory == SWIG_CAST_NEW_MEMORY) { assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ if (own) *own = *own | SWIG_CAST_NEW_MEMORY; } } break; } } } else { if (ptr) *ptr = vptr; break; } } if (sobj) { if (own) *own = *own | sobj->own; if (flags & SWIG_POINTER_DISOWN) { sobj->own = 0; } res = SWIG_OK; } else { if (implicit_conv) { SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { PyObject *impconv; data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ impconv = SWIG_Python_CallFunctor(klass, obj); data->implicitconv = 0; if (PyErr_Occurred()) { PyErr_Clear(); impconv = 0; } if (impconv) { SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); if (SWIG_IsOK(res)) { if (ptr) { *ptr = vptr; /* transfer the ownership to 'ptr' */ iobj->own = 0; res = SWIG_AddCast(res); res = SWIG_AddNewMask(res); } else { res = SWIG_AddCast(res); } } } Py_DECREF(impconv); } } } } if (!SWIG_IsOK(res) && obj == Py_None) { if (ptr) *ptr = 0; if (PyErr_Occurred()) PyErr_Clear(); res = SWIG_OK; } } return res; } /* Convert a function ptr value */ SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { if (!PyCFunction_Check(obj)) { return SWIG_ConvertPtr(obj, ptr, ty, 0); } else { void *vptr = 0; /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; if (!desc) return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { int newmemory = 0; *ptr = SWIG_TypeCast(tc,vptr,&newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ } else { return SWIG_ERROR; } } else { *ptr = vptr; } return SWIG_OK; } } /* Convert a packed value value */ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { /* check type cast? */ swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) return SWIG_ERROR; } } return SWIG_OK; } /* ----------------------------------------------------------------------------- * Create a new pointer object * ----------------------------------------------------------------------------- */ /* Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; PyObject *newraw = data->newraw; if (newraw) { inst = PyObject_Call(newraw, data->newargs, NULL); if (inst) { #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) PyObject **dictptr = _PyObject_GetDictPtr(inst); if (dictptr != NULL) { PyObject *dict = *dictptr; if (dict == NULL) { dict = PyDict_New(); *dictptr = dict; PyDict_SetItem(dict, SWIG_This(), swig_this); } } #else PyObject *key = SWIG_This(); PyObject_SetAttr(inst, key, swig_this); #endif } } else { #if PY_VERSION_HEX >= 0x03000000 inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); if (inst) { PyObject_SetAttr(inst, SWIG_This(), swig_this); Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; } #else PyObject *dict = PyDict_New(); if (dict) { PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); } #endif } return inst; #else #if (PY_VERSION_HEX >= 0x02010000) PyObject *inst = 0; PyObject *dict = PyDict_New(); if (dict) { PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); } return (PyObject *) inst; #else PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); if (inst == NULL) { return NULL; } inst->in_class = (PyClassObject *)data->newargs; Py_INCREF(inst->in_class); inst->in_dict = PyDict_New(); if (inst->in_dict == NULL) { Py_DECREF(inst); return NULL; } #ifdef Py_TPFLAGS_HAVE_WEAKREFS inst->in_weakreflist = NULL; #endif #ifdef Py_TPFLAGS_GC PyObject_GC_Init(inst); #endif PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); return (PyObject *) inst; #endif #endif } SWIGRUNTIME void SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) { PyObject *dict; #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) PyObject **dictptr = _PyObject_GetDictPtr(inst); if (dictptr != NULL) { dict = *dictptr; if (dict == NULL) { dict = PyDict_New(); *dictptr = dict; } PyDict_SetItem(dict, SWIG_This(), swig_this); return; } #endif dict = PyObject_GetAttrString(inst, (char*)"__dict__"); PyDict_SetItem(dict, SWIG_This(), swig_this); Py_DECREF(dict); } SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args) { PyObject *obj[2]; if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { return NULL; } else { SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } return SWIG_Py_Void(); } } /* Create a new pointer object */ SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { SwigPyClientData *clientdata; PyObject * robj; int own; if (!ptr) return SWIG_Py_Void(); clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; if (clientdata && clientdata->pytype) { SwigPyObject *newobj; if (flags & SWIG_BUILTIN_TP_INIT) { newobj = (SwigPyObject*) self; if (newobj->ptr) { PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); while (newobj->next) newobj = (SwigPyObject *) newobj->next; newobj->next = next_self; newobj = (SwigPyObject *)next_self; } } else { newobj = PyObject_New(SwigPyObject, clientdata->pytype); } if (newobj) { newobj->ptr = ptr; newobj->ty = type; newobj->own = own; newobj->next = 0; #ifdef SWIGPYTHON_BUILTIN newobj->dict = 0; #endif return (PyObject*) newobj; } return SWIG_Py_Void(); } assert(!(flags & SWIG_BUILTIN_TP_INIT)); robj = SwigPyObject_New(ptr, type, own); if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); Py_DECREF(robj); robj = inst; } return robj; } /* Create a new packed object */ SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* * Get type list * -----------------------------------------------------------------------------*/ #ifdef SWIG_LINK_RUNTIME void *SWIG_ReturnGlobalTypeList(void *); #endif SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { static void *type_pointer = (void *)0; /* first check if module already created */ if (!type_pointer) { #ifdef SWIG_LINK_RUNTIME type_pointer = SWIG_ReturnGlobalTypeList((void *)0); #else # ifdef SWIGPY_USE_CAPSULE type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); # else type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); # endif if (PyErr_Occurred()) { PyErr_Clear(); type_pointer = (void *)0; } #endif } return (swig_module_info *) type_pointer; } #if PY_MAJOR_VERSION < 2 /* PyModule_AddObject function was introduced in Python 2.0. The following function is copied out of Python/modsupport.c in python version 2.3.4 */ SWIGINTERN int PyModule_AddObject(PyObject *m, char *name, PyObject *o) { PyObject *dict; if (!PyModule_Check(m)) { PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); return SWIG_ERROR; } if (!o) { PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); return SWIG_ERROR; } dict = PyModule_GetDict(m); if (dict == NULL) { /* Internal error -- modules must have a dict! */ PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", PyModule_GetName(m)); return SWIG_ERROR; } if (PyDict_SetItemString(dict, name, o)) return SWIG_ERROR; Py_DECREF(o); return SWIG_OK; } #endif SWIGRUNTIME void #ifdef SWIGPY_USE_CAPSULE SWIG_Python_DestroyModule(PyObject *obj) #else SWIG_Python_DestroyModule(void *vptr) #endif { #ifdef SWIGPY_USE_CAPSULE swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); #else swig_module_info *swig_module = (swig_module_info *) vptr; #endif swig_type_info **types = swig_module->types; size_t i; for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); swig_this = NULL; } SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { #if PY_VERSION_HEX >= 0x03000000 /* Add a dummy module object into sys.modules */ PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); #else static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); #endif #ifdef SWIGPY_USE_CAPSULE PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); } else { Py_XDECREF(pointer); } #else PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); } else { Py_XDECREF(pointer); } #endif } /* The python cached type query */ SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void) { static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); return cache; } SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { #ifdef SWIGPY_USE_CAPSULE descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); #else descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); #endif } else { swig_module_info *swig_module = SWIG_GetModule(0); descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); if (descriptor) { #ifdef SWIGPY_USE_CAPSULE obj = PyCapsule_New((void*) descriptor, NULL, NULL); #else obj = PyCObject_FromVoidPtr(descriptor, NULL); #endif PyDict_SetItem(cache, key, obj); Py_DECREF(obj); } } Py_DECREF(key); return descriptor; } /* For backward compatibility only */ #define SWIG_POINTER_EXCEPTION 0 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) { if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; } else { return 0; } } SWIGRUNTIME int SWIG_Python_ArgFail(int argnum) { if (PyErr_Occurred()) { /* add information about failing argument */ char mesg[256]; PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); return SWIG_Python_AddErrMesg(mesg, 1); } else { return 0; } } SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self) { SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : ""; } SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj) { if (type) { #if defined(SWIG_COBJECT_TYPES) if (obj && SwigPyObject_Check(obj)) { const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } } else #endif { const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } Py_XDECREF(str); return; } } PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); } else { PyErr_Format(PyExc_TypeError, "unexpected type is received"); } } /* Convert a pointer value, signal an exception on a type mismatch */ SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); #if SWIG_POINTER_EXCEPTION if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } #endif } return result; } #ifdef SWIGPYTHON_BUILTIN SWIGRUNTIME int SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { PyTypeObject *tp = obj->ob_type; PyObject *descr; PyObject *encoded_name; descrsetfunc f; int res = -1; # ifdef Py_USING_UNICODE if (PyString_Check(name)) { name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); if (!name) return -1; } else if (!PyUnicode_Check(name)) # else if (!PyString_Check(name)) # endif { PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); return -1; } else { Py_INCREF(name); } if (!tp->tp_dict) { if (PyType_Ready(tp) < 0) goto done; } descr = _PyType_Lookup(tp, name); f = NULL; if (descr != NULL) f = descr->ob_type->tp_descr_set; if (!f) { if (PyString_Check(name)) { encoded_name = name; Py_INCREF(name); } else { encoded_name = PyUnicode_AsUTF8String(name); } PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); Py_DECREF(encoded_name); } else { res = f(descr, obj, value); } done: Py_DECREF(name); return res; } #endif #ifdef __cplusplus } #endif #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_DocxFactory__WordProcessingCompiler swig_types[0] #define SWIGTYPE_p_DocxFactory__WordProcessingMerger swig_types[1] #define SWIGTYPE_p_allocator_type swig_types[2] #define SWIGTYPE_p_char swig_types[3] #define SWIGTYPE_p_difference_type swig_types[4] #define SWIGTYPE_p_p_PyObject swig_types[5] #define SWIGTYPE_p_size_type swig_types[6] #define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[7] #define SWIGTYPE_p_std__invalid_argument swig_types[8] #define SWIGTYPE_p_std__vectorT__Tp__Alloc_t swig_types[9] #define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[10] #define SWIGTYPE_p_swig__SwigPyIterator swig_types[11] #define SWIGTYPE_p_value_type swig_types[12] static swig_type_info *swig_types[14]; static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) /* -------- TYPES TABLE (END) -------- */ #if (PY_VERSION_HEX <= 0x02000000) # if !defined(SWIG_PYTHON_CLASSIC) # error "This python version requires swig to be run with the '-classic' option" # endif #endif /*----------------------------------------------- @(target):= _NavalLetter.so ------------------------------------------------*/ #if PY_VERSION_HEX >= 0x03000000 # define SWIG_init PyInit__NavalLetter #else # define SWIG_init init_NavalLetter #endif #define SWIG_name "_NavalLetter" #define SWIGVERSION 0x030002 #define SWIG_VERSION SWIGVERSION #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) #include <stdexcept> namespace swig { class SwigPtr_PyObject { protected: PyObject *_obj; public: SwigPtr_PyObject() :_obj(0) { } SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); _obj = item._obj; return *this; } ~SwigPtr_PyObject() { Py_XDECREF(_obj); } operator PyObject *() const { return _obj; } PyObject *operator->() const { return _obj; } }; } namespace swig { struct SwigVar_PyObject : SwigPtr_PyObject { SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; return *this; } }; } #include <time.h> #include <string> #include <cctype> #include <stdio.h> #include <algorithm> #include <vector> #include <iostream> #include "/opt/DocxFactory/include/WordProcessingCompiler.h" #include "/opt/DocxFactory/include/WordProcessingMerger.h" extern DocxFactory::WordProcessingMerger& initialize(void); extern void print_Reply(DocxFactory::WordProcessingMerger& l_mergerIn, std::string user_SSIC, std::string user_code_serial, std::string user_date); extern void save_Output(DocxFactory::WordProcessingMerger& l_mergerIn, std::string user_fileName); extern void print_Header(DocxFactory::WordProcessingMerger& l_mergerIn, std::string user_unit, std::string user_address, std::string user_address2); extern void print_FromToSubj(DocxFactory::WordProcessingMerger& l_mergerIn, std::string user_from, std::string user_to, std::string user_subj); extern void print_Via(DocxFactory::WordProcessingMerger& l_mergerIn, std::vector<std::string> user_via); extern void print_Ref(DocxFactory::WordProcessingMerger& l_mergerIn, std::vector<std::string> user_ref); extern void print_Encl(DocxFactory::WordProcessingMerger& l_mergerIn, std::vector<std::string> user_encl); extern void print_Body(DocxFactory::WordProcessingMerger& l_mergerIn, std::vector<std::string> user_bodyLvl, std::vector<std::string> user_body); extern void print_Copy(DocxFactory::WordProcessingMerger& l_mergerIn, std::vector<std::string> user_copy); extern void print_Sig(DocxFactory::WordProcessingMerger& l_mergerIn, std::string user_sig); #include <iostream> #if PY_VERSION_HEX >= 0x03020000 # define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj)) #else # define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj)) #endif #include <stdexcept> #if defined(__GNUC__) # if __GNUC__ == 2 && __GNUC_MINOR <= 96 # define SWIG_STD_NOMODERN_STL # endif #endif #include <string> #include <stddef.h> namespace swig { struct stop_iteration { }; struct SwigPyIterator { private: SwigPtr_PyObject _seq; protected: SwigPyIterator(PyObject *seq) : _seq(seq) { } public: virtual ~SwigPyIterator() {} // Access iterator method, required by Python virtual PyObject *value() const = 0; // Forward iterator method, required by Python virtual SwigPyIterator *incr(size_t n = 1) = 0; // Backward iterator method, very common in C++, but not required in Python virtual SwigPyIterator *decr(size_t /*n*/ = 1) { throw stop_iteration(); } // Random access iterator methods, but not required in Python virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const { throw std::invalid_argument("operation not supported"); } virtual bool equal (const SwigPyIterator &/*x*/) const { throw std::invalid_argument("operation not supported"); } // C++ common/needed methods virtual SwigPyIterator *copy() const = 0; PyObject *next() { SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads PyObject *obj = value(); incr(); SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads return obj; } /* Make an alias for Python 3.x */ PyObject *__next__() { return next(); } PyObject *previous() { SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads decr(); PyObject *obj = value(); SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads return obj; } SwigPyIterator *advance(ptrdiff_t n) { return (n > 0) ? incr(n) : decr(-n); } bool operator == (const SwigPyIterator& x) const { return equal(x); } bool operator != (const SwigPyIterator& x) const { return ! operator==(x); } SwigPyIterator& operator += (ptrdiff_t n) { return *advance(n); } SwigPyIterator& operator -= (ptrdiff_t n) { return *advance(-n); } SwigPyIterator* operator + (ptrdiff_t n) const { return copy()->advance(n); } SwigPyIterator* operator - (ptrdiff_t n) const { return copy()->advance(-n); } ptrdiff_t operator - (const SwigPyIterator& x) const { return x.distance(*this); } static swig_type_info* descriptor() { static int init = 0; static swig_type_info* desc = 0; if (!init) { desc = SWIG_TypeQuery("swig::SwigPyIterator *"); init = 1; } return desc; } }; #if defined(SWIGPYTHON_BUILTIN) inline PyObject* make_output_iterator_builtin (PyObject *pyself) { Py_INCREF(pyself); return pyself; } #endif } SWIGINTERN int SWIG_AsVal_double (PyObject *obj, double *val) { int res = SWIG_TypeError; if (PyFloat_Check(obj)) { if (val) *val = PyFloat_AsDouble(obj); return SWIG_OK; } else if (PyInt_Check(obj)) { if (val) *val = PyInt_AsLong(obj); return SWIG_OK; } else if (PyLong_Check(obj)) { double v = PyLong_AsDouble(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_OK; } else { PyErr_Clear(); } } #ifdef SWIG_PYTHON_CAST_MODE { int dispatch = 0; double d = PyFloat_AsDouble(obj); if (!PyErr_Occurred()) { if (val) *val = d; return SWIG_AddCast(SWIG_OK); } else { PyErr_Clear(); } if (!dispatch) { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); } else { PyErr_Clear(); } } } #endif return res; } #include <float.h> #include <math.h> SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max) { double x = *d; if ((min <= x && x <= max)) { double fx = floor(x); double cx = ceil(x); double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ if ((errno == EDOM) || (errno == ERANGE)) { errno = 0; } else { double summ, reps, diff; if (rd < x) { diff = x - rd; } else if (rd > x) { diff = rd - x; } else { return 1; } summ = rd + x; reps = diff/summ; if (reps < 8*DBL_EPSILON) { *d = rd; return 1; } } } return 0; } SWIGINTERN int SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) { #if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(obj)) { long v = PyInt_AsLong(obj); if (v >= 0) { if (val) *val = v; return SWIG_OK; } else { return SWIG_OverflowError; } } else #endif if (PyLong_Check(obj)) { unsigned long v = PyLong_AsUnsignedLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_OK; } else { PyErr_Clear(); #if PY_VERSION_HEX >= 0x03000000 { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (v < 0) { return SWIG_OverflowError; } } else { PyErr_Clear(); } } #endif } } #ifdef SWIG_PYTHON_CAST_MODE { int dispatch = 0; unsigned long v = PyLong_AsUnsignedLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_AddCast(SWIG_OK); } else { PyErr_Clear(); } if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { if (val) *val = (unsigned long)(d); return res; } } } #endif return SWIG_TypeError; } SWIGINTERNINLINE int SWIG_AsVal_size_t (PyObject * obj, size_t *val) { unsigned long v; int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); return res; } #define SWIG_From_long PyLong_FromLong SWIGINTERNINLINE PyObject * SWIG_From_ptrdiff_t (ptrdiff_t value) { return SWIG_From_long (static_cast< long >(value)); } SWIGINTERNINLINE PyObject* SWIG_From_bool (bool value) { return PyBool_FromLong(value ? 1 : 0); } SWIGINTERN int SWIG_AsVal_long (PyObject *obj, long* val) { if (PyInt_Check(obj)) { if (val) *val = PyInt_AsLong(obj); return SWIG_OK; } else if (PyLong_Check(obj)) { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_OK; } else { PyErr_Clear(); } } #ifdef SWIG_PYTHON_CAST_MODE { int dispatch = 0; long v = PyInt_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_AddCast(SWIG_OK); } else { PyErr_Clear(); } if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { if (val) *val = (long)(d); return res; } } } #endif return SWIG_TypeError; } SWIGINTERNINLINE int SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val) { long v; int res = SWIG_AsVal_long (obj, val ? &v : 0); if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v); return res; } #include <algorithm> #include <vector> SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { static int init = 0; static swig_type_info* info = 0; if (!init) { info = SWIG_TypeQuery("_p_char"); init = 1; } return info; } SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { #if PY_VERSION_HEX>=0x03000000 if (PyUnicode_Check(obj)) #else if (PyString_Check(obj)) #endif { char *cstr; Py_ssize_t len; #if PY_VERSION_HEX>=0x03000000 if (!alloc && cptr) { /* We can't allow converting without allocation, since the internal representation of string in Python 3 is UCS-2/UCS-4 but we require a UTF-8 representation. TODO(bhy) More detailed explanation */ return SWIG_RuntimeError; } obj = PyUnicode_AsUTF8String(obj); PyBytes_AsStringAndSize(obj, &cstr, &len); if(alloc) *alloc = SWIG_NEWOBJ; #else PyString_AsStringAndSize(obj, &cstr, &len); #endif if (cptr) { if (alloc) { /* In python the user should not be able to modify the inner string representation. To warranty that, if you define SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string buffer is always returned. The default behavior is just to return the pointer value, so, be careful. */ #if defined(SWIG_PYTHON_SAFE_CSTRINGS) if (*alloc != SWIG_OLDOBJ) #else if (*alloc == SWIG_NEWOBJ) #endif { *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); *alloc = SWIG_NEWOBJ; } else { *cptr = cstr; *alloc = SWIG_OLDOBJ; } } else { #if PY_VERSION_HEX>=0x03000000 assert(0); /* Should never reach here in Python 3 */ #endif *cptr = SWIG_Python_str_AsChar(obj); } } if (psize) *psize = len + 1; #if PY_VERSION_HEX>=0x03000000 Py_XDECREF(obj); #endif return SWIG_OK; } else { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); if (pchar_descriptor) { void* vptr = 0; if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { if (cptr) *cptr = (char *) vptr; if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; if (alloc) *alloc = SWIG_OLDOBJ; return SWIG_OK; } } } return SWIG_TypeError; } SWIGINTERN int SWIG_AsPtr_std_string (PyObject * obj, std::string **val) { char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) { if (buf) { if (val) *val = new std::string(buf, size - 1); if (alloc == SWIG_NEWOBJ) delete[] buf; return SWIG_NEWOBJ; } else { if (val) *val = 0; return SWIG_OLDOBJ; } } else { static int init = 0; static swig_type_info* descriptor = 0; if (!init) { descriptor = SWIG_TypeQuery("std::string" " *"); init = 1; } if (descriptor) { std::string *vptr; int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0); if (SWIG_IsOK(res) && val) *val = vptr; return res; } } return SWIG_ERROR; } SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char* carray, size_t size) { if (carray) { if (size > INT_MAX) { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); return pchar_descriptor ? SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); } else { #if PY_VERSION_HEX >= 0x03000000 #if PY_VERSION_HEX >= 0x03010000 return PyUnicode_DecodeUTF8(carray, static_cast< int >(size), "surrogateescape"); #else return PyUnicode_FromStringAndSize(carray, static_cast< int >(size)); #endif #else return PyString_FromStringAndSize(carray, static_cast< int >(size)); #endif } } else { return SWIG_Py_Void(); } } SWIGINTERNINLINE PyObject * SWIG_From_std_string (const std::string& s) { return SWIG_FromCharPtrAndSize(s.data(), s.size()); } #include <limits.h> #if !defined(SWIG_NO_LLONG_MAX) # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) # define LLONG_MAX __LONG_LONG_MAX__ # define LLONG_MIN (-LLONG_MAX - 1LL) # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) # endif #endif SWIGINTERN int SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) { unsigned long v; int res = SWIG_AsVal_unsigned_SS_long (obj, &v); if (SWIG_IsOK(res)) { if ((v > USHRT_MAX)) { return SWIG_OverflowError; } else { if (val) *val = static_cast< unsigned short >(v); } } return res; } SWIGINTERN int SWIG_AsCharArray(PyObject * obj, char *val, size_t size) { char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ; int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); if (SWIG_IsOK(res)) { /* special case of single char conversion when we don't need space for NUL */ if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize; if (csize <= size) { if (val) { if (csize) memcpy(val, cptr, csize*sizeof(char)); if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char)); } if (alloc == SWIG_NEWOBJ) { delete[] cptr; res = SWIG_DelNewMask(res); } return res; } if (alloc == SWIG_NEWOBJ) delete[] cptr; } return SWIG_TypeError; } SWIGINTERN int SWIG_AsVal_char (PyObject * obj, char *val) { int res = SWIG_AsCharArray(obj, val, 1); if (!SWIG_IsOK(res)) { long v; res = SWIG_AddCast(SWIG_AsVal_long (obj, &v)); if (SWIG_IsOK(res)) { if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) { if (val) *val = static_cast< char >(v); } else { res = SWIG_OverflowError; } } } return res; } SWIGINTERNINLINE PyObject * SWIG_From_char (char c) { return SWIG_FromCharPtrAndSize(&c,1); } SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_long (unsigned long value) { return (value > LONG_MAX) ? PyLong_FromUnsignedLong(value) : PyLong_FromLong(static_cast< long >(value)); } SWIGINTERNINLINE PyObject * SWIG_From_unsigned_SS_short (unsigned short value) { return SWIG_From_unsigned_SS_long (value); } namespace swig { template <class Type> struct noconst_traits { typedef Type noconst_type; }; template <class Type> struct noconst_traits<const Type> { typedef Type noconst_type; }; /* type categories */ struct pointer_category { }; struct value_category { }; /* General traits that provides type_name and type_info */ template <class Type> struct traits { }; template <class Type> inline const char* type_name() { return traits<typename noconst_traits<Type >::noconst_type >::type_name(); } template <class Type> struct traits_info { static swig_type_info *type_query(std::string name) { name += " *"; return SWIG_TypeQuery(name.c_str()); } static swig_type_info *type_info() { static swig_type_info *info = type_query(type_name<Type>()); return info; } }; template <class Type> inline swig_type_info *type_info() { return traits_info<Type>::type_info(); } /* Partial specialization for pointers */ template <class Type> struct traits <Type *> { typedef pointer_category category; static std::string make_ptr_name(const char* name) { std::string ptrname = name; ptrname += " *"; return ptrname; } static const char* type_name() { static std::string name = make_ptr_name(swig::type_name<Type>()); return name.c_str(); } }; template <class Type, class Category> struct traits_as { }; template <class Type, class Category> struct traits_check { }; } namespace swig { /* Traits that provides the from method */ template <class Type> struct traits_from_ptr { static PyObject *from(Type *val, int owner = 0) { return SWIG_InternalNewPointerObj(val, type_info<Type>(), owner); } }; template <class Type> struct traits_from { static PyObject *from(const Type& val) { return traits_from_ptr<Type>::from(new Type(val), 1); } }; template <class Type> struct traits_from<Type *> { static PyObject *from(Type* val) { return traits_from_ptr<Type>::from(val, 0); } }; template <class Type> struct traits_from<const Type *> { static PyObject *from(const Type* val) { return traits_from_ptr<Type>::from(const_cast<Type*>(val), 0); } }; template <class Type> inline PyObject *from(const Type& val) { return traits_from<Type>::from(val); } template <class Type> inline PyObject *from_ptr(Type* val, int owner) { return traits_from_ptr<Type>::from(val, owner); } /* Traits that provides the asval/as/check method */ template <class Type> struct traits_asptr { static int asptr(PyObject *obj, Type **val) { Type *p; int res = SWIG_ConvertPtr(obj, (void**)&p, type_info<Type>(), 0); if (SWIG_IsOK(res)) { if (val) *val = p; } return res; } }; template <class Type> inline int asptr(PyObject *obj, Type **vptr) { return traits_asptr<Type>::asptr(obj, vptr); } template <class Type> struct traits_asval { static int asval(PyObject *obj, Type *val) { if (val) { Type *p = 0; int res = traits_asptr<Type>::asptr(obj, &p); if (!SWIG_IsOK(res)) return res; if (p) { typedef typename noconst_traits<Type>::noconst_type noconst_type; *(const_cast<noconst_type*>(val)) = *p; if (SWIG_IsNewObj(res)){ delete p; res = SWIG_DelNewMask(res); } return res; } else { return SWIG_ERROR; } } else { return traits_asptr<Type>::asptr(obj, (Type **)(0)); } } }; template <class Type> struct traits_asval<Type*> { static int asval(PyObject *obj, Type **val) { if (val) { typedef typename noconst_traits<Type>::noconst_type noconst_type; noconst_type *p = 0; int res = traits_asptr<noconst_type>::asptr(obj, &p); if (SWIG_IsOK(res)) { *(const_cast<noconst_type**>(val)) = p; } return res; } else { return traits_asptr<Type>::asptr(obj, (Type **)(0)); } } }; template <class Type> inline int asval(PyObject *obj, Type *val) { return traits_asval<Type>::asval(obj, val); } template <class Type> struct traits_as<Type, value_category> { static Type as(PyObject *obj, bool throw_error) { Type v; int res = asval(obj, &v); if (!obj || !SWIG_IsOK(res)) { if (!PyErr_Occurred()) { ::SWIG_Error(SWIG_TypeError, swig::type_name<Type>()); } if (throw_error) throw std::invalid_argument("bad type"); } return v; } }; template <class Type> struct traits_as<Type, pointer_category> { static Type as(PyObject *obj, bool throw_error) { Type *v = 0; int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR); if (SWIG_IsOK(res) && v) { if (SWIG_IsNewObj(res)) { Type r(*v); delete v; return r; } else { return *v; } } else { // Uninitialized return value, no Type() constructor required. static Type *v_def = (Type*) malloc(sizeof(Type)); if (!PyErr_Occurred()) { SWIG_Error(SWIG_TypeError, swig::type_name<Type>()); } if (throw_error) throw std::invalid_argument("bad type"); memset(v_def,0,sizeof(Type)); return *v_def; } } }; template <class Type> struct traits_as<Type*, pointer_category> { static Type* as(PyObject *obj, bool throw_error) { Type *v = 0; int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR); if (SWIG_IsOK(res)) { return v; } else { if (!PyErr_Occurred()) { SWIG_Error(SWIG_TypeError, swig::type_name<Type>()); } if (throw_error) throw std::invalid_argument("bad type"); return 0; } } }; template <class Type> inline Type as(PyObject *obj, bool te = false) { return traits_as<Type, typename traits<Type>::category>::as(obj, te); } template <class Type> struct traits_check<Type, value_category> { static bool check(PyObject *obj) { int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; return SWIG_IsOK(res) ? true : false; } }; template <class Type> struct traits_check<Type, pointer_category> { static bool check(PyObject *obj) { int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; return SWIG_IsOK(res) ? true : false; } }; template <class Type> inline bool check(PyObject *obj) { return traits_check<Type, typename traits<Type>::category>::check(obj); } } #include <functional> namespace std { template <> struct less <PyObject *>: public binary_function<PyObject *, PyObject *, bool> { bool operator()(PyObject * v, PyObject *w) const { bool res; SWIG_PYTHON_THREAD_BEGIN_BLOCK; res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false; /* This may fall into a case of inconsistent eg. ObjA > ObjX > ObjB but ObjA < ObjB */ if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) ) { /* Objects can't be compared, this mostly occurred in Python 3.0 */ /* Compare their ptr directly for a workaround */ res = (v < w); PyErr_Clear(); } SWIG_PYTHON_THREAD_END_BLOCK; return res; } }; template <> struct less <swig::SwigPtr_PyObject>: public binary_function<swig::SwigPtr_PyObject, swig::SwigPtr_PyObject, bool> { bool operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const { return std::less<PyObject *>()(v, w); } }; template <> struct less <swig::SwigVar_PyObject>: public binary_function<swig::SwigVar_PyObject, swig::SwigVar_PyObject, bool> { bool operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const { return std::less<PyObject *>()(v, w); } }; } namespace swig { template <> struct traits<PyObject *> { typedef value_category category; static const char* type_name() { return "PyObject *"; } }; template <> struct traits_asval<PyObject * > { typedef PyObject * value_type; static int asval(PyObject *obj, value_type *val) { if (val) *val = obj; return SWIG_OK; } }; template <> struct traits_check<PyObject *, value_category> { static bool check(PyObject *) { return true; } }; template <> struct traits_from<PyObject *> { typedef PyObject * value_type; static PyObject *from(const value_type& val) { Py_XINCREF(val); return val; } }; } namespace swig { template <class Difference> inline size_t check_index(Difference i, size_t size, bool insert = false) { if ( i < 0 ) { if ((size_t) (-i) <= size) return (size_t) (i + size); } else if ( (size_t) i < size ) { return (size_t) i; } else if (insert && ((size_t) i == size)) { return size; } throw std::out_of_range("index out of range"); } template <class Difference> void slice_adjust(Difference i, Difference j, Py_ssize_t step, size_t size, Difference &ii, Difference &jj, bool insert = false) { if (step == 0) { throw std::invalid_argument("slice step cannot be zero"); } else if (step > 0) { // Required range: 0 <= i < size, 0 <= j < size if (i < 0) { ii = 0; } else if (i < (Difference)size) { ii = i; } else if (insert && (i >= (Difference)size)) { ii = (Difference)size; } if ( j < 0 ) { jj = 0; } else { jj = (j < (Difference)size) ? j : (Difference)size; } } else { // Required range: -1 <= i < size-1, -1 <= j < size-1 if (i < -1) { ii = -1; } else if (i < (Difference) size) { ii = i; } else if (i >= (Difference)(size-1)) { ii = (Difference)(size-1); } if (j < -1) { jj = -1; } else { jj = (j < (Difference)size ) ? j : (Difference)(size-1); } } } template <class Sequence, class Difference> inline typename Sequence::iterator getpos(Sequence* self, Difference i) { typename Sequence::iterator pos = self->begin(); std::advance(pos, check_index(i,self->size())); return pos; } template <class Sequence, class Difference> inline typename Sequence::const_iterator cgetpos(const Sequence* self, Difference i) { typename Sequence::const_iterator pos = self->begin(); std::advance(pos, check_index(i,self->size())); return pos; } template <class Sequence, class Difference> inline Sequence* getslice(const Sequence* self, Difference i, Difference j, Py_ssize_t step) { typename Sequence::size_type size = self->size(); Difference ii = 0; Difference jj = 0; swig::slice_adjust(i, j, step, size, ii, jj); if (step > 0) { typename Sequence::const_iterator sb = self->begin(); typename Sequence::const_iterator se = self->begin(); std::advance(sb,ii); std::advance(se,jj); if (step == 1) { return new Sequence(sb, se); } else { Sequence *sequence = new Sequence(); typename Sequence::const_iterator it = sb; while (it!=se) { sequence->push_back(*it); for (Py_ssize_t c=0; c<step && it!=se; ++c) it++; } return sequence; } } else { Sequence *sequence = new Sequence(); if (ii > jj) { typename Sequence::const_reverse_iterator sb = self->rbegin(); typename Sequence::const_reverse_iterator se = self->rbegin(); std::advance(sb,size-ii-1); std::advance(se,size-jj-1); typename Sequence::const_reverse_iterator it = sb; while (it!=se) { sequence->push_back(*it); for (Py_ssize_t c=0; c<-step && it!=se; ++c) it++; } } return sequence; } } template <class Sequence, class Difference, class InputSeq> inline void setslice(Sequence* self, Difference i, Difference j, Py_ssize_t step, const InputSeq& is = InputSeq()) { typename Sequence::size_type size = self->size(); Difference ii = 0; Difference jj = 0; swig::slice_adjust(i, j, step, size, ii, jj, true); if (step > 0) { if (jj < ii) jj = ii; if (step == 1) { size_t ssize = jj - ii; if (ssize <= is.size()) { // expanding/staying the same size typename Sequence::iterator sb = self->begin(); typename InputSeq::const_iterator isit = is.begin(); std::advance(sb,ii); std::advance(isit, jj - ii); self->insert(std::copy(is.begin(), isit, sb), isit, is.end()); } else { // shrinking typename Sequence::iterator sb = self->begin(); typename Sequence::iterator se = self->begin(); std::advance(sb,ii); std::advance(se,jj); self->erase(sb,se); sb = self->begin(); std::advance(sb,ii); self->insert(sb, is.begin(), is.end()); } } else { size_t replacecount = (jj - ii + step - 1) / step; if (is.size() != replacecount) { char msg[1024]; sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); throw std::invalid_argument(msg); } typename Sequence::const_iterator isit = is.begin(); typename Sequence::iterator it = self->begin(); std::advance(it,ii); for (size_t rc=0; rc<replacecount; ++rc) { *it++ = *isit++; for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) it++; } } } else { if (jj > ii) jj = ii; size_t replacecount = (ii - jj - step - 1) / -step; if (is.size() != replacecount) { char msg[1024]; sprintf(msg, "attempt to assign sequence of size %lu to extended slice of size %lu", (unsigned long)is.size(), (unsigned long)replacecount); throw std::invalid_argument(msg); } typename Sequence::const_iterator isit = is.begin(); typename Sequence::reverse_iterator it = self->rbegin(); std::advance(it,size-ii-1); for (size_t rc=0; rc<replacecount; ++rc) { *it++ = *isit++; for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) it++; } } } template <class Sequence, class Difference> inline void delslice(Sequence* self, Difference i, Difference j, Py_ssize_t step) { typename Sequence::size_type size = self->size(); Difference ii = 0; Difference jj = 0; swig::slice_adjust(i, j, step, size, ii, jj, true); if (step > 0) { if (jj > ii) { typename Sequence::iterator sb = self->begin(); std::advance(sb,ii); if (step == 1) { typename Sequence::iterator se = self->begin(); std::advance(se,jj); self->erase(sb,se); } else { typename Sequence::iterator it = sb; size_t delcount = (jj - ii + step - 1) / step; while (delcount) { it = self->erase(it); for (Py_ssize_t c=0; c<(step-1) && it != self->end(); ++c) it++; delcount--; } } } } else { if (ii > jj) { typename Sequence::reverse_iterator sb = self->rbegin(); std::advance(sb,size-ii-1); typename Sequence::reverse_iterator it = sb; size_t delcount = (ii - jj - step - 1) / -step; while (delcount) { it = typename Sequence::reverse_iterator(self->erase((++it).base())); for (Py_ssize_t c=0; c<(-step-1) && it != self->rend(); ++c) it++; delcount--; } } } } } #if defined(__SUNPRO_CC) && defined(_RWSTD_VER) # if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL) # define SWIG_STD_NOITERATOR_TRAITS_STL # endif #endif #if !defined(SWIG_STD_NOITERATOR_TRAITS_STL) #include <iterator> #else namespace std { template <class Iterator> struct iterator_traits { typedef ptrdiff_t difference_type; typedef typename Iterator::value_type value_type; }; template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance> struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > { typedef Distance difference_type; typedef T value_type; }; template <class T> struct iterator_traits<T*> { typedef T value_type; typedef ptrdiff_t difference_type; }; template<typename _InputIterator> inline typename iterator_traits<_InputIterator>::difference_type distance(_InputIterator __first, _InputIterator __last) { typename iterator_traits<_InputIterator>::difference_type __n = 0; while (__first != __last) { ++__first; ++__n; } return __n; } } #endif namespace swig { template<typename OutIterator> class SwigPyIterator_T : public SwigPyIterator { public: typedef OutIterator out_iterator; typedef typename std::iterator_traits<out_iterator>::value_type value_type; typedef SwigPyIterator_T<out_iterator> self_type; SwigPyIterator_T(out_iterator curr, PyObject *seq) : SwigPyIterator(seq), current(curr) { } const out_iterator& get_current() const { return current; } bool equal (const SwigPyIterator &iter) const { const self_type *iters = dynamic_cast<const self_type *>(&iter); if (iters) { return (current == iters->get_current()); } else { throw std::invalid_argument("bad iterator type"); } } ptrdiff_t distance(const SwigPyIterator &iter) const { const self_type *iters = dynamic_cast<const self_type *>(&iter); if (iters) { return std::distance(current, iters->get_current()); } else { throw std::invalid_argument("bad iterator type"); } } protected: out_iterator current; }; template <class ValueType> struct from_oper { typedef const ValueType& argument_type; typedef PyObject *result_type; result_type operator()(argument_type v) const { return swig::from(v); } }; template<typename OutIterator, typename ValueType = typename std::iterator_traits<OutIterator>::value_type, typename FromOper = from_oper<ValueType> > class SwigPyIteratorOpen_T : public SwigPyIterator_T<OutIterator> { public: FromOper from; typedef OutIterator out_iterator; typedef ValueType value_type; typedef SwigPyIterator_T<out_iterator> base; typedef SwigPyIteratorOpen_T<OutIterator, ValueType, FromOper> self_type; SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq) : SwigPyIterator_T<OutIterator>(curr, seq) { } PyObject *value() const { return from(static_cast<const value_type&>(*(base::current))); } SwigPyIterator *copy() const { return new self_type(*this); } SwigPyIterator *incr(size_t n = 1) { while (n--) { ++base::current; } return this; } SwigPyIterator *decr(size_t n = 1) { while (n--) { --base::current; } return this; } }; template<typename OutIterator, typename ValueType = typename std::iterator_traits<OutIterator>::value_type, typename FromOper = from_oper<ValueType> > class SwigPyIteratorClosed_T : public SwigPyIterator_T<OutIterator> { public: FromOper from; typedef OutIterator out_iterator; typedef ValueType value_type; typedef SwigPyIterator_T<out_iterator> base; typedef SwigPyIteratorClosed_T<OutIterator, ValueType, FromOper> self_type; SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) : SwigPyIterator_T<OutIterator>(curr, seq), begin(first), end(last) { } PyObject *value() const { if (base::current == end) { throw stop_iteration(); } else { return from(static_cast<const value_type&>(*(base::current))); } } SwigPyIterator *copy() const { return new self_type(*this); } SwigPyIterator *incr(size_t n = 1) { while (n--) { if (base::current == end) { throw stop_iteration(); } else { ++base::current; } } return this; } SwigPyIterator *decr(size_t n = 1) { while (n--) { if (base::current == begin) { throw stop_iteration(); } else { --base::current; } } return this; } private: out_iterator begin; out_iterator end; }; template<typename OutIter> inline SwigPyIterator* make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) { return new SwigPyIteratorClosed_T<OutIter>(current, begin, end, seq); } template<typename OutIter> inline SwigPyIterator* make_output_iterator(const OutIter& current, PyObject *seq = 0) { return new SwigPyIteratorOpen_T<OutIter>(current, seq); } } namespace swig { template <class T> struct SwigPySequence_Ref { SwigPySequence_Ref(PyObject* seq, int index) : _seq(seq), _index(index) { } operator T () const { swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index); try { return swig::as<T>(item, true); } catch (std::exception& e) { char msg[1024]; sprintf(msg, "in sequence element %d ", _index); if (!PyErr_Occurred()) { ::SWIG_Error(SWIG_TypeError, swig::type_name<T>()); } SWIG_Python_AddErrorMsg(msg); SWIG_Python_AddErrorMsg(e.what()); throw; } } SwigPySequence_Ref& operator=(const T& v) { PySequence_SetItem(_seq, _index, swig::from<T>(v)); return *this; } private: PyObject* _seq; int _index; }; template <class T> struct SwigPySequence_ArrowProxy { SwigPySequence_ArrowProxy(const T& x): m_value(x) {} const T* operator->() const { return &m_value; } operator const T*() const { return &m_value; } T m_value; }; template <class T, class Reference > struct SwigPySequence_InputIterator { typedef SwigPySequence_InputIterator<T, Reference > self; typedef std::random_access_iterator_tag iterator_category; typedef Reference reference; typedef T value_type; typedef T* pointer; typedef int difference_type; SwigPySequence_InputIterator() { } SwigPySequence_InputIterator(PyObject* seq, int index) : _seq(seq), _index(index) { } reference operator*() const { return reference(_seq, _index); } SwigPySequence_ArrowProxy<T> operator->() const { return SwigPySequence_ArrowProxy<T>(operator*()); } bool operator==(const self& ri) const { return (_index == ri._index) && (_seq == ri._seq); } bool operator!=(const self& ri) const { return !(operator==(ri)); } self& operator ++ () { ++_index; return *this; } self& operator -- () { --_index; return *this; } self& operator += (difference_type n) { _index += n; return *this; } self operator +(difference_type n) const { return self(_seq, _index + n); } self& operator -= (difference_type n) { _index -= n; return *this; } self operator -(difference_type n) const { return self(_seq, _index - n); } difference_type operator - (const self& ri) const { return _index - ri._index; } bool operator < (const self& ri) const { return _index < ri._index; } reference operator[](difference_type n) const { return reference(_seq, _index + n); } private: PyObject* _seq; difference_type _index; }; template <class T> struct SwigPySequence_Cont { typedef SwigPySequence_Ref<T> reference; typedef const SwigPySequence_Ref<T> const_reference; typedef T value_type; typedef T* pointer; typedef int difference_type; typedef int size_type; typedef const pointer const_pointer; typedef SwigPySequence_InputIterator<T, reference> iterator; typedef SwigPySequence_InputIterator<T, const_reference> const_iterator; SwigPySequence_Cont(PyObject* seq) : _seq(0) { if (!PySequence_Check(seq)) { throw std::invalid_argument("a sequence is expected"); } _seq = seq; Py_INCREF(_seq); } ~SwigPySequence_Cont() { Py_XDECREF(_seq); } size_type size() const { return static_cast<size_type>(PySequence_Size(_seq)); } bool empty() const { return size() == 0; } iterator begin() { return iterator(_seq, 0); } const_iterator begin() const { return const_iterator(_seq, 0); } iterator end() { return iterator(_seq, size()); } const_iterator end() const { return const_iterator(_seq, size()); } reference operator[](difference_type n) { return reference(_seq, n); } const_reference operator[](difference_type n) const { return const_reference(_seq, n); } bool check(bool set_err = true) const { int s = size(); for (int i = 0; i < s; ++i) { swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i); if (!swig::check<value_type>(item)) { if (set_err) { char msg[1024]; sprintf(msg, "in sequence element %d", i); SWIG_Error(SWIG_RuntimeError, msg); } return false; } } return true; } private: PyObject* _seq; }; } SWIGINTERN int SWIG_AsVal_std_string (PyObject * obj, std::string *val) { std::string* v = (std::string *) 0; int res = SWIG_AsPtr_std_string (obj, &v); if (!SWIG_IsOK(res)) return res; if (v) { if (val) *val = *v; if (SWIG_IsNewObj(res)) { delete v; res = SWIG_DelNewMask(res); } return res; } return SWIG_ERROR; } namespace swig { template <> struct traits<std::string > { typedef value_category category; static const char* type_name() { return"std::string"; } }; template <> struct traits_asval<std::string > { typedef std::string value_type; static int asval(PyObject *obj, value_type *val) { return SWIG_AsVal_std_string (obj, val); } }; template <> struct traits_from<std::string > { typedef std::string value_type; static PyObject *from(const value_type& val) { return SWIG_From_std_string (val); } }; } namespace swig { template <class SwigPySeq, class Seq> inline void assign(const SwigPySeq& swigpyseq, Seq* seq) { // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented typedef typename SwigPySeq::value_type value_type; typename SwigPySeq::const_iterator it = swigpyseq.begin(); for (;it != swigpyseq.end(); ++it) { seq->insert(seq->end(),(value_type)(*it)); } } template <class Seq, class T = typename Seq::value_type > struct traits_asptr_stdseq { typedef Seq sequence; typedef T value_type; static int asptr(PyObject *obj, sequence **seq) { if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) { sequence *p; if (::SWIG_ConvertPtr(obj,(void**)&p, swig::type_info<sequence>(),0) == SWIG_OK) { if (seq) *seq = p; return SWIG_OLDOBJ; } } else if (PySequence_Check(obj)) { try { SwigPySequence_Cont<value_type> swigpyseq(obj); if (seq) { sequence *pseq = new sequence(); assign(swigpyseq, pseq); *seq = pseq; return SWIG_NEWOBJ; } else { return swigpyseq.check() ? SWIG_OK : SWIG_ERROR; } } catch (std::exception& e) { if (seq) { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, e.what()); } } return SWIG_ERROR; } } return SWIG_ERROR; } }; template <class Seq, class T = typename Seq::value_type > struct traits_from_stdseq { typedef Seq sequence; typedef T value_type; typedef typename Seq::size_type size_type; typedef typename sequence::const_iterator const_iterator; static PyObject *from(const sequence& seq) { #ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS swig_type_info *desc = swig::type_info<sequence>(); if (desc && desc->clientdata) { return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN); } #endif size_type size = seq.size(); if (size <= (size_type)INT_MAX) { PyObject *obj = PyTuple_New((int)size); int i = 0; for (const_iterator it = seq.begin(); it != seq.end(); ++it, ++i) { PyTuple_SetItem(obj,i,swig::from<value_type>(*it)); } return obj; } else { PyErr_SetString(PyExc_OverflowError,"sequence size not valid in python"); return NULL; } } }; } namespace swig { template <class T> struct traits_asptr<std::vector<T> > { static int asptr(PyObject *obj, std::vector<T> **vec) { return traits_asptr_stdseq<std::vector<T> >::asptr(obj, vec); } }; template <class T> struct traits_from<std::vector<T> > { static PyObject *from(const std::vector<T>& vec) { return traits_from_stdseq<std::vector<T> >::from(vec); } }; } namespace swig { template <> struct traits<std::vector<std::string, std::allocator< std::string > > > { typedef pointer_category category; static const char* type_name() { return "std::vector<" "std::string" "," "std::allocator< std::string >" " >"; } }; } SWIGINTERN swig::SwigPyIterator *std_vector_Sl_std_string_Sg__iterator(std::vector< std::string > *self,PyObject **PYTHON_SELF){ return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); } SWIGINTERN bool std_vector_Sl_std_string_Sg____nonzero__(std::vector< std::string > const *self){ return !(self->empty()); } SWIGINTERN bool std_vector_Sl_std_string_Sg____bool__(std::vector< std::string > const *self){ return !(self->empty()); } SWIGINTERN std::vector< std::string >::size_type std_vector_Sl_std_string_Sg____len__(std::vector< std::string > const *self){ return self->size(); } SWIGINTERNINLINE PyObject * SWIG_From_size_t (size_t value) { return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value)); } SWIGINTERN std::vector< std::string >::value_type std_vector_Sl_std_string_Sg__pop(std::vector< std::string > *self){ if (self->size() == 0) throw std::out_of_range("pop from empty container"); std::vector<std::string,std::allocator< std::string > >::value_type x = self->back(); self->pop_back(); return x; } SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg____getslice__(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j){ return swig::getslice(self, i, j, 1); } SWIGINTERN void std_vector_Sl_std_string_Sg____setslice____SWIG_0(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j,std::vector< std::string,std::allocator< std::string > > const &v=std::vector< std::string,std::allocator< std::string > >()){ swig::setslice(self, i, j, 1, v); } SWIGINTERN void std_vector_Sl_std_string_Sg____delslice__(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j){ swig::delslice(self, i, j, 1); } SWIGINTERN void std_vector_Sl_std_string_Sg____delitem____SWIG_0(std::vector< std::string > *self,std::vector< std::string >::difference_type i){ self->erase(swig::getpos(self,i)); } SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg____getitem____SWIG_0(std::vector< std::string > *self,PySliceObject *slice){ Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { SWIG_Error(SWIG_TypeError, "Slice object expected."); return NULL; } PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); std::vector<std::string,std::allocator< std::string > >::difference_type id = i; std::vector<std::string,std::allocator< std::string > >::difference_type jd = j; return swig::getslice(self, id, jd, step); } SWIGINTERN void std_vector_Sl_std_string_Sg____setitem____SWIG_0(std::vector< std::string > *self,PySliceObject *slice,std::vector< std::string,std::allocator< std::string > > const &v){ Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { SWIG_Error(SWIG_TypeError, "Slice object expected."); return; } PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); std::vector<std::string,std::allocator< std::string > >::difference_type id = i; std::vector<std::string,std::allocator< std::string > >::difference_type jd = j; swig::setslice(self, id, jd, step, v); } SWIGINTERN void std_vector_Sl_std_string_Sg____setitem____SWIG_1(std::vector< std::string > *self,PySliceObject *slice){ Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { SWIG_Error(SWIG_TypeError, "Slice object expected."); return; } PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); std::vector<std::string,std::allocator< std::string > >::difference_type id = i; std::vector<std::string,std::allocator< std::string > >::difference_type jd = j; swig::delslice(self, id, jd, step); } SWIGINTERN void std_vector_Sl_std_string_Sg____delitem____SWIG_1(std::vector< std::string > *self,PySliceObject *slice){ Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { SWIG_Error(SWIG_TypeError, "Slice object expected."); return; } PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); std::vector<std::string,std::allocator< std::string > >::difference_type id = i; std::vector<std::string,std::allocator< std::string > >::difference_type jd = j; swig::delslice(self, id, jd, step); } SWIGINTERN std::vector< std::string >::value_type const &std_vector_Sl_std_string_Sg____getitem____SWIG_1(std::vector< std::string > const *self,std::vector< std::string >::difference_type i){ return *(swig::cgetpos(self, i)); } SWIGINTERN void std_vector_Sl_std_string_Sg____setitem____SWIG_2(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::value_type const &x){ *(swig::getpos(self,i)) = x; } SWIGINTERN void std_vector_Sl_std_string_Sg__append(std::vector< std::string > *self,std::vector< std::string >::value_type const &x){ self->push_back(x); } SWIGINTERN std::vector< std::string >::iterator std_vector_Sl_std_string_Sg__erase__SWIG_0(std::vector< std::string > *self,std::vector< std::string >::iterator pos){ return self->erase(pos); } SWIGINTERN std::vector< std::string >::iterator std_vector_Sl_std_string_Sg__erase__SWIG_1(std::vector< std::string > *self,std::vector< std::string >::iterator first,std::vector< std::string >::iterator last){ return self->erase(first, last); } SWIGINTERN std::vector< std::string >::iterator std_vector_Sl_std_string_Sg__insert__SWIG_0(std::vector< std::string > *self,std::vector< std::string >::iterator pos,std::vector< std::string >::value_type const &x){ return self->insert(pos, x); } SWIGINTERN void std_vector_Sl_std_string_Sg__insert__SWIG_1(std::vector< std::string > *self,std::vector< std::string >::iterator pos,std::vector< std::string >::size_type n,std::vector< std::string >::value_type const &x){ self->insert(pos, n, x); } #ifdef __cplusplus extern "C" { #endif SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:delete_SwigPyIterator",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_value",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_value" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value(); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = result; return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_incr",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_incr" "', argument " "2"" of type '" "size_t""'"); } arg2 = static_cast< size_t >(val2); try { result = (swig::SwigPyIterator *)(arg1)->incr(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_incr",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { result = (swig::SwigPyIterator *)(arg1)->incr(); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_SwigPyIterator_incr__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_size_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_SwigPyIterator_incr__SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_incr'.\n" " Possible C/C++ prototypes are:\n" " swig::SwigPyIterator::incr(size_t)\n" " swig::SwigPyIterator::incr()\n"); return 0; } SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_decr",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_decr" "', argument " "2"" of type '" "size_t""'"); } arg2 = static_cast< size_t >(val2); try { result = (swig::SwigPyIterator *)(arg1)->decr(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_decr",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { result = (swig::SwigPyIterator *)(arg1)->decr(); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_SwigPyIterator_decr__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_size_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_SwigPyIterator_decr__SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_decr'.\n" " Possible C/C++ prototypes are:\n" " swig::SwigPyIterator::decr(size_t)\n" " swig::SwigPyIterator::decr()\n"); return 0; } SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; ptrdiff_t result; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_distance",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_distance" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); try { result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2); } catch(std::invalid_argument &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail; } resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; bool result; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_equal",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_equal" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); try { result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2); } catch(std::invalid_argument &_e) { SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail; } resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_copy",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_copy" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->copy(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_next",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_next" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { result = (PyObject *)(arg1)->next(); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = result; return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator___next__",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___next__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { result = (PyObject *)(arg1)->__next__(); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = result; return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_previous",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_previous" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); try { result = (PyObject *)(arg1)->previous(); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = result; return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_advance",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_advance" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { result = (swig::SwigPyIterator *)(arg1)->advance(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; bool result; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___eq__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___eq__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); result = (bool)((swig::SwigPyIterator const *)arg1)->operator ==((swig::SwigPyIterator const &)*arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; bool result; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___ne__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___ne__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); result = (bool)((swig::SwigPyIterator const *)arg1)->operator !=((swig::SwigPyIterator const &)*arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___iadd__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___iadd__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___isub__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___isub__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___add__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___add__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; ptrdiff_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; swig::SwigPyIterator *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'"); } arg2 = static_cast< ptrdiff_t >(val2); try { result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2); } catch(swig::stop_iteration &_e) { { (void)_e; SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); SWIG_fail; } } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ; swig::SwigPyIterator *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; ptrdiff_t result; if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); } arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } if (!argp2) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); } arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2); result = ((swig::SwigPyIterator const *)arg1)->operator -((swig::SwigPyIterator const &)*arg2); resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_SwigPyIterator___sub____SWIG_1(self, args); } } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_SwigPyIterator___sub____SWIG_0(self, args); } } } fail: Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_swig__SwigPyIterator, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } SWIGINTERN PyObject *_wrap_WordProcessingCompiler_getInstance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingCompiler *result = 0 ; if (!PyArg_ParseTuple(args,(char *)":WordProcessingCompiler_getInstance")) SWIG_fail; result = (DocxFactory::WordProcessingCompiler *) &DocxFactory::WordProcessingCompiler::getInstance(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DocxFactory__WordProcessingCompiler, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_delete_WordProcessingCompiler(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingCompiler *arg1 = (DocxFactory::WordProcessingCompiler *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:delete_WordProcessingCompiler",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingCompiler, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WordProcessingCompiler" "', argument " "1"" of type '" "DocxFactory::WordProcessingCompiler *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingCompiler * >(argp1); delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingCompiler_compile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingCompiler *arg1 = (DocxFactory::WordProcessingCompiler *) 0 ; std::string *arg2 = 0 ; std::string *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; int res3 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:WordProcessingCompiler_compile",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingCompiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingCompiler_compile" "', argument " "1"" of type '" "DocxFactory::WordProcessingCompiler *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingCompiler * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingCompiler_compile" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingCompiler_compile" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "WordProcessingCompiler_compile" "', argument " "3"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingCompiler_compile" "', argument " "3"" of type '" "std::string const &""'"); } arg3 = ptr; } (arg1)->compile((std::string const &)*arg2,(std::string const &)*arg3); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingCompiler_setTempDir__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingCompiler *arg1 = (DocxFactory::WordProcessingCompiler *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingCompiler_setTempDir",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingCompiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingCompiler_setTempDir" "', argument " "1"" of type '" "DocxFactory::WordProcessingCompiler *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingCompiler * >(argp1); (arg1)->setTempDir(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingCompiler_setTempDir__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingCompiler *arg1 = (DocxFactory::WordProcessingCompiler *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingCompiler_setTempDir",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingCompiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingCompiler_setTempDir" "', argument " "1"" of type '" "DocxFactory::WordProcessingCompiler *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingCompiler * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingCompiler_setTempDir" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingCompiler_setTempDir" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } (arg1)->setTempDir((std::string const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingCompiler_setTempDir(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingCompiler, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingCompiler_setTempDir__SWIG_0(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingCompiler, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingCompiler_setTempDir__SWIG_1(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingCompiler_setTempDir'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingCompiler::setTempDir()\n" " DocxFactory::WordProcessingCompiler::setTempDir(std::string const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingCompiler_getWorkDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingCompiler *arg1 = (DocxFactory::WordProcessingCompiler *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingCompiler_getWorkDir",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingCompiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingCompiler_getWorkDir" "', argument " "1"" of type '" "DocxFactory::WordProcessingCompiler const *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingCompiler * >(argp1); result = ((DocxFactory::WordProcessingCompiler const *)arg1)->getWorkDir(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingCompiler_getTempDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingCompiler *arg1 = (DocxFactory::WordProcessingCompiler *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingCompiler_getTempDir",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingCompiler, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingCompiler_getTempDir" "', argument " "1"" of type '" "DocxFactory::WordProcessingCompiler const *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingCompiler * >(argp1); result = ((DocxFactory::WordProcessingCompiler const *)arg1)->getTempDir(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *WordProcessingCompiler_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_DocxFactory__WordProcessingCompiler, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getInstance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *result = 0 ; if (!PyArg_ParseTuple(args,(char *)":WordProcessingMerger_getInstance")) SWIG_fail; result = (DocxFactory::WordProcessingMerger *) &DocxFactory::WordProcessingMerger::getInstance(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_delete_WordProcessingMerger(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:delete_WordProcessingMerger",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WordProcessingMerger" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_load(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_load",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_load" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_load" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_load" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } (arg1)->load((std::string const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_save__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_save",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_save" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_save" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_save" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } (arg1)->save((std::string const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_save__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_save",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_save" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->save(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_save(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_save__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_save__SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_save'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::save(std::string const &)\n" " DocxFactory::WordProcessingMerger::save()\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger__print__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; unsigned short arg3 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; unsigned short val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:WordProcessingMerger__print",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger__print" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger__print" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger__print" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } ecode3 = SWIG_AsVal_unsigned_SS_short(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "WordProcessingMerger__print" "', argument " "3"" of type '" "unsigned short""'"); } arg3 = static_cast< unsigned short >(val3); (arg1)->print((std::string const &)*arg2,arg3); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger__print__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger__print",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger__print" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger__print" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger__print" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } (arg1)->print((std::string const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger__print(PyObject *self, PyObject *args) { int argc; PyObject *argv[4]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 3) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger__print__SWIG_1(self, args); } } } if (argc == 3) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_unsigned_SS_short(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_WordProcessingMerger__print__SWIG_0(self, args); } } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger__print'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::print(std::string const &,unsigned short)\n" " DocxFactory::WordProcessingMerger::print(std::string const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setClipboardValue__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; std::string *arg3 = 0 ; std::string *arg4 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; int res3 = SWIG_OLDOBJ ; int res4 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOO:WordProcessingMerger_setClipboardValue",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "3"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "3"" of type '" "std::string const &""'"); } arg3 = ptr; } { std::string *ptr = (std::string *)0; res4 = SWIG_AsPtr_std_string(obj3, &ptr); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "4"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "4"" of type '" "std::string const &""'"); } arg4 = ptr; } (arg1)->setClipboardValue((std::string const &)*arg2,(std::string const &)*arg3,(std::string const &)*arg4); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setClipboardValue__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; std::string *arg3 = 0 ; double arg4 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; int res3 = SWIG_OLDOBJ ; double val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOO:WordProcessingMerger_setClipboardValue",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "3"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "3"" of type '" "std::string const &""'"); } arg3 = ptr; } ecode4 = SWIG_AsVal_double(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "WordProcessingMerger_setClipboardValue" "', argument " "4"" of type '" "double""'"); } arg4 = static_cast< double >(val4); (arg1)->setClipboardValue((std::string const &)*arg2,(std::string const &)*arg3,arg4); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setClipboardValue(PyObject *self, PyObject *args) { int argc; PyObject *argv[5]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 4) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 4) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_double(argv[3], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_WordProcessingMerger_setClipboardValue__SWIG_1(self, args); } } } } } if (argc == 4) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setClipboardValue__SWIG_0(self, args); } } } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setClipboardValue'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setClipboardValue(std::string const &,std::string const &,std::string const &)\n" " DocxFactory::WordProcessingMerger::setClipboardValue(std::string const &,std::string const &,double)\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_paste__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_paste",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_paste" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_paste" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_paste" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } (arg1)->paste((std::string const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_paste__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_paste",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_paste" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->paste(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_paste(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_paste__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_paste__SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_paste'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::paste(std::string const &)\n" " DocxFactory::WordProcessingMerger::paste()\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getFields(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getFields",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getFields" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger const *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = ((DocxFactory::WordProcessingMerger const *)arg1)->getFields(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getItems(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getItems",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getItems" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger const *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = ((DocxFactory::WordProcessingMerger const *)arg1)->getItems(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getItemParent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_getItemParent",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getItemParent" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger const *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_getItemParent" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_getItemParent" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } result = ((DocxFactory::WordProcessingMerger const *)arg1)->getItemParent((std::string const &)*arg2); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getItemFields(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_getItemFields",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getItemFields" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger const *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_getItemFields" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_getItemFields" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } result = ((DocxFactory::WordProcessingMerger const *)arg1)->getItemFields((std::string const &)*arg2); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setCodePage__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_setCodePage",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setCodePage" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->setCodePage(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setCodePage__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_setCodePage",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setCodePage" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_setCodePage" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setCodePage" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } (arg1)->setCodePage((std::string const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setCodePage(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setCodePage__SWIG_0(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setCodePage__SWIG_1(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setCodePage'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setCodePage()\n" " DocxFactory::WordProcessingMerger::setCodePage(std::string const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setNumFracSep__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; char arg2 ; void *argp1 = 0 ; int res1 = 0 ; char val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_setNumFracSep",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setNumFracSep" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); ecode2 = SWIG_AsVal_char(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WordProcessingMerger_setNumFracSep" "', argument " "2"" of type '" "char""'"); } arg2 = static_cast< char >(val2); (arg1)->setNumFracSep(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setNumFracSep__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_setNumFracSep",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setNumFracSep" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->setNumFracSep(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setNumFracSep(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setNumFracSep__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_char(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_WordProcessingMerger_setNumFracSep__SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setNumFracSep'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setNumFracSep(char)\n" " DocxFactory::WordProcessingMerger::setNumFracSep()\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setNumThSep__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; char arg2 ; void *argp1 = 0 ; int res1 = 0 ; char val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_setNumThSep",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setNumThSep" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); ecode2 = SWIG_AsVal_char(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WordProcessingMerger_setNumThSep" "', argument " "2"" of type '" "char""'"); } arg2 = static_cast< char >(val2); (arg1)->setNumThSep(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setNumThSep__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_setNumThSep",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setNumThSep" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->setNumThSep(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setNumThSep(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setNumThSep__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_char(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_WordProcessingMerger_setNumThSep__SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setNumThSep'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setNumThSep(char)\n" " DocxFactory::WordProcessingMerger::setNumThSep()\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setDateFormat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_setDateFormat",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setDateFormat" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_setDateFormat" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setDateFormat" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } (arg1)->setDateFormat((std::string const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setDateFormat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_setDateFormat",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setDateFormat" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->setDateFormat(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setDateFormat(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setDateFormat__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setDateFormat__SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setDateFormat'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setDateFormat(std::string const &)\n" " DocxFactory::WordProcessingMerger::setDateFormat()\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setYearOffset__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; unsigned short arg2 ; void *argp1 = 0 ; int res1 = 0 ; unsigned short val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_setYearOffset",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setYearOffset" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WordProcessingMerger_setYearOffset" "', argument " "2"" of type '" "unsigned short""'"); } arg2 = static_cast< unsigned short >(val2); (arg1)->setYearOffset(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setYearOffset__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_setYearOffset",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setYearOffset" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->setYearOffset(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setYearOffset(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setYearOffset__SWIG_1(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_WordProcessingMerger_setYearOffset__SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setYearOffset'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setYearOffset(unsigned short)\n" " DocxFactory::WordProcessingMerger::setYearOffset()\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setFirstWeekDay__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_setFirstWeekDay",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setFirstWeekDay" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->setFirstWeekDay(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setFirstWeekDay__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; unsigned short arg2 ; void *argp1 = 0 ; int res1 = 0 ; unsigned short val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_setFirstWeekDay",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setFirstWeekDay" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WordProcessingMerger_setFirstWeekDay" "', argument " "2"" of type '" "unsigned short""'"); } arg2 = static_cast< unsigned short >(val2); (arg1)->setFirstWeekDay(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setFirstWeekDay(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setFirstWeekDay__SWIG_0(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_unsigned_SS_short(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_WordProcessingMerger_setFirstWeekDay__SWIG_1(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setFirstWeekDay'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setFirstWeekDay()\n" " DocxFactory::WordProcessingMerger::setFirstWeekDay(unsigned short)\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setWeekDayNames__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_setWeekDayNames",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->setWeekDayNames(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setWeekDayNames__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; std::string *arg3 = 0 ; std::string *arg4 = 0 ; std::string *arg5 = 0 ; std::string *arg6 = 0 ; std::string *arg7 = 0 ; std::string *arg8 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; int res3 = SWIG_OLDOBJ ; int res4 = SWIG_OLDOBJ ; int res5 = SWIG_OLDOBJ ; int res6 = SWIG_OLDOBJ ; int res7 = SWIG_OLDOBJ ; int res8 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:WordProcessingMerger_setWeekDayNames",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "3"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "3"" of type '" "std::string const &""'"); } arg3 = ptr; } { std::string *ptr = (std::string *)0; res4 = SWIG_AsPtr_std_string(obj3, &ptr); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "4"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "4"" of type '" "std::string const &""'"); } arg4 = ptr; } { std::string *ptr = (std::string *)0; res5 = SWIG_AsPtr_std_string(obj4, &ptr); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "5"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "5"" of type '" "std::string const &""'"); } arg5 = ptr; } { std::string *ptr = (std::string *)0; res6 = SWIG_AsPtr_std_string(obj5, &ptr); if (!SWIG_IsOK(res6)) { SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "6"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "6"" of type '" "std::string const &""'"); } arg6 = ptr; } { std::string *ptr = (std::string *)0; res7 = SWIG_AsPtr_std_string(obj6, &ptr); if (!SWIG_IsOK(res7)) { SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "7"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "7"" of type '" "std::string const &""'"); } arg7 = ptr; } { std::string *ptr = (std::string *)0; res8 = SWIG_AsPtr_std_string(obj7, &ptr); if (!SWIG_IsOK(res8)) { SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "8"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "8"" of type '" "std::string const &""'"); } arg8 = ptr; } (arg1)->setWeekDayNames((std::string const &)*arg2,(std::string const &)*arg3,(std::string const &)*arg4,(std::string const &)*arg5,(std::string const &)*arg6,(std::string const &)*arg7,(std::string const &)*arg8); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; if (SWIG_IsNewObj(res5)) delete arg5; if (SWIG_IsNewObj(res6)) delete arg6; if (SWIG_IsNewObj(res7)) delete arg7; if (SWIG_IsNewObj(res8)) delete arg8; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; if (SWIG_IsNewObj(res5)) delete arg5; if (SWIG_IsNewObj(res6)) delete arg6; if (SWIG_IsNewObj(res7)) delete arg7; if (SWIG_IsNewObj(res8)) delete arg8; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setWeekDayNames__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; std::string *arg3 = 0 ; std::string *arg4 = 0 ; std::string *arg5 = 0 ; std::string *arg6 = 0 ; std::string *arg7 = 0 ; std::string *arg8 = 0 ; std::string *arg9 = 0 ; std::string *arg10 = 0 ; std::string *arg11 = 0 ; std::string *arg12 = 0 ; std::string *arg13 = 0 ; std::string *arg14 = 0 ; std::string *arg15 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; int res3 = SWIG_OLDOBJ ; int res4 = SWIG_OLDOBJ ; int res5 = SWIG_OLDOBJ ; int res6 = SWIG_OLDOBJ ; int res7 = SWIG_OLDOBJ ; int res8 = SWIG_OLDOBJ ; int res9 = SWIG_OLDOBJ ; int res10 = SWIG_OLDOBJ ; int res11 = SWIG_OLDOBJ ; int res12 = SWIG_OLDOBJ ; int res13 = SWIG_OLDOBJ ; int res14 = SWIG_OLDOBJ ; int res15 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; PyObject * obj11 = 0 ; PyObject * obj12 = 0 ; PyObject * obj13 = 0 ; PyObject * obj14 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOOOO:WordProcessingMerger_setWeekDayNames",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13,&obj14)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "3"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "3"" of type '" "std::string const &""'"); } arg3 = ptr; } { std::string *ptr = (std::string *)0; res4 = SWIG_AsPtr_std_string(obj3, &ptr); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "4"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "4"" of type '" "std::string const &""'"); } arg4 = ptr; } { std::string *ptr = (std::string *)0; res5 = SWIG_AsPtr_std_string(obj4, &ptr); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "5"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "5"" of type '" "std::string const &""'"); } arg5 = ptr; } { std::string *ptr = (std::string *)0; res6 = SWIG_AsPtr_std_string(obj5, &ptr); if (!SWIG_IsOK(res6)) { SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "6"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "6"" of type '" "std::string const &""'"); } arg6 = ptr; } { std::string *ptr = (std::string *)0; res7 = SWIG_AsPtr_std_string(obj6, &ptr); if (!SWIG_IsOK(res7)) { SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "7"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "7"" of type '" "std::string const &""'"); } arg7 = ptr; } { std::string *ptr = (std::string *)0; res8 = SWIG_AsPtr_std_string(obj7, &ptr); if (!SWIG_IsOK(res8)) { SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "8"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "8"" of type '" "std::string const &""'"); } arg8 = ptr; } { std::string *ptr = (std::string *)0; res9 = SWIG_AsPtr_std_string(obj8, &ptr); if (!SWIG_IsOK(res9)) { SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "9"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "9"" of type '" "std::string const &""'"); } arg9 = ptr; } { std::string *ptr = (std::string *)0; res10 = SWIG_AsPtr_std_string(obj9, &ptr); if (!SWIG_IsOK(res10)) { SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "10"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "10"" of type '" "std::string const &""'"); } arg10 = ptr; } { std::string *ptr = (std::string *)0; res11 = SWIG_AsPtr_std_string(obj10, &ptr); if (!SWIG_IsOK(res11)) { SWIG_exception_fail(SWIG_ArgError(res11), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "11"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "11"" of type '" "std::string const &""'"); } arg11 = ptr; } { std::string *ptr = (std::string *)0; res12 = SWIG_AsPtr_std_string(obj11, &ptr); if (!SWIG_IsOK(res12)) { SWIG_exception_fail(SWIG_ArgError(res12), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "12"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "12"" of type '" "std::string const &""'"); } arg12 = ptr; } { std::string *ptr = (std::string *)0; res13 = SWIG_AsPtr_std_string(obj12, &ptr); if (!SWIG_IsOK(res13)) { SWIG_exception_fail(SWIG_ArgError(res13), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "13"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "13"" of type '" "std::string const &""'"); } arg13 = ptr; } { std::string *ptr = (std::string *)0; res14 = SWIG_AsPtr_std_string(obj13, &ptr); if (!SWIG_IsOK(res14)) { SWIG_exception_fail(SWIG_ArgError(res14), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "14"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "14"" of type '" "std::string const &""'"); } arg14 = ptr; } { std::string *ptr = (std::string *)0; res15 = SWIG_AsPtr_std_string(obj14, &ptr); if (!SWIG_IsOK(res15)) { SWIG_exception_fail(SWIG_ArgError(res15), "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "15"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setWeekDayNames" "', argument " "15"" of type '" "std::string const &""'"); } arg15 = ptr; } (arg1)->setWeekDayNames((std::string const &)*arg2,(std::string const &)*arg3,(std::string const &)*arg4,(std::string const &)*arg5,(std::string const &)*arg6,(std::string const &)*arg7,(std::string const &)*arg8,(std::string const &)*arg9,(std::string const &)*arg10,(std::string const &)*arg11,(std::string const &)*arg12,(std::string const &)*arg13,(std::string const &)*arg14,(std::string const &)*arg15); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; if (SWIG_IsNewObj(res5)) delete arg5; if (SWIG_IsNewObj(res6)) delete arg6; if (SWIG_IsNewObj(res7)) delete arg7; if (SWIG_IsNewObj(res8)) delete arg8; if (SWIG_IsNewObj(res9)) delete arg9; if (SWIG_IsNewObj(res10)) delete arg10; if (SWIG_IsNewObj(res11)) delete arg11; if (SWIG_IsNewObj(res12)) delete arg12; if (SWIG_IsNewObj(res13)) delete arg13; if (SWIG_IsNewObj(res14)) delete arg14; if (SWIG_IsNewObj(res15)) delete arg15; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; if (SWIG_IsNewObj(res5)) delete arg5; if (SWIG_IsNewObj(res6)) delete arg6; if (SWIG_IsNewObj(res7)) delete arg7; if (SWIG_IsNewObj(res8)) delete arg8; if (SWIG_IsNewObj(res9)) delete arg9; if (SWIG_IsNewObj(res10)) delete arg10; if (SWIG_IsNewObj(res11)) delete arg11; if (SWIG_IsNewObj(res12)) delete arg12; if (SWIG_IsNewObj(res13)) delete arg13; if (SWIG_IsNewObj(res14)) delete arg14; if (SWIG_IsNewObj(res15)) delete arg15; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setWeekDayNames(PyObject *self, PyObject *args) { int argc; PyObject *argv[16]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 15) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setWeekDayNames__SWIG_0(self, args); } } if (argc == 8) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[4], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[5], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[6], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[7], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setWeekDayNames__SWIG_1(self, args); } } } } } } } } } if (argc == 15) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[4], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[5], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[6], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[7], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[8], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[9], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[10], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[11], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[12], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[13], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[14], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setWeekDayNames__SWIG_2(self, args); } } } } } } } } } } } } } } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setWeekDayNames'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setWeekDayNames()\n" " DocxFactory::WordProcessingMerger::setWeekDayNames(std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &)\n" " DocxFactory::WordProcessingMerger::setWeekDayNames(std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setMonthNames__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_setMonthNames",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->setMonthNames(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setMonthNames__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; std::string *arg3 = 0 ; std::string *arg4 = 0 ; std::string *arg5 = 0 ; std::string *arg6 = 0 ; std::string *arg7 = 0 ; std::string *arg8 = 0 ; std::string *arg9 = 0 ; std::string *arg10 = 0 ; std::string *arg11 = 0 ; std::string *arg12 = 0 ; std::string *arg13 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; int res3 = SWIG_OLDOBJ ; int res4 = SWIG_OLDOBJ ; int res5 = SWIG_OLDOBJ ; int res6 = SWIG_OLDOBJ ; int res7 = SWIG_OLDOBJ ; int res8 = SWIG_OLDOBJ ; int res9 = SWIG_OLDOBJ ; int res10 = SWIG_OLDOBJ ; int res11 = SWIG_OLDOBJ ; int res12 = SWIG_OLDOBJ ; int res13 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; PyObject * obj11 = 0 ; PyObject * obj12 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOO:WordProcessingMerger_setMonthNames",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "3"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "3"" of type '" "std::string const &""'"); } arg3 = ptr; } { std::string *ptr = (std::string *)0; res4 = SWIG_AsPtr_std_string(obj3, &ptr); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "4"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "4"" of type '" "std::string const &""'"); } arg4 = ptr; } { std::string *ptr = (std::string *)0; res5 = SWIG_AsPtr_std_string(obj4, &ptr); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "5"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "5"" of type '" "std::string const &""'"); } arg5 = ptr; } { std::string *ptr = (std::string *)0; res6 = SWIG_AsPtr_std_string(obj5, &ptr); if (!SWIG_IsOK(res6)) { SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "6"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "6"" of type '" "std::string const &""'"); } arg6 = ptr; } { std::string *ptr = (std::string *)0; res7 = SWIG_AsPtr_std_string(obj6, &ptr); if (!SWIG_IsOK(res7)) { SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "7"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "7"" of type '" "std::string const &""'"); } arg7 = ptr; } { std::string *ptr = (std::string *)0; res8 = SWIG_AsPtr_std_string(obj7, &ptr); if (!SWIG_IsOK(res8)) { SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "8"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "8"" of type '" "std::string const &""'"); } arg8 = ptr; } { std::string *ptr = (std::string *)0; res9 = SWIG_AsPtr_std_string(obj8, &ptr); if (!SWIG_IsOK(res9)) { SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "9"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "9"" of type '" "std::string const &""'"); } arg9 = ptr; } { std::string *ptr = (std::string *)0; res10 = SWIG_AsPtr_std_string(obj9, &ptr); if (!SWIG_IsOK(res10)) { SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "10"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "10"" of type '" "std::string const &""'"); } arg10 = ptr; } { std::string *ptr = (std::string *)0; res11 = SWIG_AsPtr_std_string(obj10, &ptr); if (!SWIG_IsOK(res11)) { SWIG_exception_fail(SWIG_ArgError(res11), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "11"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "11"" of type '" "std::string const &""'"); } arg11 = ptr; } { std::string *ptr = (std::string *)0; res12 = SWIG_AsPtr_std_string(obj11, &ptr); if (!SWIG_IsOK(res12)) { SWIG_exception_fail(SWIG_ArgError(res12), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "12"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "12"" of type '" "std::string const &""'"); } arg12 = ptr; } { std::string *ptr = (std::string *)0; res13 = SWIG_AsPtr_std_string(obj12, &ptr); if (!SWIG_IsOK(res13)) { SWIG_exception_fail(SWIG_ArgError(res13), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "13"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "13"" of type '" "std::string const &""'"); } arg13 = ptr; } (arg1)->setMonthNames((std::string const &)*arg2,(std::string const &)*arg3,(std::string const &)*arg4,(std::string const &)*arg5,(std::string const &)*arg6,(std::string const &)*arg7,(std::string const &)*arg8,(std::string const &)*arg9,(std::string const &)*arg10,(std::string const &)*arg11,(std::string const &)*arg12,(std::string const &)*arg13); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; if (SWIG_IsNewObj(res5)) delete arg5; if (SWIG_IsNewObj(res6)) delete arg6; if (SWIG_IsNewObj(res7)) delete arg7; if (SWIG_IsNewObj(res8)) delete arg8; if (SWIG_IsNewObj(res9)) delete arg9; if (SWIG_IsNewObj(res10)) delete arg10; if (SWIG_IsNewObj(res11)) delete arg11; if (SWIG_IsNewObj(res12)) delete arg12; if (SWIG_IsNewObj(res13)) delete arg13; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; if (SWIG_IsNewObj(res5)) delete arg5; if (SWIG_IsNewObj(res6)) delete arg6; if (SWIG_IsNewObj(res7)) delete arg7; if (SWIG_IsNewObj(res8)) delete arg8; if (SWIG_IsNewObj(res9)) delete arg9; if (SWIG_IsNewObj(res10)) delete arg10; if (SWIG_IsNewObj(res11)) delete arg11; if (SWIG_IsNewObj(res12)) delete arg12; if (SWIG_IsNewObj(res13)) delete arg13; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setMonthNames__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; std::string *arg3 = 0 ; std::string *arg4 = 0 ; std::string *arg5 = 0 ; std::string *arg6 = 0 ; std::string *arg7 = 0 ; std::string *arg8 = 0 ; std::string *arg9 = 0 ; std::string *arg10 = 0 ; std::string *arg11 = 0 ; std::string *arg12 = 0 ; std::string *arg13 = 0 ; std::string *arg14 = 0 ; std::string *arg15 = 0 ; std::string *arg16 = 0 ; std::string *arg17 = 0 ; std::string *arg18 = 0 ; std::string *arg19 = 0 ; std::string *arg20 = 0 ; std::string *arg21 = 0 ; std::string *arg22 = 0 ; std::string *arg23 = 0 ; std::string *arg24 = 0 ; std::string *arg25 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; int res3 = SWIG_OLDOBJ ; int res4 = SWIG_OLDOBJ ; int res5 = SWIG_OLDOBJ ; int res6 = SWIG_OLDOBJ ; int res7 = SWIG_OLDOBJ ; int res8 = SWIG_OLDOBJ ; int res9 = SWIG_OLDOBJ ; int res10 = SWIG_OLDOBJ ; int res11 = SWIG_OLDOBJ ; int res12 = SWIG_OLDOBJ ; int res13 = SWIG_OLDOBJ ; int res14 = SWIG_OLDOBJ ; int res15 = SWIG_OLDOBJ ; int res16 = SWIG_OLDOBJ ; int res17 = SWIG_OLDOBJ ; int res18 = SWIG_OLDOBJ ; int res19 = SWIG_OLDOBJ ; int res20 = SWIG_OLDOBJ ; int res21 = SWIG_OLDOBJ ; int res22 = SWIG_OLDOBJ ; int res23 = SWIG_OLDOBJ ; int res24 = SWIG_OLDOBJ ; int res25 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; PyObject * obj7 = 0 ; PyObject * obj8 = 0 ; PyObject * obj9 = 0 ; PyObject * obj10 = 0 ; PyObject * obj11 = 0 ; PyObject * obj12 = 0 ; PyObject * obj13 = 0 ; PyObject * obj14 = 0 ; PyObject * obj15 = 0 ; PyObject * obj16 = 0 ; PyObject * obj17 = 0 ; PyObject * obj18 = 0 ; PyObject * obj19 = 0 ; PyObject * obj20 = 0 ; PyObject * obj21 = 0 ; PyObject * obj22 = 0 ; PyObject * obj23 = 0 ; PyObject * obj24 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOOOOOOOOOOOOOO:WordProcessingMerger_setMonthNames",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13,&obj14,&obj15,&obj16,&obj17,&obj18,&obj19,&obj20,&obj21,&obj22,&obj23,&obj24)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "3"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "3"" of type '" "std::string const &""'"); } arg3 = ptr; } { std::string *ptr = (std::string *)0; res4 = SWIG_AsPtr_std_string(obj3, &ptr); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "4"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "4"" of type '" "std::string const &""'"); } arg4 = ptr; } { std::string *ptr = (std::string *)0; res5 = SWIG_AsPtr_std_string(obj4, &ptr); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "5"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "5"" of type '" "std::string const &""'"); } arg5 = ptr; } { std::string *ptr = (std::string *)0; res6 = SWIG_AsPtr_std_string(obj5, &ptr); if (!SWIG_IsOK(res6)) { SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "6"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "6"" of type '" "std::string const &""'"); } arg6 = ptr; } { std::string *ptr = (std::string *)0; res7 = SWIG_AsPtr_std_string(obj6, &ptr); if (!SWIG_IsOK(res7)) { SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "7"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "7"" of type '" "std::string const &""'"); } arg7 = ptr; } { std::string *ptr = (std::string *)0; res8 = SWIG_AsPtr_std_string(obj7, &ptr); if (!SWIG_IsOK(res8)) { SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "8"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "8"" of type '" "std::string const &""'"); } arg8 = ptr; } { std::string *ptr = (std::string *)0; res9 = SWIG_AsPtr_std_string(obj8, &ptr); if (!SWIG_IsOK(res9)) { SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "9"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "9"" of type '" "std::string const &""'"); } arg9 = ptr; } { std::string *ptr = (std::string *)0; res10 = SWIG_AsPtr_std_string(obj9, &ptr); if (!SWIG_IsOK(res10)) { SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "10"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "10"" of type '" "std::string const &""'"); } arg10 = ptr; } { std::string *ptr = (std::string *)0; res11 = SWIG_AsPtr_std_string(obj10, &ptr); if (!SWIG_IsOK(res11)) { SWIG_exception_fail(SWIG_ArgError(res11), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "11"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "11"" of type '" "std::string const &""'"); } arg11 = ptr; } { std::string *ptr = (std::string *)0; res12 = SWIG_AsPtr_std_string(obj11, &ptr); if (!SWIG_IsOK(res12)) { SWIG_exception_fail(SWIG_ArgError(res12), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "12"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "12"" of type '" "std::string const &""'"); } arg12 = ptr; } { std::string *ptr = (std::string *)0; res13 = SWIG_AsPtr_std_string(obj12, &ptr); if (!SWIG_IsOK(res13)) { SWIG_exception_fail(SWIG_ArgError(res13), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "13"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "13"" of type '" "std::string const &""'"); } arg13 = ptr; } { std::string *ptr = (std::string *)0; res14 = SWIG_AsPtr_std_string(obj13, &ptr); if (!SWIG_IsOK(res14)) { SWIG_exception_fail(SWIG_ArgError(res14), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "14"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "14"" of type '" "std::string const &""'"); } arg14 = ptr; } { std::string *ptr = (std::string *)0; res15 = SWIG_AsPtr_std_string(obj14, &ptr); if (!SWIG_IsOK(res15)) { SWIG_exception_fail(SWIG_ArgError(res15), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "15"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "15"" of type '" "std::string const &""'"); } arg15 = ptr; } { std::string *ptr = (std::string *)0; res16 = SWIG_AsPtr_std_string(obj15, &ptr); if (!SWIG_IsOK(res16)) { SWIG_exception_fail(SWIG_ArgError(res16), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "16"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "16"" of type '" "std::string const &""'"); } arg16 = ptr; } { std::string *ptr = (std::string *)0; res17 = SWIG_AsPtr_std_string(obj16, &ptr); if (!SWIG_IsOK(res17)) { SWIG_exception_fail(SWIG_ArgError(res17), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "17"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "17"" of type '" "std::string const &""'"); } arg17 = ptr; } { std::string *ptr = (std::string *)0; res18 = SWIG_AsPtr_std_string(obj17, &ptr); if (!SWIG_IsOK(res18)) { SWIG_exception_fail(SWIG_ArgError(res18), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "18"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "18"" of type '" "std::string const &""'"); } arg18 = ptr; } { std::string *ptr = (std::string *)0; res19 = SWIG_AsPtr_std_string(obj18, &ptr); if (!SWIG_IsOK(res19)) { SWIG_exception_fail(SWIG_ArgError(res19), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "19"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "19"" of type '" "std::string const &""'"); } arg19 = ptr; } { std::string *ptr = (std::string *)0; res20 = SWIG_AsPtr_std_string(obj19, &ptr); if (!SWIG_IsOK(res20)) { SWIG_exception_fail(SWIG_ArgError(res20), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "20"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "20"" of type '" "std::string const &""'"); } arg20 = ptr; } { std::string *ptr = (std::string *)0; res21 = SWIG_AsPtr_std_string(obj20, &ptr); if (!SWIG_IsOK(res21)) { SWIG_exception_fail(SWIG_ArgError(res21), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "21"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "21"" of type '" "std::string const &""'"); } arg21 = ptr; } { std::string *ptr = (std::string *)0; res22 = SWIG_AsPtr_std_string(obj21, &ptr); if (!SWIG_IsOK(res22)) { SWIG_exception_fail(SWIG_ArgError(res22), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "22"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "22"" of type '" "std::string const &""'"); } arg22 = ptr; } { std::string *ptr = (std::string *)0; res23 = SWIG_AsPtr_std_string(obj22, &ptr); if (!SWIG_IsOK(res23)) { SWIG_exception_fail(SWIG_ArgError(res23), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "23"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "23"" of type '" "std::string const &""'"); } arg23 = ptr; } { std::string *ptr = (std::string *)0; res24 = SWIG_AsPtr_std_string(obj23, &ptr); if (!SWIG_IsOK(res24)) { SWIG_exception_fail(SWIG_ArgError(res24), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "24"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "24"" of type '" "std::string const &""'"); } arg24 = ptr; } { std::string *ptr = (std::string *)0; res25 = SWIG_AsPtr_std_string(obj24, &ptr); if (!SWIG_IsOK(res25)) { SWIG_exception_fail(SWIG_ArgError(res25), "in method '" "WordProcessingMerger_setMonthNames" "', argument " "25"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setMonthNames" "', argument " "25"" of type '" "std::string const &""'"); } arg25 = ptr; } (arg1)->setMonthNames((std::string const &)*arg2,(std::string const &)*arg3,(std::string const &)*arg4,(std::string const &)*arg5,(std::string const &)*arg6,(std::string const &)*arg7,(std::string const &)*arg8,(std::string const &)*arg9,(std::string const &)*arg10,(std::string const &)*arg11,(std::string const &)*arg12,(std::string const &)*arg13,(std::string const &)*arg14,(std::string const &)*arg15,(std::string const &)*arg16,(std::string const &)*arg17,(std::string const &)*arg18,(std::string const &)*arg19,(std::string const &)*arg20,(std::string const &)*arg21,(std::string const &)*arg22,(std::string const &)*arg23,(std::string const &)*arg24,(std::string const &)*arg25); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; if (SWIG_IsNewObj(res5)) delete arg5; if (SWIG_IsNewObj(res6)) delete arg6; if (SWIG_IsNewObj(res7)) delete arg7; if (SWIG_IsNewObj(res8)) delete arg8; if (SWIG_IsNewObj(res9)) delete arg9; if (SWIG_IsNewObj(res10)) delete arg10; if (SWIG_IsNewObj(res11)) delete arg11; if (SWIG_IsNewObj(res12)) delete arg12; if (SWIG_IsNewObj(res13)) delete arg13; if (SWIG_IsNewObj(res14)) delete arg14; if (SWIG_IsNewObj(res15)) delete arg15; if (SWIG_IsNewObj(res16)) delete arg16; if (SWIG_IsNewObj(res17)) delete arg17; if (SWIG_IsNewObj(res18)) delete arg18; if (SWIG_IsNewObj(res19)) delete arg19; if (SWIG_IsNewObj(res20)) delete arg20; if (SWIG_IsNewObj(res21)) delete arg21; if (SWIG_IsNewObj(res22)) delete arg22; if (SWIG_IsNewObj(res23)) delete arg23; if (SWIG_IsNewObj(res24)) delete arg24; if (SWIG_IsNewObj(res25)) delete arg25; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; if (SWIG_IsNewObj(res3)) delete arg3; if (SWIG_IsNewObj(res4)) delete arg4; if (SWIG_IsNewObj(res5)) delete arg5; if (SWIG_IsNewObj(res6)) delete arg6; if (SWIG_IsNewObj(res7)) delete arg7; if (SWIG_IsNewObj(res8)) delete arg8; if (SWIG_IsNewObj(res9)) delete arg9; if (SWIG_IsNewObj(res10)) delete arg10; if (SWIG_IsNewObj(res11)) delete arg11; if (SWIG_IsNewObj(res12)) delete arg12; if (SWIG_IsNewObj(res13)) delete arg13; if (SWIG_IsNewObj(res14)) delete arg14; if (SWIG_IsNewObj(res15)) delete arg15; if (SWIG_IsNewObj(res16)) delete arg16; if (SWIG_IsNewObj(res17)) delete arg17; if (SWIG_IsNewObj(res18)) delete arg18; if (SWIG_IsNewObj(res19)) delete arg19; if (SWIG_IsNewObj(res20)) delete arg20; if (SWIG_IsNewObj(res21)) delete arg21; if (SWIG_IsNewObj(res22)) delete arg22; if (SWIG_IsNewObj(res23)) delete arg23; if (SWIG_IsNewObj(res24)) delete arg24; if (SWIG_IsNewObj(res25)) delete arg25; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setMonthNames(PyObject *self, PyObject *args) { int argc; PyObject *argv[26]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 25) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setMonthNames__SWIG_0(self, args); } } if (argc == 13) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[4], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[5], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[6], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[7], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[8], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[9], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[10], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[11], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[12], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setMonthNames__SWIG_1(self, args); } } } } } } } } } } } } } } if (argc == 25) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[4], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[5], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[6], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[7], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[8], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[9], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[10], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[11], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[12], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[13], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[14], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[15], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[16], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[17], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[18], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[19], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[20], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[21], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[22], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[23], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[24], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setMonthNames__SWIG_2(self, args); } } } } } } } } } } } } } } } } } } } } } } } } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setMonthNames'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setMonthNames()\n" " DocxFactory::WordProcessingMerger::setMonthNames(std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &)\n" " DocxFactory::WordProcessingMerger::setMonthNames(std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &,std::string const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getCodePage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getCodePage",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getCodePage" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (arg1)->getCodePage(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getNumFracSep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getNumFracSep",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getNumFracSep" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (char)(arg1)->getNumFracSep(); resultobj = SWIG_From_char(static_cast< char >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getNumThSep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getNumThSep",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getNumThSep" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (char)(arg1)->getNumThSep(); resultobj = SWIG_From_char(static_cast< char >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getDateFormat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getDateFormat",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getDateFormat" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (arg1)->getDateFormat(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getYearOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; unsigned short result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getYearOffset",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getYearOffset" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (unsigned short)(arg1)->getYearOffset(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getFirstWeekDay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; unsigned short result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getFirstWeekDay",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getFirstWeekDay" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (unsigned short)(arg1)->getFirstWeekDay(); resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getWeekDayFullNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getWeekDayFullNames",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getWeekDayFullNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (arg1)->getWeekDayFullNames(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getWeekDayShortNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getWeekDayShortNames",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getWeekDayShortNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (arg1)->getWeekDayShortNames(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getMonthFullNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getMonthFullNames",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getMonthFullNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (arg1)->getMonthFullNames(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getMonthShortNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getMonthShortNames",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getMonthShortNames" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = (arg1)->getMonthShortNames(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setTempDir__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_setTempDir",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setTempDir" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); (arg1)->setTempDir(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setTempDir__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:WordProcessingMerger_setTempDir",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_setTempDir" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WordProcessingMerger_setTempDir" "', argument " "2"" of type '" "std::string const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "WordProcessingMerger_setTempDir" "', argument " "2"" of type '" "std::string const &""'"); } arg2 = ptr; } (arg1)->setTempDir((std::string const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_setTempDir(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 1) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setTempDir__SWIG_0(self, args); } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0); _v = SWIG_CheckState(res); if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_WordProcessingMerger_setTempDir__SWIG_1(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'WordProcessingMerger_setTempDir'.\n" " Possible C/C++ prototypes are:\n" " DocxFactory::WordProcessingMerger::setTempDir()\n" " DocxFactory::WordProcessingMerger::setTempDir(std::string const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getWorkDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getWorkDir",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getWorkDir" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger const *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = ((DocxFactory::WordProcessingMerger const *)arg1)->getWorkDir(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_WordProcessingMerger_getTempDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = (DocxFactory::WordProcessingMerger *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::string result; if (!PyArg_ParseTuple(args,(char *)"O:WordProcessingMerger_getTempDir",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WordProcessingMerger_getTempDir" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger const *""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); result = ((DocxFactory::WordProcessingMerger const *)arg1)->getTempDir(); resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *WordProcessingMerger_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_DocxFactory__WordProcessingMerger, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } SWIGINTERN PyObject *_wrap_StringVector_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; PyObject **arg2 = (PyObject **) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; swig::SwigPyIterator *result = 0 ; arg2 = &obj0; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_iterator",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_iterator" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (swig::SwigPyIterator *)std_vector_Sl_std_string_Sg__iterator(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; bool result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector___nonzero__",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___nonzero__" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (bool)std_vector_Sl_std_string_Sg____nonzero__((std::vector< std::string > const *)arg1); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; bool result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector___bool__",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___bool__" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (bool)std_vector_Sl_std_string_Sg____bool__((std::vector< std::string > const *)arg1); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::size_type result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector___len__",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___len__" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = std_vector_Sl_std_string_Sg____len__((std::vector< std::string > const *)arg1); resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::value_type result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_pop",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_pop" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); try { result = std_vector_Sl_std_string_Sg__pop(arg1); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::difference_type arg2 ; std::vector< std::string >::difference_type arg3 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; ptrdiff_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; std::vector< std::string,std::allocator< std::string > > *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___getslice__",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___getslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___getslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'"); } arg2 = static_cast< std::vector< std::string >::difference_type >(val2); ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector___getslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'"); } arg3 = static_cast< std::vector< std::string >::difference_type >(val3); try { result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg____getslice__(arg1,arg2,arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___setslice____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::difference_type arg2 ; std::vector< std::string >::difference_type arg3 ; std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; ptrdiff_t val3 ; int ecode3 = 0 ; int res4 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOO:StringVector___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___setslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'"); } arg2 = static_cast< std::vector< std::string >::difference_type >(val2); ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector___setslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'"); } arg3 = static_cast< std::vector< std::string >::difference_type >(val3); { std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0; res4 = swig::asptr(obj3, &ptr); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "StringVector___setslice__" "', argument " "4"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector___setslice__" "', argument " "4"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); } arg4 = ptr; } try { std_vector_Sl_std_string_Sg____setslice____SWIG_0(arg1,arg2,arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); } resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res4)) delete arg4; return resultobj; fail: if (SWIG_IsNewObj(res4)) delete arg4; return NULL; } SWIGINTERN PyObject *_wrap_StringVector___setslice____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::difference_type arg2 ; std::vector< std::string >::difference_type arg3 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; ptrdiff_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___setslice__",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___setslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'"); } arg2 = static_cast< std::vector< std::string >::difference_type >(val2); ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector___setslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'"); } arg3 = static_cast< std::vector< std::string >::difference_type >(val3); try { std_vector_Sl_std_string_Sg____setslice____SWIG_0(arg1,arg2,arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); } resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___setslice__(PyObject *self, PyObject *args) { int argc; PyObject *argv[5]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 4) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 3) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_StringVector___setslice____SWIG_1(self, args); } } } } if (argc == 4) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { { int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { int res = swig::asptr(argv[3], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_StringVector___setslice____SWIG_0(self, args); } } } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector___setslice__'.\n" " Possible C/C++ prototypes are:\n" " std::vector< std::string >::__setslice__(std::vector< std::string >::difference_type,std::vector< std::string >::difference_type,std::vector< std::string,std::allocator< std::string > > const &)\n" " std::vector< std::string >::__setslice__(std::vector< std::string >::difference_type,std::vector< std::string >::difference_type)\n"); return 0; } SWIGINTERN PyObject *_wrap_StringVector___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::difference_type arg2 ; std::vector< std::string >::difference_type arg3 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; ptrdiff_t val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___delslice__",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___delslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___delslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'"); } arg2 = static_cast< std::vector< std::string >::difference_type >(val2); ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector___delslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'"); } arg3 = static_cast< std::vector< std::string >::difference_type >(val3); try { std_vector_Sl_std_string_Sg____delslice__(arg1,arg2,arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); } resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::difference_type arg2 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___delitem__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___delitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___delitem__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'"); } arg2 = static_cast< std::vector< std::string >::difference_type >(val2); try { std_vector_Sl_std_string_Sg____delitem____SWIG_0(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; PySliceObject *arg2 = (PySliceObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; std::vector< std::string,std::allocator< std::string > > *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___getitem__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___getitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); { if (!PySlice_Check(obj1)) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector___getitem__" "', argument " "2"" of type '" "PySliceObject *""'"); } arg2 = (PySliceObject *) obj1; } try { result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg____getitem____SWIG_0(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; PySliceObject *arg2 = (PySliceObject *) 0 ; std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res3 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); { if (!PySlice_Check(obj1)) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'"); } arg2 = (PySliceObject *) obj1; } { std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0; res3 = swig::asptr(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector___setitem__" "', argument " "3"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector___setitem__" "', argument " "3"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); } arg3 = ptr; } try { std_vector_Sl_std_string_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); } resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res3)) delete arg3; return resultobj; fail: if (SWIG_IsNewObj(res3)) delete arg3; return NULL; } SWIGINTERN PyObject *_wrap_StringVector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; PySliceObject *arg2 = (PySliceObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___setitem__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); { if (!PySlice_Check(obj1)) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'"); } arg2 = (PySliceObject *) obj1; } try { std_vector_Sl_std_string_Sg____setitem____SWIG_1(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); } resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; PySliceObject *arg2 = (PySliceObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___delitem__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___delitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); { if (!PySlice_Check(obj1)) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector___delitem__" "', argument " "2"" of type '" "PySliceObject *""'"); } arg2 = (PySliceObject *) obj1; } try { std_vector_Sl_std_string_Sg____delitem____SWIG_1(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } catch(std::invalid_argument &_e) { SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); } resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___delitem__(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 2) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { _v = PySlice_Check(argv[1]); } if (_v) { return _wrap_StringVector___delitem____SWIG_1(self, args); } } } if (argc == 2) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_StringVector___delitem____SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector___delitem__'.\n" " Possible C/C++ prototypes are:\n" " std::vector< std::string >::__delitem__(std::vector< std::string >::difference_type)\n" " std::vector< std::string >::__delitem__(PySliceObject *)\n"); return 0; } SWIGINTERN PyObject *_wrap_StringVector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::difference_type arg2 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; std::vector< std::string >::value_type *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___getitem__",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___getitem__" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___getitem__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'"); } arg2 = static_cast< std::vector< std::string >::difference_type >(val2); try { result = (std::vector< std::string >::value_type *) &std_vector_Sl_std_string_Sg____getitem____SWIG_1((std::vector< std::string > const *)arg1,arg2); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector___getitem__(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 2) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { _v = PySlice_Check(argv[1]); } if (_v) { return _wrap_StringVector___getitem____SWIG_0(self, args); } } } if (argc == 2) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_StringVector___getitem____SWIG_1(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector___getitem__'.\n" " Possible C/C++ prototypes are:\n" " std::vector< std::string >::__getitem__(PySliceObject *)\n" " std::vector< std::string >::__getitem__(std::vector< std::string >::difference_type) const\n"); return 0; } SWIGINTERN PyObject *_wrap_StringVector___setitem____SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::difference_type arg2 ; std::vector< std::string >::value_type *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; ptrdiff_t val2 ; int ecode2 = 0 ; int res3 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___setitem__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'"); } arg2 = static_cast< std::vector< std::string >::difference_type >(val2); { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector___setitem__" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector___setitem__" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); } arg3 = ptr; } try { std_vector_Sl_std_string_Sg____setitem____SWIG_2(arg1,arg2,(std::string const &)*arg3); } catch(std::out_of_range &_e) { SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); } resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res3)) delete arg3; return resultobj; fail: if (SWIG_IsNewObj(res3)) delete arg3; return NULL; } SWIGINTERN PyObject *_wrap_StringVector___setitem__(PyObject *self, PyObject *args) { int argc; PyObject *argv[4]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 3) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 2) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { _v = PySlice_Check(argv[1]); } if (_v) { return _wrap_StringVector___setitem____SWIG_1(self, args); } } } if (argc == 3) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { _v = PySlice_Check(argv[1]); } if (_v) { int res = swig::asptr(argv[2], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_StringVector___setitem____SWIG_0(self, args); } } } } if (argc == 3) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_StringVector___setitem____SWIG_2(self, args); } } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector___setitem__'.\n" " Possible C/C++ prototypes are:\n" " std::vector< std::string >::__setitem__(PySliceObject *,std::vector< std::string,std::allocator< std::string > > const &)\n" " std::vector< std::string >::__setitem__(PySliceObject *)\n" " std::vector< std::string >::__setitem__(std::vector< std::string >::difference_type,std::vector< std::string >::value_type const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_StringVector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::value_type *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_append",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_append" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "StringVector_append" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_append" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); } arg2 = ptr; } std_vector_Sl_std_string_Sg__append(arg1,(std::string const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_new_StringVector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *result = 0 ; if (!PyArg_ParseTuple(args,(char *)":new_StringVector")) SWIG_fail; result = (std::vector< std::string > *)new std::vector< std::string >(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_new_StringVector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = 0 ; int res1 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; std::vector< std::string > *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:new_StringVector",&obj0)) SWIG_fail; { std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0; res1 = swig::asptr(obj0, &ptr); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_StringVector" "', argument " "1"" of type '" "std::vector< std::string > const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_StringVector" "', argument " "1"" of type '" "std::vector< std::string > const &""'"); } arg1 = ptr; } result = (std::vector< std::string > *)new std::vector< std::string >((std::vector< std::string > const &)*arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW | 0 ); if (SWIG_IsNewObj(res1)) delete arg1; return resultobj; fail: if (SWIG_IsNewObj(res1)) delete arg1; return NULL; } SWIGINTERN PyObject *_wrap_StringVector_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; bool result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_empty",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_empty" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (bool)((std::vector< std::string > const *)arg1)->empty(); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::size_type result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_size",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_size" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = ((std::vector< std::string > const *)arg1)->size(); resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_clear",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_clear" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); (arg1)->clear(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string > *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_swap",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_swap" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "StringVector_swap" "', argument " "2"" of type '" "std::vector< std::string > &""'"); } if (!argp2) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_swap" "', argument " "2"" of type '" "std::vector< std::string > &""'"); } arg2 = reinterpret_cast< std::vector< std::string > * >(argp2); (arg1)->swap(*arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; SwigValueWrapper< std::allocator< std::string > > result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_get_allocator",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_get_allocator" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = ((std::vector< std::string > const *)arg1)->get_allocator(); resultobj = SWIG_NewPointerObj((new std::vector< std::string >::allocator_type(static_cast< const std::vector< std::string >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__string_t, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::iterator result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_begin",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_begin" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (arg1)->begin(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)), swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::iterator result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_end",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_end" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (arg1)->end(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)), swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::reverse_iterator result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_rbegin",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_rbegin" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (arg1)->rbegin(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::reverse_iterator & >(result)), swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::reverse_iterator result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_rend",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_rend" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (arg1)->rend(); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::reverse_iterator & >(result)), swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_new_StringVector__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string >::size_type arg1 ; size_t val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string > *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:new_StringVector",&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_StringVector" "', argument " "1"" of type '" "std::vector< std::string >::size_type""'"); } arg1 = static_cast< std::vector< std::string >::size_type >(val1); result = (std::vector< std::string > *)new std::vector< std::string >(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_pop_back",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_pop_back" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); (arg1)->pop_back(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::size_type arg2 ; void *argp1 = 0 ; int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_resize",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_resize" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector_resize" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'"); } arg2 = static_cast< std::vector< std::string >::size_type >(val2); (arg1)->resize(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::iterator arg2 ; void *argp1 = 0 ; int res1 = 0 ; swig::SwigPyIterator *iter2 = 0 ; int res2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; std::vector< std::string >::iterator result; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_erase",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_erase" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'"); } else { swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'"); } } result = std_vector_Sl_std_string_Sg__erase__SWIG_0(arg1,arg2); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)), swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::iterator arg2 ; std::vector< std::string >::iterator arg3 ; void *argp1 = 0 ; int res1 = 0 ; swig::SwigPyIterator *iter2 = 0 ; int res2 ; swig::SwigPyIterator *iter3 = 0 ; int res3 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; std::vector< std::string >::iterator result; if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector_erase",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_erase" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'"); } else { swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'"); } } res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res3) || !iter3) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "3"" of type '" "std::vector< std::string >::iterator""'"); } else { swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter3); if (iter_t) { arg3 = iter_t->get_current(); } else { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "3"" of type '" "std::vector< std::string >::iterator""'"); } } result = std_vector_Sl_std_string_Sg__erase__SWIG_1(arg1,arg2,arg3); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)), swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_erase(PyObject *self, PyObject *args) { int argc; PyObject *argv[4]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 3) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 2) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { swig::SwigPyIterator *iter = 0; int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0)); if (_v) { return _wrap_StringVector_erase__SWIG_0(self, args); } } } if (argc == 3) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { swig::SwigPyIterator *iter = 0; int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0)); if (_v) { swig::SwigPyIterator *iter = 0; int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0)); if (_v) { return _wrap_StringVector_erase__SWIG_1(self, args); } } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector_erase'.\n" " Possible C/C++ prototypes are:\n" " std::vector< std::string >::erase(std::vector< std::string >::iterator)\n" " std::vector< std::string >::erase(std::vector< std::string >::iterator,std::vector< std::string >::iterator)\n"); return 0; } SWIGINTERN PyObject *_wrap_new_StringVector__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string >::size_type arg1 ; std::vector< std::string >::value_type *arg2 = 0 ; size_t val1 ; int ecode1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; std::vector< std::string > *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:new_StringVector",&obj0,&obj1)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_StringVector" "', argument " "1"" of type '" "std::vector< std::string >::size_type""'"); } arg1 = static_cast< std::vector< std::string >::size_type >(val1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_StringVector" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_StringVector" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); } arg2 = ptr; } result = (std::vector< std::string > *)new std::vector< std::string >(arg1,(std::vector< std::string >::value_type const &)*arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW | 0 ); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_new_StringVector(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 0) { return _wrap_new_StringVector__SWIG_0(self, args); } if (argc == 1) { int _v; { int res = SWIG_AsVal_size_t(argv[0], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_new_StringVector__SWIG_2(self, args); } } if (argc == 1) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_new_StringVector__SWIG_1(self, args); } } if (argc == 2) { int _v; { int res = SWIG_AsVal_size_t(argv[0], NULL); _v = SWIG_CheckState(res); } if (_v) { int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_new_StringVector__SWIG_3(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_StringVector'.\n" " Possible C/C++ prototypes are:\n" " std::vector< std::string >::vector()\n" " std::vector< std::string >::vector(std::vector< std::string > const &)\n" " std::vector< std::string >::vector(std::vector< std::string >::size_type)\n" " std::vector< std::string >::vector(std::vector< std::string >::size_type,std::vector< std::string >::value_type const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_StringVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::value_type *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_push_back",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_push_back" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); { std::string *ptr = (std::string *)0; res2 = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "StringVector_push_back" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_push_back" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); } arg2 = ptr; } (arg1)->push_back((std::vector< std::string >::value_type const &)*arg2); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res2)) delete arg2; return resultobj; fail: if (SWIG_IsNewObj(res2)) delete arg2; return NULL; } SWIGINTERN PyObject *_wrap_StringVector_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::value_type *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_front",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_front" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (std::vector< std::string >::value_type *) &((std::vector< std::string > const *)arg1)->front(); resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::value_type *result = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_back",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_back" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = (std::vector< std::string >::value_type *) &((std::vector< std::string > const *)arg1)->back(); resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::size_type arg2 ; std::vector< std::string >::value_type *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; int res3 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector_assign",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_assign" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector_assign" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'"); } arg2 = static_cast< std::vector< std::string >::size_type >(val2); { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector_assign" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_assign" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); } arg3 = ptr; } (arg1)->assign(arg2,(std::vector< std::string >::value_type const &)*arg3); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res3)) delete arg3; return resultobj; fail: if (SWIG_IsNewObj(res3)) delete arg3; return NULL; } SWIGINTERN PyObject *_wrap_StringVector_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::size_type arg2 ; std::vector< std::string >::value_type *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; int res3 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector_resize",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_resize" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector_resize" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'"); } arg2 = static_cast< std::vector< std::string >::size_type >(val2); { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector_resize" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_resize" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); } arg3 = ptr; } (arg1)->resize(arg2,(std::vector< std::string >::value_type const &)*arg3); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res3)) delete arg3; return resultobj; fail: if (SWIG_IsNewObj(res3)) delete arg3; return NULL; } SWIGINTERN PyObject *_wrap_StringVector_resize(PyObject *self, PyObject *args) { int argc; PyObject *argv[4]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 3) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 2) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_size_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_StringVector_resize__SWIG_0(self, args); } } } if (argc == 3) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_size_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_StringVector_resize__SWIG_1(self, args); } } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector_resize'.\n" " Possible C/C++ prototypes are:\n" " std::vector< std::string >::resize(std::vector< std::string >::size_type)\n" " std::vector< std::string >::resize(std::vector< std::string >::size_type,std::vector< std::string >::value_type const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_StringVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::iterator arg2 ; std::vector< std::string >::value_type *arg3 = 0 ; void *argp1 = 0 ; int res1 = 0 ; swig::SwigPyIterator *iter2 = 0 ; int res2 ; int res3 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; std::vector< std::string >::iterator result; if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector_insert",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_insert" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'"); } else { swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'"); } } { std::string *ptr = (std::string *)0; res3 = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector_insert" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_insert" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); } arg3 = ptr; } result = std_vector_Sl_std_string_Sg__insert__SWIG_0(arg1,arg2,(std::string const &)*arg3); resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)), swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN); if (SWIG_IsNewObj(res3)) delete arg3; return resultobj; fail: if (SWIG_IsNewObj(res3)) delete arg3; return NULL; } SWIGINTERN PyObject *_wrap_StringVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::iterator arg2 ; std::vector< std::string >::size_type arg3 ; std::vector< std::string >::value_type *arg4 = 0 ; void *argp1 = 0 ; int res1 = 0 ; swig::SwigPyIterator *iter2 = 0 ; int res2 ; size_t val3 ; int ecode3 = 0 ; int res4 = SWIG_OLDOBJ ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOO:StringVector_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_insert" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0); if (!SWIG_IsOK(res2) || !iter2) { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'"); } else { swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2); if (iter_t) { arg2 = iter_t->get_current(); } else { SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'"); } } ecode3 = SWIG_AsVal_size_t(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector_insert" "', argument " "3"" of type '" "std::vector< std::string >::size_type""'"); } arg3 = static_cast< std::vector< std::string >::size_type >(val3); { std::string *ptr = (std::string *)0; res4 = SWIG_AsPtr_std_string(obj3, &ptr); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "StringVector_insert" "', argument " "4"" of type '" "std::vector< std::string >::value_type const &""'"); } if (!ptr) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_insert" "', argument " "4"" of type '" "std::vector< std::string >::value_type const &""'"); } arg4 = ptr; } std_vector_Sl_std_string_Sg__insert__SWIG_1(arg1,arg2,arg3,(std::string const &)*arg4); resultobj = SWIG_Py_Void(); if (SWIG_IsNewObj(res4)) delete arg4; return resultobj; fail: if (SWIG_IsNewObj(res4)) delete arg4; return NULL; } SWIGINTERN PyObject *_wrap_StringVector_insert(PyObject *self, PyObject *args) { int argc; PyObject *argv[5]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 4) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 3) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { swig::SwigPyIterator *iter = 0; int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0)); if (_v) { int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_StringVector_insert__SWIG_0(self, args); } } } } if (argc == 4) { int _v; int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0)); _v = SWIG_CheckState(res); if (_v) { swig::SwigPyIterator *iter = 0; int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0); _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0)); if (_v) { { int res = SWIG_AsVal_size_t(argv[2], NULL); _v = SWIG_CheckState(res); } if (_v) { int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0)); _v = SWIG_CheckState(res); if (_v) { return _wrap_StringVector_insert__SWIG_1(self, args); } } } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector_insert'.\n" " Possible C/C++ prototypes are:\n" " std::vector< std::string >::insert(std::vector< std::string >::iterator,std::vector< std::string >::value_type const &)\n" " std::vector< std::string >::insert(std::vector< std::string >::iterator,std::vector< std::string >::size_type,std::vector< std::string >::value_type const &)\n"); return 0; } SWIGINTERN PyObject *_wrap_StringVector_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; std::vector< std::string >::size_type arg2 ; void *argp1 = 0 ; int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_reserve",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_reserve" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector_reserve" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'"); } arg2 = static_cast< std::vector< std::string >::size_type >(val2); (arg1)->reserve(arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_StringVector_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; std::vector< std::string >::size_type result; if (!PyArg_ParseTuple(args,(char *)"O:StringVector_capacity",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_capacity" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); result = ((std::vector< std::string > const *)arg1)->capacity(); resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_delete_StringVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if (!PyArg_ParseTuple(args,(char *)"O:delete_StringVector",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_StringVector" "', argument " "1"" of type '" "std::vector< std::string > *""'"); } arg1 = reinterpret_cast< std::vector< std::string > * >(argp1); delete arg1; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *StringVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_NewClientData(obj)); return SWIG_Py_Void(); } SWIGINTERN PyObject *_wrap_initialize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *result = 0 ; if (!PyArg_ParseTuple(args,(char *)":initialize")) SWIG_fail; result = (DocxFactory::WordProcessingMerger *) &initialize(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_print_Reply(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::string arg2 ; std::string arg3 ; std::string arg4 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOO:print_Reply",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_Reply" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_Reply" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Reply" "', argument " "2"" of type '" "std::string""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Reply" "', argument " "3"" of type '" "std::string""'"); } arg3 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj3, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Reply" "', argument " "4"" of type '" "std::string""'"); } arg4 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } print_Reply(*arg1,arg2,arg3,arg4); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_print_Header(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::string arg2 ; std::string arg3 ; std::string arg4 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOO:print_Header",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_Header" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_Header" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Header" "', argument " "2"" of type '" "std::string""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Header" "', argument " "3"" of type '" "std::string""'"); } arg3 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj3, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Header" "', argument " "4"" of type '" "std::string""'"); } arg4 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } print_Header(*arg1,arg2,arg3,arg4); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_print_FromToSubj(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::string arg2 ; std::string arg3 ; std::string arg4 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOOO:print_FromToSubj",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_FromToSubj" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_FromToSubj" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_FromToSubj" "', argument " "2"" of type '" "std::string""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj2, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_FromToSubj" "', argument " "3"" of type '" "std::string""'"); } arg3 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj3, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_FromToSubj" "', argument " "4"" of type '" "std::string""'"); } arg4 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } print_FromToSubj(*arg1,arg2,arg3,arg4); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_print_Via(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::vector< std::string,std::allocator< std::string > > arg2 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:print_Via",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_Via" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_Via" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0; int res = swig::asptr(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Via" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > >""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } print_Via(*arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_print_Ref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::vector< std::string,std::allocator< std::string > > arg2 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:print_Ref",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_Ref" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_Ref" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0; int res = swig::asptr(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Ref" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > >""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } print_Ref(*arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_print_Encl(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::vector< std::string,std::allocator< std::string > > arg2 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:print_Encl",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_Encl" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_Encl" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0; int res = swig::asptr(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Encl" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > >""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } print_Encl(*arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_print_Body(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::vector< std::string,std::allocator< std::string > > arg2 ; std::vector< std::string,std::allocator< std::string > > arg3 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OOO:print_Body",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_Body" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_Body" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0; int res = swig::asptr(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Body" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > >""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } { std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0; int res = swig::asptr(obj2, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Body" "', argument " "3"" of type '" "std::vector< std::string,std::allocator< std::string > >""'"); } arg3 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } print_Body(*arg1,arg2,arg3); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_print_Copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::vector< std::string,std::allocator< std::string > > arg2 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:print_Copy",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_Copy" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_Copy" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0; int res = swig::asptr(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Copy" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > >""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } print_Copy(*arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_print_Sig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::string arg2 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:print_Sig",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_Sig" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_Sig" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "print_Sig" "', argument " "2"" of type '" "std::string""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } print_Sig(*arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_save_Output(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; DocxFactory::WordProcessingMerger *arg1 = 0 ; std::string arg2 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if (!PyArg_ParseTuple(args,(char *)"OO:save_Output",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DocxFactory__WordProcessingMerger, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "save_Output" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "save_Output" "', argument " "1"" of type '" "DocxFactory::WordProcessingMerger &""'"); } arg1 = reinterpret_cast< DocxFactory::WordProcessingMerger * >(argp1); { std::string *ptr = (std::string *)0; int res = SWIG_AsPtr_std_string(obj1, &ptr); if (!SWIG_IsOK(res) || !ptr) { SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "save_Output" "', argument " "2"" of type '" "std::string""'"); } arg2 = *ptr; if (SWIG_IsNewObj(res)) delete ptr; } save_Output(*arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } static PyMethodDef SwigMethods[] = { { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"delete_SwigPyIterator", _wrap_delete_SwigPyIterator, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_value", _wrap_SwigPyIterator_value, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_incr", _wrap_SwigPyIterator_incr, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_decr", _wrap_SwigPyIterator_decr, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_distance", _wrap_SwigPyIterator_distance, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_equal", _wrap_SwigPyIterator_equal, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_copy", _wrap_SwigPyIterator_copy, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_next", _wrap_SwigPyIterator_next, METH_VARARGS, NULL}, { (char *)"SwigPyIterator___next__", _wrap_SwigPyIterator___next__, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_previous", _wrap_SwigPyIterator_previous, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_advance", _wrap_SwigPyIterator_advance, METH_VARARGS, NULL}, { (char *)"SwigPyIterator___eq__", _wrap_SwigPyIterator___eq__, METH_VARARGS, NULL}, { (char *)"SwigPyIterator___ne__", _wrap_SwigPyIterator___ne__, METH_VARARGS, NULL}, { (char *)"SwigPyIterator___iadd__", _wrap_SwigPyIterator___iadd__, METH_VARARGS, NULL}, { (char *)"SwigPyIterator___isub__", _wrap_SwigPyIterator___isub__, METH_VARARGS, NULL}, { (char *)"SwigPyIterator___add__", _wrap_SwigPyIterator___add__, METH_VARARGS, NULL}, { (char *)"SwigPyIterator___sub__", _wrap_SwigPyIterator___sub__, METH_VARARGS, NULL}, { (char *)"SwigPyIterator_swigregister", SwigPyIterator_swigregister, METH_VARARGS, NULL}, { (char *)"WordProcessingCompiler_getInstance", _wrap_WordProcessingCompiler_getInstance, METH_VARARGS, NULL}, { (char *)"delete_WordProcessingCompiler", _wrap_delete_WordProcessingCompiler, METH_VARARGS, NULL}, { (char *)"WordProcessingCompiler_compile", _wrap_WordProcessingCompiler_compile, METH_VARARGS, NULL}, { (char *)"WordProcessingCompiler_setTempDir", _wrap_WordProcessingCompiler_setTempDir, METH_VARARGS, NULL}, { (char *)"WordProcessingCompiler_getWorkDir", _wrap_WordProcessingCompiler_getWorkDir, METH_VARARGS, NULL}, { (char *)"WordProcessingCompiler_getTempDir", _wrap_WordProcessingCompiler_getTempDir, METH_VARARGS, NULL}, { (char *)"WordProcessingCompiler_swigregister", WordProcessingCompiler_swigregister, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getInstance", _wrap_WordProcessingMerger_getInstance, METH_VARARGS, NULL}, { (char *)"delete_WordProcessingMerger", _wrap_delete_WordProcessingMerger, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_load", _wrap_WordProcessingMerger_load, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_save", _wrap_WordProcessingMerger_save, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger__print", _wrap_WordProcessingMerger__print, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setClipboardValue", _wrap_WordProcessingMerger_setClipboardValue, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_paste", _wrap_WordProcessingMerger_paste, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getFields", _wrap_WordProcessingMerger_getFields, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getItems", _wrap_WordProcessingMerger_getItems, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getItemParent", _wrap_WordProcessingMerger_getItemParent, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getItemFields", _wrap_WordProcessingMerger_getItemFields, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setCodePage", _wrap_WordProcessingMerger_setCodePage, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setNumFracSep", _wrap_WordProcessingMerger_setNumFracSep, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setNumThSep", _wrap_WordProcessingMerger_setNumThSep, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setDateFormat", _wrap_WordProcessingMerger_setDateFormat, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setYearOffset", _wrap_WordProcessingMerger_setYearOffset, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setFirstWeekDay", _wrap_WordProcessingMerger_setFirstWeekDay, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setWeekDayNames", _wrap_WordProcessingMerger_setWeekDayNames, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setMonthNames", _wrap_WordProcessingMerger_setMonthNames, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getCodePage", _wrap_WordProcessingMerger_getCodePage, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getNumFracSep", _wrap_WordProcessingMerger_getNumFracSep, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getNumThSep", _wrap_WordProcessingMerger_getNumThSep, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getDateFormat", _wrap_WordProcessingMerger_getDateFormat, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getYearOffset", _wrap_WordProcessingMerger_getYearOffset, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getFirstWeekDay", _wrap_WordProcessingMerger_getFirstWeekDay, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getWeekDayFullNames", _wrap_WordProcessingMerger_getWeekDayFullNames, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getWeekDayShortNames", _wrap_WordProcessingMerger_getWeekDayShortNames, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getMonthFullNames", _wrap_WordProcessingMerger_getMonthFullNames, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getMonthShortNames", _wrap_WordProcessingMerger_getMonthShortNames, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_setTempDir", _wrap_WordProcessingMerger_setTempDir, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getWorkDir", _wrap_WordProcessingMerger_getWorkDir, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_getTempDir", _wrap_WordProcessingMerger_getTempDir, METH_VARARGS, NULL}, { (char *)"WordProcessingMerger_swigregister", WordProcessingMerger_swigregister, METH_VARARGS, NULL}, { (char *)"StringVector_iterator", _wrap_StringVector_iterator, METH_VARARGS, NULL}, { (char *)"StringVector___nonzero__", _wrap_StringVector___nonzero__, METH_VARARGS, NULL}, { (char *)"StringVector___bool__", _wrap_StringVector___bool__, METH_VARARGS, NULL}, { (char *)"StringVector___len__", _wrap_StringVector___len__, METH_VARARGS, NULL}, { (char *)"StringVector_pop", _wrap_StringVector_pop, METH_VARARGS, NULL}, { (char *)"StringVector___getslice__", _wrap_StringVector___getslice__, METH_VARARGS, NULL}, { (char *)"StringVector___setslice__", _wrap_StringVector___setslice__, METH_VARARGS, NULL}, { (char *)"StringVector___delslice__", _wrap_StringVector___delslice__, METH_VARARGS, NULL}, { (char *)"StringVector___delitem__", _wrap_StringVector___delitem__, METH_VARARGS, NULL}, { (char *)"StringVector___getitem__", _wrap_StringVector___getitem__, METH_VARARGS, NULL}, { (char *)"StringVector___setitem__", _wrap_StringVector___setitem__, METH_VARARGS, NULL}, { (char *)"StringVector_append", _wrap_StringVector_append, METH_VARARGS, NULL}, { (char *)"StringVector_empty", _wrap_StringVector_empty, METH_VARARGS, NULL}, { (char *)"StringVector_size", _wrap_StringVector_size, METH_VARARGS, NULL}, { (char *)"StringVector_clear", _wrap_StringVector_clear, METH_VARARGS, NULL}, { (char *)"StringVector_swap", _wrap_StringVector_swap, METH_VARARGS, NULL}, { (char *)"StringVector_get_allocator", _wrap_StringVector_get_allocator, METH_VARARGS, NULL}, { (char *)"StringVector_begin", _wrap_StringVector_begin, METH_VARARGS, NULL}, { (char *)"StringVector_end", _wrap_StringVector_end, METH_VARARGS, NULL}, { (char *)"StringVector_rbegin", _wrap_StringVector_rbegin, METH_VARARGS, NULL}, { (char *)"StringVector_rend", _wrap_StringVector_rend, METH_VARARGS, NULL}, { (char *)"StringVector_pop_back", _wrap_StringVector_pop_back, METH_VARARGS, NULL}, { (char *)"StringVector_erase", _wrap_StringVector_erase, METH_VARARGS, NULL}, { (char *)"new_StringVector", _wrap_new_StringVector, METH_VARARGS, NULL}, { (char *)"StringVector_push_back", _wrap_StringVector_push_back, METH_VARARGS, NULL}, { (char *)"StringVector_front", _wrap_StringVector_front, METH_VARARGS, NULL}, { (char *)"StringVector_back", _wrap_StringVector_back, METH_VARARGS, NULL}, { (char *)"StringVector_assign", _wrap_StringVector_assign, METH_VARARGS, NULL}, { (char *)"StringVector_resize", _wrap_StringVector_resize, METH_VARARGS, NULL}, { (char *)"StringVector_insert", _wrap_StringVector_insert, METH_VARARGS, NULL}, { (char *)"StringVector_reserve", _wrap_StringVector_reserve, METH_VARARGS, NULL}, { (char *)"StringVector_capacity", _wrap_StringVector_capacity, METH_VARARGS, NULL}, { (char *)"delete_StringVector", _wrap_delete_StringVector, METH_VARARGS, NULL}, { (char *)"StringVector_swigregister", StringVector_swigregister, METH_VARARGS, NULL}, { (char *)"initialize", _wrap_initialize, METH_VARARGS, NULL}, { (char *)"print_Reply", _wrap_print_Reply, METH_VARARGS, NULL}, { (char *)"print_Header", _wrap_print_Header, METH_VARARGS, NULL}, { (char *)"print_FromToSubj", _wrap_print_FromToSubj, METH_VARARGS, NULL}, { (char *)"print_Via", _wrap_print_Via, METH_VARARGS, NULL}, { (char *)"print_Ref", _wrap_print_Ref, METH_VARARGS, NULL}, { (char *)"print_Encl", _wrap_print_Encl, METH_VARARGS, NULL}, { (char *)"print_Body", _wrap_print_Body, METH_VARARGS, NULL}, { (char *)"print_Copy", _wrap_print_Copy, METH_VARARGS, NULL}, { (char *)"print_Sig", _wrap_print_Sig, METH_VARARGS, NULL}, { (char *)"save_Output", _wrap_save_Output, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } }; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ static swig_type_info _swigt__p_DocxFactory__WordProcessingCompiler = {"_p_DocxFactory__WordProcessingCompiler", "DocxFactory::WordProcessingCompiler *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_DocxFactory__WordProcessingMerger = {"_p_DocxFactory__WordProcessingMerger", "DocxFactory::WordProcessingMerger *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_PyObject = {"_p_p_PyObject", "PyObject **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__allocatorT_std__string_t = {"_p_std__allocatorT_std__string_t", "std::vector< std::string >::allocator_type *|std::allocator< std::string > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__invalid_argument = {"_p_std__invalid_argument", "std::invalid_argument *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__vectorT__Tp__Alloc_t = {"_p_std__vectorT__Tp__Alloc_t", "std::vector< _Tp,_Alloc > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t = {"_p_std__vectorT_std__string_std__allocatorT_std__string_t_t", "std::vector< std::string,std::allocator< std::string > > *|std::vector< std::string > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_swig__SwigPyIterator = {"_p_swig__SwigPyIterator", "swig::SwigPyIterator *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_DocxFactory__WordProcessingCompiler, &_swigt__p_DocxFactory__WordProcessingMerger, &_swigt__p_allocator_type, &_swigt__p_char, &_swigt__p_difference_type, &_swigt__p_p_PyObject, &_swigt__p_size_type, &_swigt__p_std__allocatorT_std__string_t, &_swigt__p_std__invalid_argument, &_swigt__p_std__vectorT__Tp__Alloc_t, &_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t, &_swigt__p_swig__SwigPyIterator, &_swigt__p_value_type, }; static swig_cast_info _swigc__p_DocxFactory__WordProcessingCompiler[] = { {&_swigt__p_DocxFactory__WordProcessingCompiler, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DocxFactory__WordProcessingMerger[] = { {&_swigt__p_DocxFactory__WordProcessingMerger, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_allocator_type[] = { {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_difference_type[] = { {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_PyObject[] = { {&_swigt__p_p_PyObject, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_size_type[] = { {&_swigt__p_size_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__allocatorT_std__string_t[] = { {&_swigt__p_std__allocatorT_std__string_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__invalid_argument[] = { {&_swigt__p_std__invalid_argument, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__vectorT__Tp__Alloc_t[] = { {&_swigt__p_std__vectorT__Tp__Alloc_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t[] = { {&_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_swig__SwigPyIterator[] = { {&_swigt__p_swig__SwigPyIterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_value_type[] = { {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { _swigc__p_DocxFactory__WordProcessingCompiler, _swigc__p_DocxFactory__WordProcessingMerger, _swigc__p_allocator_type, _swigc__p_char, _swigc__p_difference_type, _swigc__p_p_PyObject, _swigc__p_size_type, _swigc__p_std__allocatorT_std__string_t, _swigc__p_std__invalid_argument, _swigc__p_std__vectorT__Tp__Alloc_t, _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t, _swigc__p_swig__SwigPyIterator, _swigc__p_value_type, }; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ static swig_const_info swig_const_table[] = { {0, 0, 0, 0.0, 0, 0}}; #ifdef __cplusplus } #endif /* ----------------------------------------------------------------------------- * Type initialization: * This problem is tough by the requirement that no dynamic * memory is used. Also, since swig_type_info structures store pointers to * swig_cast_info structures and swig_cast_info structures store pointers back * to swig_type_info structures, we need some lookup code at initialization. * The idea is that swig generates all the structures that are needed. * The runtime then collects these partially filled structures. * The SWIG_InitializeModule function takes these initial arrays out of * swig_module, and does all the lookup, filling in the swig_module.types * array with the correct data and linking the correct swig_cast_info * structures together. * * The generated swig_type_info structures are assigned statically to an initial * array. We just loop through that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the * cast linked list. The cast data is initially stored in something like a * two-dimensional array. Each row corresponds to a type (there are the same * number of rows as there are in the swig_type_initial array). Each entry in * a column is one of the swig_cast_info structures for that type. * The cast_initial array is actually an array of arrays, because each row has * a variable number of columns. So to actually build the cast linked list, * we find the array of casts associated with the type, and loop through it * adding the casts to the list. The one last trick we need to do is making * sure the type pointer in the swig_cast_info struct is correct. * * First off, we lookup the cast->type name to see if it is already loaded. * There are three cases to handle: * 1) If the cast->type has already been loaded AND the type we are adding * casting info to has not been loaded (it is in this module), THEN we * replace the cast->type pointer with the type pointer that has already * been loaded. * 2) If BOTH types (the one we are adding casting info to, and the * cast->type) are loaded, THEN the cast info has already been loaded by * the previous module so we just ignore it. * 3) Finally, if cast->type has not already been loaded, then we add that * swig_cast_info to the linked list (because the cast->type) pointer will * be correct. * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #if 0 } /* c-mode */ #endif #endif #if 0 #define SWIGRUNTIME_DEBUG #endif SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; int found, init; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { /* Initialize the swig_module */ swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; init = 1; } else { init = 0; } /* Try and load any already created modules */ module_head = SWIG_GetModule(clientdata); if (!module_head) { /* This is the first module loaded for this interpreter */ /* so set the swig module into the interpreter */ SWIG_SetModule(clientdata, &swig_module); module_head = &swig_module; } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ found=0; iter=module_head; do { if (iter==&swig_module) { found=1; break; } iter=iter->next; } while (iter!= module_head); /* if the is found in the list, then all is done and we may leave */ if (found) return; /* otherwise we must add out module into the list */ swig_module.next = module_head->next; module_head->next = &swig_module; } /* When multiple interpreters are used, a module could have already been initialized in a different interpreter, but not yet have a pointer in this interpreter. In this case, we do not want to continue adding types... everything should be set up already */ if (init == 0) return; /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; swig_type_info *ret; swig_cast_info *cast; #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ if (swig_module.next != &swig_module) { type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); } if (type) { /* Overwrite clientdata field */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: found type %s\n", type->name); #endif if (swig_module.type_initial[i]->clientdata) { type->clientdata = swig_module.type_initial[i]->clientdata; #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); #endif } } else { type = swig_module.type_initial[i]; } /* Insert casting types */ cast = swig_module.cast_initial[i]; while (cast->type) { /* Don't need to add information already in the list */ ret = 0; #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); #endif if (swig_module.next != &swig_module) { ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); #ifdef SWIGRUNTIME_DEBUG if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); #endif } if (ret) { if (type == swig_module.type_initial[i]) { #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: skip old type %s\n", ret->name); #endif cast->type = ret; ret = 0; } else { /* Check for casting already in the list */ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); #ifdef SWIGRUNTIME_DEBUG if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); #endif if (!ocast) ret = 0; } } if (!ret) { #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); #endif if (type->cast) { type->cast->prev = cast; cast->next = type->cast; } type->cast = cast; } cast++; } /* Set entry in modules->types array equal to the type */ swig_module.types[i] = type; } swig_module.types[i] = 0; #ifdef SWIGRUNTIME_DEBUG printf("**** SWIG_InitializeModule: Cast List ******\n"); for (i = 0; i < swig_module.size; ++i) { int j = 0; swig_cast_info *cast = swig_module.cast_initial[i]; printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; ++j; } printf("---- Total casts: %d\n",j); } printf("**** SWIG_InitializeModule: Cast List ******\n"); #endif } /* This function will propagate the clientdata field of type to * any new swig_type_info structures that have been added into the list * of equivalent types. It is like calling * SWIG_TypeClientData(type, clientdata) a second time. */ SWIGRUNTIME void SWIG_PropagateClientData(void) { size_t i; swig_cast_info *equiv; static int init_run = 0; if (init_run) return; init_run = 1; for (i = 0; i < swig_module.size; i++) { if (swig_module.types[i]->clientdata) { equiv = swig_module.types[i]->cast; while (equiv) { if (!equiv->converter) { if (equiv->type && !equiv->type->clientdata) SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); } equiv = equiv->next; } } } } #ifdef __cplusplus #if 0 { /* c-mode */ #endif } #endif #ifdef __cplusplus extern "C" { #endif /* Python-specific SWIG API */ #define SWIG_newvarlink() SWIG_Python_newvarlink() #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) /* ----------------------------------------------------------------------------- * global variable support code. * ----------------------------------------------------------------------------- */ typedef struct swig_globalvar { char *name; /* Name of global variable */ PyObject *(*get_attr)(void); /* Return the current value */ int (*set_attr)(PyObject *); /* Set the value */ struct swig_globalvar *next; } swig_globalvar; typedef struct swig_varlinkobject { PyObject_HEAD swig_globalvar *vars; } swig_varlinkobject; SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { #if PY_VERSION_HEX >= 0x03000000 return PyUnicode_InternFromString("<Swig global variables>"); #else return PyString_FromString("<Swig global variables>"); #endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { #if PY_VERSION_HEX >= 0x03000000 PyObject *str = PyUnicode_InternFromString("("); PyObject *tail; PyObject *joined; swig_globalvar *var; for (var = v->vars; var; var=var->next) { tail = PyUnicode_FromString(var->name); joined = PyUnicode_Concat(str, tail); Py_DecRef(str); Py_DecRef(tail); str = joined; if (var->next) { tail = PyUnicode_InternFromString(", "); joined = PyUnicode_Concat(str, tail); Py_DecRef(str); Py_DecRef(tail); str = joined; } } tail = PyUnicode_InternFromString(")"); joined = PyUnicode_Concat(str, tail); Py_DecRef(str); Py_DecRef(tail); str = joined; #else PyObject *str = PyString_FromString("("); swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); #endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v) { swig_globalvar *var = v->vars; while (var) { swig_globalvar *n = var->next; free(var->name); free(var); var = n; } } SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n) { PyObject *res = NULL; swig_globalvar *var = v->vars; while (var) { if (strcmp(var->name,n) == 0) { res = (*var->get_attr)(); break; } var = var->next; } if (res == NULL && !PyErr_Occurred()) { PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); } return res; } SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { int res = 1; swig_globalvar *var = v->vars; while (var) { if (strcmp(var->name,n) == 0) { res = (*var->set_attr)(p); break; } var = var->next; } if (res == 1 && !PyErr_Occurred()) { PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); } return res; } SWIGINTERN PyTypeObject* swig_varlink_type(void) { static char varlink__doc__[] = "Swig var link object"; static PyTypeObject varlink_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif (char *)"swigvarlink", /* tp_name */ sizeof(swig_varlinkobject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) swig_varlink_dealloc, /* tp_dealloc */ (printfunc) swig_varlink_print, /* tp_print */ (getattrfunc) swig_varlink_getattr, /* tp_getattr */ (setattrfunc) swig_varlink_setattr, /* tp_setattr */ 0, /* tp_compare */ (reprfunc) swig_varlink_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ 0, /* tp_flags */ varlink__doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 0, /* tp_version */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; varlink_type = tmp; type_init = 1; #if PY_VERSION_HEX < 0x02020000 varlink_type.ob_type = &PyType_Type; #else if (PyType_Ready(&varlink_type) < 0) return NULL; #endif } return &varlink_type; } /* Create a variable linking object for use later */ SWIGINTERN PyObject * SWIG_Python_newvarlink(void) { swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); if (result) { result->vars = 0; } return ((PyObject*) result); } SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { swig_varlinkobject *v = (swig_varlinkobject *) p; swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); if (gv) { size_t size = strlen(name)+1; gv->name = (char *)malloc(size); if (gv->name) { strncpy(gv->name,name,size); gv->get_attr = get_attr; gv->set_attr = set_attr; gv->next = v->vars; } } v->vars = gv; } SWIGINTERN PyObject * SWIG_globals(void) { static PyObject *_SWIG_globals = 0; if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); return _SWIG_globals; } /* ----------------------------------------------------------------------------- * constants/methods manipulation * ----------------------------------------------------------------------------- */ /* Install Constants */ SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { PyObject *obj = 0; size_t i; for (i = 0; constants[i].type; ++i) { switch(constants[i].type) { case SWIG_PY_POINTER: obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); break; case SWIG_PY_BINARY: obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); break; default: obj = 0; break; } if (obj) { PyDict_SetItemString(d, constants[i].name, obj); Py_DECREF(obj); } } } /* -----------------------------------------------------------------------------*/ /* Fix SwigMethods to carry the callback ptrs when needed */ /* -----------------------------------------------------------------------------*/ SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) { size_t i; for (i = 0; methods[i].ml_name; ++i) { const char *c = methods[i].ml_doc; if (c && (c = strstr(c, "swig_ptr: "))) { int j; swig_const_info *ci = 0; const char *name = c + 10; for (j = 0; const_table[j].type; ++j) { if (strncmp(const_table[j].name, name, strlen(const_table[j].name)) == 0) { ci = &(const_table[j]); break; } } if (ci) { void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; if (ptr) { size_t shift = (ci->ptype) - types; swig_type_info *ty = types_initial[shift]; size_t ldoc = (c - methods[i].ml_doc); size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; char *ndoc = (char*)malloc(ldoc + lptr + 10); if (ndoc) { char *buff = ndoc; strncpy(buff, methods[i].ml_doc, ldoc); buff += ldoc; strncpy(buff, "swig_ptr: ", 10); buff += 10; SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); methods[i].ml_doc = ndoc; } } } } } } #ifdef __cplusplus } #endif /* -----------------------------------------------------------------------------* * Partial Init method * -----------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" #endif SWIGEXPORT #if PY_VERSION_HEX >= 0x03000000 PyObject* #else void #endif SWIG_init(void) { PyObject *m, *d, *md; #if PY_VERSION_HEX >= 0x03000000 static struct PyModuleDef SWIG_module = { # if PY_VERSION_HEX >= 0x03020000 PyModuleDef_HEAD_INIT, # else { PyObject_HEAD_INIT(NULL) NULL, /* m_init */ 0, /* m_index */ NULL, /* m_copy */ }, # endif (char *) SWIG_name, NULL, -1, SwigMethods, NULL, NULL, NULL, NULL }; #endif #if defined(SWIGPYTHON_BUILTIN) static SwigPyClientData SwigPyObject_clientdata = { 0, 0, 0, 0, 0, 0, 0 }; static PyGetSetDef this_getset_def = { (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL }; static SwigPyGetSet thisown_getset_closure = { (PyCFunction) SwigPyObject_own, (PyCFunction) SwigPyObject_own }; static PyGetSetDef thisown_getset_def = { (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure }; PyObject *metatype_args; PyTypeObject *builtin_pytype; int builtin_base_count; swig_type_info *builtin_basetype; PyObject *tuple; PyGetSetDescrObject *static_getset; PyTypeObject *metatype; SwigPyClientData *cd; PyObject *public_interface, *public_symbol; PyObject *this_descr; PyObject *thisown_descr; int i; (void)builtin_pytype; (void)builtin_base_count; (void)builtin_basetype; (void)tuple; (void)static_getset; /* metatype is used to implement static member variables. */ metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type); assert(metatype_args); metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL); assert(metatype); Py_DECREF(metatype_args); metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro; assert(PyType_Ready(metatype) >= 0); #endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); #if PY_VERSION_HEX >= 0x03000000 m = PyModule_Create(&SWIG_module); #else m = Py_InitModule((char *) SWIG_name, SwigMethods); #endif md = d = PyModule_GetDict(m); (void)md; SWIG_InitializeModule(0); #ifdef SWIGPYTHON_BUILTIN SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); assert(SwigPyObject_stype); cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; if (!cd) { SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce(); } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) { PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); # if PY_VERSION_HEX >= 0x03000000 return NULL; # else return; # endif } /* All objects have a 'this' attribute */ this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); (void)this_descr; /* All objects have a 'thisown' attribute */ thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); (void)thisown_descr; public_interface = PyList_New(0); public_symbol = 0; (void)public_symbol; PyDict_SetItemString(md, "__all__", public_interface); Py_DECREF(public_interface); for (i = 0; SwigMethods[i].ml_name != NULL; ++i) SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); for (i = 0; swig_const_table[i].name != 0; ++i) SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); #endif SWIG_InstallConstants(d,swig_const_table); #if PY_VERSION_HEX >= 0x03000000 return m; #else return; #endif }
[ "accounts@wilselby.com" ]
accounts@wilselby.com
44b3d8de5e08ca3fcb8d2b51c236cea2b4fb2050
612fe5642da6513b9aa4fe229525c139886777a1
/diluent_AS_2_24_impulse_mod_1.ino
658bfad47e1b6788c0b5c12f1b830c9b674a5290
[]
no_license
acemachine/diluent_AS_2_24_impulse_mod_1
65f65761c5f2f68a54005d4d49eefee25aea72f1
12a8c27946bc6a630da3cee2fbb2f53ac88b8b90
refs/heads/master
2016-09-10T19:34:58.723286
2015-02-25T01:30:06
2015-02-25T01:30:06
31,291,355
0
0
null
null
null
null
UTF-8
C++
false
false
13,116
ino
#include <TimerOne.h> #include <Wire.h> #include <Time.h> #include <Adafruit_PWMServoDriver.h> #define MOTOR_0 204 #define MOTOR_100 408 #define MOTOR_50 ((MOTOR_0+MOTOR_100)/2) #define MOTOR_25 ((MOTOR_0+MOTOR_50)/2) #define MOTOR_12 ((MOTOR_0+MOTOR_25)/2) #define LED_1G 39 #define LED_2A 41 #define LED_3G 43 #define LED_4R 45 #define LED_5R 47 #define LED_6R 49 #define LED_ON(led) digitalWrite(led, LOW) #define LED_OFF(led) digitalWrite(led, HIGH) #define LED_ALLON() LED_ON(LED_1G); LED_ON(LED_2A); LED_ON(LED_3G); LED_ON(LED_4R); LED_ON(LED_5R); LED_ON(LED_6R) #define LED_ALLOFF() LED_OFF(LED_1G); LED_OFF(LED_2A); LED_OFF(LED_3G); LED_OFF(LED_4R); LED_OFF(LED_5R); LED_OFF(LED_6R) #define LED_ERROR(led) LED_OFF(LED_1G); LED_OFF(LED_2A); LED_OFF(LED_3G); LED_ON(led) #define GREEN_TOGGLE 30 #define KNOB1 A11 #define KNOB2 A10 #define KNOB3 A9 #define KNOB4 A8 #define BELT_WAIT A8 #define BELT_STEP 2 #define BELT_DIRECTION 5 #define BELT_ENCODER A13 volatile double next_beltpos = 0; volatile unsigned long belt_watchdog = 0; volatile int pumpDivCount = 0; int pumpSpeedDividor =5; #define STATION_SEAL_MOTOR 14 #define STATION_SEAL_SPEED A9 #define STATION_SEAL_HALL 28 #define STATION_SEAL_HEAT 25 #define STATION_SEAL_TEMP A12 #define STATION_SEAL_TEMP_SET A10 #define STATION_SEAL_TEMP_ERROR() (analogRead(STATION_SEAL_TEMP_SET) - analogRead(STATION_SEAL_TEMP)) volatile enum { SEAL_TURN_1, SEAL_SLOW_SPEED, SEAL_TURN_2, SEAL_DONE, SEAL_OFF, } seal_state = SEAL_OFF; volatile unsigned seal_temperature = 0; #define STATION_FILL_SERVO 13 #define STATION_FILL_SWITCH 27 #define STATION_FILL_UP 235 #define STATION_FILL_CHECK /*222*/ 196 #define STATION_FILL_DOWN 135 #define STATION_FILL_STEP 3 #define STATION_FILL_DIRECTION 6 #define STATION_FILL_STEPS 1025 #define STATION_FILL_SENSOR A14 volatile enum { FILL_RESET, FILL_CHECK_1, FILL_CHECK_2, FILL_PUMP, FILL_SLOW_UP, FILL_DONE, FILL_OFF, } fill_state = FILL_OFF; volatile int fill_stepsleft = 0; #define STATION_CUT_MOTOR 15 #define STATION_CUT_HALL 24 volatile enum { CUT_TURN_1, CUT_TURN_2, CUT_DONE, CUT_OFF, } cut_state = CUT_OFF; Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(); volatile enum { INIT, WAIT, MOVE_BELT, STATIONS, BELT_ERROR, FILL_ERROR, } global_state = INIT; #define IS_ERROR() (global_state == BELT_ERROR || global_state == FILL_ERROR) int debounceRead(int pin) { unsigned value = digitalRead(pin); unsigned last_debounce = millis(); while ((millis() - last_debounce) < 50) { delay(1); int newvalue = digitalRead(pin); if (newvalue != value) { value = newvalue; last_debounce = millis(); } } return value; } void setup() { //Serial.begin(9600); // Initialize the user interface { // Set LEDs to out (active low) pinMode(LED_1G, OUTPUT); pinMode(LED_2A, OUTPUT); pinMode(LED_3G, OUTPUT); pinMode(LED_4R, OUTPUT); pinMode(LED_5R, OUTPUT); pinMode(LED_6R, OUTPUT); // Set up big green button pinMode(GREEN_TOGGLE, INPUT_PULLUP); } LED_ALLON(); // Init I2C PWM board to 50Hz { pwm.begin(); pwm.setPWMFreq(50); // Set PWM to OFF, wait a bit for register pwm.setPWM(STATION_CUT_MOTOR, 0, MOTOR_0); pwm.setPWM(STATION_FILL_SERVO, 0, STATION_FILL_UP); pwm.setPWM(STATION_SEAL_MOTOR, 0, MOTOR_0); delay(1000); } // Initialize the cutter { pinMode(STATION_CUT_HALL, INPUT_PULLUP); // Home cutter motor pwm.setPWM(STATION_CUT_MOTOR, 0, MOTOR_50); while (digitalRead(STATION_CUT_HALL) == 0); while (digitalRead(STATION_CUT_HALL) == 1); pwm.setPWM(STATION_CUT_MOTOR, 0, MOTOR_0); } // Initialize the filler { // Pump stepper pinMode(STATION_FILL_STEP, OUTPUT); pinMode(STATION_FILL_DIRECTION, OUTPUT); digitalWrite(STATION_FILL_DIRECTION, 0); // Fill check switch pinMode(STATION_FILL_SWITCH, INPUT_PULLUP); // Put pump servo in upward position pwm.setPWM(STATION_FILL_SERVO, 0, STATION_FILL_UP); delay(250); } // Initialize sealer { // Configure heater pinMode(STATION_SEAL_HALL, INPUT_PULLUP); pinMode(STATION_SEAL_HEAT, OUTPUT); //digitalWrite(STATION_SEAL_HEAT, 1); //seal_temperature = analogRead(STATION_SEAL_TEMP); // Home sealer motor pwm.setPWM(STATION_SEAL_MOTOR, 0, MOTOR_50); while (digitalRead(STATION_SEAL_HALL) == 0); while (digitalRead(STATION_SEAL_HALL) == 1); pwm.setPWM(STATION_SEAL_MOTOR, 0, MOTOR_0); } // Initialize belt { // Belt stepper pinMode(BELT_STEP, OUTPUT); pinMode(BELT_DIRECTION, OUTPUT); digitalWrite(BELT_DIRECTION, 0); // Get encoder value, set belt home position //next_beltpos = 697.0; next_beltpos = analogRead(BELT_ENCODER); next_beltpos += 102.4 - fmod(next_beltpos, 102.4); } // Initialize CNC shield { // Set CNC shield ENable (active low) pinMode(8, OUTPUT); digitalWrite(8, 0); } // Configure stepper timer interrupt Timer1.initialize(300); Timer1.attachInterrupt(timerint); // Wait for temperature LED_ALLOFF(); LED_ON(LED_2A); while ((analogRead(STATION_SEAL_TEMP_SET) - analogRead(STATION_SEAL_TEMP)) > 0) { delay(100); } // Wait for green button to depress LED_ALLOFF(); LED_ON(LED_3G); while (debounceRead(GREEN_TOGGLE) == 0) { delay(100); } //global_state = WAIT; } void loop() { // Check for errors while (IS_ERROR() && debounceRead(GREEN_TOGGLE) == 0) { delay(100); } LED_OFF(LED_4R); LED_OFF(LED_5R); LED_OFF(LED_6R); handle_pause: global_state = WAIT; // Handle pause while (debounceRead(GREEN_TOGGLE) == 1) { LED_OFF(LED_1G); LED_ON(LED_3G); delay(100); } LED_OFF(LED_3G); // Handle heater LED_OFF(LED_1G); if (!IS_ERROR() && STATION_SEAL_TEMP_ERROR() > 20) { while (!IS_ERROR() && STATION_SEAL_TEMP_ERROR() > 0) { delay(100); } LED_ON(LED_3G); while (debounceRead(GREEN_TOGGLE) == 0) { delay(100); } goto handle_pause; } LED_ON(LED_1G); if (global_state == WAIT) { double old_beltpos = next_beltpos; // Advance belt to next position next_beltpos = fmod(next_beltpos + 102.4, 1024); belt_watchdog = millis(); global_state = MOVE_BELT; // Wait for state change while (global_state == MOVE_BELT) { delay(10); } if (IS_ERROR()) { // Revert old belt position on error next_beltpos = old_beltpos; } } if (global_state == STATIONS) { // Cut station pwm.setPWM(STATION_CUT_MOTOR, 0, MOTOR_100); cut_state = CUT_TURN_1; // Fill station unsigned fill_start = millis(); unsigned fill_tries = 0; unsigned fill_servopos = 0; double fill_sensorval = 0; pwm.setPWM(STATION_FILL_SERVO, 0, STATION_FILL_CHECK); fill_state = FILL_CHECK_1; // Seal station pwm.setPWM(STATION_SEAL_MOTOR, 0, MOTOR_50); seal_state = SEAL_TURN_1; // Wait for state change while ((cut_state != CUT_OFF || fill_state != FILL_OFF || seal_state != SEAL_OFF)) { if (cut_state == CUT_DONE) { pwm.setPWM(STATION_CUT_MOTOR, 0, MOTOR_0); cut_state = CUT_OFF; } unsigned now = millis(); #define FILL_TIME() (now - fill_start) #define FILL_SENSE() (fill_sensorval = analogRead(STATION_FILL_SENSOR)) #define FILL_TRANS(state) { fill_start = millis(); fill_state = state; } if (fill_state == FILL_RESET && FILL_TIME() > 500) { // 3 strikes and you're out if (fill_tries >= 2) { fill_state = FILL_OFF; global_state = FILL_ERROR; LED_ERROR(LED_5R); } else { pwm.setPWM(STATION_FILL_SERVO, 0, STATION_FILL_CHECK); FILL_TRANS(FILL_CHECK_1); } } else if (fill_state == FILL_CHECK_1/* && FILL_TIME() > 500*/) { //pwm.setPWM(STATION_FILL_SERVO, 0, STATION_FILL_DOWN); fill_servopos = STATION_FILL_CHECK; FILL_TRANS(FILL_CHECK_2); //delay(100); FILL_SENSE(); //delay(100); FILL_SENSE(); //delay(100); FILL_SENSE(); //delay(100); FILL_SENSE(); //delay(100); FILL_SENSE(); //delay(100); FILL_SENSE(); } else if (fill_state == FILL_CHECK_2) { //fill torque// if (fill_servopos > STATION_FILL_DOWN) { if (FILL_SENSE() < 400 && fill_servopos > 160 && fill_servopos < 200) { // Fill switch contacted something, bad fill_tries += 1; pwm.setPWM(STATION_FILL_SERVO, 0, STATION_FILL_UP); FILL_TRANS(FILL_RESET); } else { fill_servopos -= 1; pwm.setPWM(STATION_FILL_SERVO, 0, fill_servopos); delay(17); } } else { if (digitalRead(STATION_FILL_SWITCH) == 1) { // Fill switch contacted nothing, empty FILL_TRANS(FILL_DONE); } else { // Fill switch engaged fill_servopos = STATION_FILL_DOWN; fill_stepsleft = STATION_FILL_STEPS; FILL_TRANS(FILL_PUMP); } } } else if (fill_state == FILL_SLOW_UP) { if(fill_servopos < STATION_FILL_UP){ fill_servopos += 1; pwm.setPWM(STATION_FILL_SERVO, 0, fill_servopos); delay(13); } else { FILL_TRANS(FILL_OFF); } } else if (fill_state == FILL_DONE) { pwm.setPWM(STATION_FILL_SERVO, 0, STATION_FILL_UP); fill_state = FILL_OFF; } if (seal_state == SEAL_SLOW_SPEED) { pwm.setPWM(STATION_SEAL_MOTOR, 0, map(analogRead(STATION_SEAL_SPEED), 0, 1023, map(10, 0, 100, MOTOR_0, MOTOR_100), map(25, 0, 100, MOTOR_0, MOTOR_100))); seal_state = SEAL_TURN_2; } else if (seal_state == SEAL_DONE) { pwm.setPWM(STATION_SEAL_MOTOR, 0, MOTOR_0); seal_state = SEAL_OFF; } delay(1); } // Reset all pwms (in case error happened) pwm.setPWM(STATION_CUT_MOTOR, 0, MOTOR_0); pwm.setPWM(STATION_FILL_SERVO, 0, STATION_FILL_UP); pwm.setPWM(STATION_SEAL_MOTOR, 0, MOTOR_0); cut_state = CUT_OFF; fill_state = FILL_OFF; seal_state = SEAL_OFF; } // Handle knobbed pause delay(map(analogRead(BELT_WAIT), 0, 1023, 0, 5000)); } volatile unsigned count = 0; void timerint() { if (global_state == MOVE_BELT || global_state == INIT) { if(fabs((double)analogRead(BELT_ENCODER) - next_beltpos) > 10.0) { digitalWrite(BELT_STEP, digitalRead(BELT_STEP) ^ 1); } else if (global_state == MOVE_BELT) { // Next step global_state = STATIONS; } } if (global_state == WAIT && digitalRead(GREEN_TOGGLE) == 1 && analogRead(KNOB1) > 512 && analogRead(KNOB1) < 1000) { //-> if ( pumpDivCount >= pumpSpeedDividor) { digitalWrite(STATION_FILL_STEP, digitalRead(STATION_FILL_STEP) ^ 1); pumpDivCount = 0; } else { pumpDivCount++; } //<- digitalWrite(STATION_FILL_STEP, digitalRead(STATION_FILL_STEP) ^ 1); } /*if (global_state == STATIONS)*/ { // Check cutter station if (cut_state == CUT_TURN_1 || cut_state == CUT_TURN_2) { unsigned hall = digitalRead(STATION_CUT_HALL); if (cut_state == CUT_TURN_1 && hall == 1) { cut_state = CUT_TURN_2; } else if (cut_state == CUT_TURN_2 && hall == 0) { cut_state = CUT_DONE; } } // Check fill station if (fill_state == FILL_PUMP) { if (fill_stepsleft > 0 && pumpDivCount >= pumpSpeedDividor) { digitalWrite(STATION_FILL_STEP, digitalRead(STATION_FILL_STEP) ^ 1); fill_stepsleft -= 1; pumpDivCount = 0; } else if (fill_stepsleft > 0) { pumpDivCount++; } else { fill_state = FILL_SLOW_UP; } } // Check seal station if (seal_state == SEAL_TURN_1 || seal_state == SEAL_TURN_2) { unsigned hall = digitalRead(STATION_SEAL_HALL); if (seal_state == SEAL_TURN_1 && hall == 1) { seal_state = SEAL_SLOW_SPEED; } else if (seal_state == SEAL_TURN_2 && hall == 0) { seal_state = SEAL_DONE; } } } if ((count % 1000) == 0) { int err = STATION_SEAL_TEMP_ERROR(); if(!IS_ERROR() && err > 0) { digitalWrite(STATION_SEAL_HEAT, 0); } else{ digitalWrite(STATION_SEAL_HEAT, 1); } if (!IS_ERROR() && err > 20) { LED_ON(LED_2A); } else { LED_OFF(LED_2A); } } // Check watchdogs if (global_state == MOVE_BELT && (millis() - belt_watchdog) > 1000) { global_state = BELT_ERROR; LED_ERROR(LED_4R); } count += 1; }
[ "acemachinedesign@gmail.com" ]
acemachinedesign@gmail.com
02662c266782b8ce6d7f76bbb956f31d2fb3b70f
a18b7682d910cccba92cafe3c90a4feb898fd4f2
/Source/ArenaBattleSetting/Public/studyCharacterSetting.h
ba6631eba465cc34e88dc4f8d44606c4ac540a71
[]
no_license
ckws5341/UE4_Study
22c94681bb9041641921211ee27033cafce37f75
aadf74a434f5865037c9f2d99b11b4d507f6150c
refs/heads/master
2020-06-17T13:03:38.387815
2019-08-16T05:11:57
2019-08-16T05:11:57
195,932,889
0
0
null
null
null
null
UTF-8
C++
false
false
433
h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "UObject/NoExportTypes.h" #include "studyCharacterSetting.generated.h" /** * */ UCLASS(config=StudyUnreal) class ARENABATTLESETTING_API UstudyCharacterSetting : public UObject { GENERATED_BODY() public : UstudyCharacterSetting(); UPROPERTY(config) TArray<FSoftObjectPath> CharacterAssets; };
[ "ckws5341@gmail.com" ]
ckws5341@gmail.com
35f9ee64589c968225bffbe9d8c8c86d157bcca8
41b383b6790c480e2766158901037d468eba62f7
/src/nodes/visual/Shape.h
10a63629eaa41938bbcca6841f39e2fbc657220b
[ "MIT" ]
permissive
hugosilvaguerreiro/ant-engine
774f02dee5b4269bed86da03657491aaebe41f6e
c43d5d8611eeafc37c4a0e08961b2360b56530d9
refs/heads/master
2023-04-18T03:50:16.800504
2021-05-12T23:24:30
2021-05-12T23:24:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
935
h
// // Created by huguntu on 17/04/21. // #ifndef ANT_ENGINE_SHAPE_H #define ANT_ENGINE_SHAPE_H #include "../Node.h" namespace antEngine { struct vertex { int x; int y; }; class Shape : public Node { /** * Shapes are assigned to other Nodes in order to give them a visual aspect * Shapes will be locked to the parent object and will move with it * TODO: Be able to move the shape relative to the parent node **/ public: Shape(const std::string &nodeId, const Position &pos); void ready() override; void step() override; }; class SquareShape : public Shape { public: int size; SquareShape(const std::string &nodeId, const Position &pos, int size); void ready() override; void step() override; void render(Renderer *renderer) override; }; } #endif //ANT_ENGINE_SHAPE_H
[ "hugo.guerreiro@tecnico.ulisboa.pt" ]
hugo.guerreiro@tecnico.ulisboa.pt
398a6674a585df59d230f2ae99c7ec55bd683714
849e8e59bca03602b53c63da631118433ae68048
/include/platform/dirutils.h
ccb63ca62a2d630971a2a5a688c082d0e9111005
[ "Apache-2.0" ]
permissive
premkumr/platform
9e7a34f0122ee6361b2ff5eb3c81be502f6b7892
b87422c1f86069ffe6fd83573b5bea757f8d5ab9
refs/heads/master
2021-01-22T18:42:37.085462
2017-02-10T14:02:45
2017-02-10T14:22:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,506
h
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2016 Couchbase, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <cstdint> #include <string> #include <vector> #include <platform/dirutils-visibility.h> namespace cb { namespace io { /** * Return the directory part of an absolute path */ DIRUTILS_PUBLIC_API std::string dirname(const std::string& dir); /** * Return the filename part of an absolute path */ DIRUTILS_PUBLIC_API std::string basename(const std::string& name); /** * Return a vector containing all of the files starting with a given * name stored in a given directory */ DIRUTILS_PUBLIC_API std::vector<std::string> findFilesWithPrefix(const std::string& dir, const std::string& name); /** * Return a vector containing all of the files starting with a given * name specified with this absolute path */ DIRUTILS_PUBLIC_API std::vector<std::string> findFilesWithPrefix(const std::string& name); /** * Return a vector containing all of the files containing a given * substring located in a given directory */ DIRUTILS_PUBLIC_API std::vector<std::string> findFilesContaining(const std::string& dir, const std::string& name); /** * Delete a file or directory (including subdirectories) */ DIRUTILS_PUBLIC_API bool rmrf(const std::string& path); /** * Check if a directory exists or not */ DIRUTILS_PUBLIC_API bool isDirectory(const std::string& directory); /** * Check if a path exists and is a file */ DIRUTILS_PUBLIC_API bool isFile(const std::string& file); /** * Try to create directory including all of the parent directories * * @param directory the directory to create * @throws std::runtime_error if an error occurs */ DIRUTILS_PUBLIC_API void mkdirp(const std::string& directory); /** * Create a unique temporary filename with the given prefix. * * This method is implemented by using cb_mktemp, but the caller * does not need to add the XXXXXX in the filename. * * @param prefix The prefix to use in the filename. * @return The unique filename */ DIRUTILS_PUBLIC_API std::string mktemp(const std::string& prefix); /** * Get the name of the current working directory * * @return the name of the current working directory * @throws std::system_error if we fail to determine the current working * directory */ DIRUTILS_PUBLIC_API std::string getcwd(void); /** * Try to set the maximum number of file descriptors to the requested * limit, and return the number we could get. * * On a Unix system this limit affects files and sockets * * @param limit the requested maximum number of file descriptors * @return the maximum number of file descriptors * @throws std::system_error if we fail to determine the maximum number * of file descriptor */ DIRUTILS_PUBLIC_API uint64_t maximizeFileDescriptors(uint64_t limit); } }
[ "trond.norbye@gmail.com" ]
trond.norbye@gmail.com
358c65e3c26826172509b5a8614a27183a97ffe7
08b17eb651963352921ccb596b7c61be4a40cdb2
/Video-Tools/AVIMux_GUI/LanguageCodes.cpp
b38ec21407579cac2f774ffda0785c5e466e2483
[]
no_license
BrunoReX/avimuxgui
c798baf50d0bcb4572a97267eb8b5a58c9705ab5
bfe14ecd7bf6fc34c5cab4c241ed788dd6b04b38
refs/heads/master
2021-01-19T15:01:28.551533
2014-03-17T21:27:03
2014-03-17T21:27:03
17,843,935
2
1
null
null
null
null
UTF-8
C++
false
false
3,785
cpp
#include "stdafx.h" #include "LanguageCodes.h" #include "../Strings.h" LANGUAGE_CODE_DESCRIPTOR::LANGUAGE_CODE_DESCRIPTOR() { memset(code, 0, sizeof(code)); memset(full, 0, sizeof(full)); priority = 0; usage_counter = 0.; bSeparator = false; } LANGUAGE_CODE_DESCRIPTOR::~LANGUAGE_CODE_DESCRIPTOR() { } void LANGUAGE_CODE_DESCRIPTOR::IncPriority() { priority++; } void LANGUAGE_CODE_DESCRIPTOR::DecPriority() { if (priority > 0) priority--; } void LANGUAGE_CODE_DESCRIPTOR::IncUsageCounter() { usage_counter += 1; } void LANGUAGE_CODE_DESCRIPTOR::DecUsageCounter() { if (usage_counter > 0) usage_counter -= 1; } void LANGUAGE_CODE_DESCRIPTOR::AgeUsageCounter() { usage_counter /= 1.1f; } void LANGUAGE_CODE_DESCRIPTOR::SetUsageCounter(float count) { usage_counter = count; } void LANGUAGE_CODE_DESCRIPTOR::SetCode(char* c) { memset(code, 0, sizeof(code)); strncpy(code, c, sizeof(code)-1); } void LANGUAGE_CODE_DESCRIPTOR::SetFull(char* c) { memset(full, 0, sizeof(full)); strncpy(full, c, sizeof(full)-1); } char* LANGUAGE_CODE_DESCRIPTOR::GetCode() { return code; } char* LANGUAGE_CODE_DESCRIPTOR::GetFull() { return full; } void LANGUAGE_CODE_DESCRIPTOR::Separator(int _priority) { bSeparator = true; SetPriority(_priority); usage_counter = -1.; } void LANGUAGE_CODE_DESCRIPTOR::SetPriority(int _priority) { priority = _priority; } bool LANGUAGE_CODE_DESCRIPTOR::operator <(const LANGUAGE_CODE_DESCRIPTOR& other) { if (priority < other.priority || priority == other.priority && usage_counter < other.usage_counter) return true; return false; } void LANGUAGE_CODE_DESCRIPTOR::CreateString(char* buf, int buf_len) { _snprintf(buf, buf_len, "%s:%s:%1.4f:%d", code, full, usage_counter, priority); buf[buf_len-1] = 0; } bool LANGUAGE_CODE_DESCRIPTOR::LoadFromString(char* buf) { std::vector<char*> in; split_string(buf, ":", in); if (in.size() != 4) { DeleteStringVector(in); return false; } char* _code = in[0]; int code_len = strlen(_code); char* _full = in[1]; char* _usage_counter = in[2]; char* _priority = in[3]; if (!isint(_priority) || code_len > 4) { DeleteStringVector(in); return false; } priority = atoi(_priority); strcpy(code, _code); strcpy(full, _full); usage_counter = (float)atof(_usage_counter); DeleteStringVector(in); return true; } LANGUAGE_CODES::LANGUAGE_CODES() { } LANGUAGE_CODES::~LANGUAGE_CODES() { } int LANGUAGE_CODES::CreateString(char* buf, int buf_len) { std::vector<LANGUAGE_CODE_DESCRIPTOR>::iterator iter = codes.begin(); int pos = 0; for (; iter != codes.end(); iter++) { iter->CreateString(buf + pos, buf_len - pos); pos += strlen(buf + pos); buf[pos++] = 13; buf[pos++] = 10; } return pos; } int LANGUAGE_CODES::LoadFromString(char* buf) { std::vector<char*> lines; std::vector<char*>::iterator line; split_string(buf, "\x0A", lines); int j = 1; for (line = lines.begin(); line != lines.end(); line++) { if (strlen(*line) > 3) { LANGUAGE_CODE_DESCRIPTOR lcd; if ((*line)[strlen(*line)-1] == 13) (*line)[strlen(*line)-1] = 0; if (!lcd.LoadFromString(*line)) { DeleteStringVector(lines); return -j; } codes.push_back(lcd); } j++; } DeleteStringVector(lines); return 1; } int LANGUAGE_CODES::GetCount() { return codes.size(); } char* LANGUAGE_CODES::GetCode(int index) { if (index >= 0 && (size_t)index < codes.size()) { return codes[index].GetCode(); } return NULL; } char* LANGUAGE_CODES::GetFullName(int index) { if (index >= 0 && (size_t)index < codes.size()) { return codes[index].GetFull(); } return NULL; } LANGUAGE_CODES* language_codes = NULL; LANGUAGE_CODES* GetLanguageCodesObject() { if (!language_codes) language_codes = new LANGUAGE_CODES; return language_codes; }
[ "brunorex@gmail.com" ]
brunorex@gmail.com
21b9ebe63f32610a113b9642e66d4ef62ff6a8b3
fcc170818be293fbf648e9301f39ac13631ed7cc
/AllInOne/PushFramework/include/Protocol.h
65e04073cfb0926621965c7359ab58c39ca4ce42
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
zj19880805/HBnews
92f933ca3b4e971af6b98c544b0f42f261e1d6ea
8bdb29b85c2047f3d3709511b10b580b65b48756
refs/heads/master
2021-01-10T21:26:17.860116
2012-08-09T15:46:03
2012-08-09T15:46:03
5,325,350
1
0
null
null
null
null
UTF-8
C++
false
false
4,442
h
/******************************************************************** File : Protocol.h Creation date : 2010/6/27 License : Copyright 2010 Ahmed Charfeddine, http://www.pushframework.com 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 Protocol__INCLUDED #define Protocol__INCLUDED #pragma once #include "PushFramework.h" #include "DataBuffer.h" namespace PushFramework { class OutgoingPacket; class IncomingPacket; class ConnectionContext; enum SendResult { SendResult_OK, SendResult_Retry, SendResult_NotOK }; /** A subclass of this class defines a communication protocol between Push Framework and remote clients (or a category of remote clients if you are using multiple protocols). Server business code is expected to send responses in form of OutgoingPacket instances. The framework requests the protocol instance to serialize these instances by triggering encoding and framing jobs. Incoming data is handed to the de-serialization functions which in turns calls on user-defined deframing and decoding in order to construct the IncomingPacket instance and its accompanying service id. */ class PUSHFRAMEWORK_API Protocol { public: enum Result { Success = 0, eInsufficientBuffer, eIncompletePacket, eCorruptPacket, eEncodingFailure, eDecodingFailure, eUndefinedFailure, ePacketizingError, }; /** @name TORs **/ //@{ Protocol(void); ~Protocol(void); //@} /** @name Consumed by Push Framework internal code. **/ int serializeOutgoingPacket(OutgoingPacket& packet, DataBuffer& buffer, unsigned int& nWrittenBytes); int tryDeserializeIncomingPacket(DataBuffer& buffer, IncomingPacket*& pPacket, int& serviceId, unsigned int& nExtractedBytes, ConnectionContext* pContext); //@} public: /** @name Serialization. **/ /** \param packet OutgoingPacket instance to encode. Override to encode the OutgoingPacket instance. Save the result into the same input. */ virtual int encodeOutgoingPacket(OutgoingPacket& packet) = 0; /** \param packet OutgoingPacket instance to encode. \param buffer Buffer to write the result to. \param nWrittenBytes Report the total bytes written. Override to write the encoded packet into the intermediate sending buffer. */ virtual int frameOutgoingPacket(OutgoingPacket& packet, DataBuffer& buffer, unsigned int& nWrittenBytes) = 0; //@} /** @name De-serialization. **/ /** \param buffer to read data from. \param pPacket Reference to the output pointer that should store the address of the potentially created instance. \param serviceId Service id value used to route the created instance. \param nExtractedBytes Number of bytes extracted from the buffer. Override to deframe incoming packets from within the received bytes. */ virtual int tryDeframeIncomingPacket(DataBuffer& buffer, IncomingPacket*& pPacket, int& serviceId, unsigned int& nExtractedBytes, ConnectionContext* pContext) = 0; /** \param pPacket The previously deframed instance. \param serviceId Service id value used to route the created instance. Override to decode the created instance. */ virtual int decodeIncomingPacket(IncomingPacket* pPacket, int& serviceId) = 0; /** \param pPacket IncomingPacket instance to delete. Incoming requests are created by the Protocol at time of de-serialization. When the servicing job that treats a requests finishes, the instance is handed back to its creator for deletion. Developer can call on delete or any other way of releasing the instance if a pool of requests is organized. */ virtual void disposeIncomingPacket(IncomingPacket* pPacket) = 0; //@} }; } #endif // Protocol__INCLUDED
[ "416671186@qq.com" ]
416671186@qq.com
d6278ec3902c790581259d866d8e282eee024702
83fed348c038712c028cabd65d07bac6367f9e14
/20. RemoveLinkedListElements.cpp
9c1502eff94382615f697e029cc8f4ebbaf74304
[]
no_license
psoni207/July-LeetCoding-Challenge
4d10f788336de3af76ebce7fcb5a30a69e75e876
8bea34d803cf5eacc96a54d88059e6673d177037
refs/heads/master
2022-11-27T11:29:33.650588
2020-07-31T15:37:47
2020-07-31T15:37:47
276,330,358
0
0
null
null
null
null
UTF-8
C++
false
false
610
cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* removeElements(ListNode* head, int val) { if (head == NULL){ return NULL; } if (head->val == val){ return removeElements(head->next, val); } head->next = removeElements(head->next, val); return head; } };
[ "psoni207@gmail.com" ]
psoni207@gmail.com
45f97d0decf74b5cbbc543f1e034073f4b4b5e8f
6068b516f7adcc47d88264b5fdbb32850499aaba
/BE project/Locker/aadhaar_based_locker_system/aadhaar_based_locker_system.ino
8fe39879ac053bfcfcd33c10ec35b1f5b1d3ce22
[]
no_license
umang-butani/Arduino-Projcts
cb83acd564115b8da2d19944ecd91df3b14898fd
e3e6e2609626c444263f7e56d514eeb57ec1aab4
refs/heads/master
2022-01-24T04:28:58.110099
2019-07-07T04:10:06
2019-07-07T04:10:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,856
ino
/* Aadhar base Locker system by Umang Butani(umangbutani@gmail.com) Date:02-04-2018 */ #include<SoftwareSerial.h> SoftwareSerial BT(12, 13); //TX, RX pins of arduino respetively #include<LiquidCrystal.h> LiquidCrystal lcd(7,6,5,4,3,2); String Aadhar=""; String info=""; volatile int count=0; char inChar; boolean stringComplete = false; // whether the string is complete int flag = 0; //----------//Aadhar data//-------------// String P1="390177559845"; // Change your AADHAAR data here String P2="644084935126"; void setup() { Serial.begin(9600); BT.begin(9600); //lcd.begin(16, 2); // lcd.print("ADVANCE LOCKER SYSTEM"); } void loop() { lcd.setCursor(0, 1); lcd.print("SCAN AADHAR CARD"); while (BT.available()) { inChar = (char)BT.read(); // get the new byte: info += inChar; // add it to the inputString: count ++; // if the incoming character is a newline, set a flag so the main loop can do something about it: if (inChar == '@') { Close(); } if (inChar == '\n') { info=""; Aadhar = info; flag =1; } if(info.length()>29 && info.length()<42) { Aadhar+=inChar; } if (info.length() > 40 && flag==1) { Serial.println(Aadhar); info = ""; { if(Aadhar == P2) { Open(); } else { lcd.setCursor(0, 1); lcd.print("unAuthorized User"); Serial.println("unAuthorized User"); } } flag=0; } } } void Open() { Serial.println("Opening...."); digitalWrite( 2,HIGH); digitalWrite( 3,LOW); delay(700); digitalWrite( 2,LOW); } void Close() { Serial.println("Closing...."); digitalWrite( 3,HIGH); digitalWrite( 2,LOW); delay(1000); digitalWrite( 3,LOW); }
[ "umangbutani@gmail.com" ]
umangbutani@gmail.com
a533e2fa1609db16a719897371073b5ccb0ad5ec
cc57145c6aaed587aae05fe5f7e586f1032409ba
/lhs/cimsim/LhsForm.h
edbc255dd8e03b211c7cb614fe311501c1ea2627
[]
no_license
andygarcia/denmod
f12fb8e0a2691228ce99f0c93c2f3cd318deac86
01f85e803ff8f90f121f1070f194d3f297d93842
refs/heads/master
2020-04-15T14:39:46.321111
2015-06-05T20:29:42
2015-06-05T20:29:42
9,421,998
3
1
null
null
null
null
UTF-8
C++
false
false
12,108
h
#pragma once #include "SensitivityAnalysis.h" #include "SimulationStack.h" using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; namespace lhs { namespace cimsim { public ref class LhsForm : public System::Windows::Forms::Form { public: LhsForm(void); protected: ~LhsForm(void); private: System::Void OnBrowseDml(System::Object^ sender, System::EventArgs^ e); System::Void OnBrowseLsp(System::Object^ sender, System::EventArgs^ e); System::Void OnBrowseOutput(System::Object^ sender, System::EventArgs^ e); System::Void OnRun(System::Object^ sender, System::EventArgs^ e); System::Void ReadFiles( Object ^ sender, DoWorkEventArgs ^ e ); System::Void ReadFilesProgressChanged( Object ^ sender, ProgressChangedEventArgs ^ e ); System::Void ReadFilesCompleted( Object ^ sender, RunWorkerCompletedEventArgs ^ e ); System::Void StartSimulations( Object ^ sender, DoWorkEventArgs ^ e ); System::Void SimulationsProgressChanged( Object ^ sender, ProgressChangedEventArgs ^ e ); System::Void SimulationsCompleted( Object ^ sender, RunWorkerCompletedEventArgs ^ e ); void AppendToOutput( String ^ s ); System::Void OnFormClosing( Object ^ sender, FormClosingEventArgs ^ e ); System::Void OnFormClosed( Object ^ sender, FormClosedEventArgs ^ e ); bool ConfirmStudyCancel(void); private: SensitivityAnalysisParser ^ _parser; int _numberOfRuns; BackgroundWorker ^ _fileReader; SimulationStack ^ _simulationStack; List<BackgroundWorker^> ^ _simulationThreads; int _simulationThreadsCompleted; bool _closeForm; bool _runningStudy; private: System::Windows::Forms::TextBox^ tboxLsp; private: System::Windows::Forms::TextBox^ tboxOutput; private: System::Windows::Forms::Label^ lblLsp; private: System::Windows::Forms::Label^ lblOutput; private: System::Windows::Forms::Button^ btnBrowseLsp; private: System::Windows::Forms::Button^ btnBrowseOutput; private: System::Windows::Forms::Button^ btnRun; private: System::Windows::Forms::TextBox^ tboxDml; private: System::Windows::Forms::Label^ lblDml; private: System::Windows::Forms::Button^ btnBrowseDml; private: System::Windows::Forms::ProgressBar^ pbarRuns; private: System::Windows::Forms::RichTextBox^ rboxOutput; private: System::Windows::Forms::Label^ lblActiveSimulationThreads; private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { this->tboxLsp = (gcnew System::Windows::Forms::TextBox()); this->tboxOutput = (gcnew System::Windows::Forms::TextBox()); this->lblLsp = (gcnew System::Windows::Forms::Label()); this->lblOutput = (gcnew System::Windows::Forms::Label()); this->btnBrowseLsp = (gcnew System::Windows::Forms::Button()); this->btnBrowseOutput = (gcnew System::Windows::Forms::Button()); this->btnRun = (gcnew System::Windows::Forms::Button()); this->tboxDml = (gcnew System::Windows::Forms::TextBox()); this->lblDml = (gcnew System::Windows::Forms::Label()); this->btnBrowseDml = (gcnew System::Windows::Forms::Button()); this->pbarRuns = (gcnew System::Windows::Forms::ProgressBar()); this->rboxOutput = (gcnew System::Windows::Forms::RichTextBox()); this->lblActiveSimulationThreads = (gcnew System::Windows::Forms::Label()); this->SuspendLayout(); // // tboxLsp // this->tboxLsp->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left) | System::Windows::Forms::AnchorStyles::Right)); this->tboxLsp->Location = System::Drawing::Point(105, 43); this->tboxLsp->Name = L"tboxLsp"; this->tboxLsp->Size = System::Drawing::Size(434, 20); this->tboxLsp->TabIndex = 0; // // tboxOutput // this->tboxOutput->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left) | System::Windows::Forms::AnchorStyles::Right)); this->tboxOutput->Location = System::Drawing::Point(105, 72); this->tboxOutput->Name = L"tboxOutput"; this->tboxOutput->Size = System::Drawing::Size(434, 20); this->tboxOutput->TabIndex = 1; // // lblLsp // this->lblLsp->AutoSize = true; this->lblLsp->Location = System::Drawing::Point(12, 46); this->lblLsp->Name = L"lblLsp"; this->lblLsp->Size = System::Drawing::Size(52, 13); this->lblLsp->TabIndex = 2; this->lblLsp->Text = L".LSP File:"; // // lblOutput // this->lblOutput->AutoSize = true; this->lblOutput->Location = System::Drawing::Point(12, 75); this->lblOutput->Name = L"lblOutput"; this->lblOutput->Size = System::Drawing::Size(87, 13); this->lblOutput->TabIndex = 2; this->lblOutput->Text = L"Output Directory:"; // // btnBrowseLsp // this->btnBrowseLsp->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right)); this->btnBrowseLsp->Location = System::Drawing::Point(545, 41); this->btnBrowseLsp->Name = L"btnBrowseLsp"; this->btnBrowseLsp->Size = System::Drawing::Size(75, 23); this->btnBrowseLsp->TabIndex = 3; this->btnBrowseLsp->Text = L"Browse"; this->btnBrowseLsp->UseVisualStyleBackColor = true; this->btnBrowseLsp->Click += gcnew System::EventHandler(this, &LhsForm::OnBrowseLsp); // // btnBrowseOutput // this->btnBrowseOutput->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right)); this->btnBrowseOutput->Location = System::Drawing::Point(545, 70); this->btnBrowseOutput->Name = L"btnBrowseOutput"; this->btnBrowseOutput->Size = System::Drawing::Size(75, 23); this->btnBrowseOutput->TabIndex = 3; this->btnBrowseOutput->Text = L"Browse"; this->btnBrowseOutput->UseVisualStyleBackColor = true; this->btnBrowseOutput->Click += gcnew System::EventHandler(this, &LhsForm::OnBrowseOutput); // // btnRun // this->btnRun->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right)); this->btnRun->Location = System::Drawing::Point(545, 561); this->btnRun->Name = L"btnRun"; this->btnRun->Size = System::Drawing::Size(75, 23); this->btnRun->TabIndex = 4; this->btnRun->Text = L"Run"; this->btnRun->UseVisualStyleBackColor = true; this->btnRun->Click += gcnew System::EventHandler(this, &LhsForm::OnRun); // // tboxDml // this->tboxDml->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left) | System::Windows::Forms::AnchorStyles::Right)); this->tboxDml->Location = System::Drawing::Point(105, 14); this->tboxDml->Name = L"tboxDml"; this->tboxDml->Size = System::Drawing::Size(434, 20); this->tboxDml->TabIndex = 0; // // lblDml // this->lblDml->AutoSize = true; this->lblDml->Location = System::Drawing::Point(12, 17); this->lblDml->Name = L"lblDml"; this->lblDml->Size = System::Drawing::Size(52, 13); this->lblDml->TabIndex = 2; this->lblDml->Text = L".DML File"; // // btnBrowseDml // this->btnBrowseDml->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right)); this->btnBrowseDml->Location = System::Drawing::Point(545, 12); this->btnBrowseDml->Name = L"btnBrowseDml"; this->btnBrowseDml->Size = System::Drawing::Size(75, 23); this->btnBrowseDml->TabIndex = 3; this->btnBrowseDml->Text = L"Browse"; this->btnBrowseDml->UseVisualStyleBackColor = true; this->btnBrowseDml->Click += gcnew System::EventHandler(this, &LhsForm::OnBrowseDml); // // pbarRuns // this->pbarRuns->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left) | System::Windows::Forms::AnchorStyles::Right)); this->pbarRuns->Location = System::Drawing::Point(12, 121); this->pbarRuns->Name = L"pbarRuns"; this->pbarRuns->Size = System::Drawing::Size(608, 23); this->pbarRuns->TabIndex = 5; // // rboxOutput // this->rboxOutput->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) | System::Windows::Forms::AnchorStyles::Left) | System::Windows::Forms::AnchorStyles::Right)); this->rboxOutput->HideSelection = false; this->rboxOutput->Location = System::Drawing::Point(12, 150); this->rboxOutput->Name = L"rboxOutput"; this->rboxOutput->Size = System::Drawing::Size(608, 405); this->rboxOutput->TabIndex = 9; this->rboxOutput->Text = L""; // // lblActiveSimulationThreads // this->lblActiveSimulationThreads->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left)); this->lblActiveSimulationThreads->AutoSize = true; this->lblActiveSimulationThreads->Location = System::Drawing::Point(9, 566); this->lblActiveSimulationThreads->Name = L"lblActiveSimulationThreads"; this->lblActiveSimulationThreads->Size = System::Drawing::Size(127, 13); this->lblActiveSimulationThreads->TabIndex = 11; this->lblActiveSimulationThreads->Text = L"Active simulation threads:"; this->lblActiveSimulationThreads->Visible = false; // // LhsForm // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(632, 596); this->Controls->Add(this->lblActiveSimulationThreads); this->Controls->Add(this->rboxOutput); this->Controls->Add(this->pbarRuns); this->Controls->Add(this->btnRun); this->Controls->Add(this->btnBrowseOutput); this->Controls->Add(this->btnBrowseDml); this->Controls->Add(this->btnBrowseLsp); this->Controls->Add(this->lblDml); this->Controls->Add(this->lblOutput); this->Controls->Add(this->lblLsp); this->Controls->Add(this->tboxDml); this->Controls->Add(this->tboxOutput); this->Controls->Add(this->tboxLsp); this->MinimumSize = System::Drawing::Size(640, 480); this->Name = L"LhsForm"; this->Text = L"CIMSiM Sensitivity Analysis Study"; this->FormClosed += gcnew System::Windows::Forms::FormClosedEventHandler(this, &LhsForm::OnFormClosed); this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &LhsForm::OnFormClosing); this->ResumeLayout(false); this->PerformLayout(); } #pragma endregion }; } }
[ "andygarcia@gmail.com" ]
andygarcia@gmail.com
17ee325a80e8810a3b9ddb844ea64c726f4c9396
4aa8fe70dcd61dc77820ea8b353794feb86984eb
/hittable.h
756c93ca59a8789cbeae3678c9c08942bb1ad22b
[]
no_license
dhui626/RayTracing
7faded09db1d6b9982e937f72177867f2a8c4146
4f5d8ce7cd96dfc114d9ce15adc47ac310b094b9
refs/heads/main
2023-06-15T06:40:19.993231
2021-07-18T02:37:24
2021-07-18T02:37:24
386,942,241
0
0
null
null
null
null
GB18030
C++
false
false
606
h
#ifndef HITTABLE_H #define HITTABLE_H #include "ray.h" class material; struct hit_record { // 记录交点的位置、法向、t值 Vector3f p; Vector3f n; std::shared_ptr<material> mat_ptr; double t; bool front_face; // 待修改 inline void set_face_normal(const ray& r, const Vector3f& outward_normal) { front_face = r.direction().dot(outward_normal) < 0; n = front_face ? outward_normal : -outward_normal; } }; class hittable { public: virtual bool hit(const ray& r, double t_min, double t_max, hit_record& rec) const = 0; }; #endif
[ "linzhehui626@mail.ustc.edu.cn" ]
linzhehui626@mail.ustc.edu.cn
cb4f9c12d420bc4f8acbaf627fde1a37f9a7457e
65bf5f335bfd9a258e97c81839cd564593341b19
/src/debug/debug-scopes.h
f3b79b9645dee20707d1fe449dff8d36576e44d5
[ "BSD-3-Clause", "bzip2-1.0.6" ]
permissive
mstoodle/v8
44002ffb746a70c7832bb4eb9bd72201641a7eeb
3dc43a7550c7142c940681492e3f792dc91f0122
refs/heads/master
2020-12-14T09:57:17.164068
2016-04-04T13:00:34
2016-04-04T13:01:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,242
h
// Copyright 2015 the V8 project 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 V8_DEBUG_DEBUG_SCOPES_H_ #define V8_DEBUG_DEBUG_SCOPES_H_ #include "src/debug/debug-frames.h" #include "src/frames.h" namespace v8 { namespace internal { // Iterate over the actual scopes visible from a stack frame or from a closure. // The iteration proceeds from the innermost visible nested scope outwards. // All scopes are backed by an actual context except the local scope, // which is inserted "artificially" in the context chain. class ScopeIterator { public: enum ScopeType { ScopeTypeGlobal = 0, ScopeTypeLocal, ScopeTypeWith, ScopeTypeClosure, ScopeTypeCatch, ScopeTypeBlock, ScopeTypeScript, ScopeTypeModule }; static const int kScopeDetailsTypeIndex = 0; static const int kScopeDetailsObjectIndex = 1; static const int kScopeDetailsNameIndex = 2; static const int kScopeDetailsStartPositionIndex = 3; static const int kScopeDetailsEndPositionIndex = 4; static const int kScopeDetailsFunctionIndex = 5; static const int kScopeDetailsSize = 6; enum Option { DEFAULT, IGNORE_NESTED_SCOPES, COLLECT_NON_LOCALS }; ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector, Option options = DEFAULT); ScopeIterator(Isolate* isolate, Handle<JSFunction> function); MUST_USE_RESULT MaybeHandle<JSObject> MaterializeScopeDetails(); // More scopes? bool Done() { DCHECK(!failed_); return context_.is_null(); } bool Failed() { return failed_; } // Move to the next scope. void Next(); // Return the type of the current scope. ScopeType Type(); // Return the JavaScript object with the content of the current scope. MaybeHandle<JSObject> ScopeObject(); bool HasContext(); // Set variable value and return true on success. bool SetVariableValue(Handle<String> variable_name, Handle<Object> new_value); Handle<ScopeInfo> CurrentScopeInfo(); // Return the context for this scope. For the local context there might not // be an actual context. Handle<Context> CurrentContext(); // Populate the set with collected non-local variable names. Handle<StringSet> GetNonLocals(); #ifdef DEBUG // Debug print of the content of the current scope. void DebugPrint(); #endif private: struct ExtendedScopeInfo { ExtendedScopeInfo(Handle<ScopeInfo> info, int start, int end) : scope_info(info), start_position(start), end_position(end) {} Handle<ScopeInfo> scope_info; int start_position; int end_position; }; Isolate* isolate_; FrameInspector* const frame_inspector_; Handle<Context> context_; List<ExtendedScopeInfo> nested_scope_chain_; Handle<StringSet> non_locals_; bool seen_script_scope_; bool failed_; inline JavaScriptFrame* GetFrame() { return frame_inspector_->GetArgumentsFrame(); } inline Handle<JSFunction> GetFunction() { return Handle<JSFunction>::cast(frame_inspector_->GetFunction()); } void RetrieveScopeChain(Scope* scope); void CollectNonLocals(Scope* scope); MUST_USE_RESULT MaybeHandle<JSObject> MaterializeScriptScope(); MUST_USE_RESULT MaybeHandle<JSObject> MaterializeLocalScope(); MUST_USE_RESULT MaybeHandle<JSObject> MaterializeModuleScope(); Handle<JSObject> MaterializeClosure(); Handle<JSObject> MaterializeCatchScope(); Handle<JSObject> MaterializeBlockScope(); bool SetLocalVariableValue(Handle<String> variable_name, Handle<Object> new_value); bool SetBlockVariableValue(Handle<String> variable_name, Handle<Object> new_value); bool SetClosureVariableValue(Handle<String> variable_name, Handle<Object> new_value); bool SetScriptVariableValue(Handle<String> variable_name, Handle<Object> new_value); bool SetCatchVariableValue(Handle<String> variable_name, Handle<Object> new_value); bool SetContextLocalValue(Handle<ScopeInfo> scope_info, Handle<Context> context, Handle<String> variable_name, Handle<Object> new_value); void CopyContextLocalsToScopeObject(Handle<ScopeInfo> scope_info, Handle<Context> context, Handle<JSObject> scope_object); bool CopyContextExtensionToScopeObject(Handle<JSObject> extension, Handle<JSObject> scope_object, KeyCollectionType type); // Get the chain of nested scopes within this scope for the source statement // position. The scopes will be added to the list from the outermost scope to // the innermost scope. Only nested block, catch or with scopes are tracked // and will be returned, but no inner function scopes. void GetNestedScopeChain(Isolate* isolate, Scope* scope, int statement_position); DISALLOW_IMPLICIT_CONSTRUCTORS(ScopeIterator); }; } // namespace internal } // namespace v8 #endif // V8_DEBUG_DEBUG_SCOPES_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
e8f3b7f7229e7f6ff093aa7f44109ec5f1999cf1
e335ddf2bac4fd18e1890c10bfbd1b8310eee433
/src/toolkits/parsers/mi.cpp
d9d9376530fa3d28142b03aefa9001d5acdca9be
[ "Apache-2.0" ]
permissive
arturochian/RcppGraphChi
b5a9fbfb507ad0ede39424e5cdc0aab2ef2fef73
8f41ad5388d9eaeb210f06782fe76081351a6e88
refs/heads/master
2020-02-26T17:42:16.782790
2014-12-20T05:22:20
2014-12-20T05:22:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,164
cpp
/** * Copyright (c) 2009 Carnegie Mellon University. * 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. * * Written by Danny Bickson, CMU * * * This program reads a text input file, where each line * is taken from another document. The program counts the number of word * occurances for each line (document) and outputs a document word count to be used * in LDA. */ #include <cstdio> #include <iostream> #include <map> #include <omp.h> #include <assert.h> #include "graphchi_basic_includes.hpp" #include "../collaborative_filtering/timer.hpp" #include "../collaborative_filtering/util.hpp" #include "common.hpp" #include <math.h> #include <iomanip> using namespace std; using namespace graphchi; bool debug = false; timer mytime; size_t lines; unsigned long long total_lines = 0; string dir; string outdir; std::vector<std::string> in_files; //non word tokens that will be removed in the parsing //it is possible to add additional special characters or remove ones you want to keep const char spaces[] = {" \r\n\t!?@#$%^&*()-+.,~`\";:/"}; const char qoute[] = {",\""}; const char comma[] = {","}; int has_header_titles = 1; std::map<std::string, int> p_x; std::map<std::string, int> p_y; int n = 0; std::vector<std::string> header_titles; int from_val = -1; int to_val = -1; void parse(int i){ in_file fin(in_files[i]); size_t linesize = 0; char * saveptr = NULL, * saveptr2 = NULL,* linebuf = NULL; size_t line = 1; uint id; if (has_header_titles){ char * linebuf = NULL; size_t linesize; char linebuf_debug[1024]; /* READ LINE */ int rc = getline(&linebuf, &linesize, fin.outf); if (rc == -1) logstream(LOG_FATAL)<<"Error header line " << " [ " << linebuf_debug << " ] " << std::endl; strncpy(linebuf_debug, linebuf, 1024); char *pch = strtok(linebuf,"\t,\r;\""); if (pch == NULL) logstream(LOG_FATAL)<<"Error header line " << " [ " << linebuf_debug << " ] " << std::endl; for (int j=0; j < strlen(pch); j++) if (pch[j] == ' ') pch[j] = '_'; header_titles.push_back(pch); if (debug) printf("Found title: %s\n", pch); while (pch != NULL){ pch = strtok(NULL, "\t,\r;\""); if (pch == NULL || pch[0] == '\0') break; for (int j=0; j < strlen(pch); j++) if (pch[j] == ' ') pch[j] = '_'; header_titles.push_back(pch); if (debug) printf("Found title: %s\n", pch); } } while(true){ int rc = getline(&linebuf, &linesize, fin.outf); if (rc < 1) return; int index = 0; char frombuf[256]; char tobuf[256]; char *pch = strtok_r(linebuf, ",\"", &saveptr); if (!pch){ logstream(LOG_ERROR) << "Error when parsing file: " << in_files[i] << ":" << line << "[" << linebuf << "]" << std::endl; return; } if (debug) printf("Found token 1 %s\n", pch); if (pch[0] == '"') pch++; index++; bool found_from = false, found_to = false; int from,to; if (index == from_val){ strncpy(frombuf, pch, 256); found_from = true; } if (index == to_val){ strncpy(tobuf, pch, 256); found_to = true; } while(true){ pch = strtok_r(NULL, ",\"", &saveptr); if (pch == NULL) break; index++; if (debug) printf("Found token %d %s\n", index, pch); if (pch[0] == '"') pch++; if (index > from_val && index > to_val) break; if (index == from_val){ strncpy(frombuf, pch, 256); found_from = true; } if (index == to_val){ strncpy(tobuf, pch, 256); found_to = true; } } char totalbuf[512]; assert(found_from && found_to); sprintf(totalbuf, "%s_%s", frombuf, tobuf); if (debug) printf("Incrementing map: %s\n", totalbuf); frommap.string2nodeid[totalbuf]++; p_x[frombuf]++; p_y[tobuf]++; n++; } } int main(int argc, const char *argv[]) { Rcpp::Rcout<<"GraphChi parsers library is written by Danny Bickson (c). Send any " " comments or bug reports to danny.bickson@gmail.com " << std::endl; global_logger().set_log_level(LOG_INFO); global_logger().set_log_to_console(true); graphchi_init(argc, argv); debug = get_option_int("debug", 0); dir = get_option_string("file_list"); lines = get_option_int("lines", 0); omp_set_num_threads(get_option_int("ncpus", 1)); from_val = get_option_int("from_val", from_val); to_val = get_option_int("to_val", to_val); if (from_val == -1) logstream(LOG_FATAL)<<"Must set from/to " << std::endl; mytime.start(); FILE * f = fopen(dir.c_str(), "r"); if (f == NULL) logstream(LOG_FATAL)<<"Failed to open file list!"<<std::endl; while(true){ char buf[256]; int rc = fscanf(f, "%s\n", buf); if (rc < 1) break; in_files.push_back(buf); } if (in_files.size() == 0) logstream(LOG_FATAL)<<"Failed to read any file frommap from the list file: " << dir << std::endl; #pragma omp parallel for for (int i=0; i< (int)in_files.size(); i++) parse(i); std::cout << "Finished in " << mytime.current_time() << std::endl; int total_x =0 , total_y = 0; std::map<std::string, int>::iterator it; double h = 0; for (it = p_x.begin(); it != p_x.end(); it++){ total_x+= it->second; h-= (it->second / (double)n)*log2(it->second / (double)n); } for (it = p_y.begin(); it != p_y.end(); it++) total_y+= it->second; assert(total_x == n); assert(total_y == n); double mi = 0; std::map<std::string, uint>::iterator iter; assert(n != 0); int total_p_xy = 0; for (iter = frommap.string2nodeid.begin() ; iter != frommap.string2nodeid.end(); iter++){ double p_xy = iter->second / (double)n; assert(p_xy > 0); char buf[256]; strncpy(buf, iter->first.c_str(), 256); char * first = strtok(buf, "_"); char * second = strtok(NULL, "\n\r "); assert(first && second); double px = p_x[first] / (double)n; double py = p_y[second] / (double)n; assert(px > 0 && py > 0); mi += p_xy * log2(p_xy / (px * py)); total_p_xy += iter->second; } assert(total_p_xy == n); logstream(LOG_INFO)<<"Total examples: " <<n << std::endl; logstream(LOG_INFO)<<"Unique p(x) " << p_x.size() << std::endl; logstream(LOG_INFO)<<"Unique p(y) " << p_y.size() << std::endl; logstream(LOG_INFO)<<"Average F(x) " << total_x / (double)p_x.size() << std::endl; logstream(LOG_INFO)<<"Average F(y) " << total_y / (double)p_y.size() << std::endl; std::cout<<"Mutual information of " << from_val << " [" << header_titles[from_val-1] << "] <-> " << to_val << " [" << header_titles[to_val-1] << "] is: " ; if (mi/h > 1e-3) std::cout<<std::setprecision(3) << mi << std::endl; else std::cout<<"-"<<std::endl; save_map_to_text_file(frommap.string2nodeid, outdir + dir + "map.text"); logstream(LOG_INFO)<<"Saving map file " << outdir << dir << "map.text" << std::endl; return 0; }
[ "qkou@umail.iu.edu" ]
qkou@umail.iu.edu
1aef67db5512dd7180890a8a3d9e68b66a09d9bd
3f1cd82c58f759c71dc717311a5bd8868fde109f
/payload/flight-m0/src/IMU.cpp
8d6410485b46c361225c132a6f62e33bdb4ed0fa
[]
no_license
KeelyHill/Sounding-Rocket-Software
eddb0bf9cd67eec474765e365bcf24843a026109
33028f54e282e0add3d2dbeb0e14081cf226eea8
refs/heads/master
2021-09-29T03:44:26.025941
2018-11-23T16:12:48
2018-11-23T16:12:57
111,454,920
2
1
null
null
null
null
UTF-8
C++
false
false
4,578
cpp
#ifndef IMU_CPP #define IMU_CPP #include <../lib/Adafruit_LSM9DS1/Adafruit_LSM9DS1.h> #include <Adafruit_Sensor.h> #include <Madgwick.h> #include <Mahony.h> #include "global.h" class IMU { Adafruit_LSM9DS1 lsm = Adafruit_LSM9DS1(); // i2c sensor // Adafruit_LSM9DS1 lsm = Adafruit_LSM9DS1(SS_ACCEL, SS_ACCEL); // Adafruit_LSM9DS1 lsm = Adafruit_LSM9DS1(LSM9DS1_XGCS, LSM9DS1_MCS); sensors_event_t accel, mag, gyro, temp; uint32_t lastIMUSamp = 0; // millis /* Calibration values */ // Offsets applied to raw x/y/z mag values const float magOffsets[3] = { 66.2F, 4.45, -5.99F }; // Soft iron error compensation matrix const float magSoftironMatrix[3][3] = { { 1.028, 0.056, 0.202 }, { 0.056, 0.910, 0.038 }, { 0.202, 0.038, 1.1113 } }; const float magFieldStrength = 52.85F; // Offsets applied to compensate for gyro zero-drift error for x/y/z const float gyroZeroOffsets[3] = { 0.0F, 0.0F, 0.0F }; public: Mahony filter; // lighter weight // Madgwick filter; /** Starts the LSM device, if successful also sets sensor ranges. */ bool begin() { if (lsm.begin()) { // accelerometer range lsm.setupAccel(lsm.LSM9DS1_ACCELRANGE_2G); // 2, 4, 8, 16 // magnetometer sensitivity lsm.setupMag(lsm.LSM9DS1_MAGGAIN_4GAUSS); // 4, 8, 12, 16 // Setup the gyroscope lsm.setupGyro(lsm.LSM9DS1_GYROSCALE_245DPS); // 245, 500, 2000 return true; } return false; } /** Samples the LSM device (over whichever bus) and updates the orientation filter. */ void sample() { lsm.getEvent(&accel, &mag, &gyro, &temp); double delta_IMU_time = millis()/1000.0f - lastIMUSamp/1000.0f; lastIMUSamp = millis(); // float heading = atan2(mag.magnetic.y, mag.magnetic.x); // atan2(y/x) // Serial.print(heading * 180/M_PI); Serial.print(" - "); Serial.print(mag.magnetic.x); Serial.print(" "); Serial.print(mag.magnetic.y); Serial.print(" "); Serial.println(mag.magnetic.z); // Apply mag offset compensation (base values in uTesla) float mx_ = mag.magnetic.x - magOffsets[0]; float my_ = mag.magnetic.y - magOffsets[1]; float mz_ = mag.magnetic.z - magOffsets[2]; // Apply mag soft iron error compensation float mx = mx_ * magSoftironMatrix[0][0] + my_ * magSoftironMatrix[0][1] + mz_ * magSoftironMatrix[0][2]; float my = mx_ * magSoftironMatrix[1][0] + my_ * magSoftironMatrix[1][1] + mz_ * magSoftironMatrix[1][2]; float mz = mx_ * magSoftironMatrix[2][0] + my_ * magSoftironMatrix[2][1] + mz_ * magSoftironMatrix[2][2]; // Apply gyro zero-rate error compensation float gx = gyro.gyro.x + gyroZeroOffsets[0]; float gy = gyro.gyro.y + gyroZeroOffsets[1]; float gz = gyro.gyro.z + gyroZeroOffsets[2]; // The filter library expects gyro data in degrees/s, but adafruit sensor // uses rad/s so we need to convert them first (or adapt the filter lib // where they are being converted) gx *= 57.2958F; gy *= 57.2958F; gz *= 57.2958F; filter.update(gx, gy, gz, accel.acceleration.x, accel.acceleration.y, accel.acceleration.z, mx, my, mz, delta_IMU_time); // // filter.updateIMU(gx, gy, gz, // accel.acceleration.x, accel.acceleration.y, accel.acceleration.z, // delta_IMU_time); if (DEBUG) { // Serial.print(" dT (ms):"); // Serial.println(delta_IMU_time); } } void debugPrint() { if (DEBUG) { float roll = filter.getRoll(); float pitch = filter.getPitch(); float yaw = filter.getYaw(); Serial.print(millis()); Serial.print(" - Orientation: "); Serial.print(yaw); Serial.print(" "); Serial.print(pitch); Serial.print(" "); Serial.println(roll); } } /** Prints raw data to serial for calibration (call after sample()). https://learn.adafruit.com/nxp-precision-9dof-breakout/calibration-usb */ void calibrationPrint() { Serial.print("Raw:"); Serial.print((int)(accel.acceleration.x * 1000)); Serial.print(","); Serial.print((int)(accel.acceleration.y * 1000)); Serial.print(","); Serial.print((int)(accel.acceleration.z * 1000)); Serial.print(","); Serial.print((int)(gyro.gyro.x * 1000)); Serial.print(","); Serial.print((int)(gyro.gyro.y * 1000)); Serial.print(","); Serial.print((int)(gyro.gyro.z * 1000)); Serial.print(","); Serial.print((int)(mag.magnetic.x * 1000)); Serial.print(","); Serial.print((int)(mag.magnetic.y * 1000)); Serial.print(","); Serial.print((int)(mag.magnetic.z * 1000)); Serial.println(); } }; #endif
[ "KeelyHill@gmx.com" ]
KeelyHill@gmx.com
b9803612ce3366d5767aaac32af1eb0b595c8702
cdb484ada723112d92c5371be32fa86a7e5c3d51
/include/TAO/CIAO/ccm/CCM_PrimaryKeyBaseC.h
825f513626231a1aa51a341296fa7c7859550854
[]
no_license
EnergonV/ACE_TAO
e68266224833e3ce0c967aa9df03e5b556cae791
c8e41e1ce710e68c5954aceb207a8a163000c9f2
refs/heads/master
2021-05-07T18:59:43.956077
2017-10-30T15:55:43
2017-10-30T15:55:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,376
h
// -*- C++ -*- /** * Code generated by the The ACE ORB (TAO) IDL Compiler v2.3.2 * TAO and the TAO IDL Compiler have been developed by: * Center for Distributed Object Computing * Washington University * St. Louis, MO * USA * http://www.cs.wustl.edu/~schmidt/doc-center.html * and * Distributed Object Computing Laboratory * University of California at Irvine * Irvine, CA * USA * and * Institute for Software Integrated Systems * Vanderbilt University * Nashville, TN * USA * http://www.isis.vanderbilt.edu/ * * Information about TAO is available at: * http://www.dre.vanderbilt.edu/~schmidt/TAO.html **/ // TAO_IDL - Generated from // be\be_codegen.cpp:149 #ifndef _TAO_IDL_CCM_PRIMARYKEYBASEC_BYSWJJ_H_ #define _TAO_IDL_CCM_PRIMARYKEYBASEC_BYSWJJ_H_ #include /**/ "ace/pre.h" #include /**/ "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include /**/ "CCM_Stub_Export.h" #include "tao/AnyTypeCode/AnyTypeCode_methods.h" #include "tao/AnyTypeCode/Any.h" #include "tao/ORB.h" #include "tao/Basic_Types.h" #include "tao/Arg_Traits_T.h" #include "tao/Basic_Arguments.h" #include "tao/Special_Basic_Arguments.h" #include "tao/Any_Insert_Policy_T.h" #include "tao/Fixed_Size_Argument_T.h" #include "tao/Var_Size_Argument_T.h" #include /**/ "tao/Version.h" #include /**/ "tao/Versioned_Namespace.h" #if TAO_MAJOR_VERSION != 2 || TAO_MINOR_VERSION != 3 || TAO_BETA_VERSION != 2 #error This file should be regenerated with TAO_IDL #endif #if defined (TAO_EXPORT_MACRO) #undef TAO_EXPORT_MACRO #endif #define TAO_EXPORT_MACRO CCM_STUB_Export // TAO_IDL - Generated from // be\be_visitor_arg_traits.cpp:66 TAO_BEGIN_VERSIONED_NAMESPACE_DECL // Arg traits specializations. namespace TAO { } TAO_END_VERSIONED_NAMESPACE_DECL // TAO_IDL - Generated from // be\be_visitor_traits.cpp:60 TAO_BEGIN_VERSIONED_NAMESPACE_DECL // Traits specializations. namespace TAO { } TAO_END_VERSIONED_NAMESPACE_DECL // TAO_IDL - Generated from // be\be_codegen.cpp:1700 #if defined (__ACE_INLINE__) #include "CCM_PrimaryKeyBaseC.inl" #endif /* defined INLINE */ #include /**/ "ace/post.h" #endif /* ifndef */
[ "vit_klich@list.ru" ]
vit_klich@list.ru
95edc62a3f7bd18058bad381782ec764b12d39a3
2c62385f15b1f8e6072138d5175d7a70dd236b98
/blazetest/src/mathtest/smatdmatadd/MCaHDa.cpp
c48bc5084303abe87f2b4d3c4cb7a7ca8c7e3c35
[ "BSD-3-Clause" ]
permissive
lyxm/blaze
665e4c6f6e1a717973d2d98e148c720030843266
10dbaa368790316b5e044cfe9b92f5534f60a2dc
refs/heads/master
2021-01-12T20:31:45.197297
2015-10-15T21:39:17
2015-10-15T21:39:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,092
cpp
//================================================================================================= /*! // \file src/mathtest/smatdmatadd/MCaHDa.cpp // \brief Source file for the MCaHDa sparse matrix/dense matrix addition math test // // Copyright (C) 2013 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. Redistribution and use in source and binary // forms, with or without modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of // conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list // of conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // 3. Neither the names of the Blaze development group nor the names of its contributors // may be used to endorse or promote products derived from this software without specific // prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT // SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR // BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. */ //================================================================================================= //************************************************************************************************* // Includes //************************************************************************************************* #include <cstdlib> #include <iostream> #include <blaze/math/CompressedMatrix.h> #include <blaze/math/DynamicMatrix.h> #include <blaze/math/HermitianMatrix.h> #include <blazetest/mathtest/Creator.h> #include <blazetest/mathtest/smatdmatadd/OperationTest.h> #include <blazetest/system/MathTest.h> //================================================================================================= // // MAIN FUNCTION // //================================================================================================= //************************************************************************************************* int main() { std::cout << " Running 'MCaHDa'..." << std::endl; using blazetest::mathtest::TypeA; try { // Matrix type definitions typedef blaze::CompressedMatrix<TypeA> MCa; typedef blaze::HermitianMatrix< blaze::DynamicMatrix<TypeA> > HDa; // Creator type definitions typedef blazetest::Creator<MCa> CMCa; typedef blazetest::Creator<HDa> CHDa; // Running tests with small matrices for( size_t i=0UL; i<=6UL; ++i ) { for( size_t j=0UL; j<=i*i; ++j ) { RUN_SMATDMATADD_OPERATION_TEST( CMCa( i, i, j ), CHDa( i ) ); } } // Running tests with large matrices RUN_SMATDMATADD_OPERATION_TEST( CMCa( 67UL, 67UL, 7UL ), CHDa( 67UL ) ); RUN_SMATDMATADD_OPERATION_TEST( CMCa( 128UL, 128UL, 16UL ), CHDa( 128UL ) ); } catch( std::exception& ex ) { std::cerr << "\n\n ERROR DETECTED during sparse matrix/dense matrix addition:\n" << ex.what() << "\n"; return EXIT_FAILURE; } return EXIT_SUCCESS; } //*************************************************************************************************
[ "klaus.iglberger@gmail.com" ]
klaus.iglberger@gmail.com
9791b12c0c3c6cc1b3593dad9c17d4af680d8645
42813f15accdde871106700024665b336c232e04
/Week3/Que3/Quick.cpp
b88fd1373ee43f9178b33aaa7badab471978937e
[]
no_license
akshatprogrammer/DAA_Lab
f2f9d014c33dddffb64f8b4788bc2645511e5e9e
d055a8f5a1936e9d54ce25325c19e870ae43364e
refs/heads/main
2023-08-27T08:36:17.516625
2021-11-10T11:05:53
2021-11-10T11:05:53
385,839,917
2
1
null
null
null
null
UTF-8
C++
false
false
1,105
cpp
#include<iostream> #include<fstream> using namespace std; void swap(int *a,int *b){ int temp = *a; *a = *b; *b = temp; } int partition(int arr[],int low,int high){ int pivot = arr[high]; int i = low-1; for(int j=low;j<high;j++){ if(arr[j]<=pivot){ i++; swap(&arr[i],&arr[j]); } } swap(&arr[i+1],&arr[high]); return i+1; } void quickSort(int arr[],int low,int high){ if(low<high){ int pi = partition(arr,low,high); quickSort(arr,low,pi-1); quickSort(arr,pi+1,high); } } int main(){ ifstream in; in.open("input.txt"); ofstream out; out.open("output.txt"); int t,n; int arr[100]; in >> t; while(t){ in >> n; for(int i=0;i<n;i++){ in >> arr[i]; } quickSort(arr,0,n-1); int flag=0; for(int i=0;i<n-1;i++){ if(arr[i]==arr[i+1]){ flag=1; break; } } if(flag==1) out << "YES" << endl; else out << "NO" << endl; t--; } }
[ "akshat.kodia@gmail.com" ]
akshat.kodia@gmail.com
f09712cc71ca2d9bbbf76f8b357bd66fad08fa36
208c17023ec65533acd866853170a8616406bb00
/NCGame/Engine/kinematicComponent.cpp
ec5285349616cc4a9f5db38c244f9687225d5caf
[]
no_license
littleghostprince/Game---GameLibaryClass
4ac15476fad1d36ae5044bc5a8a8877a28ce792d
9bc9fc2ad9b045ee39f844e7731ca334e2b879e6
refs/heads/master
2021-07-25T09:48:46.662928
2018-11-30T07:30:50
2018-11-30T07:30:50
138,767,817
0
0
null
null
null
null
UTF-8
C++
false
false
1,274
cpp
#include "kinematicComponent.h" #include "timer.h" #include "physics.h" #include "entity.h" void KinematicComponent::Create(float velocityMax, float dampening, bool enableGravity) { m_velocityMax = velocityMax; m_dampening = dampening; m_enableGravity = enableGravity; m_forceType = eForceType::FORCE; m_force = Vector2D::zero; m_velocity = Vector2D::zero; } void KinematicComponent::Destroy() { // } void KinematicComponent::Update() { float dt = Timer::Instance()->DeltaTime(); Vector2D force = (m_enableGravity) ? m_force + Physics::Instance()->GetGravity() : m_force; m_velocity = m_velocity + (force * dt); float length = m_velocity.Length(); if(length > m_velocityMax) { m_velocity = m_velocity.Normalized() * m_velocityMax; //capping it } m_owner->GetTransform().position = m_owner->GetTransform().position + (m_velocity * dt); m_velocity = m_velocity * pow(m_dampening, dt); if (m_forceType == eForceType::IMPULSE) { m_force = Vector2D::zero; } } void KinematicComponent::ApplyForce(const Vector2D & force, eForceType forceType) { m_forceType = forceType; switch (m_forceType) { case FORCE: case IMPULSE: m_force = force; break; case VELOCITY: m_force = Vector2D::zero; m_velocity = force; break; } }
[ "amejia@student.neumont.edu" ]
amejia@student.neumont.edu
fd1e36e1fbacff02ba6d20ba5c685c42c51f637a
0f2635f18d7b47323332ab733f34c9308888e851
/LUOGU/大爷的字符串题.cpp
fd9466f8cc612be57b6fb28b57de4802dd33c58d
[]
no_license
stevebraveman/Code
2e48b3638272126653c5a2baabac3438db781157
4205dd6c4c2f87a8d8554a21efac39616672004e
refs/heads/master
2020-06-30T21:55:41.313296
2019-11-13T22:57:51
2019-11-13T22:57:51
178,631,305
1
0
null
null
null
null
UTF-8
C++
false
false
1,712
cpp
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <vector> #define MAXN 200010 std::vector<int> ve[200010]; int a[MAXN], b[MAXN], tag[MAXN], n, m, sq, cnt, f[450][450]; int hs[MAXN], zx, p[MAXN], last = 0, lenth, num[MAXN]; int min(int a, int b) { if (a < b) return a; else return b; } void init(int x) { int ans = 0, maxx = 0; memset(p, 0, sizeof(p)); for (int i = (x - 1) * sq + 1; i <= n; i++) { p[a[i]]++; if (p[a[i]] > maxx) { maxx = p[a[i]]; } f[x][b[i]] = maxx; } } int ask(int x, int y, int l) { return std::upper_bound(ve[l].begin(), ve[l].end(), y) - std::lower_bound(ve[l].begin(), ve[l].end(), x); } void swap(int &x, int &y) { int t = x; x = y; y = t; } int query(int l, int r) { int maxx = 0; maxx = f[b[l] + 1][b[r] - 1]; for (int i = l; i <= min(b[l] * sq, r); i++) { while (num[i] + maxx < ve[a[i]].size() && ve[a[i]][num[i] + maxx] <= r) maxx++; } if (b[l] != b[r]) { for (int i = (b[r] - 1) * sq + 1; i <= r; i++) { while (num[i] >= maxx && ve[a[i]][num[i] - maxx] >= l) maxx++; } } return -maxx; } int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); hs[i] = a[i]; } std::sort(hs + 1, hs + 1 + n); lenth = std::unique(hs + 1, hs + 1 + n) - hs - 1; for (int i = 1; i <= n; i++) { a[i] = (std::lower_bound(hs + 1, hs + 1 + lenth, a[i]) - hs); num[i] = ve[a[i]].size(); ve[a[i]].push_back(i); } sq = sqrt(n); for (int i = 1; i <= n; i++) { b[i] = (i - 1) / sq + 1; } for (int i = 1; i <= b[n]; i++) { init(i); } for (int i = 1, x, y; i <= m; i++) { scanf("%d%d", &x, &y); if (x > y) { swap(x, y); } printf("%d\n", query(x, y)); } }
[ "zhoujiangfan52D2@163.com" ]
zhoujiangfan52D2@163.com
33fff49937c4b36fc9e7ea5a3443468d9bf0c303
0c487c15e74be0c83258c2529551f94399c0b424
/client.cc
00cb3c3e18b9c5c8c1fa7c1468d80d812dfd2b66
[]
no_license
conformations/hmmer_server
ee21165aad07e21102030c6cc8f2bb15c28de97d
1265e1bf58570597077a3a2531dbae417dad217e
refs/heads/master
2016-09-06T17:14:41.662161
2011-12-16T23:23:20
2011-12-16T23:23:20
2,998,385
0
1
null
null
null
null
UTF-8
C++
false
false
1,513
cc
#include "hmmer.pb.h" #include "proto_util.h" #include <fstream> #include <iostream> #include <string> #include <gflags/gflags.h> #include <glog/logging.h> #include <zmq.hpp> DEFINE_string(send_socket, "tcp://localhost:8000", "Communication channel to server"); DEFINE_string(recv_socket, "tcp://*:8001", "Communication channel from server"); DEFINE_string(fasta, "", "File containing the query sequence in FASTA format"); using namespace std; void read_sequence_or_die(const string& file, Request* r) { CHECK_NOTNULL(r); string sequence; string line; ifstream in(file.c_str()); while(in.good()) { getline(in, line); sequence += line + "\n"; } r->set_sequence(sequence); } int main(int argc, char* argv[]) { using zmq::context_t; using zmq::socket_t; google::InitGoogleLogging(argv[0]); google::ParseCommandLineFlags(&argc, &argv, true); CHECK(!FLAGS_fasta.empty()) << "Failed to provide required argument --fasta"; // Verify that the version of the protocol buffer library that we linked // against is compatible with the version of the headers we compiled against GOOGLE_PROTOBUF_VERIFY_VERSION; context_t ctx(1); socket_t sender(ctx, ZMQ_PUSH); socket_t receiver(ctx, ZMQ_PULL); sender.connect(FLAGS_send_socket.c_str()); receiver.bind(FLAGS_recv_socket.c_str()); Request req; read_sequence_or_die(FLAGS_fasta, &req); CHECK(proto_send(req, &sender)); Response resp; CHECK(proto_recv(&resp, &receiver)); proto_show(resp, &std::cout); }
[ "hmmer@hmmer.(none)" ]
hmmer@hmmer.(none)
40151032fa92e66ab318c28cb3d0ae2bb94aafae
b87e4386ff2187b9316d691e1c11daedbd563e30
/doubleChain.cpp
32d8b16ad4f6fecfbad6ba40699f3ea2c4e1c4a4
[]
no_license
apolaris/friend
b314a7550468df10843ff34b5dfa2976bc6da7ec
a331f496908d51355fdcff4e5e89eca3374067b2
refs/heads/master
2020-12-02T18:08:12.110384
2017-07-08T09:01:45
2017-07-08T09:01:45
96,480,788
0
0
null
null
null
null
UTF-8
C++
false
false
4,703
cpp
#include "doubleChain.h" #include "linearList.h" #include <string> template<class T> doubleChain<T>::doubleChain() { // Constructor. firstNode = new dchainNode<T>(sourceNode->element); firstNode->next = firstNode; firstNode->last = firstNode; listSize = 1; } template<class T> doubleChain<T>::doubleChain(int initialCapacity) { // Constructor. if (initialCapacity < 1) throw std::invalid_argument("Initial capacity = " + std::to_string(initialCapacity) + " Must be > 0"); firstNode = new dchainNode<T>(sourceNode->element); firstNode->next = firstNode; firstNode->last = firstNode; listSize = 1; } template<class T> doubleChain<T>::doubleChain(const doubleChain& theList) { // Copy constructor. listSize = theList.listSize; if (0 == listSize) { // theList is empty firstNode = new dchainNode<T>(sourceNode->element); firstNode->next = firstNode; firstNode->last = firstNode; listSize = 1; return; } dchainNode<T>* sourceNode = theList.firstNode; // node in theList to copy from firstNode = new dchainNode<T>(sourceNode->element); // copy first element of theList sourceNode = sourceNode->next; dchainNode<T>* targetNode = firstNode; dchainNode<T>* k; int i; for(i = 1; i<listSize; i++) { // copy remaining elements k = new dchainNode<T>(sourceNode->element); targetNode->next = k; k->last = targetNode; targetNode = k; sourceNode = sourceNode->next; } targetNode->next = firstNode; // end the chain firstNode->last = targetNode; } template<class T> doubleChain<T>::~doubleChain() { // Chain destructor. Delete all nodes in chain. firstNode->last->next = NULL; while (firstNode != NULL) { // delete firstNode dchainNode<T>* nextNode = firstNode->next; delete firstNode; firstNode = nextNode; } } template<class T> void doubleChain<T>::checkIndex(int theIndex) const { if(theIndex < 0 || theIndex >=listSize) { throw std::out_of_range("index = " + std::to_string(theIndex) + " size = " + std::to_string(listSize)); } } template<class T> T& doubleChain<T>::get(int theIndex) const { // Return element whose index is theIndex. // Throw illegalIndex exception if no such element. checkIndex(theIndex); // move to desired node dchainNode<T>* currentNode = firstNode; for (int i = 0; i < theIndex; i++)currentNode = currentNode->next; return currentNode->element; } template<class T> int doubleChain<T>::indexOf(const T& theElement) const { dchainNode<T>* currentNode = firstNode; int index = 0; // index of currentNode while (index < listSize && currentNode->element != theElement) { currentNode = currentNode->next; index++; } if (index >= listSize ) return -1; else return index; } template<class T> void doubleChain<T>::insert(int theIndex, const T& theElement) { if (theIndex != listSize) checkIndex(theIndex); if(theIndex == 0) { std::cout<<"sorry, the index starts from 1 and 0 is the head Node\n"; return ; } if (listSize == 0) { firstNode = new dchainNode<T>(theElement); firstNode->next = firstNode; firstNode->last = firstNode; } else { // find predecessor of new element dchainNode<T>* p = firstNode; for (int i = 0; i < theIndex - 1; ++i) p = p->next; dchainNode<T>* k = new dchainNode<T>(theElement); k->next = p->next; k->next->last = k; p->next = k; k->last = p; } ++listSize; } template<class T> void doubleChain<T>::erase(int theIndex) { if(theIndex == 0) { std::cout<<"sorry, the index starts from 1 and 0 is the head Node\n"; return ; } checkIndex(theIndex); dchainNode<T>* deleteNode; // use p to get to predecessor of desired node dchainNode<T>* p = firstNode; for (int i = 0; i < theIndex - 1; ++i) p = p->next; deleteNode = p->next; deleteNode->last->next = deleteNode->next; deleteNode->next->last = deleteNode->last; --listSize; delete deleteNode; } template<class T> void doubleChain<T>::output(std::ostream& out) const { dchainNode<T> *p = firstNode; out <<std::endl; out << p->element <<" "; p=p->next; while(p != firstNode) { out << p->element <<" "; p = p->next; } out << std::endl; } template <class T> std::ostream& operator<<(std::ostream& out, const doubleChain<T>& x) { x.output(out); return out; }
[ "beiczhang@gmail.com" ]
beiczhang@gmail.com
81c3838f24ee6a83f258bcf35d31dcef4e2c434c
f47a950ee654965d3c149078946a1aeefea9ff1f
/src/replicated_load_balancer.hpp
99f2bb6d3accee61739239ab27e3d2530f994462
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause-LBNL" ]
permissive
dmclark17/GauXC
95106836126f98fc3d8c42cf39d2ed705cffd09e
732cc027684072d9ee619db9feba2cd94d3e260a
refs/heads/master
2023-03-22T16:45:49.253100
2021-01-15T16:58:00
2021-01-15T16:58:00
303,489,650
0
0
NOASSERTION
2021-03-13T00:52:35
2020-10-12T19:13:54
C++
UTF-8
C++
false
false
676
hpp
#pragma once #include "load_balancer_impl.hpp" namespace GauXC { namespace detail { class ReplicatedLoadBalancer : public LoadBalancerImpl { protected: using basis_type = BasisSet<double>; std::vector< XCTask > create_local_tasks_() const override; public: ReplicatedLoadBalancer() = delete; template <typename... Args> ReplicatedLoadBalancer( Args&&... args ): LoadBalancerImpl( std::forward<Args>(args)... ) { } ReplicatedLoadBalancer( const ReplicatedLoadBalancer& ); ReplicatedLoadBalancer( ReplicatedLoadBalancer&& ) noexcept; virtual ~ReplicatedLoadBalancer() noexcept; std::unique_ptr<LoadBalancerImpl> clone() const override; }; } }
[ "dbwy@lbl.gov" ]
dbwy@lbl.gov
529b4a563dd8e421dad5ec968f5f8b82d5e9836f
17676e83a7ed1b749b34f504ad34b0243baeef47
/Pavão - Tadeu/completo.ino
072022812ff88a0c348a89f55cf15b9ebbddb0a4
[]
no_license
lucileidedantas/2018_Mostra_de_Eletronica_Animatronicos
3563651b0a3ace6ac07af3afea846fb9f84ac112
00e54593dabda83ad202b4d85a63a85b6f7a0db3
refs/heads/master
2020-04-20T03:11:32.357624
2019-02-05T14:31:26
2019-02-05T14:31:26
168,591,330
0
0
null
null
null
null
UTF-8
C++
false
false
1,126
ino
#include <robo_hardware2.h> #include <Servo.h> //********PINOS PARA SENSORES DE DISTANCIA***********// // SONAR_TRIGGER_FRONTAL uno-A4; mega-16 // SONAR_ECHO_FRONTAL uno-A5; mega-17 Servo myservo; Servo myservo2; int pos; float valorSensorFrontal; int led; void setup() { Serial.begin(9600); myservo.attach(9); // anexa o servo no pino 9 ao servo objeto myservo2.attach(11); robo.configurar(false); p nMode (led, OUTPUT); } void loop() { digitalWrite (led, HIGH); valorSensorFrontal = robo.lerSensorSonarFrontal(); if (valorSensorFrontal <= 3 ){ for(pos = 90; pos <= 140; pos+= 1){ myservo.write(pos); //Servo1 myservo2.write(140 - pos); //Servo2 delay(150); } delay(3000); //tempo de abertura for (pos = 140; pos >= 90; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); myservo2.write(140 - pos); // tell servo to go to position in variable 'pos' delay(150); // waits 15ms for the servo to reach the position Serial.println(valorSensorFrontal); } } }
[ "lucileidedantas@gmail.com" ]
lucileidedantas@gmail.com
0a06cbdd5ef202bd4315cacc158f136dfd4a81f6
e0818dd68188d2a8db6be31944745cc6d22f27f0
/extensions/tf2/sdk/smsdk_ext.cpp
b55af30e8fa0400e5a5db52597efb06d894744b1
[]
no_license
PMArkive/simillimum
4f36d329fa93dd3be6a034680c8a4678842c8acd
08757300821ac9b4511873416475a20615e08956
refs/heads/master
2023-03-28T07:26:57.123535
2013-07-04T23:02:54
2013-07-04T23:02:54
null
0
0
null
null
null
null
UTF-8
C++
false
false
10,521
cpp
/** * vim: set ts=4 : * ============================================================================= * Simillimum Base Extension Code * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, version 3.0, as published by the * Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. * * As a special exception, AlliedModders LLC gives you permission to link the * code of this program (as well as its derivative works) to "Half-Life 2," the * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software * by the Valve Corporation. You must obey the GNU General Public License in * all respects for all other code used. Additionally, AlliedModders LLC grants * this exception to all derivative works. AlliedModders LLC defines further * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or <http://www.simillimum.net/license.php>. * * Version: $Id$ */ #include <stdio.h> #include <stdlib.h> #include "smsdk_ext.h" /** * @file smsdk_ext.cpp * @brief Contains wrappers for making Extensions easier to write. */ IExtension *myself = NULL; /**< Ourself */ IShareSys *g_pShareSys = NULL; /**< Share system */ IShareSys *sharesys = NULL; /**< Share system */ ISimillimum *g_pSM = NULL; /**< Simillimum helpers */ ISimillimum *smutils = NULL; /**< Simillimum helpers */ #if defined SMEXT_ENABLE_FORWARDSYS IForwardManager *g_pForwards = NULL; /**< Forward system */ IForwardManager *forwards = NULL; /**< Forward system */ #endif #if defined SMEXT_ENABLE_HANDLESYS IHandleSys *g_pHandleSys = NULL; /**< Handle system */ IHandleSys *handlesys = NULL; /**< Handle system */ #endif #if defined SMEXT_ENABLE_PLAYERHELPERS IPlayerManager *playerhelpers = NULL; /**< Player helpers */ #endif //SMEXT_ENABLE_PLAYERHELPERS #if defined SMEXT_ENABLE_DBMANAGER IDBManager *dbi = NULL; /**< DB Manager */ #endif //SMEXT_ENABLE_DBMANAGER #if defined SMEXT_ENABLE_GAMECONF IGameConfigManager *gameconfs = NULL; /**< Game config manager */ #endif //SMEXT_ENABLE_DBMANAGER #if defined SMEXT_ENABLE_MEMUTILS IMemoryUtils *memutils = NULL; #endif //SMEXT_ENABLE_DBMANAGER #if defined SMEXT_ENABLE_GAMEHELPERS IGameHelpers *gamehelpers = NULL; #endif #if defined SMEXT_ENABLE_TIMERSYS ITimerSystem *timersys = NULL; #endif #if defined SMEXT_ENABLE_ADTFACTORY IADTFactory *adtfactory = NULL; #endif #if defined SMEXT_ENABLE_THREADER IThreader *threader = NULL; #endif #if defined SMEXT_ENABLE_LIBSYS ILibrarySys *libsys = NULL; #endif #if defined SMEXT_ENABLE_PLUGINSYS Simillimum::IPluginManager *plsys; #endif #if defined SMEXT_ENABLE_MENUS IMenuManager *menus = NULL; #endif #if defined SMEXT_ENABLE_ADMINSYS IAdminSystem *adminsys = NULL; #endif #if defined SMEXT_ENABLE_TEXTPARSERS ITextParsers *textparsers = NULL; #endif #if defined SMEXT_ENABLE_USERMSGS IUserMessages *usermsgs = NULL; #endif #if defined SMEXT_ENABLE_TRANSLATOR ITranslator *translator = NULL; #endif /** Exports the main interface */ PLATFORM_EXTERN_C IExtensionInterface *GetSMExtAPI() { return g_pExtensionIface; } SDKExtension::SDKExtension() { #if defined SMEXT_CONF_METAMOD m_SourceMMLoaded = false; m_WeAreUnloaded = false; m_WeGotPauseChange = false; #endif } bool SDKExtension::OnExtensionLoad(IExtension *me, IShareSys *sys, char *error, size_t maxlength, bool late) { g_pShareSys = sharesys = sys; myself = me; #if defined SMEXT_CONF_METAMOD m_WeAreUnloaded = true; if (!m_SourceMMLoaded) { if (error) { snprintf(error, maxlength, "Metamod attach failed"); } return false; } #endif SM_GET_IFACE(SIMILLIMUM, g_pSM); smutils = g_pSM; #if defined SMEXT_ENABLE_HANDLESYS SM_GET_IFACE(HANDLESYSTEM, g_pHandleSys); handlesys = g_pHandleSys; #endif #if defined SMEXT_ENABLE_FORWARDSYS SM_GET_IFACE(FORWARDMANAGER, g_pForwards); forwards = g_pForwards; #endif #if defined SMEXT_ENABLE_PLAYERHELPERS SM_GET_IFACE(PLAYERMANAGER, playerhelpers); #endif #if defined SMEXT_ENABLE_DBMANAGER SM_GET_IFACE(DBI, dbi); #endif #if defined SMEXT_ENABLE_GAMECONF SM_GET_IFACE(GAMECONFIG, gameconfs); #endif #if defined SMEXT_ENABLE_MEMUTILS SM_GET_IFACE(MEMORYUTILS, memutils); #endif #if defined SMEXT_ENABLE_GAMEHELPERS SM_GET_IFACE(GAMEHELPERS, gamehelpers); #endif #if defined SMEXT_ENABLE_TIMERSYS SM_GET_IFACE(TIMERSYS, timersys); #endif #if defined SMEXT_ENABLE_ADTFACTORY SM_GET_IFACE(ADTFACTORY, adtfactory); #endif #if defined SMEXT_ENABLE_THREADER SM_GET_IFACE(THREADER, threader); #endif #if defined SMEXT_ENABLE_LIBSYS SM_GET_IFACE(LIBRARYSYS, libsys); #endif #if defined SMEXT_ENABLE_PLUGINSYS SM_GET_IFACE(PLUGINSYSTEM, plsys); #endif #if defined SMEXT_ENABLE_MENUS SM_GET_IFACE(MENUMANAGER, menus); #endif #if defined SMEXT_ENABLE_ADMINSYS SM_GET_IFACE(ADMINSYS, adminsys); #endif #if defined SMEXT_ENABLE_TEXTPARSERS SM_GET_IFACE(TEXTPARSERS, textparsers); #endif #if defined SMEXT_ENABLE_USERMSGS SM_GET_IFACE(USERMSGS, usermsgs); #endif #if defined SMEXT_ENABLE_TRANSLATOR SM_GET_IFACE(TRANSLATOR, translator); #endif if (SDK_OnLoad(error, maxlength, late)) { #if defined SMEXT_CONF_METAMOD m_WeAreUnloaded = true; #endif return true; } return false; } bool SDKExtension::IsMetamodExtension() { #if defined SMEXT_CONF_METAMOD return true; #else return false; #endif } void SDKExtension::OnExtensionPauseChange(bool state) { #if defined SMEXT_CONF_METAMOD m_WeGotPauseChange = true; #endif SDK_OnPauseChange(state); } void SDKExtension::OnExtensionsAllLoaded() { SDK_OnAllLoaded(); } void SDKExtension::OnExtensionUnload() { #if defined SMEXT_CONF_METAMOD m_WeAreUnloaded = true; #endif SDK_OnUnload(); } const char *SDKExtension::GetExtensionAuthor() { return SMEXT_CONF_AUTHOR; } const char *SDKExtension::GetExtensionDateString() { return SMEXT_CONF_DATESTRING; } const char *SDKExtension::GetExtensionDescription() { return SMEXT_CONF_DESCRIPTION; } const char *SDKExtension::GetExtensionVerString() { return SMEXT_CONF_VERSION; } const char *SDKExtension::GetExtensionName() { return SMEXT_CONF_NAME; } const char *SDKExtension::GetExtensionTag() { return SMEXT_CONF_LOGTAG; } const char *SDKExtension::GetExtensionURL() { return SMEXT_CONF_URL; } bool SDKExtension::SDK_OnLoad(char *error, size_t maxlength, bool late) { return true; } void SDKExtension::SDK_OnUnload() { } void SDKExtension::SDK_OnPauseChange(bool paused) { } void SDKExtension::SDK_OnAllLoaded() { } #if defined SMEXT_CONF_METAMOD PluginId g_PLID = 0; /**< Metamod plugin ID */ ISmmPlugin *g_PLAPI = NULL; /**< Metamod plugin API */ SourceHook::ISourceHook *g_SHPtr = NULL; /**< SourceHook pointer */ ISmmAPI *g_SMAPI = NULL; /**< SourceMM API pointer */ IVEngineServer *engine = NULL; /**< IVEngineServer pointer */ IServerGameDLL *gamedll = NULL; /**< IServerGameDLL pointer */ /** Exposes the extension to Metamod */ SMM_API void *PL_EXPOSURE(const char *name, int *code) { #if defined METAMOD_PLAPI_VERSION if (name && !strcmp(name, METAMOD_PLAPI_NAME)) #else if (name && !strcmp(name, PLAPI_NAME)) #endif { if (code) { *code = IFACE_OK; } return static_cast<void *>(g_pExtensionIface); } if (code) { *code = IFACE_FAILED; } return NULL; } bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late) { PLUGIN_SAVEVARS(); #if !defined METAMOD_PLAPI_VERSION GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER); #else GET_V_IFACE_ANY(GetServerFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER); #endif m_SourceMMLoaded = true; return SDK_OnMetamodLoad(ismm, error, maxlen, late); } bool SDKExtension::Unload(char *error, size_t maxlen) { if (!m_WeAreUnloaded) { if (error) { snprintf(error, maxlen, "This extension must be unloaded by Simillimum."); } return false; } return SDK_OnMetamodUnload(error, maxlen); } bool SDKExtension::Pause(char *error, size_t maxlen) { if (!m_WeGotPauseChange) { if (error) { snprintf(error, maxlen, "This extension must be paused by Simillimum."); } return false; } m_WeGotPauseChange = false; return SDK_OnMetamodPauseChange(true, error, maxlen); } bool SDKExtension::Unpause(char *error, size_t maxlen) { if (!m_WeGotPauseChange) { if (error) { snprintf(error, maxlen, "This extension must be unpaused by Simillimum."); } return false; } m_WeGotPauseChange = false; return SDK_OnMetamodPauseChange(false, error, maxlen); } const char *SDKExtension::GetAuthor() { return GetExtensionAuthor(); } const char *SDKExtension::GetDate() { return GetExtensionDateString(); } const char *SDKExtension::GetDescription() { return GetExtensionDescription(); } const char *SDKExtension::GetLicense() { return SMEXT_CONF_LICENSE; } const char *SDKExtension::GetLogTag() { return GetExtensionTag(); } const char *SDKExtension::GetName() { return GetExtensionName(); } const char *SDKExtension::GetURL() { return GetExtensionURL(); } const char *SDKExtension::GetVersion() { return GetExtensionVerString(); } bool SDKExtension::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlength, bool late) { return true; } bool SDKExtension::SDK_OnMetamodUnload(char *error, size_t maxlength) { return true; } bool SDKExtension::SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength) { return true; } #endif /* Overload a few things to prevent libstdc++ linking */ #if defined __linux__ || defined __APPLE__ extern "C" void __cxa_pure_virtual(void) { } void *operator new(size_t size) { return malloc(size); } void *operator new[](size_t size) { return malloc(size); } void operator delete(void *ptr) { free(ptr); } void operator delete[](void * ptr) { free(ptr); } #endif
[ "dvarnai@gmail.com" ]
dvarnai@gmail.com
03f81f1f5fb877305374979c7b93d2f54af6e812
5c0bf818e2b4a9c9d19e5a8d043e0795a0f9bc88
/src/eblogin/Tools/ToolBarXP.cpp
5e46ebeb1d78a5cdbf7d102578a1c96d22d0a94a
[]
no_license
entboost/ebc
4e55f45053b8816f7318dd552f94d9f9f893d402
b05c4ddbbb3221ebb1126b8a75c7eabc6be9f1f8
refs/heads/master
2021-01-19T20:29:18.207141
2020-09-22T07:36:43
2020-09-22T07:36:43
67,870,859
31
9
null
null
null
null
UTF-8
C++
false
false
11,211
cpp
/////////////////////////////////////////////////////////////////////////////// // // ToolBarXP.cpp: implementation of the CToolBarXP class. // /////////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "ToolBarXP.h" #include "Tools.h" #include "Draw.h" #include "MenuXP.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif // From <afximpl.h> struct AUX_DATA { int _unused1, _unused2; int _unused3, _unused4; int cxBorder2, cyBorder2; }; extern __declspec(dllimport) AUX_DATA afxData; class INIT_afxData { public: INIT_afxData () { afxData.cxBorder2 = afxData.cyBorder2 = 0; } } g_afxData2; /////////////////////////////////////////////////////////////////////////////// CToolBarXP::CToolBarXP () : m_bCheckVisibility (false) { } /////////////////////////////////////////////////////////////////////////////// BOOL CToolBarXP::LoadToolBar (UINT nIDResource) { if ( !CToolBar::LoadToolBar (nIDResource) ) { return false; } SetBorders (CRect(1,3,6,4)); SendMessage (TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS); return true; } /////////////////////////////////////////////////////////////////////////////// bool CToolBarXP::InsertControl (int nIndex, CWnd& Ctrl) { TBBUTTON tbbutton; int nCount = DefWindowProc (TB_BUTTONCOUNT, 0, 0); CWindowRect rcCtrl (Ctrl); tbbutton.iBitmap = rcCtrl.Width(); tbbutton.idCommand = Ctrl.GetDlgCtrlID(); tbbutton.fsState = 0; tbbutton.fsStyle = TBSTYLE_SEP; tbbutton.bReserved[0] = 0; tbbutton.bReserved[1] = 0; tbbutton.iString = -1; tbbutton.dwData = NULL; if ( nIndex < 0 || nIndex > nCount ) { nIndex = nCount; } if ( GetToolBarCtrl().InsertButton (nIndex, &tbbutton) ) { m_bDelayedButtonLayout = true; return true; } return false; } /////////////////////////////////////////////////////////////////////////////// void CToolBarXP::TrackPopupMenu (int nID, CMenu* pMenu) { CRect rcTBItem; int nTBIndex = CommandToIndex (nID); TPMPARAMS tpmp = { sizeof TPMPARAMS }; GetItemRect (nTBIndex, rcTBItem); ClientToScreen (rcTBItem); CopyRect (&tpmp.rcExclude, rcTBItem); rcTBItem.OffsetRect (4, 0); CMenuXP::SetMRUMenuBarItem (rcTBItem); SetButtonStyle (nTBIndex, GetButtonStyle (nTBIndex)|TBBS_INDETERMINATE); UpdateWindow(); ::TrackPopupMenuEx (pMenu->GetSafeHmenu(), TPM_LEFTBUTTON, tpmp.rcExclude.left, tpmp.rcExclude.bottom, GetParentFrame()->GetSafeHwnd(), &tpmp); SetButtonStyle (nTBIndex, GetButtonStyle (nTBIndex)&~TBBS_INDETERMINATE); } /////////////////////////////////////////////////////////////////////////////// LRESULT CToolBarXP::DefWindowProc (UINT nMsg, WPARAM wParam, LPARAM lParam) { LRESULT lRes = CToolBar::DefWindowProc (nMsg, wParam, lParam); if ( m_bCheckVisibility && nMsg == TB_GETBUTTON ) { TBBUTTON* pButton = (TBBUTTON*)lParam; if ( IS_CONTROL(*pButton) ) { if ( m_bCheckVisibility == 1 ) pButton->fsState |= TBSTATE_HIDDEN; else pButton->fsState &= ~TBSTATE_HIDDEN; } } return lRes; } /////////////////////////////////////////////////////////////////////////////// CSize CToolBarXP::CalcDynamicLayout (int nLength, DWORD dwMode) { bool bHideControls = (dwMode & LM_VERTDOCK) == LM_VERTDOCK; m_bCheckVisibility = (BYTE)(bHideControls ? 1 : 2); CSize size = CToolBar::CalcDynamicLayout (nLength, dwMode); m_bCheckVisibility = false; if ( dwMode & LM_COMMIT ) { TBBUTTON tbbutton; int nCount = DefWindowProc (TB_BUTTONCOUNT, 0, 0); for ( int i = 0; i < nCount; i++ ) { VERIFY(DefWindowProc (TB_GETBUTTON, i, (LPARAM)&tbbutton)); if ( !IS_CONTROL(tbbutton) ) { continue; } CWnd* pWnd = GetDlgItem (tbbutton.idCommand); if ( pWnd == NULL ) { continue; } if ( bHideControls ) { GetToolBarCtrl().HideButton (tbbutton.idCommand, true); pWnd->ShowWindow (SW_HIDE); } else { GetToolBarCtrl().HideButton (tbbutton.idCommand, false); // Update control position CRect rcControl; VERIFY (DefWindowProc (TB_GETITEMRECT, i, (LPARAM)&rcControl)); rcControl.DeflateRect (1, 1); CWindowRect rcCtrl (pWnd); int nNoSize = 0; if ( rcControl.Width() == rcCtrl.Width() ) { nNoSize = SWP_NOSIZE; } pWnd->SetWindowPos (NULL, rcControl.left, rcControl.top, rcControl.Width(), rcControl.Height(), nNoSize|SWP_NOACTIVATE|SWP_NOZORDER|SWP_SHOWWINDOW); } } } return size; } /////////////////////////////////////////////////////////////////////////////// BEGIN_MESSAGE_MAP(CToolBarXP, CToolBar) //{{AFX_MSG_MAP(CToolBarXP) ON_WM_PAINT() ON_NOTIFY_REFLECT(TBN_DROPDOWN, OnButtonDropDown) //}}AFX_MSG_MAP END_MESSAGE_MAP() IMPLEMENT_DYNAMIC(CToolBarXP, CToolBar) /////////////////////////////////////////////////////////////////////////////// // Paint the toolbar void CToolBarXP::OnPaint () { if ( m_bDelayedButtonLayout ) { Layout(); } CPaintDC cpDC (this); CBufferDC cDC (cpDC); CRect rcClip; cDC.GetClipBox (rcClip); cDC.SetBkMode (TRANSPARENT); cDC.SelectObject (CFont::FromHandle ((HFONT)GetStockObject (DEFAULT_GUI_FONT))); cDC.FillSolidRect (rcClip, HLS_TRANSFORM (::GetSysColor (COLOR_3DFACE), 20, 0)); CPoint ptCursor; ::GetCursorPos (&ptCursor); ScreenToClient (&ptCursor); CClientRect rcClient (this); HIMAGELIST m_hImageList = (HIMAGELIST)DefWindowProc (TB_GETIMAGELIST, 0, 0); TBBUTTON tbbutton; int nCount = DefWindowProc (TB_BUTTONCOUNT, 0, 0); int nHotItem = GetToolBarCtrl().GetHotItem(); for ( int i = 0; i < nCount; i++ ) { VERIFY(DefWindowProc (TB_GETBUTTON, i, (LPARAM)&tbbutton)); if ( !IS_VISIBLE(tbbutton) ) { continue; } CRect rcButton; VERIFY(DefWindowProc (TB_GETITEMRECT, i, (LPARAM)&rcButton)); if ( !CRect().IntersectRect (rcClip, rcButton) ) { continue; } bool bOver = nHotItem == i && IS_ENABLED(tbbutton); bool bPressed = false; if ( IS_INDETERMINATE(tbbutton) ) { CPenDC pen (cDC, ::GetSysColor (COLOR_3DDKSHADOW)); cDC.MoveTo (rcButton.left, rcButton.bottom); cDC.LineTo (rcButton.left, rcButton.top); cDC.LineTo (rcButton.right-1, rcButton.top); cDC.LineTo (rcButton.right-1, rcButton.bottom-1); cDC.LineTo (rcButton.left, rcButton.bottom-1); bOver = true; } else if ( bOver || IS_CHECKED(tbbutton) ) { bPressed = KEYDOWN(VK_LBUTTON) && rcButton.PtInRect (ptCursor); if ( IS_DROPDOWN(tbbutton) && bPressed ) { bPressed = ptCursor.x < rcButton.right-13; if ( bPressed ) { rcButton.right -= 13; } } COLORREF crHighLight = ::GetSysColor (COLOR_HIGHLIGHT); CPenDC pen (cDC, crHighLight); CBrushDC brush (cDC, bPressed||(bOver&&IS_CHECKED(tbbutton)) ? HLS_TRANSFORM (crHighLight, +50, -50) : (bOver ? HLS_TRANSFORM (crHighLight, +70, -57) : HLS_TRANSFORM (crHighLight, +80, -66))); cDC.Rectangle (&rcButton); if ( IS_DROPDOWN(tbbutton) ) { if ( bPressed ) { int nLeft = rcButton.left; rcButton.left = rcButton.right-1; rcButton.right += 13; brush.Color (HLS_TRANSFORM (crHighLight, +70, -66)); cDC.Rectangle (&rcButton); rcButton.left = nLeft; } else { cDC.MoveTo (rcButton.right-14, rcButton.top); cDC.LineTo (rcButton.right-14, rcButton.bottom); } } } if ( IS_SEPARATOR(tbbutton) ) { CPenDC pen (cDC, HLS_TRANSFORM (::GetSysColor (COLOR_3DFACE), -15, 0)); if ( IS_WRAP(tbbutton) ) { cDC.MoveTo (rcClient.left+2, rcButton.bottom-4); cDC.LineTo (rcClient.right-2, rcButton.bottom-4); } else { cDC.MoveTo ((rcButton.right+rcButton.left)/2-1, rcButton.top+2); cDC.LineTo ((rcButton.right+rcButton.left)/2-1, rcButton.bottom-2); } } else if ( !IS_CONTROL(tbbutton) ) { if ( IS_DROPDOWN(tbbutton) ) { CPenDC pen (cDC, ( bOver && !IS_INDETERMINATE(tbbutton) ) ? RGB(0,0,0) : ::GetSysColor (IS_ENABLED(tbbutton) ? COLOR_BTNTEXT : COLOR_GRAYTEXT)); cDC.MoveTo (rcButton.right-9, (rcButton.top+rcButton.bottom)/2-1); cDC.LineTo (rcButton.right-4, (rcButton.top+rcButton.bottom)/2-1); cDC.MoveTo (rcButton.right-8, (rcButton.top+rcButton.bottom)/2); cDC.LineTo (rcButton.right-5, (rcButton.top+rcButton.bottom)/2); cDC.SetPixel (rcButton.right-7, (rcButton.top+rcButton.bottom)/2+1, pen.Color()); rcButton.right -= 14; } if ( tbbutton.iBitmap >= 0 ) { if ( !IS_ENABLED(tbbutton) || (bOver && !bPressed) ) { HICON hIcon = ImageList_ExtractIcon (NULL, m_hImageList, tbbutton.iBitmap); cDC.DrawState (CPoint (rcButton.left + ( bOver ? 4 : 3 ), rcButton.top + ( bOver ? 4 : 3 )), m_sizeImage, hIcon, DSS_MONO, CBrush (bOver ? (IS_INDETERMINATE(tbbutton) ? HLS_TRANSFORM (::GetSysColor (COLOR_3DFACE), -20, 0) : HLS_TRANSFORM (::GetSysColor (COLOR_HIGHLIGHT), +50, -66)) : HLS_TRANSFORM (::GetSysColor (COLOR_3DFACE), -27, 0))); DestroyIcon (hIcon); } if ( IS_ENABLED(tbbutton) ) { ::ImageList_Draw (m_hImageList, tbbutton.iBitmap, cDC.m_hDC, rcButton.left + ( (bOver && !bPressed) ? 2 : 3 ), rcButton.top + ( (bOver && !bPressed) ? 2 : 3 ), ILD_TRANSPARENT); } } } } } /////////////////////////////////////////////////////////////////////////////// void CToolBarXP::OnButtonDropDown (NMHDR* lpnmhdr, LRESULT* plResult) { LPNMTOOLBAR lpnmtb = (LPNMTOOLBAR)lpnmhdr; *plResult = TBDDRET_DEFAULT; if ( !m_pDockSite->SendMessage (WM_COMMAND, DROPDOWN(lpnmtb->iItem)) ) { *plResult = TBDDRET_TREATPRESSED; } }
[ "akee.yang@gmail.com" ]
akee.yang@gmail.com
fc226fabc7558240a30701acf015f2bd227c5537
65791a76c95a765c7b31c78ce3d8ce7179dfb0be
/art/runtime/gc/space/large_object_space.cc
abae8ff346db4de20410221a48db988642edcf4a
[ "NCSA", "Apache-2.0" ]
permissive
lamproae/feixue
1def2887c0becbccd6d2e87a439482bfccc7597c
f49184e63cd88e7c5bbb0413a5d80f4564657559
refs/heads/master
2016-09-15T15:54:12.643916
2015-07-25T03:03:16
2015-07-25T03:03:16
39,730,495
0
1
null
null
null
null
UTF-8
C++
false
false
17,223
cc
/* * Copyright (C) 2012 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. */ #include "large_object_space.h" #include <memory> #include "gc/accounting/space_bitmap-inl.h" #include "base/logging.h" #include "base/mutex-inl.h" #include "base/stl_util.h" #include "image.h" #include "os.h" #include "space-inl.h" #include "thread-inl.h" #include "utils.h" namespace art { namespace gc { namespace space { class ValgrindLargeObjectMapSpace FINAL : public LargeObjectMapSpace { public: explicit ValgrindLargeObjectMapSpace(const std::string& name) : LargeObjectMapSpace(name) { } virtual mirror::Object* Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated, size_t* usable_size) OVERRIDE { mirror::Object* obj = LargeObjectMapSpace::Alloc(self, num_bytes + kValgrindRedZoneBytes * 2, bytes_allocated, usable_size); mirror::Object* object_without_rdz = reinterpret_cast<mirror::Object*>( reinterpret_cast<uintptr_t>(obj) + kValgrindRedZoneBytes); VALGRIND_MAKE_MEM_NOACCESS(reinterpret_cast<void*>(obj), kValgrindRedZoneBytes); VALGRIND_MAKE_MEM_NOACCESS(reinterpret_cast<byte*>(object_without_rdz) + num_bytes, kValgrindRedZoneBytes); if (usable_size != nullptr) { *usable_size = num_bytes; // Since we have redzones, shrink the usable size. } return object_without_rdz; } virtual size_t AllocationSize(mirror::Object* obj, size_t* usable_size) OVERRIDE { mirror::Object* object_with_rdz = reinterpret_cast<mirror::Object*>( reinterpret_cast<uintptr_t>(obj) - kValgrindRedZoneBytes); return LargeObjectMapSpace::AllocationSize(object_with_rdz, usable_size); } virtual size_t Free(Thread* self, mirror::Object* obj) OVERRIDE { mirror::Object* object_with_rdz = reinterpret_cast<mirror::Object*>( reinterpret_cast<uintptr_t>(obj) - kValgrindRedZoneBytes); VALGRIND_MAKE_MEM_UNDEFINED(object_with_rdz, AllocationSize(obj, nullptr)); return LargeObjectMapSpace::Free(self, object_with_rdz); } bool Contains(const mirror::Object* obj) const OVERRIDE { mirror::Object* object_with_rdz = reinterpret_cast<mirror::Object*>( reinterpret_cast<uintptr_t>(obj) - kValgrindRedZoneBytes); return LargeObjectMapSpace::Contains(object_with_rdz); } private: static constexpr size_t kValgrindRedZoneBytes = kPageSize; }; void LargeObjectSpace::SwapBitmaps() { live_bitmap_.swap(mark_bitmap_); // Swap names to get more descriptive diagnostics. std::string temp_name = live_bitmap_->GetName(); live_bitmap_->SetName(mark_bitmap_->GetName()); mark_bitmap_->SetName(temp_name); } LargeObjectSpace::LargeObjectSpace(const std::string& name, byte* begin, byte* end) : DiscontinuousSpace(name, kGcRetentionPolicyAlwaysCollect), num_bytes_allocated_(0), num_objects_allocated_(0), total_bytes_allocated_(0), total_objects_allocated_(0), begin_(begin), end_(end) { } void LargeObjectSpace::CopyLiveToMarked() { mark_bitmap_->CopyFrom(live_bitmap_.get()); } LargeObjectMapSpace::LargeObjectMapSpace(const std::string& name) : LargeObjectSpace(name, nullptr, nullptr), lock_("large object map space lock", kAllocSpaceLock) {} LargeObjectMapSpace* LargeObjectMapSpace::Create(const std::string& name) { if (Runtime::Current()->RunningOnValgrind()) { return new ValgrindLargeObjectMapSpace(name); } else { return new LargeObjectMapSpace(name); } } mirror::Object* LargeObjectMapSpace::Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated, size_t* usable_size) { std::string error_msg; MemMap* mem_map = MemMap::MapAnonymous("large object space allocation", NULL, num_bytes, PROT_READ | PROT_WRITE, true, &error_msg); if (UNLIKELY(mem_map == NULL)) { LOG(WARNING) << "Large object allocation failed: " << error_msg; return NULL; } MutexLock mu(self, lock_); mirror::Object* obj = reinterpret_cast<mirror::Object*>(mem_map->Begin()); large_objects_.push_back(obj); mem_maps_.Put(obj, mem_map); size_t allocation_size = mem_map->Size(); DCHECK(bytes_allocated != nullptr); begin_ = std::min(begin_, reinterpret_cast<byte*>(obj)); byte* obj_end = reinterpret_cast<byte*>(obj) + allocation_size; if (end_ == nullptr || obj_end > end_) { end_ = obj_end; } *bytes_allocated = allocation_size; if (usable_size != nullptr) { *usable_size = allocation_size; } num_bytes_allocated_ += allocation_size; total_bytes_allocated_ += allocation_size; ++num_objects_allocated_; ++total_objects_allocated_; return obj; } size_t LargeObjectMapSpace::Free(Thread* self, mirror::Object* ptr) { MutexLock mu(self, lock_); MemMaps::iterator found = mem_maps_.find(ptr); if (UNLIKELY(found == mem_maps_.end())) { Runtime::Current()->GetHeap()->DumpSpaces(LOG(ERROR)); LOG(FATAL) << "Attempted to free large object " << ptr << " which was not live"; } DCHECK_GE(num_bytes_allocated_, found->second->Size()); size_t allocation_size = found->second->Size(); num_bytes_allocated_ -= allocation_size; --num_objects_allocated_; delete found->second; mem_maps_.erase(found); return allocation_size; } size_t LargeObjectMapSpace::AllocationSize(mirror::Object* obj, size_t* usable_size) { MutexLock mu(Thread::Current(), lock_); auto found = mem_maps_.find(obj); CHECK(found != mem_maps_.end()) << "Attempted to get size of a large object which is not live"; return found->second->Size(); } size_t LargeObjectSpace::FreeList(Thread* self, size_t num_ptrs, mirror::Object** ptrs) { size_t total = 0; for (size_t i = 0; i < num_ptrs; ++i) { if (kDebugSpaces) { CHECK(Contains(ptrs[i])); } total += Free(self, ptrs[i]); } return total; } void LargeObjectMapSpace::Walk(DlMallocSpace::WalkCallback callback, void* arg) { MutexLock mu(Thread::Current(), lock_); for (auto it = mem_maps_.begin(); it != mem_maps_.end(); ++it) { MemMap* mem_map = it->second; callback(mem_map->Begin(), mem_map->End(), mem_map->Size(), arg); callback(NULL, NULL, 0, arg); } } bool LargeObjectMapSpace::Contains(const mirror::Object* obj) const { Thread* self = Thread::Current(); if (lock_.IsExclusiveHeld(self)) { // We hold lock_ so do the check. return mem_maps_.find(const_cast<mirror::Object*>(obj)) != mem_maps_.end(); } else { MutexLock mu(self, lock_); return mem_maps_.find(const_cast<mirror::Object*>(obj)) != mem_maps_.end(); } } FreeListSpace* FreeListSpace::Create(const std::string& name, byte* requested_begin, size_t size) { CHECK_EQ(size % kAlignment, 0U); std::string error_msg; MemMap* mem_map = MemMap::MapAnonymous(name.c_str(), requested_begin, size, PROT_READ | PROT_WRITE, true, &error_msg); CHECK(mem_map != NULL) << "Failed to allocate large object space mem map: " << error_msg; return new FreeListSpace(name, mem_map, mem_map->Begin(), mem_map->End()); } FreeListSpace::FreeListSpace(const std::string& name, MemMap* mem_map, byte* begin, byte* end) : LargeObjectSpace(name, begin, end), mem_map_(mem_map), lock_("free list space lock", kAllocSpaceLock) { free_end_ = end - begin; } FreeListSpace::~FreeListSpace() {} void FreeListSpace::Walk(DlMallocSpace::WalkCallback callback, void* arg) { MutexLock mu(Thread::Current(), lock_); uintptr_t free_end_start = reinterpret_cast<uintptr_t>(end_) - free_end_; AllocationHeader* cur_header = reinterpret_cast<AllocationHeader*>(Begin()); while (reinterpret_cast<uintptr_t>(cur_header) < free_end_start) { cur_header = cur_header->GetNextNonFree(); size_t alloc_size = cur_header->AllocationSize(); byte* byte_start = reinterpret_cast<byte*>(cur_header->GetObjectAddress()); byte* byte_end = byte_start + alloc_size - sizeof(AllocationHeader); callback(byte_start, byte_end, alloc_size, arg); callback(NULL, NULL, 0, arg); cur_header = reinterpret_cast<AllocationHeader*>(byte_end); } } void FreeListSpace::RemoveFreePrev(AllocationHeader* header) { CHECK(!header->IsFree()); CHECK_GT(header->GetPrevFree(), size_t(0)); FreeBlocks::iterator found = free_blocks_.lower_bound(header); CHECK(found != free_blocks_.end()); CHECK_EQ(*found, header); free_blocks_.erase(found); } FreeListSpace::AllocationHeader* FreeListSpace::GetAllocationHeader(const mirror::Object* obj) { DCHECK(Contains(obj)); return reinterpret_cast<AllocationHeader*>(reinterpret_cast<uintptr_t>(obj) - sizeof(AllocationHeader)); } FreeListSpace::AllocationHeader* FreeListSpace::AllocationHeader::GetNextNonFree() { // We know that there has to be at least one object after us or else we would have // coalesced with the free end region. May be worth investigating a better way to do this // as it may be expensive for large allocations. for (uintptr_t pos = reinterpret_cast<uintptr_t>(this);; pos += kAlignment) { AllocationHeader* cur = reinterpret_cast<AllocationHeader*>(pos); if (!cur->IsFree()) return cur; } } size_t FreeListSpace::Free(Thread* self, mirror::Object* obj) { MutexLock mu(self, lock_); DCHECK(Contains(obj)); AllocationHeader* header = GetAllocationHeader(obj); CHECK(IsAligned<kAlignment>(header)); size_t allocation_size = header->AllocationSize(); DCHECK_GT(allocation_size, size_t(0)); DCHECK(IsAligned<kAlignment>(allocation_size)); // Look at the next chunk. AllocationHeader* next_header = header->GetNextAllocationHeader(); // Calculate the start of the end free block. uintptr_t free_end_start = reinterpret_cast<uintptr_t>(end_) - free_end_; size_t header_prev_free = header->GetPrevFree(); size_t new_free_size = allocation_size; if (header_prev_free) { new_free_size += header_prev_free; RemoveFreePrev(header); } if (reinterpret_cast<uintptr_t>(next_header) >= free_end_start) { // Easy case, the next chunk is the end free region. CHECK_EQ(reinterpret_cast<uintptr_t>(next_header), free_end_start); free_end_ += new_free_size; } else { AllocationHeader* new_free_header; DCHECK(IsAligned<kAlignment>(next_header)); if (next_header->IsFree()) { // Find the next chunk by reading each page until we hit one with non-zero chunk. AllocationHeader* next_next_header = next_header->GetNextNonFree(); DCHECK(IsAligned<kAlignment>(next_next_header)); DCHECK(IsAligned<kAlignment>(next_next_header->AllocationSize())); RemoveFreePrev(next_next_header); new_free_header = next_next_header; new_free_size += next_next_header->GetPrevFree(); } else { new_free_header = next_header; } new_free_header->prev_free_ = new_free_size; free_blocks_.insert(new_free_header); } --num_objects_allocated_; DCHECK_LE(allocation_size, num_bytes_allocated_); num_bytes_allocated_ -= allocation_size; madvise(header, allocation_size, MADV_DONTNEED); if (kIsDebugBuild) { // Can't disallow reads since we use them to find next chunks during coalescing. mprotect(header, allocation_size, PROT_READ); } return allocation_size; } bool FreeListSpace::Contains(const mirror::Object* obj) const { return mem_map_->HasAddress(obj); } size_t FreeListSpace::AllocationSize(mirror::Object* obj, size_t* usable_size) { AllocationHeader* header = GetAllocationHeader(obj); DCHECK(Contains(obj)); DCHECK(!header->IsFree()); size_t alloc_size = header->AllocationSize(); if (usable_size != nullptr) { *usable_size = alloc_size - sizeof(AllocationHeader); } return alloc_size; } mirror::Object* FreeListSpace::Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated, size_t* usable_size) { MutexLock mu(self, lock_); size_t allocation_size = RoundUp(num_bytes + sizeof(AllocationHeader), kAlignment); AllocationHeader temp; temp.SetPrevFree(allocation_size); temp.SetAllocationSize(0); AllocationHeader* new_header; // Find the smallest chunk at least num_bytes in size. FreeBlocks::iterator found = free_blocks_.lower_bound(&temp); if (found != free_blocks_.end()) { AllocationHeader* header = *found; free_blocks_.erase(found); // Fit our object in the previous free header space. new_header = header->GetPrevFreeAllocationHeader(); // Remove the newly allocated block from the header and update the prev_free_. header->prev_free_ -= allocation_size; if (header->prev_free_ > 0) { // If there is remaining space, insert back into the free set. free_blocks_.insert(header); } } else { // Try to steal some memory from the free space at the end of the space. if (LIKELY(free_end_ >= allocation_size)) { // Fit our object at the start of the end free block. new_header = reinterpret_cast<AllocationHeader*>(end_ - free_end_); free_end_ -= allocation_size; } else { return nullptr; } } DCHECK(bytes_allocated != nullptr); *bytes_allocated = allocation_size; if (usable_size != nullptr) { *usable_size = allocation_size - sizeof(AllocationHeader); } // Need to do these inside of the lock. ++num_objects_allocated_; ++total_objects_allocated_; num_bytes_allocated_ += allocation_size; total_bytes_allocated_ += allocation_size; // We always put our object at the start of the free block, there can not be another free block // before it. if (kIsDebugBuild) { mprotect(new_header, allocation_size, PROT_READ | PROT_WRITE); } new_header->SetPrevFree(0); new_header->SetAllocationSize(allocation_size); return new_header->GetObjectAddress(); } void FreeListSpace::Dump(std::ostream& os) const { MutexLock mu(Thread::Current(), const_cast<Mutex&>(lock_)); os << GetName() << " -" << " begin: " << reinterpret_cast<void*>(Begin()) << " end: " << reinterpret_cast<void*>(End()) << "\n"; uintptr_t free_end_start = reinterpret_cast<uintptr_t>(end_) - free_end_; AllocationHeader* cur_header = reinterpret_cast<AllocationHeader*>(Begin()); while (reinterpret_cast<uintptr_t>(cur_header) < free_end_start) { byte* free_start = reinterpret_cast<byte*>(cur_header); cur_header = cur_header->GetNextNonFree(); byte* free_end = reinterpret_cast<byte*>(cur_header); if (free_start != free_end) { os << "Free block at address: " << reinterpret_cast<const void*>(free_start) << " of length " << free_end - free_start << " bytes\n"; } size_t alloc_size = cur_header->AllocationSize(); byte* byte_start = reinterpret_cast<byte*>(cur_header->GetObjectAddress()); byte* byte_end = byte_start + alloc_size - sizeof(AllocationHeader); os << "Large object at address: " << reinterpret_cast<const void*>(free_start) << " of length " << byte_end - byte_start << " bytes\n"; cur_header = reinterpret_cast<AllocationHeader*>(byte_end); } if (free_end_) { os << "Free block at address: " << reinterpret_cast<const void*>(free_end_start) << " of length " << free_end_ << " bytes\n"; } } void LargeObjectSpace::SweepCallback(size_t num_ptrs, mirror::Object** ptrs, void* arg) { SweepCallbackContext* context = static_cast<SweepCallbackContext*>(arg); space::LargeObjectSpace* space = context->space->AsLargeObjectSpace(); Thread* self = context->self; Locks::heap_bitmap_lock_->AssertExclusiveHeld(self); // If the bitmaps aren't swapped we need to clear the bits since the GC isn't going to re-swap // the bitmaps as an optimization. if (!context->swap_bitmaps) { accounting::LargeObjectBitmap* bitmap = space->GetLiveBitmap(); for (size_t i = 0; i < num_ptrs; ++i) { bitmap->Clear(ptrs[i]); } } context->freed.objects += num_ptrs; context->freed.bytes += space->FreeList(self, num_ptrs, ptrs); } collector::ObjectBytePair LargeObjectSpace::Sweep(bool swap_bitmaps) { if (Begin() >= End()) { return collector::ObjectBytePair(0, 0); } accounting::LargeObjectBitmap* live_bitmap = GetLiveBitmap(); accounting::LargeObjectBitmap* mark_bitmap = GetMarkBitmap(); if (swap_bitmaps) { std::swap(live_bitmap, mark_bitmap); } AllocSpace::SweepCallbackContext scc(swap_bitmaps, this); accounting::LargeObjectBitmap::SweepWalk(*live_bitmap, *mark_bitmap, reinterpret_cast<uintptr_t>(Begin()), reinterpret_cast<uintptr_t>(End()), SweepCallback, &scc); return scc.freed; } } // namespace space } // namespace gc } // namespace art
[ "ektksc@gmail.com" ]
ektksc@gmail.com
2b6d53d73fcd1c6eeb09281e2e3cb9ef5a60f990
d255a6c41b2d41e9351673a2b09872297ec051eb
/pat_a1143/pat_a1143_0.cpp
d86fe039a1e5968edba7894cf63e2dbefed1cb76
[]
no_license
wangruici/pat_doing
9080e0adfc57fed801090c2ab4edd6e36729e5e4
440090c5bbea219fd1dd56465512038488781436
refs/heads/master
2021-01-24T01:22:18.170878
2018-04-18T13:58:07
2018-04-18T13:58:07
122,806,167
3
0
null
null
null
null
UTF-8
C++
false
false
2,213
cpp
//run out of time #include <iostream> #include <string> #include <unordered_set> #include <cstdio> using std::cin; using std::cout; using std::endl; using std::string; using std::unordered_set; const int maxn=10010; struct Node{ int value; Node* lchild; Node* rchild; Node* parent; Node(int _value):value(_value),lchild(NULL),rchild(NULL),parent(NULL){} }; void insert(Node* parent,Node* &root,int value){ if(root==NULL){ root=new Node(value); root->parent=parent; } else if(value<root->value){ insert(root,root->lchild,value); } else if(value>=root->value){ insert(root,root->rchild,value); } } Node* search(Node* root,int value){ if(root==NULL){ return NULL; } else if(value>root->value){ return search(root->rchild,value); } else if(value<root->value){ return search(root->lchild,value); } else{ return root; } } Node* getLow(Node* root,int value1,Node* &n1,int value2,Node* &n2){ n1=search(root,value1); n2=search(root,value2); if(n1==NULL||n2==NULL){ return NULL; } else{ unordered_set<Node*> parent1; Node* temp_n=n1; while(temp_n!=NULL){ parent1.insert(temp_n); temp_n=temp_n->parent; } temp_n=n2; while(temp_n!=NULL){ if(parent1.find(temp_n)!=parent1.end()){ return temp_n; } temp_n=temp_n->parent; } return NULL; } } int main(){ int total_node; int query_count; scanf("%d",&query_count); scanf("%d",&total_node); Node* root=NULL; int temp; for(int i=0;i<total_node;++i){ scanf("%d",&temp); insert(NULL,root,temp); } int temp1,temp2; Node* tempn1; Node* tempn2; Node* tempn; for(int i=0;i<query_count;++i){ scanf("%d%d",&temp1,&temp2); tempn=getLow(root,temp1,tempn1,temp2,tempn2); if(tempn1==NULL&&tempn2==NULL){ printf("ERROR: %d and %d are not found.\n",temp1,temp2); } else if(tempn1==NULL){ printf("ERROR: %d is not found.\n",temp1); } else if(tempn2==NULL){ printf("ERROR: %d is not found.\n",temp2); } else if(tempn==tempn1){ printf("%d is an ancestor of %d.\n",temp1,temp2); } else if(tempn==tempn2){ printf("%d is an ancestor of %d.\n",temp2,temp1); } else{ printf("LCA of %d and %d is %d.\n",temp1,temp2,tempn->value); } } return 0; }
[ "wrctianming@163.com" ]
wrctianming@163.com
96a2c68f2fb7c1c2e7673c6f7b1991aa2321e16f
edccfef24a84712873938e24e138d2ce79834181
/third-party/tbb/examples/parallel_for/tachyon/src/ui.hpp
54439b78a032c264c67cc826963930f586d87c7f
[ "MIT", "Zlib", "BSD-3-Clause", "Apache-2.0", "BSD-2-Clause" ]
permissive
rui314/mold
aa746e60ee491af54b7753d35bef3d2b821ae0c6
f76d3e0d0c285fab4d770d4b57035d57690fade7
refs/heads/main
2023-08-31T22:14:27.427281
2023-08-31T09:16:26
2023-08-31T09:16:32
299,510,783
12,149
503
MIT
2023-09-14T03:54:12
2020-09-29T05:12:48
C++
UTF-8
C++
false
false
2,592
hpp
/* Copyright (c) 2005-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* The original source for this example is Copyright (c) 1994-2008 John E. Stone All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * ui.h - defines for user interface functions * * $Id: ui.h,v 1.2 2007-02-22 17:54:16 Exp $ */ /* Different types of message, for levels of verbosity etc */ #define MSG_0 100 #define MSG_1 101 #define MSG_2 102 #define MSG_3 103 #define MSG_4 104 #define MSG_5 105 #define MSG_ERR 200 #define MSG_ABORT 300 void rt_ui_message(int, const char *); void rt_ui_progress(int); int rt_ui_checkaction(void);
[ "ruiu@cs.stanford.edu" ]
ruiu@cs.stanford.edu
79b6f9da18e1c8d92266731e0d2bea4d1a67be4e
f259bd1124d55899e487b5fc1ab782f5818cfc01
/Classes/Native/AssemblyU2DUnityScript_ThirdPersonController973398072.h
ca7fe9848a475e3e22b8562dc2dd8957a42ff80e
[]
no_license
maewang/GirlsWhoCode-VR-Recycling-App
e3898c1805b22734e55253b808f497edde4c241f
3fa9021342298aca05e40500980f59969772304e
refs/heads/master
2021-08-22T04:58:04.958739
2017-11-29T10:27:27
2017-11-29T10:27:27
112,148,020
0
0
null
null
null
null
UTF-8
C++
false
false
21,082
h
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // UnityEngine.AnimationClip struct AnimationClip_t2007702890; // UnityEngine.Animation struct Animation_t1724966010; #include "UnityEngine_UnityEngine_MonoBehaviour667441552.h" #include "AssemblyU2DUnityScript_CharacterState3638982408.h" #include "UnityEngine_UnityEngine_Vector34282066566.h" #include "UnityEngine_UnityEngine_CollisionFlags490137529.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // ThirdPersonController struct ThirdPersonController_t973398072 : public MonoBehaviour_t667441552 { public: // UnityEngine.AnimationClip ThirdPersonController::idleAnimation AnimationClip_t2007702890 * ___idleAnimation_2; // UnityEngine.AnimationClip ThirdPersonController::walkAnimation AnimationClip_t2007702890 * ___walkAnimation_3; // UnityEngine.AnimationClip ThirdPersonController::runAnimation AnimationClip_t2007702890 * ___runAnimation_4; // UnityEngine.AnimationClip ThirdPersonController::jumpPoseAnimation AnimationClip_t2007702890 * ___jumpPoseAnimation_5; // System.Single ThirdPersonController::walkMaxAnimationSpeed float ___walkMaxAnimationSpeed_6; // System.Single ThirdPersonController::trotMaxAnimationSpeed float ___trotMaxAnimationSpeed_7; // System.Single ThirdPersonController::runMaxAnimationSpeed float ___runMaxAnimationSpeed_8; // System.Single ThirdPersonController::jumpAnimationSpeed float ___jumpAnimationSpeed_9; // System.Single ThirdPersonController::landAnimationSpeed float ___landAnimationSpeed_10; // UnityEngine.Animation ThirdPersonController::_animation Animation_t1724966010 * ____animation_11; // CharacterState ThirdPersonController::_characterState int32_t ____characterState_12; // System.Single ThirdPersonController::walkSpeed float ___walkSpeed_13; // System.Single ThirdPersonController::trotSpeed float ___trotSpeed_14; // System.Single ThirdPersonController::runSpeed float ___runSpeed_15; // System.Single ThirdPersonController::inAirControlAcceleration float ___inAirControlAcceleration_16; // System.Single ThirdPersonController::jumpHeight float ___jumpHeight_17; // System.Single ThirdPersonController::gravity float ___gravity_18; // System.Single ThirdPersonController::speedSmoothing float ___speedSmoothing_19; // System.Single ThirdPersonController::rotateSpeed float ___rotateSpeed_20; // System.Single ThirdPersonController::trotAfterSeconds float ___trotAfterSeconds_21; // System.Boolean ThirdPersonController::canJump bool ___canJump_22; // System.Single ThirdPersonController::jumpRepeatTime float ___jumpRepeatTime_23; // System.Single ThirdPersonController::jumpTimeout float ___jumpTimeout_24; // System.Single ThirdPersonController::groundedTimeout float ___groundedTimeout_25; // System.Single ThirdPersonController::lockCameraTimer float ___lockCameraTimer_26; // UnityEngine.Vector3 ThirdPersonController::moveDirection Vector3_t4282066566 ___moveDirection_27; // System.Single ThirdPersonController::verticalSpeed float ___verticalSpeed_28; // System.Single ThirdPersonController::moveSpeed float ___moveSpeed_29; // UnityEngine.CollisionFlags ThirdPersonController::collisionFlags int32_t ___collisionFlags_30; // System.Boolean ThirdPersonController::jumping bool ___jumping_31; // System.Boolean ThirdPersonController::jumpingReachedApex bool ___jumpingReachedApex_32; // System.Boolean ThirdPersonController::movingBack bool ___movingBack_33; // System.Boolean ThirdPersonController::isMoving bool ___isMoving_34; // System.Single ThirdPersonController::walkTimeStart float ___walkTimeStart_35; // System.Single ThirdPersonController::lastJumpButtonTime float ___lastJumpButtonTime_36; // System.Single ThirdPersonController::lastJumpTime float ___lastJumpTime_37; // System.Single ThirdPersonController::lastJumpStartHeight float ___lastJumpStartHeight_38; // UnityEngine.Vector3 ThirdPersonController::inAirVelocity Vector3_t4282066566 ___inAirVelocity_39; // System.Single ThirdPersonController::lastGroundedTime float ___lastGroundedTime_40; // System.Boolean ThirdPersonController::isControllable bool ___isControllable_41; public: inline static int32_t get_offset_of_idleAnimation_2() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___idleAnimation_2)); } inline AnimationClip_t2007702890 * get_idleAnimation_2() const { return ___idleAnimation_2; } inline AnimationClip_t2007702890 ** get_address_of_idleAnimation_2() { return &___idleAnimation_2; } inline void set_idleAnimation_2(AnimationClip_t2007702890 * value) { ___idleAnimation_2 = value; Il2CppCodeGenWriteBarrier(&___idleAnimation_2, value); } inline static int32_t get_offset_of_walkAnimation_3() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___walkAnimation_3)); } inline AnimationClip_t2007702890 * get_walkAnimation_3() const { return ___walkAnimation_3; } inline AnimationClip_t2007702890 ** get_address_of_walkAnimation_3() { return &___walkAnimation_3; } inline void set_walkAnimation_3(AnimationClip_t2007702890 * value) { ___walkAnimation_3 = value; Il2CppCodeGenWriteBarrier(&___walkAnimation_3, value); } inline static int32_t get_offset_of_runAnimation_4() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___runAnimation_4)); } inline AnimationClip_t2007702890 * get_runAnimation_4() const { return ___runAnimation_4; } inline AnimationClip_t2007702890 ** get_address_of_runAnimation_4() { return &___runAnimation_4; } inline void set_runAnimation_4(AnimationClip_t2007702890 * value) { ___runAnimation_4 = value; Il2CppCodeGenWriteBarrier(&___runAnimation_4, value); } inline static int32_t get_offset_of_jumpPoseAnimation_5() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___jumpPoseAnimation_5)); } inline AnimationClip_t2007702890 * get_jumpPoseAnimation_5() const { return ___jumpPoseAnimation_5; } inline AnimationClip_t2007702890 ** get_address_of_jumpPoseAnimation_5() { return &___jumpPoseAnimation_5; } inline void set_jumpPoseAnimation_5(AnimationClip_t2007702890 * value) { ___jumpPoseAnimation_5 = value; Il2CppCodeGenWriteBarrier(&___jumpPoseAnimation_5, value); } inline static int32_t get_offset_of_walkMaxAnimationSpeed_6() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___walkMaxAnimationSpeed_6)); } inline float get_walkMaxAnimationSpeed_6() const { return ___walkMaxAnimationSpeed_6; } inline float* get_address_of_walkMaxAnimationSpeed_6() { return &___walkMaxAnimationSpeed_6; } inline void set_walkMaxAnimationSpeed_6(float value) { ___walkMaxAnimationSpeed_6 = value; } inline static int32_t get_offset_of_trotMaxAnimationSpeed_7() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___trotMaxAnimationSpeed_7)); } inline float get_trotMaxAnimationSpeed_7() const { return ___trotMaxAnimationSpeed_7; } inline float* get_address_of_trotMaxAnimationSpeed_7() { return &___trotMaxAnimationSpeed_7; } inline void set_trotMaxAnimationSpeed_7(float value) { ___trotMaxAnimationSpeed_7 = value; } inline static int32_t get_offset_of_runMaxAnimationSpeed_8() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___runMaxAnimationSpeed_8)); } inline float get_runMaxAnimationSpeed_8() const { return ___runMaxAnimationSpeed_8; } inline float* get_address_of_runMaxAnimationSpeed_8() { return &___runMaxAnimationSpeed_8; } inline void set_runMaxAnimationSpeed_8(float value) { ___runMaxAnimationSpeed_8 = value; } inline static int32_t get_offset_of_jumpAnimationSpeed_9() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___jumpAnimationSpeed_9)); } inline float get_jumpAnimationSpeed_9() const { return ___jumpAnimationSpeed_9; } inline float* get_address_of_jumpAnimationSpeed_9() { return &___jumpAnimationSpeed_9; } inline void set_jumpAnimationSpeed_9(float value) { ___jumpAnimationSpeed_9 = value; } inline static int32_t get_offset_of_landAnimationSpeed_10() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___landAnimationSpeed_10)); } inline float get_landAnimationSpeed_10() const { return ___landAnimationSpeed_10; } inline float* get_address_of_landAnimationSpeed_10() { return &___landAnimationSpeed_10; } inline void set_landAnimationSpeed_10(float value) { ___landAnimationSpeed_10 = value; } inline static int32_t get_offset_of__animation_11() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ____animation_11)); } inline Animation_t1724966010 * get__animation_11() const { return ____animation_11; } inline Animation_t1724966010 ** get_address_of__animation_11() { return &____animation_11; } inline void set__animation_11(Animation_t1724966010 * value) { ____animation_11 = value; Il2CppCodeGenWriteBarrier(&____animation_11, value); } inline static int32_t get_offset_of__characterState_12() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ____characterState_12)); } inline int32_t get__characterState_12() const { return ____characterState_12; } inline int32_t* get_address_of__characterState_12() { return &____characterState_12; } inline void set__characterState_12(int32_t value) { ____characterState_12 = value; } inline static int32_t get_offset_of_walkSpeed_13() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___walkSpeed_13)); } inline float get_walkSpeed_13() const { return ___walkSpeed_13; } inline float* get_address_of_walkSpeed_13() { return &___walkSpeed_13; } inline void set_walkSpeed_13(float value) { ___walkSpeed_13 = value; } inline static int32_t get_offset_of_trotSpeed_14() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___trotSpeed_14)); } inline float get_trotSpeed_14() const { return ___trotSpeed_14; } inline float* get_address_of_trotSpeed_14() { return &___trotSpeed_14; } inline void set_trotSpeed_14(float value) { ___trotSpeed_14 = value; } inline static int32_t get_offset_of_runSpeed_15() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___runSpeed_15)); } inline float get_runSpeed_15() const { return ___runSpeed_15; } inline float* get_address_of_runSpeed_15() { return &___runSpeed_15; } inline void set_runSpeed_15(float value) { ___runSpeed_15 = value; } inline static int32_t get_offset_of_inAirControlAcceleration_16() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___inAirControlAcceleration_16)); } inline float get_inAirControlAcceleration_16() const { return ___inAirControlAcceleration_16; } inline float* get_address_of_inAirControlAcceleration_16() { return &___inAirControlAcceleration_16; } inline void set_inAirControlAcceleration_16(float value) { ___inAirControlAcceleration_16 = value; } inline static int32_t get_offset_of_jumpHeight_17() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___jumpHeight_17)); } inline float get_jumpHeight_17() const { return ___jumpHeight_17; } inline float* get_address_of_jumpHeight_17() { return &___jumpHeight_17; } inline void set_jumpHeight_17(float value) { ___jumpHeight_17 = value; } inline static int32_t get_offset_of_gravity_18() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___gravity_18)); } inline float get_gravity_18() const { return ___gravity_18; } inline float* get_address_of_gravity_18() { return &___gravity_18; } inline void set_gravity_18(float value) { ___gravity_18 = value; } inline static int32_t get_offset_of_speedSmoothing_19() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___speedSmoothing_19)); } inline float get_speedSmoothing_19() const { return ___speedSmoothing_19; } inline float* get_address_of_speedSmoothing_19() { return &___speedSmoothing_19; } inline void set_speedSmoothing_19(float value) { ___speedSmoothing_19 = value; } inline static int32_t get_offset_of_rotateSpeed_20() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___rotateSpeed_20)); } inline float get_rotateSpeed_20() const { return ___rotateSpeed_20; } inline float* get_address_of_rotateSpeed_20() { return &___rotateSpeed_20; } inline void set_rotateSpeed_20(float value) { ___rotateSpeed_20 = value; } inline static int32_t get_offset_of_trotAfterSeconds_21() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___trotAfterSeconds_21)); } inline float get_trotAfterSeconds_21() const { return ___trotAfterSeconds_21; } inline float* get_address_of_trotAfterSeconds_21() { return &___trotAfterSeconds_21; } inline void set_trotAfterSeconds_21(float value) { ___trotAfterSeconds_21 = value; } inline static int32_t get_offset_of_canJump_22() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___canJump_22)); } inline bool get_canJump_22() const { return ___canJump_22; } inline bool* get_address_of_canJump_22() { return &___canJump_22; } inline void set_canJump_22(bool value) { ___canJump_22 = value; } inline static int32_t get_offset_of_jumpRepeatTime_23() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___jumpRepeatTime_23)); } inline float get_jumpRepeatTime_23() const { return ___jumpRepeatTime_23; } inline float* get_address_of_jumpRepeatTime_23() { return &___jumpRepeatTime_23; } inline void set_jumpRepeatTime_23(float value) { ___jumpRepeatTime_23 = value; } inline static int32_t get_offset_of_jumpTimeout_24() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___jumpTimeout_24)); } inline float get_jumpTimeout_24() const { return ___jumpTimeout_24; } inline float* get_address_of_jumpTimeout_24() { return &___jumpTimeout_24; } inline void set_jumpTimeout_24(float value) { ___jumpTimeout_24 = value; } inline static int32_t get_offset_of_groundedTimeout_25() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___groundedTimeout_25)); } inline float get_groundedTimeout_25() const { return ___groundedTimeout_25; } inline float* get_address_of_groundedTimeout_25() { return &___groundedTimeout_25; } inline void set_groundedTimeout_25(float value) { ___groundedTimeout_25 = value; } inline static int32_t get_offset_of_lockCameraTimer_26() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___lockCameraTimer_26)); } inline float get_lockCameraTimer_26() const { return ___lockCameraTimer_26; } inline float* get_address_of_lockCameraTimer_26() { return &___lockCameraTimer_26; } inline void set_lockCameraTimer_26(float value) { ___lockCameraTimer_26 = value; } inline static int32_t get_offset_of_moveDirection_27() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___moveDirection_27)); } inline Vector3_t4282066566 get_moveDirection_27() const { return ___moveDirection_27; } inline Vector3_t4282066566 * get_address_of_moveDirection_27() { return &___moveDirection_27; } inline void set_moveDirection_27(Vector3_t4282066566 value) { ___moveDirection_27 = value; } inline static int32_t get_offset_of_verticalSpeed_28() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___verticalSpeed_28)); } inline float get_verticalSpeed_28() const { return ___verticalSpeed_28; } inline float* get_address_of_verticalSpeed_28() { return &___verticalSpeed_28; } inline void set_verticalSpeed_28(float value) { ___verticalSpeed_28 = value; } inline static int32_t get_offset_of_moveSpeed_29() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___moveSpeed_29)); } inline float get_moveSpeed_29() const { return ___moveSpeed_29; } inline float* get_address_of_moveSpeed_29() { return &___moveSpeed_29; } inline void set_moveSpeed_29(float value) { ___moveSpeed_29 = value; } inline static int32_t get_offset_of_collisionFlags_30() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___collisionFlags_30)); } inline int32_t get_collisionFlags_30() const { return ___collisionFlags_30; } inline int32_t* get_address_of_collisionFlags_30() { return &___collisionFlags_30; } inline void set_collisionFlags_30(int32_t value) { ___collisionFlags_30 = value; } inline static int32_t get_offset_of_jumping_31() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___jumping_31)); } inline bool get_jumping_31() const { return ___jumping_31; } inline bool* get_address_of_jumping_31() { return &___jumping_31; } inline void set_jumping_31(bool value) { ___jumping_31 = value; } inline static int32_t get_offset_of_jumpingReachedApex_32() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___jumpingReachedApex_32)); } inline bool get_jumpingReachedApex_32() const { return ___jumpingReachedApex_32; } inline bool* get_address_of_jumpingReachedApex_32() { return &___jumpingReachedApex_32; } inline void set_jumpingReachedApex_32(bool value) { ___jumpingReachedApex_32 = value; } inline static int32_t get_offset_of_movingBack_33() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___movingBack_33)); } inline bool get_movingBack_33() const { return ___movingBack_33; } inline bool* get_address_of_movingBack_33() { return &___movingBack_33; } inline void set_movingBack_33(bool value) { ___movingBack_33 = value; } inline static int32_t get_offset_of_isMoving_34() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___isMoving_34)); } inline bool get_isMoving_34() const { return ___isMoving_34; } inline bool* get_address_of_isMoving_34() { return &___isMoving_34; } inline void set_isMoving_34(bool value) { ___isMoving_34 = value; } inline static int32_t get_offset_of_walkTimeStart_35() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___walkTimeStart_35)); } inline float get_walkTimeStart_35() const { return ___walkTimeStart_35; } inline float* get_address_of_walkTimeStart_35() { return &___walkTimeStart_35; } inline void set_walkTimeStart_35(float value) { ___walkTimeStart_35 = value; } inline static int32_t get_offset_of_lastJumpButtonTime_36() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___lastJumpButtonTime_36)); } inline float get_lastJumpButtonTime_36() const { return ___lastJumpButtonTime_36; } inline float* get_address_of_lastJumpButtonTime_36() { return &___lastJumpButtonTime_36; } inline void set_lastJumpButtonTime_36(float value) { ___lastJumpButtonTime_36 = value; } inline static int32_t get_offset_of_lastJumpTime_37() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___lastJumpTime_37)); } inline float get_lastJumpTime_37() const { return ___lastJumpTime_37; } inline float* get_address_of_lastJumpTime_37() { return &___lastJumpTime_37; } inline void set_lastJumpTime_37(float value) { ___lastJumpTime_37 = value; } inline static int32_t get_offset_of_lastJumpStartHeight_38() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___lastJumpStartHeight_38)); } inline float get_lastJumpStartHeight_38() const { return ___lastJumpStartHeight_38; } inline float* get_address_of_lastJumpStartHeight_38() { return &___lastJumpStartHeight_38; } inline void set_lastJumpStartHeight_38(float value) { ___lastJumpStartHeight_38 = value; } inline static int32_t get_offset_of_inAirVelocity_39() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___inAirVelocity_39)); } inline Vector3_t4282066566 get_inAirVelocity_39() const { return ___inAirVelocity_39; } inline Vector3_t4282066566 * get_address_of_inAirVelocity_39() { return &___inAirVelocity_39; } inline void set_inAirVelocity_39(Vector3_t4282066566 value) { ___inAirVelocity_39 = value; } inline static int32_t get_offset_of_lastGroundedTime_40() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___lastGroundedTime_40)); } inline float get_lastGroundedTime_40() const { return ___lastGroundedTime_40; } inline float* get_address_of_lastGroundedTime_40() { return &___lastGroundedTime_40; } inline void set_lastGroundedTime_40(float value) { ___lastGroundedTime_40 = value; } inline static int32_t get_offset_of_isControllable_41() { return static_cast<int32_t>(offsetof(ThirdPersonController_t973398072, ___isControllable_41)); } inline bool get_isControllable_41() const { return ___isControllable_41; } inline bool* get_address_of_isControllable_41() { return &___isControllable_41; } inline void set_isControllable_41(bool value) { ___isControllable_41 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
[ "dwang11@ucla.edu" ]
dwang11@ucla.edu
2dcf832debda312fe5bfcb7b18e2fc5fa1bb68ea
4eb4242f67eb54c601885461bac58b648d91d561
/third_part/gperftools_src/tests/stacktrace_unittest.cc
fbc52f5bb7a49108121944f2594363b5f246c70e
[]
no_license
biebipan/coding
630c873ecedc43a9a8698c0f51e26efb536dabd1
7709df7e979f2deb5401d835d0e3b119a7cd88d8
refs/heads/master
2022-01-06T18:52:00.969411
2018-07-18T04:30:02
2018-07-18T04:30:02
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,949
cc
// Copyright (c) 2005, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "third_part/gperftools_src/config_for_unittests.h" #ifdef HAVE_EXECINFO_H #include <execinfo.h> #endif #include <stdio.h> #include <stdlib.h> #include "third_part/gperftools_src/base/commandlineflags.h" #include "third_part/gperftools_src/base/logging.h" #include "third_part/gperftools_src/gperftools/stacktrace.h" namespace { // Obtain a backtrace, verify that the expected callers are present in the // backtrace, and maybe print the backtrace to stdout. // The sequence of functions whose return addresses we expect to see in the // backtrace. const int BACKTRACE_STEPS = 6; struct AddressRange { const void *start, *end; }; // Expected function [start,end] range. AddressRange expected_range[BACKTRACE_STEPS]; #if __GNUC__ // Using GCC extension: address of a label can be taken with '&&label'. // Start should be a label somewhere before recursive call, end somewhere // after it. #define INIT_ADDRESS_RANGE(fn, start_label, end_label, prange) \ do { \ (prange)->start = &&start_label; \ (prange)->end = &&end_label; \ CHECK_LT((prange)->start, (prange)->end); \ } while (0) // This macro expands into "unmovable" code (opaque to GCC), and that // prevents GCC from moving a_label up or down in the code. // Without it, there is no code following the 'end' label, and GCC // (4.3.1, 4.4.0) thinks it safe to assign &&end an address that is before // the recursive call. #define DECLARE_ADDRESS_LABEL(a_label) \ a_label: do { __asm__ __volatile__(""); } while (0) // Gcc 4.4.0 may split function into multiple chunks, and the chunk // performing recursive call may end up later in the code then the return // instruction (this actually happens with FDO). // Adjust function range from __builtin_return_address. #define ADJUST_ADDRESS_RANGE_FROM_RA(prange) \ do { \ void *ra = __builtin_return_address(0); \ CHECK_LT((prange)->start, ra); \ if (ra > (prange)->end) { \ printf("Adjusting range from %p..%p to %p..%p\n", \ (prange)->start, (prange)->end, \ (prange)->start, ra); \ (prange)->end = ra; \ } \ } while (0) #else // Assume the Check* functions below are not longer than 256 bytes. #define INIT_ADDRESS_RANGE(fn, start_label, end_label, prange) \ do { \ (prange)->start = reinterpret_cast<const void *>(&fn); \ (prange)->end = reinterpret_cast<const char *>(&fn) + 256; \ } while (0) #define DECLARE_ADDRESS_LABEL(a_label) do { } while (0) #define ADJUST_ADDRESS_RANGE_FROM_RA(prange) do { } while (0) #endif // __GNUC__ //-----------------------------------------------------------------------// void CheckRetAddrIsInFunction(void *ret_addr, const AddressRange &range) { CHECK_GE(ret_addr, range.start); CHECK_LE(ret_addr, range.end); } //-----------------------------------------------------------------------// void ATTRIBUTE_NOINLINE CheckStackTrace(int); void ATTRIBUTE_NOINLINE CheckStackTraceLeaf(void) { const int STACK_LEN = 10; void *stack[STACK_LEN]; int size; ADJUST_ADDRESS_RANGE_FROM_RA(&expected_range[1]); INIT_ADDRESS_RANGE(CheckStackTraceLeaf, start, end, &expected_range[0]); DECLARE_ADDRESS_LABEL(start); size = GetStackTrace(stack, STACK_LEN, 0); printf("Obtained %d stack frames.\n", size); CHECK_GE(size, 1); CHECK_LE(size, STACK_LEN); #ifdef HAVE_EXECINFO_H { char **strings = backtrace_symbols(stack, size); printf("Obtained %d stack frames.\n", size); for (int i = 0; i < size; i++) printf("%s %p\n", strings[i], stack[i]); printf("CheckStackTrace() addr: %p\n", &CheckStackTrace); free(strings); } #endif for (int i = 0; i < BACKTRACE_STEPS; i++) { printf("Backtrace %d: expected: %p..%p actual: %p ... ", i, expected_range[i].start, expected_range[i].end, stack[i]); fflush(stdout); CheckRetAddrIsInFunction(stack[i], expected_range[i]); printf("OK\n"); } DECLARE_ADDRESS_LABEL(end); } //-----------------------------------------------------------------------// /* Dummy functions to make the backtrace more interesting. */ void ATTRIBUTE_NOINLINE CheckStackTrace4(int i) { ADJUST_ADDRESS_RANGE_FROM_RA(&expected_range[2]); INIT_ADDRESS_RANGE(CheckStackTrace4, start, end, &expected_range[1]); DECLARE_ADDRESS_LABEL(start); for (int j = i; j >= 0; j--) CheckStackTraceLeaf(); DECLARE_ADDRESS_LABEL(end); } void ATTRIBUTE_NOINLINE CheckStackTrace3(int i) { ADJUST_ADDRESS_RANGE_FROM_RA(&expected_range[3]); INIT_ADDRESS_RANGE(CheckStackTrace3, start, end, &expected_range[2]); DECLARE_ADDRESS_LABEL(start); for (int j = i; j >= 0; j--) CheckStackTrace4(j); DECLARE_ADDRESS_LABEL(end); } void ATTRIBUTE_NOINLINE CheckStackTrace2(int i) { ADJUST_ADDRESS_RANGE_FROM_RA(&expected_range[4]); INIT_ADDRESS_RANGE(CheckStackTrace2, start, end, &expected_range[3]); DECLARE_ADDRESS_LABEL(start); for (int j = i; j >= 0; j--) CheckStackTrace3(j); DECLARE_ADDRESS_LABEL(end); } void ATTRIBUTE_NOINLINE CheckStackTrace1(int i) { ADJUST_ADDRESS_RANGE_FROM_RA(&expected_range[5]); INIT_ADDRESS_RANGE(CheckStackTrace1, start, end, &expected_range[4]); DECLARE_ADDRESS_LABEL(start); for (int j = i; j >= 0; j--) CheckStackTrace2(j); DECLARE_ADDRESS_LABEL(end); } void ATTRIBUTE_NOINLINE CheckStackTrace(int i) { INIT_ADDRESS_RANGE(CheckStackTrace, start, end, &expected_range[5]); DECLARE_ADDRESS_LABEL(start); for (int j = i; j >= 0; j--) CheckStackTrace1(j); DECLARE_ADDRESS_LABEL(end); } } // namespace //-----------------------------------------------------------------------// int main(int argc, char ** argv) { CheckStackTrace(0); printf("PASS\n"); return 0; }
[ "guoliqiang@ubuntu.(none)" ]
guoliqiang@ubuntu.(none)
d5771968c13d8e9b1378de04655f1ba487faf0f8
f18d0153621709192dbe81f8c447b45240b54dea
/小游戏及其管理系统/小游戏及其管理系统/pushbox.h
574b39ce76027933284536bffdbd8f9bcbe1dda2
[]
no_license
ThorpZhang/workSet
e08ddd7b6e10cae87b4b1416d44fe678a33ff5c9
f72cc76d22e2b23e144b63369568dd146907ebea
refs/heads/master
2020-04-25T14:09:58.846034
2019-03-02T03:21:33
2019-03-02T03:21:33
172,832,197
2
0
null
null
null
null
GB18030
C++
false
false
1,640
h
#pragma once #include <stdio.h> #include <stdlib.h> #include <conio.h> #include<iostream> #include"user.h" #include"Storage.h" #include"memberService.h" #include"typeDefinition.h" #define GameScreen_Height 10 #define GameScreen_Width 20 using namespace std; //定义命名空间ManagementSystemV5 namespace ManagementSystemV5 { //int GameScreen[GameScreen_Height][GameScreen_Width] = {}; //定义游戏屏幕 //char key;//定义用户按键 struct people { int x; int y; }; struct box { int x; int y; }; struct goal { int x; int y; }; //static people gamer;//定义玩家 //char control;//定义按键 void drawWall();//画墙 void refreshScreen();//清屏 void printfMassage();//输出游戏规则 void drawScreen(int *x);//打印屏幕 void CheckBoxGamerStatus();//监控全局箱子 玩家的状态 一旦重叠就改显示 void gamerMove();//玩家移动的时候刷新 void initGamer();//初始化游戏玩家位置 void refreshGamer();//将游戏玩家加入游戏 char getDirection();//获取用户当前按键 void gameControl(char x);//用户移动事件 bool detectionWin();//检测胜利条件 void CheckBoxGamerStatus(); void useMap(int x); void useMap1(); void useMap2(); void useMap3(); void initGameScreen(); //void putBoxStatus(); //测试方法 输出箱子位置 void putGamerStatus();//测试方法 输出人物位置 //void putGoalStatus();//测试方法 输出目的地位置 /* 0 空地 1 ○ 人 2 ⊙ 目的地 3 □ 箱子 4 ■ 墙壁 5 ◎ 人和目的地重叠 6 ◇ 箱子和目的地重叠 */ void play1(childplayer*p); void play2(adplayer*p); }
[ "1104332138@qq.com" ]
1104332138@qq.com
b47cec9291e270162a8cd9fbf14ed16e8bbfeb16
2f1a092537d8650cacbd274a3bd600e87a627e90
/thrift/compiler/test/fixtures/frozen-struct/gen-cpp2/include2_constants.cpp
4a83ae9610199cd8648de2807f06476ce70fb82d
[ "Apache-2.0" ]
permissive
ConnectionMaster/fbthrift
3aa7d095c00b04030fddbabffbf09a5adca29d42
d5d0fa3f72ee0eb4c7b955e9e04a25052678d740
refs/heads/master
2023-04-10T17:49:05.409858
2021-08-03T02:32:49
2021-08-03T02:33:57
187,603,239
1
1
Apache-2.0
2023-04-03T23:15:28
2019-05-20T08:49:29
C++
UTF-8
C++
false
false
145
cpp
/** * Autogenerated by Thrift for src/include2.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
d40956598385efe2f703a6408d13490e8c0cc18c
0f30d43960d46961688497af9004c2f154d71877
/culture/target/cpp/ts/include/thx/culture/Embed.h
bb994d6dcdff8214500f3668a77cc9eabf351631
[]
no_license
mboussaa/haxe-testing
77d2c44596f92d3b509ad2e450f61d2e640eb9a3
930bd6e63c8cb91a4df323d01ae518d048c089ba
refs/heads/master
2021-01-17T10:20:07.126520
2016-06-02T10:00:49
2016-06-02T10:00:49
59,005,172
1
0
null
null
null
null
UTF-8
C++
false
true
1,077
h
// Generated by Haxe 3.3.0 #ifndef INCLUDED_thx_culture_Embed #define INCLUDED_thx_culture_Embed #ifndef HXCPP_H #include <hxcpp.h> #endif HX_DECLARE_CLASS2(thx,culture,Embed) namespace thx{ namespace culture{ class HXCPP_CLASS_ATTRIBUTES Embed_obj : public hx::Object { public: typedef hx::Object super; typedef Embed_obj OBJ_; Embed_obj(); public: void __construct(); inline void *operator new(size_t inSize, bool inContainer=false,const char *inName="thx.culture.Embed") { return hx::Object::operator new(inSize,inContainer,inName); } inline void *operator new(size_t inSize, int extra) { return hx::Object::operator new(inSize+extra,false,"thx.culture.Embed"); } static hx::ObjectPtr< Embed_obj > __new(); static Dynamic __CreateEmpty(); static Dynamic __Create(hx::DynamicArray inArgs); //~Embed_obj(); HX_DO_RTTI_ALL; static void __register(); ::String __ToString() const { return HX_HCSTRING("Embed","\xb9","\xfd","\xfc","\x02"); } }; } // end namespace thx } // end namespace culture #endif /* INCLUDED_thx_culture_Embed */
[ "mohamed.boussaa@inria.fr" ]
mohamed.boussaa@inria.fr
3a531fc85ccae29be09bc9bec61e20514afc7916
f94aa5bd4d8814b57ae6713c1f69fa1e11bc6526
/TribesAscendSDK/HeaderDump/TribesGame__GFxTrPage_RoamingMatch.h
7a26ec5c7adc9d6dcac5472c079fe240c91b4335
[]
no_license
pixel5/TASDK
71980b727b86034771ea91c67f6c02116f47c245
0dc5e4524efed291fe7d8cf936fa64e0e37e4e82
refs/heads/master
2020-05-23T15:12:55.162796
2013-07-13T00:27:32
2013-07-13T00:27:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
912
h
#pragma once #define ADD_VAR( x, y, z ) ( ##x ) var_##y() \ { \ static ScriptProperty *script_property = ( ScriptProperty* )( ScriptObject::Find( #x " TribesGame.GFxTrPage_RoamingMatch." #y ) ); \ return ( ##x( this, script_property->offset, z ) ); \ } #define ADD_STRUCT( x, y, z ) ( ##x ) var_##y() \ { \ static ScriptProperty *script_property = ( ScriptProperty* )( ScriptObject::Find( "StructProperty TribesGame.GFxTrPage_RoamingMatch." #y ) ); \ return ( ##x( this, script_property->offset, z ) ); \ } #define ADD_OBJECT( x, y ) ( class x* ) var_##y() \ { \ static ScriptProperty *script_property = ( ScriptProperty* )( ScriptObject::Find( "ObjectProperty TribesGame.GFxTrPage_RoamingMatch." #y ) ); \ return *( x** )( this + script_property->offset ); \ } namespace UnrealScript { class GFxTrPage_RoamingMatch : public GFxTrPage { public: }; } #undef ADD_VAR #undef ADD_STRUCT #undef ADD_OBJECT
[ "altimormc@gmail.com" ]
altimormc@gmail.com
edefca0160cd0a959e77f5d2b049aa11ccf2e172
4e8a367ed7424890b7394d94f6f04a48cf03b5e8
/Dynamic Programming/ContinousSubarraySum.cpp
b6d49008590a66ad25d8866dd7bbd13470c4ec8d
[]
no_license
swapnilkant11/leetcode-problem-solutions-in-cpp
9087807206e10a9bd56729657983253b1dd76560
4328d8623230a9c687f912a8b7f8598ea4cda6a3
refs/heads/master
2022-12-01T04:10:41.689161
2020-08-20T18:25:52
2020-08-20T18:25:52
262,617,301
1
0
null
null
null
null
UTF-8
C++
false
false
968
cpp
// Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at // least 2 that sums up to a multiple of k, that is, sums up to n*k where n is also an integer. https://leetcode.com/problems/continuous-subarray-sum/ // created by Swapnil Kant // on 17-05-2020 bool continoussum(int arr[], int n, int k){ //declare a map to store the index of the elements occured. map<int, int> mp; mp[0] = -1; // sum variable. int sum = 0; for(int i = 0; i < n; i++){ // calculate the sum. sum += arr[i]; if(k != 0){ // calulate mod. sum = sum % k; if(mp.find(sum) != mp.end()){ // check for subarray condition. if(i - mp[sum] > 1) return true; } else mp[sum] = i; } } return false; } // the time complexity of the above algorithm will be O(n). // the space complexity of the above algorithm will be O(n).
[ "swapnilkant11@gmail.com" ]
swapnilkant11@gmail.com
0f272ca2eb270e92135f2f3dd759323e5db4389e
0b45aa221f069d9cd781dafa14bc2099b20fb03e
/trunk/sdk/tests/test_feature/source/test_saveload.cpp
8245e6ca44a24a5368fd2edcedfecc0716fb8a6f
[]
no_license
svn2github/angelscript
f2d16c2f32d89a364823904d6ca3048222951f8d
6af5956795e67f8b41c6a23d20e369fe2c5ee554
refs/heads/master
2023-09-03T07:42:01.087488
2015-01-12T00:00:30
2015-01-12T00:00:30
19,475,268
0
1
null
null
null
null
UTF-8
C++
false
false
72,564
cpp
// // Tests importing functions from other modules // // Test author: Andreas Jonsson // #include <memory> #include <vector> #include "utils.h" #include "../../../add_on/scriptarray/scriptarray.h" namespace TestSaveLoad { using namespace std; static const char * const TESTNAME = "TestSaveLoad"; static const char *script1 = "import void Test() from 'DynamicModule'; \n" "OBJ g_obj; \n" "array<A@> g_a = {A(),A()}; \n" "array<string> g_s = {'a','b','c'}; \n" "A @gHandle; \n" "funcdef void func_t(OBJ, float, A @); \n" "void func(OBJ o, float f, A @a) {} \n" "enum ETest {} \n" "void main() \n" "{ \n" " Test(); \n" " TestStruct(); \n" " TestArray(); \n" " GlobalCharArray.resize(1); \n" " string s = ARRAYTOHEX(GlobalCharArray); \n" " func_t @f = func; \n" " f(OBJ(), 1, A()); \n" "} \n" "void TestObj(OBJ &out obj) \n" "{ \n" "} \n" "void TestStruct() \n" "{ \n" " A a; \n" " a.a = 2; \n" " A@ b = @a; \n" "} \n" "void TestArray() \n" "{ \n" " A[] c(3); \n" " int[] d(2); \n" " A[]@[] e(1); \n" " @e[0] = @c; \n" "} \n" "class A \n" "{ \n" " int a; \n" " ETest e; \n" "}; \n" "void TestHandle(A @a) \n" "{ \n" "} \n" "interface MyIntf \n" "{ \n" " void test(); \n" "} \n" "class MyClass : MyIntf \n" "{ \n" " array<int> arr = {1000,200,40,1}; \n" " int sum = arr[0] + arr[1] + arr[2] + arr[3]; \n" " void test() {number = sum;} \n" "} \n"; static const char *script2 = "void Test() \n" "{ \n" " int[] a(3); \n" " a[0] = 23; \n" " a[1] = 13; \n" " a[2] = 34; \n" " if( a[0] + a[1] + a[2] == 23+13+34 ) \n" " number = 1234567890; \n" "} \n"; static const char *script3 = "float[] f(5); \n" "void Test(int a) {} \n"; static const char *script4 = "class CheckCollision \n" "{ \n" " Actor@[] _list1; \n" " \n" " void Initialize() { \n" " _list1.resize(1); \n" " } \n" " \n" " void Register(Actor@ entity){ \n" " @_list1[0] = @entity; \n" " } \n" "} \n" " \n" "CheckCollision g_checkCollision; \n" " \n" "class Shot : Actor { \n" " void Initialize(int a = 0) { \n" " g_checkCollision.Register(this); \n" " } \n" "} \n" "interface Actor { } \n" "InGame g_inGame; \n" "class InGame \n" "{ \n" " Ship _ship; \n" " void Initialize(int level) \n" " { \n" " g_checkCollision.Initialize(); \n" " _ship.Initialize(); \n" " } \n" "} \n" "class Ship : Actor \n" "{ \n" " Shot@[] _shots; \n" " void Initialize() \n" " { \n" " _shots.resize(5); \n" " \n" " for (int i=0; i < 5; i++) \n" " { \n" " Shot shot; \n" " @_shots[i] = @shot; \n" " _shots[i].Initialize(); \n" " } \n" " } \n" "} \n"; // Make sure the handle can be explicitly taken for class properties, array members, and global variables static const char *script5 = "IsoMap _iso; \n" "IsoSprite[] _sprite; \n" " \n" "int which = 0; \n" " \n" "bool Initialize() { \n" " if (!_iso.Load('data/iso/map.imp')) \n" " return false; \n" " \n" " _sprite.resize(100); \n" " \n" " if (!_sprite[0].Load('data/iso/pacman.spr')) \n" " return false; \n" " \n" " for (int i=1; i < 100; i++) { \n" " if (!_sprite[i].Load('data/iso/residencia1.spr')) \n" " return false; \n" " } \n" " \n" " \n" " _iso.AddEntity(_sprite[0], 0, 0, 0); \n" " \n" " return true; \n" "} \n"; bool fail = false; int number = 0; int number2 = 0; COutStream out; CScriptArray* GlobalCharArray = 0; void print(const string &) { } int getInt() { return 42; } void ArrayToHexStr(asIScriptGeneric *gen) { new(gen->GetAddressOfReturnLocation()) string(); } asIScriptEngine *ConfigureEngine(int version) { asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream,Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); RegisterStdString(engine); // Register a property with the built-in array type GlobalCharArray = (CScriptArray*)engine->CreateScriptObject(engine->GetObjectTypeById(engine->GetTypeIdByDecl("uint8[]"))); int r = engine->RegisterGlobalProperty("uint8[] GlobalCharArray", GlobalCharArray); assert( r >= 0 ); // Register function that use the built-in array type r = engine->RegisterGlobalFunction("string ARRAYTOHEX(uint8[] &in)", asFUNCTION(ArrayToHexStr), asCALL_GENERIC); assert( r >= 0 ); if( version == 1 ) { // The order of the properties shouldn't matter engine->RegisterGlobalProperty("int number", &number); engine->RegisterGlobalProperty("int number2", &number2); } else { // The order of the properties shouldn't matter engine->RegisterGlobalProperty("int number2", &number2); engine->RegisterGlobalProperty("int number", &number); } engine->RegisterObjectType("OBJ", sizeof(int), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_PRIMITIVE); return engine; } void TestScripts(asIScriptEngine *engine) { int r; // Bind the imported functions asIScriptModule *mod = engine->GetModule(0); r = mod->BindAllImportedFunctions(); assert( r >= 0 ); // Verify if handles are properly resolved asIScriptFunction *func = mod->GetFunctionByDecl("void TestHandle(A @)"); if( func == 0 ) { PRINTF("%s: Failed to identify function with handle\n", TESTNAME); TEST_FAILED; } ExecuteString(engine, "main()", mod); if( number != 1234567890 ) { PRINTF("%s: Failed to set the number as expected\n", TESTNAME); TEST_FAILED; } // Call an interface method on a class that implements the interface asIObjectType *type = engine->GetModule(0)->GetObjectTypeByName("MyClass"); asIScriptObject *obj = (asIScriptObject*)engine->CreateScriptObject(type); int intfTypeId = engine->GetModule(0)->GetTypeIdByDecl("MyIntf"); type = engine->GetObjectTypeById(intfTypeId); if( type == 0 ) TEST_FAILED; else func = type->GetMethodByDecl("void test()"); asIScriptContext *ctx = engine->CreateContext(); r = ctx->Prepare(func); if( r < 0 ) TEST_FAILED; ctx->SetObject(obj); ctx->Execute(); if( r != asEXECUTION_FINISHED ) TEST_FAILED; if( ctx ) ctx->Release(); if( obj ) obj->Release(); if( number != 1241 ) { PRINTF("%s: Interface method failed\n", TESTNAME); TEST_FAILED; } } void ConstructFloatArray(vector<float> *p) { new(p) vector<float>; } void ConstructFloatArray(int s, vector<float> *p) { new(p) vector<float>(s); } void DestructFloatArray(vector<float> *p) { p->~vector<float>(); } void IsoMapFactory(asIScriptGeneric *gen) { *(int**)gen->GetAddressOfReturnLocation() = new int(1); } void IsoSpriteFactory(asIScriptGeneric *gen) { *(int**)gen->GetAddressOfReturnLocation() = new int(1); } void DummyAddref(asIScriptGeneric *gen) { int *object = (int*)gen->GetObject(); (*object)++; } void DummyRelease(asIScriptGeneric *gen) { int *object = (int*)gen->GetObject(); (*object)--; if( *object == 0 ) delete object; } void Dummy(asIScriptGeneric *) { } static string _out; void output(asIScriptGeneric *gen) { string *str = (string*)gen->GetArgAddress(0); _out += *str; } bool Test2(); class Tmpl { public: Tmpl() {refCount = 1;} void AddRef() {refCount++;} void Release() {if( --refCount == 0 ) delete this;} static Tmpl *TmplFactory(asIObjectType*) {return new Tmpl;} static bool TmplCallback(asIObjectType * /*ot*/, bool & /*dontGC*/) {return false;} int refCount; }; bool TestAndrewPrice(); static asIScriptFunction *g_func = 0; bool Test() { int r; COutStream out; CBufferedOutStream bout; asIScriptEngine* engine; asIScriptModule* mod; // Test WriteConfigToStream/ConfigEngineFromStream with namespaces // http://www.gamedev.net/topic/664405-scripthelper-config-helpers-not-working-correctly/ { asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->SetDefaultNamespace("test"); engine->RegisterObjectType("foo", 0, asOBJ_REF | asOBJ_NOCOUNT); engine->SetDefaultNamespace("blah"); engine->RegisterGlobalFunction("test::foo @bar(test::foo @)", asFUNCTION(0), asCALL_GENERIC); engine->SetDefaultNamespace(""); engine->RegisterGlobalProperty("test::foo @g", (void*)1); stringstream s; int r = WriteConfigToStream(engine, s); if( r < 0 ) TEST_FAILED; // skip the first two lines, since they vary depending on library version, platform, and compilation mode string output = s.str(); size_t pos = output.find('\n'); pos = output.find('\n', pos+1); output = output.substr(pos+1); if( output != "// Engine properties\n" "ep 0 0\n" "ep 1 0\n" "ep 2 1\n" "ep 3 1\n" "ep 4 0\n" "ep 5 0\n" "ep 6 0\n" "ep 7 0\n" "ep 8 0\n" "ep 9 1\n" "ep 10 0\n" "ep 11 1\n" "ep 12 0\n" "ep 13 0\n" "ep 14 2\n" "ep 15 0\n" "ep 16 1\n" "ep 17 0\n" "ep 18 0\n" "ep 19 1\n" "ep 20 0\n" "ep 21 0\n" "ep 22 0\n" "ep 23 0\n" "\n" "// Enums\n" "\n" "// Types\n" "access 1\n" "namespace test\n" "objtype \"foo\" 262145\n" "\n" "// Type members\n" "\n" "// Functions\n" "namespace blah\n" "func \"test::foo@ bar(test::foo@)\"\n" "\n" "// Properties\n" "namespace ::\n" "prop \"test::foo@ g\"\n" "\n" "// String factory\n" "\n" "// Default array type\n" ) { PRINTF("%s", output.c_str()); TEST_FAILED; } engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); r = ConfigEngineFromStream(engine, s); if( r < 0 ) TEST_FAILED; stringstream s2; r = WriteConfigToStream(engine, s2); if( r < 0 ) TEST_FAILED; // Take out the engine property asEP_INIT_GLOBAL_VARS_AFTER_BUILD before // comparison, since it will not be maintained by the WriteConfigFromEngine output = s.str(); string output2 = s2.str(); pos = output.find("ep 9"); output = output.substr(0, pos) + output.substr(pos+7); output2 = output2.substr(0, pos) + output2.substr(pos+7); if( output != output2 ) { PRINTF("%s", s2.str().c_str()); TEST_FAILED; } engine->Release(); } // Test save/load with funcdef and imported functions // http://www.gamedev.net/topic/657621-using-global-funcdef-setter-with-imported-function-gives-assert-or-invalid-bytecode/ { asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); struct T { static void set_funcdef_var(asIScriptFunction*f) { if( g_func ) g_func->Release(); g_func = f; } }; const char *script = "import void bar() from \"somewhere\";" "void test1(){ @foo = test2; }" "void test2(){ @foo = bar; }"; engine->RegisterFuncdef( "void MyVoid()" ); engine->RegisterGlobalFunction( "void set_foo(MyVoid@)", asFUNCTION(T::set_funcdef_var), asCALL_CDECL ); asIScriptModule* module = engine->GetModule( "script", asGM_ALWAYS_CREATE ); module->AddScriptSection( "script", script ); if( module->Build() < 0 ) // assert (-DNDEBUG not present) TEST_FAILED; r = ExecuteString(engine, "test2()", module); if( r != asEXECUTION_FINISHED ) TEST_FAILED; if( g_func == 0 || string(g_func->GetName()) != "bar" ) TEST_FAILED; asIScriptContext *ctx = engine->CreateContext(); ctx->Prepare(g_func); r = ctx->Execute(); if( r != asEXECUTION_EXCEPTION ) // should fail since the imported function is not bound TEST_FAILED; if( string(ctx->GetExceptionString()) == "Unbound function called" ) ctx->Release(); CBytecodeStream bytecode(""); if( module->SaveByteCode( &bytecode ) < 0 ) TEST_FAILED; asIScriptModule* module_bytecode = engine->GetModule( "script_bytecode", asGM_ALWAYS_CREATE ); if( module_bytecode->LoadByteCode( &bytecode ) < 0 ) // error (-DNDEBUG present) TEST_FAILED; if( g_func ) { g_func->Release(); g_func = 0; } r = ExecuteString(engine, "test2()", module); if( r != asEXECUTION_FINISHED ) TEST_FAILED; if( g_func == 0 || string(g_func->GetName()) != "bar" ) TEST_FAILED; if( g_func ) { g_func->Release(); g_func = 0; } engine->Release(); } // Test saving and loading with template in a namespace // http://www.gamedev.net/topic/658862-loading-bytecode-bug/ { asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->SetDefaultNamespace( "reflection" ); engine->RegisterObjectType( "type", sizeof( 4 ), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS ); engine->RegisterObjectType( "typeof<class T>", 0, asOBJ_REF | asOBJ_TEMPLATE | asOBJ_NOCOUNT); engine->RegisterObjectBehaviour("typeof<T>", asBEHAVE_FACTORY, "typeof<T> @f(int&in)", asFUNCTION(0), asCALL_GENERIC); engine->RegisterObjectMethod("typeof<T>", "type opImplConv()", asFUNCTION(0), asCALL_GENERIC); engine->SetDefaultNamespace( "" ); asIScriptModule *mod = engine->GetModule("mod", asGM_ALWAYS_CREATE); mod->AddScriptSection("test", "class A {} \n" "void func() { \n" " reflection::type t = reflection::typeof<A>(); \n" "} \n"); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"1"); mod->SaveByteCode(&stream); if( mod->LoadByteCode(&stream) != 0 ) TEST_FAILED; engine->Release(); } // Test loading bytecode that tries to access objects that don't exist // This test is designed to fail loading when loading the bytecode for // the a function, thus testing that the clean up is appropriate { asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->SetDefaultNamespace( "reflection" ); engine->RegisterObjectType( "type", sizeof( 4 ), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS ); engine->RegisterObjectType( "typeof<class T>", 0, asOBJ_REF | asOBJ_TEMPLATE | asOBJ_NOCOUNT); engine->RegisterObjectBehaviour("typeof<T>", asBEHAVE_FACTORY, "typeof<T> @f(int&in)", asFUNCTION(0), asCALL_GENERIC); engine->RegisterObjectMethod("typeof<T>", "type opImplConv()", asFUNCTION(0), asCALL_GENERIC); engine->SetDefaultNamespace( "" ); asIScriptModule *mod = engine->GetModule("mod", asGM_ALWAYS_CREATE); mod->AddScriptSection("test", "class A {} \n" "void func() { \n" " reflection::type t = reflection::typeof<A>(); \n" "} \n"); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"1"); mod->SaveByteCode(&stream); engine->Release(); // Recreate the engine without the template type engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(CBufferedOutStream, Callback), &bout, asCALL_THISCALL); bout.buffer = ""; engine->SetDefaultNamespace( "reflection" ); engine->RegisterObjectType( "type", sizeof( 4 ), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS ); // engine->RegisterObjectType( "typeof<class T>", 0, asOBJ_REF | asOBJ_TEMPLATE | asOBJ_NOCOUNT); // engine->RegisterObjectBehaviour("typeof<T>", asBEHAVE_FACTORY, "typeof<T> @f(int&in)", asFUNCTION(0), asCALL_GENERIC); // engine->RegisterObjectMethod("typeof<T>", "type opImplConv()", asFUNCTION(0), asCALL_GENERIC); engine->SetDefaultNamespace( "" ); mod = engine->GetModule("mod", asGM_ALWAYS_CREATE); if( mod->LoadByteCode(&stream) >= 0 ) TEST_FAILED; if( bout.buffer != " (0, 0) : Error : Template type 'typeof' doesn't exist\n" " (0, 0) : Error : LoadByteCode failed. The bytecode is invalid. Number of bytes read from stream: 141\n" ) { PRINTF("%s", bout.buffer.c_str()); TEST_FAILED; } engine->Release(); } // Test saving and loading script with string literal { // Write the configuration to stream asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterStdString(engine); stringstream strm; WriteConfigToStream(engine, strm); engine->Release(); // Configure engine from stream and compile the script to bytecode strm.seekp(0); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); ConfigEngineFromStream(engine, strm); const char *script = "void func() { \n" " 'test'; \n" " return; \n" "} \n"; mod = engine->GetModule("mod", asGM_ALWAYS_CREATE); mod->AddScriptSection("test", script); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"1"); r = mod->SaveByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); // Load the bytecode engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterStdString(engine); mod = engine->GetModule("mod", asGM_ALWAYS_CREATE); if( mod->LoadByteCode(&stream) != 0 ) TEST_FAILED; engine->Release(); } // Test saving and loading script with array of classes initialized from initialization list if( !strstr(asGetLibraryOptions(), "AS_NO_MEMBER_INIT") ) { asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream,Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); const char *script = "array<A@> g_a = {A()}; \n" "class A {} \n"; mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(":1", script); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"1"); mod->SaveByteCode(&stream); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); if( mod->LoadByteCode(&stream) != 0 ) TEST_FAILED; // The garbage collector must not complain about not being able to release objects engine->Release(); } // Test repeated save/loads with shared interfaces and funcdefs // http://www.gamedev.net/topic/656784-wrong-bytecode-with-funcdef-in-shared-interface/ { CBytecodeStream stream1(__FILE__"shared1"); CBytecodeStream stream2(__FILE__"shared2"); CBytecodeStream stream3(__FILE__"shared1"); CBytecodeStream stream4(__FILE__"shared2"); { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); asIScriptModule *mod1 = engine->GetModule("1", asGM_ALWAYS_CREATE); mod1->AddScriptSection("test", "funcdef void CALLBACK(); \n"); r = mod1->Build(); if( r < 0 ) TEST_FAILED; asIScriptModule *mod2 = engine->GetModule("2", asGM_ALWAYS_CREATE); mod2->AddScriptSection("test", "funcdef void CALLBACK(); \n" "void Foo1(CALLBACK@){} \n" "void Foo2(){Foo1(null);} \n"); r = mod2->Build(); if( r < 0 ) TEST_FAILED; r = mod1->SaveByteCode(&stream1); if( r < 0 ) TEST_FAILED; r = mod2->SaveByteCode(&stream2); if( r < 0 ) TEST_FAILED; engine->Release(); } asDWORD crc1 = ComputeCRC32(&stream2.buffer[0], asUINT(stream2.buffer.size())); { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); asIScriptModule *mod1 = engine->GetModule("1", asGM_ALWAYS_CREATE); r = mod1->LoadByteCode(&stream1); if( r < 0 ) TEST_FAILED; asIScriptModule *mod2 = engine->GetModule("2", asGM_ALWAYS_CREATE); r = mod2->LoadByteCode(&stream2); if( r < 0 ) TEST_FAILED; r = mod1->SaveByteCode(&stream3); if( r < 0 ) TEST_FAILED; r = mod2->SaveByteCode(&stream4); if( r < 0 ) TEST_FAILED; engine->Release(); } asDWORD crc2 = ComputeCRC32(&stream4.buffer[0], asUINT(stream4.buffer.size())); if( crc1 != crc2 ) TEST_FAILED; if( stream4.buffer.size() == stream2.buffer.size() ) { for( size_t b = 0; b < stream4.buffer.size(); ++b ) if( stream4.buffer[b] != stream2.buffer[b] ) PRINTF("streams differ on byte %d\n", b); } else PRINTF("streams differ in size\n"); { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); asIScriptModule *mod1 = engine->GetModule("1", asGM_ALWAYS_CREATE); r = mod1->LoadByteCode(&stream3); if( r < 0 ) TEST_FAILED; asIScriptModule *mod2 = engine->GetModule("2", asGM_ALWAYS_CREATE); r = mod2->LoadByteCode(&stream4); if( r < 0 ) TEST_FAILED; engine->Release(); } } // Test multiple modules with shared enums and shared classes // http://www.gamedev.net/topic/632922-huge-problems-with-precompilde-byte-code/ { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream,Callback), &out, asCALL_THISCALL); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("test", "shared enum ResourceType {} \n" "shared class Resource \n" "{ \n" " void getType(ResourceType) {} \n" "} \n"); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"shared"); r = mod->SaveByteCode(&stream); if( r < 0 ) TEST_FAILED; mod = engine->GetModule("2", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); } // Test problem reported by Andre Santee // http://www.gamedev.net/topic/635623-assertion-failed-while-using-function-handles/ if( !strstr(asGetLibraryOptions(), "AS_NO_MEMBER_INIT") ) { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream,Callback), &out, asCALL_THISCALL); engine->RegisterGlobalFunction("void assert(bool)", asFUNCTION(Assert), asCALL_GENERIC); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("test", "class Foo \n" "{ \n" " int a = 42; \n" "} \n" "class Bar \n" "{ \n" " float b = 3.14f; \n" "} \n" "funcdef void TEST_FUNC_HANDLE(Foo, Bar); \n" "void testFunction(TEST_FUNC_HANDLE@ func) \n" "{ \n" " func(Foo(), Bar()); \n" "} \n" "void callback(Foo f, Bar b) \n" "{ \n" " assert( f.a == 42 && b.b == 3.14f ); \n" " called = true; \n" "} \n" "bool called = false;\n"); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"shared"); r = mod->SaveByteCode(&stream); if( r < 0 ) TEST_FAILED; mod = engine->GetModule("2", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; r = ExecuteString(engine, "testFunction(callback); assert( called );", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; engine->Release(); } Test2(); TestAndrewPrice(); // Test saving/loading with array of function pointers // http://www.gamedev.net/topic/627737-bytecode-loading-error/ { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream,Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, false); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("test", "funcdef void F(); \n" "array<F@> arr = { f }; \n" "void f() {} \n"); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"1"); r = mod->SaveByteCode(&stream); if( r < 0 ) TEST_FAILED; mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); } // Test shared interface with function pointers // http://www.gamedev.net/topic/639243-funcdef-inside-shared-interface-interface-already-implement-warning/ { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream,Callback), &out, asCALL_THISCALL); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("test", "funcdef void fdef(); \n" "shared interface iface \n" "{ \n" " fdef@ dummy(); \n" "} \n"); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"1"); r = mod->SaveByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); // Load the bytecode in two different modules engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream,Callback), &out, asCALL_THISCALL); stream.Restart(); mod = engine->GetModule("A", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; stream.Restart(); mod = engine->GetModule("B", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); // Load the bytecode twice, replacing the module engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream,Callback), &out, asCALL_THISCALL); stream.Restart(); mod = engine->GetModule("A", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; stream.Restart(); mod = engine->GetModule("A", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); } if( !strstr(asGetLibraryOptions(), "AS_NO_MEMBER_INIT") ) { engine = ConfigureEngine(0); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(":1", script1, strlen(script1), 0); r = mod->Build(); if( r < 0 ) TEST_FAILED; // Validate the number of global functions if( mod->GetFunctionCount() != 6 ) TEST_FAILED; mod = engine->GetModule("DynamicModule", asGM_ALWAYS_CREATE); mod->AddScriptSection(":2", script2, strlen(script2), 0); mod->Build(); TestScripts(engine); asUINT currentSize, totalDestroyed, totalDetected; engine->GetGCStatistics(&currentSize, &totalDestroyed, &totalDetected); // Save the compiled byte code CBytecodeStream stream(__FILE__"1"); CBytecodeStream stream2(__FILE__"2"); mod = engine->GetModule(0); mod->SaveByteCode(&stream); mod->SaveByteCode(&stream2, true); #ifndef STREAM_TO_FILE if( stream.buffer.size() != 2486 ) PRINTF("The saved byte code is not of the expected size. It is %d bytes\n", stream.buffer.size()); asUINT zeroes = stream.CountZeroes(); if( zeroes != 575 ) { PRINTF("The saved byte code contains a different amount of zeroes than the expected. Counted %d\n", zeroes); // Mac OS X PPC has more zeroes, probably due to the bool type being 4 bytes } asDWORD crc32 = ComputeCRC32(&stream.buffer[0], asUINT(stream.buffer.size())); if( crc32 != 0xBAE6E6EC ) PRINTF("The saved byte code has different checksum than the expected. Got 0x%X\n", crc32); // Without debug info if( stream2.buffer.size() != 2084 ) PRINTF("The saved byte code without debug info is not of the expected size. It is %d bytes\n", stream2.buffer.size()); zeroes = stream2.CountZeroes(); if( zeroes != 461 ) PRINTF("The saved byte code without debug info contains a different amount of zeroes than the expected. Counted %d\n", zeroes); #endif // Test loading without releasing the engine first mod = engine->GetModule(0, asGM_ALWAYS_CREATE); if( mod->LoadByteCode(&stream) != 0 ) TEST_FAILED; if( mod->GetFunctionCount() != 6 ) TEST_FAILED; else if( string(mod->GetFunctionByIndex(0)->GetScriptSectionName()) != ":1" ) TEST_FAILED; // Make sure the parameter names were loaded const char *paramName; mod->GetFunctionByName("func")->GetParam(1, 0, 0, &paramName); if( paramName == 0 || string(paramName) != "f" ) TEST_FAILED; mod = engine->GetModule("DynamicModule", asGM_ALWAYS_CREATE); mod->AddScriptSection(":2", script2, strlen(script2), 0); mod->Build(); TestScripts(engine); // Test loading for a new engine GlobalCharArray->Release(); GlobalCharArray = 0; engine->Release(); engine = ConfigureEngine(1); stream2.Restart(); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->LoadByteCode(&stream2); if( mod->GetFunctionCount() != 6 ) TEST_FAILED; // Make sure the parameter names were not loaded mod->GetFunctionByName("func")->GetParam(1, 0, 0, &paramName); if( paramName != 0 ) TEST_FAILED; mod = engine->GetModule("DynamicModule", asGM_ALWAYS_CREATE); mod->AddScriptSection(":2", script2, strlen(script2), 0); mod->Build(); TestScripts(engine); asUINT currentSize2, totalDestroyed2, totalDetected2; engine->GetGCStatistics(&currentSize2, &totalDestroyed2, &totalDetected2); if( currentSize != currentSize2 || totalDestroyed != totalDestroyed2 || totalDetected != totalDetected2 ) TEST_FAILED; GlobalCharArray->Release(); GlobalCharArray = 0; engine->Release(); //--------------------------------------- // A tiny file for comparison #ifndef STREAM_TO_FILE engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("script", "void f() {}"); mod->Build(); CBytecodeStream streamTiny(__FILE__"tiny"); mod->SaveByteCode(&streamTiny, true); engine->Release(); asBYTE expected[] = {0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x66,0x6E,0x01,0x66,0x00,0x40,0x50,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x3F,0x0A,0x00,0x00,0x00,0x00,0x00,0x01,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; bool match = true; for( asUINT n = 0; n < streamTiny.buffer.size(); n++ ) if( streamTiny.buffer[n] != expected[n] ) { match = false; break; } if( !match ) { PRINTF("Tiny module gave a different result than expected:\n"); PRINTF("got : "); for( asUINT n = 0; n < streamTiny.buffer.size(); n++ ) PRINTF("%0.2X", streamTiny.buffer[n]); PRINTF("\n"); PRINTF("expected: "); for( asUINT m = 0; m < sizeof(expected); m++ ) PRINTF("%0.2X", expected[m]); PRINTF("\n"); } #endif } // Test saving/loading global variable of registered value type // http://www.gamedev.net/topic/638529-wrong-function-called-on-bytecode-restoration/ SKIP_ON_MAX_PORT { struct A { static void Construct1(int *a) { *a = 1; } static void Construct2(int *a) { *a = 2; } }; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->RegisterObjectType("A", sizeof(int), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_PRIMITIVE); engine->RegisterObjectBehaviour("A", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(A::Construct1), asCALL_CDECL_OBJLAST); engine->RegisterObjectProperty("A", "int val", 0); engine->RegisterObjectType("B", sizeof(int), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_PRIMITIVE); engine->RegisterObjectBehaviour("B", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(A::Construct2), asCALL_CDECL_OBJLAST); engine->RegisterObjectProperty("B", "int val", 0); engine->RegisterGlobalFunction("void assert(bool)", asFUNCTION(Assert), asCALL_GENERIC); mod = engine->GetModule("A", asGM_ALWAYS_CREATE); mod->AddScriptSection("test", "A a; B b;"); r = mod->Build(); if( r != 0 ) TEST_FAILED; CBytecodeStream stream2(__FILE__"2"); mod->SaveByteCode(&stream2); engine->Release(); // Register the types in a different order this time engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->RegisterGlobalFunction("void assert(bool)", asFUNCTION(Assert), asCALL_GENERIC); engine->RegisterObjectType("B", sizeof(int), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_PRIMITIVE); engine->RegisterObjectBehaviour("B", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(A::Construct2), asCALL_CDECL_OBJLAST); engine->RegisterObjectProperty("B", "int val", 0); engine->RegisterObjectType("A", sizeof(int), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_PRIMITIVE); engine->RegisterObjectBehaviour("A", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(A::Construct1), asCALL_CDECL_OBJLAST); engine->RegisterObjectProperty("A", "int val", 0); mod = engine->GetModule("A", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream2); if( r != 0 ) TEST_FAILED; r = ExecuteString(engine, "assert( a.val == 1 ); \n" "assert( b.val == 2 ); \n", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; engine->Release(); } //----------------------------------------- // Saving bytecode for a module that failed to compile shouldn't be allowed { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("script3", script3, strlen(script3)); r = mod->Build(); if( r >= 0 ) TEST_FAILED; CBytecodeStream stream2(__FILE__"2"); r = mod->SaveByteCode(&stream2); if( r >= 0 ) TEST_FAILED; engine->Release(); } //----------------------------------- // save/load with overloaded array types should work as well { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); RegisterScriptArray(engine, true); int r = engine->RegisterObjectType("float[]", sizeof(vector<float>), asOBJ_VALUE | asOBJ_APP_CLASS_CDA); assert(r >= 0); #ifndef AS_MAX_PORTABILITY r = engine->RegisterObjectBehaviour("float[]", asBEHAVE_CONSTRUCT, "void f()", asFUNCTIONPR(ConstructFloatArray, (vector<float> *), void), asCALL_CDECL_OBJLAST); assert(r >= 0); r = engine->RegisterObjectBehaviour("float[]", asBEHAVE_CONSTRUCT, "void f(int)", asFUNCTIONPR(ConstructFloatArray, (int, vector<float> *), void), asCALL_CDECL_OBJLAST); assert(r >= 0); r = engine->RegisterObjectBehaviour("float[]", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(DestructFloatArray), asCALL_CDECL_OBJLAST); assert(r >= 0); r = engine->RegisterObjectMethod("float[]", "float[] &opAssign(float[]&in)", asMETHODPR(vector<float>, operator=, (const std::vector<float> &), vector<float>&), asCALL_THISCALL); assert(r >= 0); r = engine->RegisterObjectMethod("float[]", "float &opIndex(int)", asMETHODPR(vector<float>, operator[], (vector<float>::size_type), float &), asCALL_THISCALL); assert(r >= 0); r = engine->RegisterObjectMethod("float[]", "int length()", asMETHOD(vector<float>, size), asCALL_THISCALL); assert(r >= 0); #else r = engine->RegisterObjectBehaviour("float[]", asBEHAVE_CONSTRUCT, "void f()", WRAP_OBJ_LAST_PR(ConstructFloatArray, (vector<float> *), void), asCALL_GENERIC); assert(r >= 0); r = engine->RegisterObjectBehaviour("float[]", asBEHAVE_CONSTRUCT, "void f(int)", WRAP_OBJ_LAST_PR(ConstructFloatArray, (int, vector<float> *), void), asCALL_GENERIC); assert(r >= 0); r = engine->RegisterObjectBehaviour("float[]", asBEHAVE_DESTRUCT, "void f()", WRAP_OBJ_LAST(DestructFloatArray), asCALL_GENERIC); assert(r >= 0); r = engine->RegisterObjectMethod("float[]", "float[] &opAssign(float[]&in)", WRAP_MFN_PR(vector<float>, operator=, (const std::vector<float> &), vector<float>&), asCALL_GENERIC); assert(r >= 0); r = engine->RegisterObjectMethod("float[]", "float &opIndex(int)", WRAP_MFN_PR(vector<float>, operator[], (vector<float>::size_type), float &), asCALL_GENERIC); assert(r >= 0); r = engine->RegisterObjectMethod("float[]", "int length()", WRAP_MFN(vector<float>, size), asCALL_GENERIC); assert(r >= 0); #endif mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("script3", script3, strlen(script3)); mod->Build(); CBytecodeStream stream3(__FILE__"3"); mod->SaveByteCode(&stream3); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->LoadByteCode(&stream3); ExecuteString(engine, "Test(3)", mod); engine->Release(); } //------------------------------------ // Test problem detected by TheAtom // http://www.gamedev.net/topic/623170-crash-on-bytecode-loading/ { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); COutStream out; engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); asIScriptModule *mod = engine->GetModule("0", asGM_ALWAYS_CREATE); mod->AddScriptSection("0", "shared class T\n" "{\n" " void f() { }\n" "};\n" "shared class T2 : T\n" "{\n" "};\n" "class T3 : T\n" "{\n" " void f() { T::f(); }\n" "};\n"); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"0"); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); mod = engine->GetModule("1", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; stream.Restart(); mod = engine->GetModule("2", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); } //--------------------------------- // Must be possible to load scripts with classes declared out of order // Built-in array types must be able to be declared even though the complete script structure hasn't been loaded yet { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); RegisterScriptString(engine); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("script", script4, strlen(script4)); r = mod->Build(); if( r < 0 ) TEST_FAILED; else { // Test the script with compiled byte code asIScriptContext *ctx = engine->CreateContext(); r = ExecuteString(engine, "g_inGame.Initialize(0);", mod, ctx); if( r != asEXECUTION_FINISHED ) { if( r == asEXECUTION_EXCEPTION ) PRINTF("%s", GetExceptionInfo(ctx).c_str()); TEST_FAILED; } if( ctx ) ctx->Release(); // Save the bytecode CBytecodeStream stream4(__FILE__"4"); mod = engine->GetModule(0); mod->SaveByteCode(&stream4); engine->Release(); // Now load the bytecode into a fresh engine and test the script again engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); RegisterScriptString(engine); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->LoadByteCode(&stream4); r = ExecuteString(engine, "g_inGame.Initialize(0);", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; } engine->Release(); } //---------------- { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); RegisterScriptString(engine); r = engine->RegisterGlobalFunction("void Assert(bool)", asFUNCTION(Assert), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectType("IsoSprite", sizeof(int), asOBJ_REF); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoSprite", asBEHAVE_FACTORY, "IsoSprite@ f()", asFUNCTION(IsoSpriteFactory), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoSprite", asBEHAVE_ADDREF, "void f()", asFUNCTION(DummyAddref), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoSprite", asBEHAVE_RELEASE, "void f()", asFUNCTION(DummyRelease), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoSprite", "IsoSprite &opAssign(const IsoSprite &in)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoSprite", "bool Load(const string &in)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectType("IsoMap", sizeof(int), asOBJ_REF); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoMap", asBEHAVE_FACTORY, "IsoMap@ f()", asFUNCTION(IsoSpriteFactory), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoMap", asBEHAVE_ADDREF, "void f()", asFUNCTION(DummyAddref), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoMap", asBEHAVE_RELEASE, "void f()", asFUNCTION(DummyRelease), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoMap", "IsoMap &opAssign(const IsoMap &in)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoMap", "bool AddEntity(const IsoSprite@+, int col, int row, int layer)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoMap", "bool Load(const string &in)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection("script", script5, strlen(script5)); r = mod->Build(); if( r < 0 ) TEST_FAILED; else { // Test the script with compiled byte code asIScriptContext *ctx = engine->CreateContext(); r = ExecuteString(engine, "Initialize();", mod, ctx); if( r != asEXECUTION_FINISHED ) { if( r == asEXECUTION_EXCEPTION ) PRINTF("%s", GetExceptionInfo(ctx).c_str()); TEST_FAILED; } if( ctx ) ctx->Release(); // Save the bytecode CBytecodeStream stream(__FILE__"5"); mod = engine->GetModule(0); mod->SaveByteCode(&stream); engine->Release(); // Now load the bytecode into a fresh engine and test the script again engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); RegisterScriptString(engine); r = engine->RegisterGlobalFunction("void Assert(bool)", asFUNCTION(Assert), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectType("IsoSprite", sizeof(int), asOBJ_REF); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoSprite", asBEHAVE_FACTORY, "IsoSprite@ f()", asFUNCTION(IsoSpriteFactory), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoSprite", asBEHAVE_ADDREF, "void f()", asFUNCTION(DummyAddref), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoSprite", asBEHAVE_RELEASE, "void f()", asFUNCTION(DummyRelease), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoSprite", "IsoSprite &opAssign(const IsoSprite &in)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoSprite", "bool Load(const string &in)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectType("IsoMap", sizeof(int), asOBJ_REF); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoMap", asBEHAVE_FACTORY, "IsoMap@ f()", asFUNCTION(IsoMapFactory), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoMap", asBEHAVE_ADDREF, "void f()", asFUNCTION(DummyAddref), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("IsoMap", asBEHAVE_RELEASE, "void f()", asFUNCTION(DummyRelease), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoMap", "IsoMap &opAssign(const IsoMap &in)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoMap", "bool AddEntity(const IsoSprite@+, int col, int row, int layer)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectMethod("IsoMap", "bool Load(const string &in)", asFUNCTION(Dummy), asCALL_GENERIC); assert( r >= 0 ); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->LoadByteCode(&stream); r = ExecuteString(engine, "Initialize();", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; } engine->Release(); } //------------------------------ // Test to make sure the script constants are stored correctly { const char *script = "void main() \n" "{ \n" " int i = 123; \n" " \n" " output( ' i = (' + i + ')' + 'aaa' + 'bbb' ); \n" "} \n"; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterStdString(engine); r = engine->RegisterGlobalFunction("void output(const string &in)", asFUNCTION(output), asCALL_GENERIC); assert( r >= 0 ); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); ExecuteString(engine, "main()", mod); if( _out != " i = (123)aaabbb" ) TEST_FAILED; CBytecodeStream stream(__FILE__); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterStdString(engine); r = engine->RegisterGlobalFunction("void output(const string &in)", asFUNCTION(output), asCALL_GENERIC); assert( r >= 0 ); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->LoadByteCode(&stream); _out = ""; ExecuteString(engine, "main()", mod); if( _out != " i = (123)aaabbb" ) TEST_FAILED; engine->Release(); } //------------------------------- // Test that registered template classes are stored correctly { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, false); engine->RegisterGlobalFunction("void assert(bool)", asFUNCTION(Assert), asCALL_GENERIC); const char *script = "void main() \n" "{ \n" " array< int > intArray = {0,1,2}; \n" " uint tmp = intArray.length(); \n" " assert( tmp == 3 ); \n" "}; \n"; mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); CBytecodeStream stream(__FILE__); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, false); engine->RegisterGlobalFunction("void assert(bool)", asFUNCTION(Assert), asCALL_GENERIC); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->LoadByteCode(&stream); if( ExecuteString(engine, "main()", mod) != asEXECUTION_FINISHED ) TEST_FAILED; engine->Release(); } // Test loading script with out of order template declarations { const char *script = "class HogeManager \n" "{ \n" " array< Hoge >@ hogeArray; \n" "} \n" "class Hoge {}; \n"; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, false); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); CBytecodeStream stream(__FILE__); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, false); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); } // Test loading script with out of order template declarations { const char *script = "class HogeManager \n" "{ \n" " HogeManager() \n" " { \n" " array< Hoge >@ hogeArray; \n" " } \n" "} \n" "class Hoge {}; \n"; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, false); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); CBytecodeStream stream(__FILE__); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, false); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); } // Test loading byte code that uses the enum types { const char *script = "array< ColorKind > COLOR_KIND_TABLE = { ColorKind_Red }; \n" "enum ColorKind { ColorKind_Red }; \n"; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, false); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); CBytecodeStream stream(__FILE__); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, false); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); } // Test loading and executing bytecode { const char *script = "interface IObj {}; \n" "class Hoge : IObj {}; \n" "void main(int a = 0) \n" "{ \n" " Hoge h; \n" " IObj@ objHandle = h; \n" " Hoge@ hogeHandle = cast< Hoge@ >( objHandle ); \n" "}; \n"; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); CBytecodeStream stream(__FILE__); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; r = ExecuteString(engine, "main()", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; engine->Release(); } // Test that property offsets are properly mapped { asQWORD test; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->RegisterObjectType("test", 8, asOBJ_VALUE | asOBJ_POD); engine->RegisterObjectProperty("test", "int a", 0); engine->RegisterObjectProperty("test", "int b", 4); engine->RegisterGlobalProperty("test t", &test); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(0, "void func() { t.a = 1; t.b = 2; }"); mod->Build(); r = ExecuteString(engine, "func()", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; if( *(int*)(&test) != 1 || *((int*)(&test)+1) != 2 ) TEST_FAILED; CBytecodeStream stream(__FILE__); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->RegisterObjectType("test", 8, asOBJ_VALUE | asOBJ_POD); engine->RegisterObjectProperty("test", "int a", 4); // Switch order of the properties engine->RegisterObjectProperty("test", "int b", 0); engine->RegisterGlobalProperty("test t", &test); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; r = ExecuteString(engine, "func()", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; if( *(int*)(&test) != 2 || *((int*)(&test)+1) != 1 ) TEST_FAILED; engine->Release(); } // Test that value types are adjusted for different sizes { engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->RegisterGlobalFunction("void assert(bool)", asFUNCTION(Assert), asCALL_GENERIC); engine->RegisterObjectType("test", 4, asOBJ_VALUE | asOBJ_POD); engine->RegisterObjectProperty("test", "int16 a", 0); engine->RegisterObjectProperty("test", "int16 b", 2); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(0, "void func() { int a = 1; test b; int c = 2; b.a = a; b.b = c; check(b); } \n" "void check(test t) { assert( t.a == 1 ); \n assert( t.b == 2 ); \n } \n"); mod->Build(); r = ExecuteString(engine, "func()", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; CBytecodeStream stream(__FILE__); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->RegisterGlobalFunction("void assert(bool)", asFUNCTION(Assert), asCALL_GENERIC); engine->RegisterObjectType("test", 8, asOBJ_VALUE | asOBJ_POD); // Different size engine->RegisterObjectProperty("test", "int16 a", 4); // Switch order of the properties engine->RegisterObjectProperty("test", "int16 b", 0); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; r = ExecuteString(engine, "func()", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; engine->Release(); } // Test loading and executing bytecode { const char *script = "interface ITest\n" "{\n" "}\n" "class Test : ITest\n" "{\n" " ITest@[] arr;\n" " void Set(ITest@ e)\n" " {\n" " arr.resize(1);\n" " @arr[0]=e;\n" " }\n" "}\n" "void main()\n" "{\n" " Test@ t=Test();\n" " t.Set(t);\n" "}\n"; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); r = ExecuteString(engine, "main()", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; CBytecodeStream stream(__FILE__); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; r = ExecuteString(engine, "main()", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; engine->Release(); } // Test { CBytecodeStream stream(__FILE__"1"); const char *script = "interface ITest1 { } \n" "interface ITest2 { } \n" " \n" "CTest@[] Array1; \n" " \n" "class CTest : ITest1 \n" "{ \n" " CTest() \n" " { \n" " Index=0; \n" " @Field=null; \n" " } \n" " \n" " int Index; \n" " ITest2@ Field; \n" "} \n" " \n" "int GetTheIndex() \n" "{ \n" " return Array1[0].Index; \n" "} \n" " \n" "void Test() \n" "{ \n" " Array1.resize(1); \n" " CTest test(); \n" " @Array1[0] = test; \n" " GetTheIndex(); \n" "} \n"; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); mod = engine->GetModule("1", asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); r = ExecuteString(engine, "Test()", mod); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterScriptArray(engine, true); mod = engine->GetModule("1", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; r = ExecuteString(engine, "Test()", mod); engine->Release(); } // Test two modules with same interface { CBytecodeStream stream(__FILE__"1"); const char *script = "interface ITest \n" "{ \n" " ITest@ test(); \n" "} \n" "class CTest : ITest \n" "{ \n" " ITest@ test() \n" " { \n" " return this; \n" " } \n" "} \n"; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); mod = engine->GetModule("1", asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); mod = engine->GetModule("2", asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); mod = engine->GetModule("1", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; stream.Restart(); mod = engine->GetModule("2", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); } // Test loading bytecode, where the code uses a template instance that the template callback doesn't allow // The loading of the bytecode must fail graciously in this case, and display intelligent error message to // allow the script writer to find the error in the original code. { CBytecodeStream stream(__FILE__"1"); const char *script = "tmpl<int> t; \n"; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); r = engine->RegisterObjectType("tmpl<class T>", 0, asOBJ_REF | asOBJ_TEMPLATE); assert( r >= 0 ); #ifndef AS_MAX_PORTABILITY r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_FACTORY, "tmpl<T>@ f(int&in)", asFUNCTIONPR(Tmpl::TmplFactory, (asIObjectType*), Tmpl*), asCALL_CDECL); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_ADDREF, "void f()", asMETHOD(Tmpl,AddRef), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_RELEASE, "void f()", asMETHOD(Tmpl,Release), asCALL_THISCALL); assert( r >= 0 ); #else r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_FACTORY, "tmpl<T>@ f(int&in)", WRAP_FN_PR(Tmpl::TmplFactory, (asIObjectType*), Tmpl*), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_ADDREF, "void f()", WRAP_MFN(Tmpl,AddRef), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_RELEASE, "void f()", WRAP_MFN(Tmpl,Release), asCALL_GENERIC); assert( r >= 0 ); #endif //r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_TEMPLATE_CALLBACK, "bool f(int&in)", asFUNCTION(Tmpl::TmplCallback), asCALL_CDECL); assert( r >= 0 ); mod = engine->GetModule("1", asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); if( r < 0 ) TEST_FAILED; mod->SaveByteCode(&stream); engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); CBufferedOutStream bout; engine->SetMessageCallback(asMETHOD(CBufferedOutStream, Callback), &bout, asCALL_THISCALL); r = engine->RegisterObjectType("tmpl<class T>", 0, asOBJ_REF | asOBJ_TEMPLATE); assert( r >= 0 ); #ifndef AS_MAX_PORTABILITY r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_FACTORY, "tmpl<T>@ f(int&in)", asFUNCTIONPR(Tmpl::TmplFactory, (asIObjectType*), Tmpl*), asCALL_CDECL); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_ADDREF, "void f()", asMETHOD(Tmpl,AddRef), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_RELEASE, "void f()", asMETHOD(Tmpl,Release), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_TEMPLATE_CALLBACK, "bool f(int&in, bool&out)", asFUNCTION(Tmpl::TmplCallback), asCALL_CDECL); assert( r >= 0 ); #else r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_FACTORY, "tmpl<T>@ f(int&in)", WRAP_FN_PR(Tmpl::TmplFactory, (asIObjectType*), Tmpl*), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_ADDREF, "void f()", WRAP_MFN(Tmpl,AddRef), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_RELEASE, "void f()", WRAP_MFN(Tmpl,Release), asCALL_GENERIC); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("tmpl<T>", asBEHAVE_TEMPLATE_CALLBACK, "bool f(int&in, bool&out)", WRAP_FN(Tmpl::TmplCallback), asCALL_GENERIC); assert( r >= 0 ); #endif mod = engine->GetModule("1", asGM_ALWAYS_CREATE); bout.buffer = ""; r = mod->LoadByteCode(&stream); if( r >= 0 ) TEST_FAILED; if( bout.buffer != " (0, 0) : Error : Attempting to instantiate invalid template type 'tmpl<int>'\n" " (0, 0) : Error : LoadByteCode failed. The bytecode is invalid. Number of bytes read from stream: 124\n" ) { PRINTF("%s", bout.buffer.c_str()); TEST_FAILED; } engine->Release(); } // Test problem reported by Philip Bennefall { const char *script = "class dummy\n" "{\n" " bool set_callback(menu_callback@ callback, string user_data)\n" " {\n" " @callback_handle=@callback;\n" " callback_data=user_data;\n" " return true;\n" " }\n" " void do_something()\n" " {\n" " if(@callback_handle!=null)\n" " {\n" " int callback_result=callback_handle(this, callback_data);\n" " }\n" " }\n" " menu_callback@ callback_handle;\n" " string callback_data;\n" "}\n" "funcdef int menu_callback(dummy@, string);\n" "void main()\n" "{\n" "}\n"; CBytecodeStream stream(__FILE__"1"); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); RegisterStdString(engine); mod = engine->GetModule("1", asGM_ALWAYS_CREATE); mod->AddScriptSection(0, script); r = mod->Build(); if( r < 0 ) TEST_FAILED; mod->SaveByteCode(&stream); mod = engine->GetModule("2", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); } // Test problem reported by Markus Larsson from Skygoblin { const char *script1 = "void main() {" " print(\"a\" + \"b\");" "}"; const char *script2 = "void main() {" " if(getInt()==1)" " print(\"a\" + \"b\");" "}"; int r; asIScriptContext* ctx; asIScriptEngine* engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); RegisterStdString(engine); #ifndef AS_MAX_PORTABILITY engine->RegisterGlobalFunction("void print(const string& in)", asFUNCTION(print), asCALL_CDECL); engine->RegisterGlobalFunction("int getInt()", asFUNCTION(getInt), asCALL_CDECL); #else engine->RegisterGlobalFunction("void print(const string& in)", WRAP_FN(print), asCALL_GENERIC); engine->RegisterGlobalFunction("int getInt()", WRAP_FN(getInt), asCALL_GENERIC); #endif ctx = engine->CreateContext(); asIScriptModule* mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->AddScriptSection(":1", script1, strlen(script1), 0); assert (r >= 0); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"1"); r = mod->SaveByteCode(&stream); if( r < 0 ) TEST_FAILED; mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; ctx->Prepare(mod->GetFunctionByDecl("void main()")); r = ctx->Execute(); if( r != asEXECUTION_FINISHED ) TEST_FAILED; mod = engine->GetModule(0, asGM_ALWAYS_CREATE); CBytecodeStream stream2(__FILE__"2"); r = mod->AddScriptSection(":1", script2, strlen(script2), 0); assert (r >= 0); r = mod->Build(); if( r < 0 ) TEST_FAILED; r = mod->SaveByteCode(&stream2); if( r < 0 ) TEST_FAILED; mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream2); if( r < 0 ) TEST_FAILED; ctx->Prepare(mod->GetFunctionByDecl("void main()")); r = ctx->Execute(); if( r != asEXECUTION_FINISHED ) TEST_FAILED; ctx->Release(); engine->Release(); } // Test problem on 64bit // http://www.gamedev.net/topic/628452-linux-x86-64-not-loading-or-saving-bytecode-correctly/ { asIScriptEngine* engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->RegisterGlobalFunction("void assert( bool )", asFUNCTION(Assert), asCALL_GENERIC); asIScriptModule *mod = engine->GetModule("test", asGM_ALWAYS_CREATE); mod->AddScriptSection("test", "enum TestEnum \n" "{ \n" " TestEnum_A = 42 \n" "} \n" "class NonPrimitive \n" "{ \n" " int val; \n" "} \n" "void Foo( int a, TestEnum e, NonPrimitive o ) \n" "{ \n" " assert( a == 1 ); \n" " assert( e == TestEnum_A ); \n" " assert( o.val == 513 ); \n" "} \n" "void main() \n" "{ \n" " NonPrimitive o; \n" " o.val = 513; \n" " Foo( 1, TestEnum_A, o ); \n" "} \n"); int r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"1"); r = mod->SaveByteCode(&stream); if( r < 0 ) TEST_FAILED; asIScriptModule *mod2 = engine->GetModule("mod2", asGM_ALWAYS_CREATE); r = mod2->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; r = ExecuteString(engine, "main()", mod2); if( r != asEXECUTION_FINISHED ) TEST_FAILED; engine->Release(); } // Success return fail; } bool Test2() { int r; asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); const char *script = "enum ENUM1{ \n" "_ENUM_1 = 1 \n" "} \n" "void main() \n" "{ \n" "int item = _ENUM_1; \n" "} \n"; asIScriptModule *mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->AddScriptSection("script", script, strlen(script)); r = mod->Build(); if( r < 0 ) TEST_FAILED; CBytecodeStream stream(__FILE__"6"); mod = engine->GetModule(0); r = mod->SaveByteCode(&stream); if( r < 0 ) TEST_FAILED; engine->Release(); engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); mod = engine->GetModule(0, asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; r = ExecuteString(engine, "main()", mod); if( r != asEXECUTION_FINISHED ) TEST_FAILED; engine->Release(); return fail; } const char *APStringFactory(int /*length*/, const char *s) { return s; } void APStringConstruct(const char **s) { *s = 0; } bool TestAndrewPrice() { COutStream out; CBufferedOutStream bout; { asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->SetEngineProperty(asEP_COPY_SCRIPT_SECTIONS, true); RegisterScriptArray(engine, true); // This POD type doesn't have an opAssign, so the bytecode will have asBC_COPY engine->RegisterObjectType("char_ptr", sizeof(char*), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_PRIMITIVE); #ifndef AS_MAX_PORTABILITY engine->RegisterObjectBehaviour("char_ptr", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(APStringConstruct), asCALL_CDECL_OBJLAST); engine->RegisterStringFactory("char_ptr", asFUNCTION(APStringFactory), asCALL_CDECL); #else engine->RegisterObjectBehaviour("char_ptr", asBEHAVE_CONSTRUCT, "void f()", WRAP_OBJ_LAST(APStringConstruct), asCALL_GENERIC); engine->RegisterStringFactory("char_ptr", WRAP_FN(APStringFactory), asCALL_GENERIC); #endif asIScriptModule *mod = engine->GetModule("Test", asGM_ALWAYS_CREATE); char Data2[] = "const char_ptr[] STORAGE_STRINGS = {'Storage[0]','Storage[1]'}; "; mod->AddScriptSection("Part2",Data2,(int)strlen(Data2)); int r = mod->Build(); if( r < 0 ) TEST_FAILED; mod->BindAllImportedFunctions(); CBytecodeStream stream(__FILE__"1"); r = mod->SaveByteCode(&stream); if( r < 0 ) TEST_FAILED; mod = engine->GetModule("Test2", asGM_ALWAYS_CREATE); r = mod->LoadByteCode(&stream); if( r < 0 ) TEST_FAILED; CScriptArray *arr = reinterpret_cast<CScriptArray*>(mod->GetAddressOfGlobalVar(0)); if( arr == 0 || arr->GetSize() != 2 || strcmp(*reinterpret_cast<const char**>(arr->At(1)), "Storage[1]") != 0 ) TEST_FAILED; engine->Release(); // Try loading the bytecode again, except this time without configuring the engine engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetMessageCallback(asMETHOD(CBufferedOutStream, Callback), &bout, asCALL_THISCALL); mod = engine->GetModule("Test3", asGM_ALWAYS_CREATE); stream.Restart(); bout.buffer = ""; r = mod->LoadByteCode(&stream); if( r >= 0 ) TEST_FAILED; if( bout.buffer != " (0, 0) : Error : Template type 'array' doesn't exist\n" " (0, 0) : Error : LoadByteCode failed. The bytecode is invalid. Number of bytes read from stream: 15\n" ) { PRINTF("%s", bout.buffer.c_str()); TEST_FAILED; } RegisterScriptArray(engine, true); stream.Restart(); bout.buffer = ""; r = mod->LoadByteCode(&stream); if( r >= 0 ) TEST_FAILED; if( bout.buffer != " (0, 0) : Error : Object type 'char_ptr' doesn't exist\n" " (0, 0) : Error : LoadByteCode failed. The bytecode is invalid. Number of bytes read from stream: 23\n" ) { PRINTF("%s", bout.buffer.c_str()); TEST_FAILED; } engine->Release(); } return fail; } } // namespace
[ "angelcode@404ce1b2-830e-0410-a2e2-b09542c77caf" ]
angelcode@404ce1b2-830e-0410-a2e2-b09542c77caf
a539c49ffe9d3b3a03ba378a366210191bed4b73
5add99407d982ea4937e5adb186b2324de9c1045
/Plugins/EasyFirebase/Source/EasyFirebase/Private/FirebaseUser.cpp
1b22fee0732b7f4b9eaf9baf50999f51d5924d2d
[]
no_license
jakeoliveroschico/EasyFirebase
bec9aa67f087d1edc5c56e7909743b7c5707fb57
bf1dfb21f3809c4034eaf8da6344c03f317f8887
refs/heads/master
2022-04-14T06:44:50.043824
2020-04-11T08:55:21
2020-04-11T08:55:21
null
0
0
null
null
null
null
UTF-8
C++
false
false
8,513
cpp
// EasyFirebase - unreal engine 4 firebase plugin Copyright (C) 2020 feixuwu <feixuwu@outlook.com> All Rights Reserved. #include "FirebaseUser.h" #include "FirebaseFutureString.h" #include "FirebaseFutureUser.h" UFirebaseUser::UFirebaseUser():mUser(nullptr) { } void UFirebaseUser::bindUser(::firebase::auth::User* user) { mUser = user; mUserInterface = user; } UFirebaseUser::~UFirebaseUser() { mUserInterface = nullptr; mUser = nullptr; } UFirebaseFutureString* UFirebaseUser::GetToken(bool forceRefresh) { if (!mUser) { return nullptr; } firebase::Future<std::string> result = mUser->GetToken(forceRefresh); UFirebaseFutureString* ret = NewObject<UFirebaseFutureString>(); ret->mStringFuture = result; return ret; } UFirebaseFutureString* UFirebaseUser::GetTokenLastResult() { if (!mUser) { return nullptr; } firebase::Future<std::string> result = mUser->GetTokenLastResult(); UFirebaseFutureString* ret = NewObject<UFirebaseFutureString>(); ret->mStringFuture = result; return ret; } TArray<UFirebaseUserInfoInterface*> UFirebaseUser::provider_data() { if (!mUser) { return TArray<UFirebaseUserInfoInterface*>(); } TArray<UFirebaseUserInfoInterface*> ret; const std::vector<firebase::auth::UserInfoInterface*>& userList = mUser->provider_data(); for (size_t i = 0; i < userList.size(); i++) { UFirebaseUserInfoInterface* tmp = NewObject<UFirebaseUserInfoInterface>(); tmp->mUserInterface = userList[i]; ret.Push(tmp); } return ret; } UFirebaseFutureVoid* UFirebaseUser::UpdateEmail(const FString& email) { if (!mUser) { return nullptr; } auto future = mUser->UpdateEmail(TCHAR_TO_UTF8(*email) ); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = future; return ret; } UFirebaseFutureVoid* UFirebaseUser::UpdateEmailLastResult() { if (!mUser) { return nullptr; } auto futureVoid = mUser->UpdateEmailLastResult(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::UpdatePassword(const FString& passwd) { if (!mUser) { return nullptr; } auto futureVoid = mUser->UpdatePassword(TCHAR_TO_UTF8(*passwd) ); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::UpdatePasswordLastResult() { if (!mUser) { return nullptr; } auto futureVoid = mUser->UpdatePasswordLastResult(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::Reauthenticate(UFirebaseCredential* crdenntial) { if (!mUser) { return nullptr; } auto futureVoid = mUser->Reauthenticate(crdenntial->mCredential); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::ReauthenticateLastResult() { if (!mUser) { return nullptr; } auto futureVoid = mUser->ReauthenticateLastResult(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureSignInResult* UFirebaseUser::ReauthenticateAndRetrieveData(UFirebaseCredential* crdenntial) { if (!mUser) { return nullptr; } auto signInResultFuture = mUser->ReauthenticateAndRetrieveData(crdenntial->mCredential); UFirebaseFutureSignInResult* ret = NewObject<UFirebaseFutureSignInResult>(); ret->mSignInFuture = signInResultFuture; return ret; } UFirebaseFutureSignInResult* UFirebaseUser::ReauthenticateAndRetrieveDataLastResult() { if (!mUser) { return nullptr; } auto signInResultFuture = mUser->ReauthenticateAndRetrieveDataLastResult(); UFirebaseFutureSignInResult* ret = NewObject<UFirebaseFutureSignInResult>(); ret->mSignInFuture = signInResultFuture; return ret; } UFirebaseFutureVoid* UFirebaseUser::SendEmailVerification() { if (!mUser) { return nullptr; } auto futureVoid = mUser->SendEmailVerification(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::SendEmailVerificationLastResult() { if (!mUser) { return nullptr; } auto futureVoid = mUser->SendEmailVerificationLastResult(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::UpdateUserProfile(const FUserProfile& profile) { if (!mUser) { return nullptr; } firebase::auth::User::UserProfile tmpProfile; tmpProfile.display_name = TCHAR_TO_UTF8(*profile.display_name); auto futureVoid = mUser->UpdateUserProfile(tmpProfile); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::UpdateUserProfileLastResult() { if (!mUser) { return nullptr; } auto futureVoid = mUser->UpdateUserProfileLastResult(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureUser* UFirebaseUser::LinkWithCredential(UFirebaseCredential* crdenntial) { if (!mUser) { return nullptr; } auto futureUser = mUser->LinkWithCredential(crdenntial->mCredential); UFirebaseFutureUser* ret = NewObject<UFirebaseFutureUser>(); ret->mUserFuture = futureUser; return ret; } UFirebaseFutureUser* UFirebaseUser::LinkWithCredentialLastResult() { if (!mUser) { return nullptr; } auto futureUser = mUser->LinkWithCredentialLastResult(); UFirebaseFutureUser* ret = NewObject<UFirebaseFutureUser>(); ret->mUserFuture = futureUser; return ret; } UFirebaseFutureSignInResult* UFirebaseUser::LinkAndRetrieveDataWithCredential(UFirebaseCredential* crdenntial) { if (!mUser) { return nullptr; } auto futureSiggInResult = mUser->LinkAndRetrieveDataWithCredential(crdenntial->mCredential); UFirebaseFutureSignInResult* ret = NewObject<UFirebaseFutureSignInResult>(); ret->mSignInFuture = futureSiggInResult; return ret; } UFirebaseFutureSignInResult* UFirebaseUser::LinkAndRetrieveDataWithCredentialLastResult() { if (!mUser) { return nullptr; } auto futureSiggInResult = mUser->LinkAndRetrieveDataWithCredentialLastResult(); UFirebaseFutureSignInResult* ret = NewObject<UFirebaseFutureSignInResult>(); ret->mSignInFuture = futureSiggInResult; return ret; } UFirebaseFutureUser* UFirebaseUser::UpdatePhoneNumberCredential(UFirebaseCredential* crdenntial) { if (!mUser) { return nullptr; } auto userFuture = mUser->UpdatePhoneNumberCredential(crdenntial->mCredential); UFirebaseFutureUser* ret = NewObject<UFirebaseFutureUser>(); ret->mUserFuture = userFuture; return ret; } UFirebaseFutureUser* UFirebaseUser::UpdatePhoneNumberCredentialLastResult() { if (!mUser) { return nullptr; } auto userFuture = mUser->UpdatePhoneNumberCredentialLastResult(); UFirebaseFutureUser* ret = NewObject<UFirebaseFutureUser>(); ret->mUserFuture = userFuture; return ret; } UFirebaseFutureVoid* UFirebaseUser::Reload() { if (!mUser) { return nullptr; } auto futureVoid = mUser->Reload(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::ReloadLastResult() { if (!mUser) { return nullptr; } auto futureVoid = mUser->Reload(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::Delete() { if (!mUser) { return nullptr; } auto futureVoid = mUser->Delete(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } UFirebaseFutureVoid* UFirebaseUser::DeleteLastResult() { if (!mUser) { return nullptr; } auto futureVoid = mUser->DeleteLastResult(); UFirebaseFutureVoid* ret = NewObject<UFirebaseFutureVoid>(); ret->mVoidFuture = futureVoid; return ret; } FUserMetadata UFirebaseUser::metadata() { if (!mUser) { return FUserMetadata(); } FUserMetadata ret; auto meta = mUser->metadata(); ret.creation_timestamp = meta.creation_timestamp; ret.last_sign_in_timestamp = meta.last_sign_in_timestamp; return ret; } bool UFirebaseUser::is_email_verified() { if (!mUser) { return false; } return mUser->is_email_verified(); } bool UFirebaseUser::is_anonymous() { if (!mUser) { return false; } return mUser->is_anonymous(); }
[ "feixuwu@outlook.com" ]
feixuwu@outlook.com
2ecb5a433713a8716e7cd0495f4198ee8ad63045
8960586f2a0e95eb89eeeabef023da8bc816cb33
/example/cubicBuilding/cubicBuilding.windDrivenRainFoam/0/alpha6
952715570f630d00a42a6b839776d76907b53453
[]
no_license
yabuzidan/windDrivenRainFoam
00ab98ab4c4579857340d4cb087add6d81ceee95
00ae5cfcb3387ad1f26a9151f2457e06f844cbd3
refs/heads/main
2023-07-11T02:32:46.743146
2023-07-02T13:44:37
2023-07-02T13:44:37
384,698,498
3
0
null
null
null
null
UTF-8
C++
false
false
1,573
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.1 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object alpha; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 4.43371674519705e-09; } top { type fixedValue; value uniform 4.43371674519705e-09; } outlet { type inletOutlet; phi phi6; inletValue uniform 0; value uniform 0; } ground { type inletOutlet; phi phi6; inletValue uniform 0; value uniform 0; } cube { type inletOutlet; phi phi6; inletValue uniform 0; value uniform 0; } sides { type slip; } } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
[ "yabuzidan@gmail.com" ]
yabuzidan@gmail.com
8915b263b9c6ed29b8763417910b130de77ba7b0
920888dac91a954b0f07a5ed1b7f13914e194e63
/nsledinfopanel.ino
a94866a31c7df2075db4f9c3a3e8366c4fcf732e
[]
no_license
mazek/nsledinfopanel
2159c37bfba89a043952d4da953981c9cd4b881c
771093aa9ebc43339b2ff24e4385989af8baaa1f
refs/heads/master
2021-01-20T00:51:54.989660
2017-04-24T19:59:59
2017-04-24T19:59:59
89,205,225
1
0
null
null
null
null
UTF-8
C++
false
false
5,109
ino
#include <ArduinoJson.h> #include <ArduinoHttpClient.h> #include <ESP8266WiFi.h> #include <WiFiClient.h> #include <FastLED.h> #include <LEDMatrix.h> #include "config.h" #include "memorysaver.h" #if !(defined ESP8266 ) #error Please select the ArduCAM ESP8266 UNO board in the Tools/Board #endif // https://forum.arduino.cc/index.php?topic=46900.0 #define NODEBUG int min = 80; int max = 160; WiFiClient wifi; HttpClient client = HttpClient(wifi, serverAddress, port); String response; char response2[200]; int statusCode = 0; //StaticJsonBuffer<3000> jsonBuffer; DynamicJsonBuffer jsonBuffer; // LED panel initialisation START #define LED_PIN 6 #define COLOR_ORDER GRB #define CHIPSET WS2812B #define MATRIX_WIDTH 32 #define MATRIX_HEIGHT 8 #define MATRIX_TYPE VERTICAL_ZIGZAG_MATRIX cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, MATRIX_TYPE> leds; // LED panel initialisation END. void setup() { Serial.begin(115200); // Connect to WiFi network Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println("WiFi connected"); Serial.println(""); Serial.println(WiFi.localIP()); FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size()); FastLED.setBrightness(2); FastLED.clear(true); delay(500); } void loop() { Serial.println("making GET request"); client.get("/pebble"); // read the status code and body of the response statusCode = client.responseStatusCode(); response = client.responseBody(); // char response2[response.length()+1]; // Serial.print("Status code: "); // Serial.println(statusCode); // Serial.print("Response: "); // Serial.println(response); response.remove(0, 3); response = response.substring(0, response.length()-5); response.toCharArray(response2,response.length()+1); Serial.print("Response2: -"); Serial.print(response2); Serial.println("-"); JsonObject& _data = jsonBuffer.parseObject(response2); if (!_data.success()) { Serial.println("parseObject() failed:( "); FastLED.showColor(CRGB::Pink); delay(5000); return; } else { Serial.println("parseObject() success! "); } String cur_time_s = _data["status"][0]["now"]; String read_time_s = _data["bgs"][0]["datetime"]; Serial.print("1 cur_time_s: "); Serial.println(cur_time_s); Serial.print("1 read_time_s: "); Serial.println(read_time_s); cur_time_s = cur_time_s.substring(0, cur_time_s.length()-3); read_time_s = read_time_s.substring(0, read_time_s.length()-3); Serial.print("2 cur_time_s: "); Serial.println(cur_time_s); Serial.print("2 read_time_s: "); Serial.println(read_time_s); unsigned long cur_time = cur_time_s.toFloat(); unsigned long read_time = read_time_s.toFloat(); Serial.print("3 cur_time: "); Serial.println(cur_time); Serial.print("3 read_time: "); Serial.println(read_time); unsigned long parakeet_last_seen = cur_time - read_time ; Serial.print("I seen parakeet more then "); Serial.print(parakeet_last_seen); Serial.println(" seconds."); // FastLED.clear(true); if (parakeet_last_seen > 900) { // Lost parakeet signal after 900 seconds. // lost_time = strftime("%d %b %Y %H:%M",localtime(read_time/1000)) // notify(title = 'Nightscout read.', // subtitle = strftime("%d %b %H:%M",localtime(cur_time/1000)), // message = 'I\'ve lost parakeet signal at: %s' % (lost_time)) Serial.println("I lost parakeet signal :("); FastLED.showColor(CRGB::Lime); } else { // Parakeet operational. Serial.println("I got parakeet signal :)"); unsigned long bwpo = _data["bgs"][0]["sgv"]; Serial.print("BWPO: "); Serial.println(bwpo); long bgdelta = _data["bgs"][0]["bgdelta"]; Serial.print("BGDELTA: "); Serial.println(bgdelta); if (bgdelta > 0) { // Sugar is growing. // bgdelta_s = "+%s" % bgdelta } else { // Sugar is dropping. // bgdelta_s = "%s" % bgdelta } if (bwpo < min) { // Sugar below minimum level. // notify(title = 'Nightscout read.', // subtitle = '', // message = 'Sugar: %s, change: %s' % (bwpo, bgdelta_s)) Serial.print("Sugar: "); Serial.print(bwpo); Serial.print(", change: "); Serial.println(bgdelta); Serial.println("Sugar below minimum level."); FastLED.showColor(CRGB::Red); } else if (bwpo > max) { // Sugar above maximum level. Serial.print("Sugar: "); Serial.print(bwpo); Serial.print(", change: "); Serial.println(bgdelta); Serial.println("Sugar above maximum level."); FastLED.showColor(CRGB::Blue); } else { // Sugar ok. FastLED.clear(true); //FastLED.showColor(CRGB::Green); } } Serial.println("Wait five seconds"); delay(5000); // FastLED.show(); }
[ "m.mazurek@netsync.pl" ]
m.mazurek@netsync.pl
1d0b86a16f3483b0941f462902499dd677da623a
41ce0fc76cdbdcca6ac84b1c106e9b2e2217bf77
/mon/src/db/impl/mongo/MongoDbHelper.h
98a69e312e23679f25d01f3c176261753915c8aa
[]
no_license
figroc/stack
f4c38ed1afb0a8ee772d441f3c08e4bf3ab03820
bf67cafd84c825714f93270da092d561e3052133
refs/heads/master
2016-08-06T16:37:18.833443
2015-11-03T14:45:45
2015-11-03T14:45:45
17,054,081
0
0
null
null
null
null
UTF-8
C++
false
false
1,512
h
#ifndef DB_MONGODB_HELPER_H #define DB_MONGODB_HELPER_H #include <string> #include <vector> #include <memory> #include <mongo/bson/bson.h> #include <mongo/client/dbclient.h> #include "../../doc/DocRecord.h" #include "../../spec/OprSpec.h" #include "../../spec/OprParam.h" namespace msvc { namespace db { class MongoDbHelper { public: static std::auto_ptr<DocTable> CreateDocFromCursor( const QuerySpec &query, const std::auto_ptr<mongo::DBClientCursor> &cursor ); static mongo::BSONObj BuildData( const std::vector<PropName> &data, const OprParam &param, int &index ); static mongo::Query BuildQuery(const QueryOption &query, const OprParam &param, int &index); static mongo::BSONObj BuildProjection(const std::vector<PropName> &proj); static mongo::BSONObj BuildSort(const std::vector<SortOption> &sort); static mongo::BSONObj BuildModify( const std::vector<ModifyOption> &modify, const OprParam &param, int &index ); private: static mongo::BSONObj BuildQueryInner( const QueryOption &query, const OprParam &param, int &index ); static mongo::BSONObj BuildCriteriaInner( const CriteriaOption &criteria, const OprParam &param, int &index ); static mongo::Labeler::Label &MapCompareOperator(const CompareOpType cop); static std::string MapLogicalOperator(const LogicalOpType lop); static std::string MapModifyOperator(const ModifyOpType mop); static int MapSortOperator(const SortOpType sop); private: MongoDbHelper() { } }; }} #endif /* DB_MONGODB_HELPER_H */
[ "figroc@gmail.com" ]
figroc@gmail.com
956d377759f7c9314b3a570d1e48daef986b8624
58c5870da23a21ac3d45c80330c5abbd7a4312e4
/Task1/PhoneticFinder.cpp
7a7599a2488f586dc3fe24d6133e41654578078d
[]
no_license
op1995/cPlusPlusCourse
89323e603a07cd0d3264162705ca88d6cdb60c01
647735830a26726230dfd1258a69b0af5620db8f
refs/heads/master
2022-04-17T23:02:51.535118
2020-04-16T13:49:05
2020-04-16T13:49:05
250,070,634
0
0
null
null
null
null
UTF-8
C++
false
false
7,105
cpp
//used geeksforgeeks to learn how to use istringstream #include "PhoneticFinder.hpp" // #define _GLIBCXX_USE_CXX11_ABI 0 #include <iostream> #include <sstream> #include <string.h> using namespace std; namespace phonetic { string find(string text, string word){ // cout << "looking for the word " + word +"\n"; if (word.size()==0) throw invalid_argument("Inserted word is of length 0!"); if (text.size()==0) throw invalid_argument("Inserted text is of length 0!"); if (word.find(" ") != std::string::npos) { throw invalid_argument("word searched for can't contain space!"); } std::istringstream iss(text); do{ string current_word; iss >> current_word; if(current_word.size()==word.size()){ //only if current_word is of same length as asked for word, it could be an answer // cout << "testing the word " + current_word +"\n"; if(current_word.compare(word)==0) { // cout << "@@@Returned using simple compare function\n"; return current_word; } bool flag = true; for(std::string::size_type i = 0; i < current_word.size() && flag; ++i) { //checking each letter // cout << "i = "; // cout << i; // cout << "\ncurrent_word.size() = "; // cout << current_word.size(); // cout << "\ncomparing "; // cout << word[i]; // cout << " to "; // cout << current_word[i]; // cout << "\n"; // if(current_word.compare("is")==0){ // string comp = "comparing the letters "; // comp = comp + word[i] + " and " + current_word[i] + "\n"; // cout << comp; // } if (!(letter_match(word[i], current_word[i]))) { // string failed = "the letters that didn't match were at place "; // failed = failed + to_string(i) + "\n"; // cout << failed; // cout << " and " + current_word[i]; flag = false; }// end if letters match }// end for loop if (flag) { // cout << "HERE123"; return current_word; //reaching here with flag still having true value means all letters matched according to rules. }// end if flag } //end if word sizes equal }while(iss); // if (true) throw invalid_argument("Word was not found in text!"); throw invalid_argument("Word was not found in text!"); // else return ""; // return "!!!"; // cout << "Grade: 56" << endl; // return "happy"; } bool letter_match (char original, char current){ // first change capital to lower case, for both letters. To make sure of working on the same thing. // no need to check for ascii values outside of the abc values, as the assignment stated input will only contain abc ascii values. if ((int)original>64 && (int)original<91){ original = original + 32; } if ((int)current>64 && (int)current<91){ current = current + 32; } // string stg = "original is "; // stg = stg + original + " and current is " + current +"\n"; // cout << stg; if(original == current) { // cout << "returning TRUE from simple compare\n"; return true; } if (replacable_letters(original, current)) return true; //if the letters are replaceable, return true return false; //if you got here, all failed. Return false. } bool replacable_letters(char original, char current){ // string comp = "comparing the letters "; // comp = comp + original + " and " + current + "\n"; // cout << comp; switch(original) { case 'v': // cout << "\n1\n"; if(current=='w')return true; else return false; case 'w': // cout << "\n2\n"; if(current=='v')return true; else return false; case 'b': // cout << "\n3\n"; if(current=='f')return true; if(current=='p')return true; else return false; case 'f': // cout << "\n4\n"; if(current=='b')return true; if(current=='p')return true; else return false; case 'p': // cout << "\n5\n"; if(current=='b')return true; if(current=='f')return true; else return false; case 'g': // cout << "\n6\n"; if(current=='j')return true; else return false; case 'j': // cout << "\n7\n"; if(current=='g')return true; else return false; case 'c': // cout << "\n8\n"; if(current=='k')return true; if(current=='q')return true; else return false; case 'k': // cout << "\n9\n"; if(current=='c')return true; if(current=='q')return true; else return false; case 'q': // cout << "\n10\n"; if(current=='c')return true; if(current=='k')return true; else return false; case 's': // cout << "\n11\n"; if(current=='z')return true; else return false; case 'z': // cout << "\n12\n"; if(current=='s')return true; else return false; case 'd': // cout << "\n13\n"; if(current=='t')return true; else return false; case 't': // cout << "\n14\n"; if(current=='d')return true; else return false; case 'o': // cout << "\n15\n"; if(current=='u')return true; else return false; case 'u': // cout << "\n16\n"; if(current=='o')return true; else return false; case 'i': // cout << "\n17\n"; if(current=='y')return true; else return false; case 'y': // cout << "\n18\n"; if(current=='i')return true; else return false; default: // cout << "\nDEFAULT\n"; return false; }//end switch return false; }//end replacable letters function }
[ "pellerofir@gmail.com" ]
pellerofir@gmail.com
8161650f1cec3f231406cf29265cb2af2183c064
d7bad594306b0042b37393070f4c8946dc97e5af
/ios/SensorStore/SensorStore.hpp
b9b6711cefa72a9eef54427db22882c44f5e2241
[]
no_license
jnoor/SensorStore
2f165e85855fde18ca81b6fe2c6a4b826155f190
b24743232c0628c5ef193b4901df2fee315064e2
refs/heads/master
2021-01-11T03:39:20.783649
2017-11-21T23:33:58
2017-11-21T23:33:58
71,405,869
0
0
null
null
null
null
UTF-8
C++
false
false
451
hpp
// // SensorStore.hpp // SensorStore // // Created by Joseph Noor on 10/17/16. // Copyright © 2016 Joseph Noor. All rights reserved. // #ifndef SensorStore_hpp #define SensorStore_hpp #include <stdio.h> __BEGIN_DECLS int SS_setup(char * logfilename, char * indexfilename, char * logoffsetfilename); long SS_write(int topic, char * value); int SS_close(); long SS_current_offset(); int SS_read_all(); __END_DECLS #endif /* SensorStore_hpp */
[ "josephgnoor@gmail.com" ]
josephgnoor@gmail.com
7ef92c279f77db66ed3f0e7c3ac7412687c087ed
5330918e825f8d373d3907962ba28215182389c3
/CondFormats/CSCObjects/src/CSCDBGasGainCorrection.cc
d489625f0d340c2daaeb2b64a4992102fe1547e7
[]
no_license
perrozzi/cmg-cmssw
31103a7179222c7aa94f65e83d090a5cf2748e27
1f4cfd936da3a6ca78f25959a41620925c4907ca
refs/heads/CMG_PAT_V5_18_from-CMSSW_5_3_22
2021-01-16T23:15:58.556441
2017-05-11T22:43:15
2017-05-11T22:43:15
13,272,641
1
0
null
2017-05-11T22:43:16
2013-10-02T14:05:21
C++
UTF-8
C++
false
false
576
cc
#include "CondFormats/CSCObjects/interface/CSCDBGasGainCorrection.h" #include "DataFormats/MuonDetId/interface/CSCIndexer.h" CSCDBGasGainCorrection::CSCDBGasGainCorrection(){} CSCDBGasGainCorrection::~CSCDBGasGainCorrection(){} const CSCDBGasGainCorrection::Item & CSCDBGasGainCorrection::item(const CSCDetId & cscId, int strip, int wire) const { CSCIndexer indexer; //note the transformation here from database index (starting from 1) to c++ indexing (starting from 0) return gasGainCorr[ indexer.gasGainIndex(cscId, strip, wire)-1 ]; // no worries about range! }
[ "sha1-cc32ac2dc755a78e7cbbd499ba4d55ded289bad9@cern.ch" ]
sha1-cc32ac2dc755a78e7cbbd499ba4d55ded289bad9@cern.ch
89b00e80acd1c1e94528ee881ad16284516d5d7f
3e3468da7650e4dc57e6a63bfd3f9febbbea3a8e
/src/Solver.cpp
c13b251de43d4e2000c0186bfdbb87768aac98d5
[]
no_license
CapNMeliodas/FormalLanguagesTask1
9ef86c5d0dee6964c793d9f6264167d63d6265b6
d8604264cdf69259c0e7959eea901d49f8c328c3
refs/heads/master
2021-07-16T07:58:54.422494
2020-05-22T12:58:10
2020-05-22T12:58:10
158,434,418
0
0
null
null
null
null
UTF-8
C++
false
false
1,630
cpp
#include "Solver.h" using namespace std; int Solver::find_max_substring(const string& regular_exp) { LAutomataBuilder builder; //Строим автомат по решулярке LAutomata* automaton = builder.build(regular_exp); int result = 0; for (int i = 0; i < word.length(); ++i) { //Для каждой стартовой позиции в слове current_letter_index = i; for (auto start : automaton->get_automata()) { //Начиная с каждой вершины автомата int max_end_pos = current_letter_index; DFS(start); //Проверяем на какой максимум мы можем отойти от стартовой вершины if ((max_end_pos - i) > result) { result = max_end_pos - i; } } } delete automaton; return result; } //DFS по автомату void Solver::DFS(Node* vertex) { if (current_letter_index > max_end_pos) { //Прочли что-то большее - обновляем max max_end_pos = current_letter_index; } if (current_letter_index == word.length()) { //Если достигли конца, выходим return; } for (auto next : vertex->ways) { //ДФС по буквам и эпсилонам if (next.second == word[current_letter_index]) { //доказательство его рабыто в theory.txt ++current_letter_index; DFS(next.first); --current_letter_index; } else if (next.second == '#') { DFS(next.first); } } } int solve(const string& w, const string& regular_exp) { //Функция для Solver sol(w); return sol.find_max_substring(regular_exp); }
[ "shotothehero@gmail.com" ]
shotothehero@gmail.com
c8c8b3955f6d4fa52554eb2d267e173042ebdc23
ad03b37cd9a5a61c6ca9911e6eb6cd94ddfc935a
/8. Developing a Program - The Particle Fire Simulation/n.Implementing Box Blur/Screen.cpp
ce127e41aa483b6b5e7dfbd7729b84dc9f1b6d34
[]
no_license
Kassout/cppForBeginners
fc145c10b4a91bca5d0b3d89ea987e41b3b69e2f
656c0914dca51c55dd62b09a9f20a2983fe5ce8f
refs/heads/main
2023-01-12T18:02:28.562152
2020-11-24T14:56:44
2020-11-24T14:56:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,208
cpp
#include "Screen.h" #include <SDL.h> #include <iostream> namespace caveofprogramming { Screen::Screen() : m_window(NULL), m_renderer(NULL), m_texture(NULL), m_buffer1(NULL), m_buffer2(NULL) { } bool Screen::init() { if (SDL_Init(SDL_INIT_VIDEO) < 0) { return false; } m_window = SDL_CreateWindow("Particle Fire Explosion", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN); if (m_window == NULL) { SDL_Quit(); return false; } m_renderer = SDL_CreateRenderer(m_window, -1, SDL_RENDERER_PRESENTVSYNC); m_texture = SDL_CreateTexture(m_renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STATIC, SCREEN_WIDTH, SCREEN_HEIGHT); if (m_renderer == NULL) { SDL_DestroyWindow(m_window); SDL_Quit(); return false; } if (m_texture == NULL) { SDL_DestroyRenderer(m_renderer); SDL_DestroyWindow(m_window); SDL_Quit(); return false; } m_buffer1 = new Uint32[SCREEN_WIDTH * SCREEN_HEIGHT]; m_buffer2 = new Uint32[SCREEN_WIDTH * SCREEN_HEIGHT]; // set pixels color memset(m_buffer1, 0, SCREEN_WIDTH * SCREEN_HEIGHT * sizeof(Uint32)); memset(m_buffer2, 0, SCREEN_WIDTH * SCREEN_HEIGHT * sizeof(Uint32)); return true; } void Screen::setPixel(int x, int y, Uint8 red, Uint8 green, Uint8 blue) { if (x < 0 || x >= SCREEN_WIDTH || y < 0 || y >= SCREEN_HEIGHT) { return; } Uint32 color = 0; color += red; color <<= 8; color += green; color <<= 8; color += blue; color <<= 8; color += 0xFF; m_buffer1[(y * SCREEN_WIDTH) + x] = color; } void Screen::update() { SDL_UpdateTexture(m_texture, NULL, m_buffer1, SCREEN_WIDTH * sizeof(Uint32)); SDL_RenderClear(m_renderer); SDL_RenderCopy(m_renderer, m_texture, NULL, NULL); SDL_RenderPresent(m_renderer); } bool Screen::processEvents() { SDL_Event event; while (SDL_PollEvent(&event)) { if (event.type == SDL_QUIT) { return false; } } return true; } void Screen::close() { delete[] m_buffer1; delete[] m_buffer2; SDL_DestroyRenderer(m_renderer); SDL_DestroyTexture(m_texture); SDL_DestroyWindow(m_window); SDL_Quit(); } void Screen::boxBlur() { // Swap the buffers, so pixel is in m_buffer2 and we are drawing to m_buffer1. Uint32* temp = m_buffer1; m_buffer1 = m_buffer2; m_buffer2 = temp; for (int y = 0; y < SCREEN_HEIGHT; y++) { for (int x = 0; x < SCREEN_WIDTH; x++) { int redTotal = 0; int greenTotal = 0; int blueTotal = 0; for (int row = -1; row <= 1; row++) { for (int col = -1; col <= 1; col++) { int currentX = x + col; int currentY = y + row; if (currentX >= 0 && currentX < SCREEN_WIDTH && currentY >= 0 && currentY < SCREEN_HEIGHT) { Uint32 color = m_buffer2[currentY * SCREEN_WIDTH + currentX]; Uint8 red = color >> 24; Uint8 green = color >> 16; Uint8 blue = color >> 8; redTotal += red; greenTotal += green; blueTotal += blue; } } } Uint8 red = redTotal / 9; Uint8 green = greenTotal / 9; Uint8 blue = blueTotal / 9; setPixel(x, y, red, green, blue); } } } } /* namespace caveofprogramming */
[ "maxime.heliotpro@gmail.com" ]
maxime.heliotpro@gmail.com
6942fb6293bc7718b49a825f57581eaa0b0ed1f2
6bc3f5955699fcdac540823c51354bc21919fb06
/USACO/2.2/preface/preface.cpp
1c7c2a8e828101b6af74364b9a575a43ee1f1989
[]
no_license
soroush-tabesh/Competitive-Programming
e1a265e2224359962088c74191b7dc87bbf314bf
a677578c2a0e21c0510258933548a251970d330d
refs/heads/master
2021-09-24T06:36:43.037300
2018-10-04T14:12:00
2018-10-04T14:12:00
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,728
cpp
/* ID: soroosh4 LANG: C++11 TASK: preface */ //In The Name of God #include <bits/stdc++.h> #define Init ios_base::sync_with_stdio(0),cin.tie(0) #define WFile freopen("preface.in","r",stdin),freopen("preface.out","w",stdout) #define forar(i,n) for(int i = 0; i < n;i++) #define fori(i,a,b) for(long long int i = a; i < b;i++) #define ford(i,a,b) for(long long int i = a; i > b;i--) #define Log(x) cout << "Log: " << x << endl; #define F first #define S second #define pb push_back #define pf push_front using namespace std; typedef long long int ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const ll mod = 1e9+7; const int MAX = 100*1000+5; void Solution(); enum{ I,V,X,L,C,D,M }; string symbs = "IVXLCDM"; int n; int data[10]; int main() { Init; WFile; Solution(); return 0; } void count(int k){ int a[4]; a[0] = k%10; a[1] = (k/10) % 10; a[2] = (k/100) % 10; a[3] = (k/1000) % 10; data[M] += a[3]; if(a[2]){ if(a[2] < 4){ data[C] += a[2]; }else if(a[2] < 6){ data[C] += 5-a[2]; data[D]++; }else if (a[2] < 9){ data[D]++; data[C] += a[2]-5; }else{ data[C]++; data[M]++; } } if(a[1]){ if(a[1] < 4){ data[X] += a[1]; }else if(a[1] < 6){ data[X] += 5-a[1]; data[L]++; }else if (a[1] < 9){ data[L]++; data[X] += a[1]-5; }else{ data[C]++; data[X]++; } } if(a[0]){ if(a[0] < 4){ data[I] += a[0]; }else if(a[0] < 6){ data[I] += 5-a[0]; data[V]++; }else if (a[0] < 9){ data[V]++; data[I] += a[0]-5; }else{ data[X]++; data[I]++; } } } void Solution(){ cin >> n; fori(i,1,n+1){ count(i); } forar(i,10){ if(data[i]){ cout << symbs[i] << ' ' << data[i] << endl; } } }
[ "sorooshtabesh@yahoo.com" ]
sorooshtabesh@yahoo.com
5d488d33a14b8151a0a3c338671e554398a73da1
91b964984762870246a2a71cb32187eb9e85d74e
/SRC/OFFI SRC!/boost_1_34_1/boost_1_34_1/libs/serialization/test/test_optional.cpp
6b8fc67de20b430ea9c7c2bdb32a7b6eaa592dc7
[ "BSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
willrebuild/flyffsf
e5911fb412221e00a20a6867fd00c55afca593c7
d38cc11790480d617b38bb5fc50729d676aef80d
refs/heads/master
2021-01-19T20:27:35.200154
2011-02-10T12:34:43
2011-02-10T12:34:43
32,710,780
3
0
null
null
null
null
UTF-8
C++
false
false
1,781
cpp
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // test_optional.cpp // (C) Copyright 2004 Pavel Vozenilek // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // should pass compilation and execution #include <fstream> #include <boost/config.hpp> #include <cstdio> // remove #if defined(BOOST_NO_STDC_NAMESPACE) namespace std{ using ::remove; } #endif #include <boost/archive/archive_exception.hpp> #include "test_tools.hpp" #include <boost/preprocessor/stringize.hpp> #include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) #include <boost/serialization/optional.hpp> #include "A.hpp" int test_main( int /* argc */, char* /* argv */[] ) { const char * testfile = boost::archive::tmpnam(NULL); BOOST_REQUIRE(NULL != testfile); const boost::optional<int> aoptional1; const boost::optional<int> aoptional2(123); { test_ostream os(testfile, TEST_STREAM_FLAGS); test_oarchive oa(os); oa << boost::serialization::make_nvp("aoptional1",aoptional1); oa << boost::serialization::make_nvp("aoptional2",aoptional2); } boost::optional<int> aoptional1a(999); boost::optional<int> aoptional2a; { test_istream is(testfile, TEST_STREAM_FLAGS); test_iarchive ia(is); ia >> boost::serialization::make_nvp("aoptional1",aoptional1a); ia >> boost::serialization::make_nvp("aoptional2",aoptional2a); } BOOST_CHECK(aoptional1 == aoptional1a); BOOST_CHECK(aoptional2 == aoptional2a); std::remove(testfile); return EXIT_SUCCESS; } // EOF
[ "66430417@qq.com@e2c90bd7-ee55-cca0-76d2-bbf4e3699278" ]
66430417@qq.com@e2c90bd7-ee55-cca0-76d2-bbf4e3699278
da3be70279613a44d2e94d3f3e432ccddbf72f54
f511554b0e1d08d4bf4f4837a9c464fc8dafee3f
/Queue/implementation_list.cpp
090eaab9074b522cfea77643ac629438462d4497
[]
no_license
Subrat2196/Placement_CB
f0770415ddebc1a27474e3a6e9753c9662651154
04923eb5c9f114d920906f30b34125b7b65f7e5d
refs/heads/master
2023-06-17T13:27:03.843544
2021-07-04T12:48:28
2021-07-04T12:48:28
369,576,385
0
0
null
null
null
null
UTF-8
C++
false
false
1,514
cpp
#include <iostream> using namespace std; class node { public: int data; node *next; node(int d) { data=d; next=NULL; } }; void insert_at_head(node *&head,int data) { //first node is inserted if(head==NULL) { head=new node(data); return; } node*ptr =new node(data); ptr->next=head; head=ptr; } void insert_at_tail(node *&head,int data) { if(head==NULL) { head= new node(data); return; } else { node *n=new node(data); node *ptr=head; while(ptr->next!=NULL) { ptr=ptr->next; } ptr->next=n; return; } } void delete_head(node *&head) { if(head==NULL) { return ; } else { node *ptr=head->next; delete(head); head=ptr; } } node* build() { int d; cin>>d; node *head=NULL; while(d==-1) { insert_at_head(head,d); } return head; } void print(node *head) //This head is a copy as we are passing by value { while(head!=NULL) { cout<<head->data<<"->"; head=head->next; } } class Queue { int cs; public: node *head=NULL; Queue() { cs=0; } bool isEmpty() { return cs==0; } void push(int data) { insert_at_tail(head,data); cs=cs+1; } void pop() { if(!isEmpty()) { cs=cs-1; delete_head(head); } } int front() { return head->data; } }; int main() { node *head=build(); return 0; }
[ "bahuguna.subrat211996@gmail.com" ]
bahuguna.subrat211996@gmail.com
6bf09e12f78d13c2d4feaae8f91a267ea81b84a9
0476541c06d6a95e8e7c5d20777b3f5ed00b15d2
/include/rti/ddsopcua/DdsOpcUaGateway.hpp
1d9db992b7a571c9b635547ddf198b75fe6e261d
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
HarkerYX/rticonnextdds-gateway-opcua
3010aadd3f2c8c0ad250917718f9a22998cc3cef
c45de71a24ac81e25dc12df749bf01dacf3ba134
refs/heads/master
2023-07-28T14:57:12.583147
2021-09-06T16:36:34
2021-09-06T16:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,388
hpp
/* * (c) 2020 Copyright, Real-Time Innovations, Inc. (RTI) * All rights reserved. * * RTI grants Licensee a license to use, modify, compile, and create derivative * works of the Software solely in combination with RTI Connext DDS. Licensee * may redistribute copies of the Software provided that all such copies are * subject to this License. The Software is provided "as is", with no warranty * of any type, including any warranty for fitness for any purpose. RTI is * under no obligation to maintain or support the Software. RTI shall not be * liable for any incidental or consequential damages arising out of the use or * inability to use the Software. For purposes of clarity, nothing in this * License prevents Licensee from using alternate versions of DDS, provided * that Licensee may not combine or link such alternate versions of DDS with * the Software. */ #ifndef RTI_DDSOPCUA_GATEWAY_HPP_ #define RTI_DDSOPCUA_GATEWAY_HPP_ #include <dds/core/Reference.hpp> #include <rti/config/Logger.hpp> #include <rti/ddsopcua/DdsOpcUaGatewayProperty.hpp> #include <rti/ddsopcua/detail/DdsOpcUaGatewayImpl.hpp> namespace rti { namespace ddsopcua { /** * @brief The @product. */ class Gateway : public dds::core::Reference<GatewayImpl> { public: typedef dds::core::Reference<GatewayImpl> Base; OMG_DDS_REF_TYPE_NOTYPENAME(Gateway, dds::core::Reference, GatewayImpl); /** * @brief Creates a @product instance * * @param[in] property * The property to configure @product instance. * */ explicit Gateway(const GatewayProperty& property) : Base(new GatewayImpl(property)) { this->delegate()->remember_reference(this->delegate()); } explicit Gateway(Base::DELEGATE_REF_T reference) : Base(reference) { if (this->delegate()) { this->delegate()->remember_reference(this->delegate()); } } /** * @brief Starts @product. * * This is a non-blocking operation. @product will create its own set of * threads to perform its tasks. */ void start() { this->delegate()->start(); } /** * @brief Stops @product. * * This operation will bloc the instance is fully stopped. */ void stop() { this->delegate()->stop(); } void print_available_configurations() { this->delegate()->print_available_configurations(); } static void initialize_globals() { GatewayImpl::initialize_globals(); } /** * @brief Finalizes global resources that @product requires to operate. * * This operation releases resources specific to @product only. @ndds * global state shall be released separately through the * DomainParticipantFactory's finalize_instance(). * * This operation should be called by your application only upon exit, * after all service instances have been deleted. Calling it at a different * time may cause the application to crash. * * @mtsafety unsafe. Applications are not allowed to call this operation * concurrently * * @throw std::exception */ static void finalize_globals() { GatewayImpl::finalize_globals(); } }; /** \ingroup RTI_RoutingServiceLibModule * * @brief The singleton type used to configure @product verbosity * * For configuring other aspects such as output file, print format or * RTI Connext specific logging, use rti::config::Logger. * */ class Logger { public: typedef rti::config::Verbosity Verbosity; typedef rti::config::LogCategory LogCategory; typedef rti::config::LoggerMode LoggerMode; typedef rti::config::PrintFormat PrintFormat; static Logger& instance(); /** * @brief Sets the verbosity for the log messages generated at the * @product level. * * @param[in] verbosity * The verbosity of the service logs */ void verbosity(rti::config::Verbosity verbosity); /** * @brief Getter for the same attribute * * @see verbosity(rti::config::Verbosity) */ rti::config::Verbosity verbosity(); virtual ~Logger(); private: Logger(); // Disable copy Logger(const Logger&); Logger& operator=(const Logger&); }; }} // namespace rti::ddsopcua #endif // RTI_DDSOPCUA_GATEWAY_HPP_
[ "fgarcia@rti.com" ]
fgarcia@rti.com
0372b21221c8051d899488e380dd8625a1b13754
4d3d21812d0cf0f810521035541adf195f773132
/201-300/217_Contains_Duplicate/217_Contains_Duplicate.cpp
fb24228c3f0da3796585bd5ad2b6a016d51f0c88
[]
no_license
chengshunzhang/my_leetcode
1220b99d4e81c5f277ef145cc15610a4fd9392d1
5ece849b945ef77a4eb4c515b46d24677b1b0fab
refs/heads/master
2020-03-28T19:17:00.430809
2019-10-08T00:40:41
2019-10-08T00:40:41
148,961,244
0
0
null
null
null
null
UTF-8
C++
false
false
567
cpp
#include <vector> #include <unordered_map> #include <iostream> using namespace std; class Solution { public: bool containsDuplicate(vector<int>& nums) { int n = nums.size(); unordered_map<int, bool> m; for(int i = 0; i < n; i++) { if(!m.count(nums[i])) { m[nums[i]] = true; } else { return true; } } return false; } }; int main() { int n[] = {1,2,3,1}; vector<int> nums(n,n+4); Solution s; cout << s.containsDuplicate(nums) << endl; return 0; }
[ "chengshun.zhang@outlook.com" ]
chengshun.zhang@outlook.com
63551d30ace784dc39492a21de242006206e8783
ffb568806e34199501c4ca6b61ac86ee9cc8de2e
/gflib2/Animation/source/gfl2_InterestJointFunction.cpp
f290f39424af194bfb3eecac946c136681254364
[]
no_license
Fumikage8/gen7-source
433fb475695b2d5ffada25a45999f98419b75b6b
f2f572b8355d043beb468004f5e293b490747953
refs/heads/main
2023-01-06T00:00:14.171807
2020-10-20T18:49:53
2020-10-20T18:49:53
305,500,113
3
1
null
null
null
null
UTF-8
C++
false
false
14,242
cpp
#include <Animation/include/gfl2_InterestJointFunction.h> #include <RenderingEngine/include/SceneGraph/gfl2_SceneGraphManager.h> using namespace gfl2; using namespace gfl2::renderingengine; using namespace gfl2::renderingengine::scenegraph; namespace gfl2 { namespace animation { /** * @brief コンストラクタ */ InterestJointFunction::InterestJointFunction() : m_pInterestNode(NULL), m_AfterFrame(0), m_AfterFrameMax(8), m_pParentFunction(NULL), m_pChildFunction(NULL) { m_OldAngles[0] = 0.0f; m_OldAngles[1] = 0.0f; } /** * @brief デストラクタ */ InterestJointFunction::~InterestJointFunction() { } /** * @brief 注目ノードの設定 */ void InterestJointFunction::SetInterestNode(gfl2::renderingengine::scenegraph::resource::MotionConfigResourceNode::InterestNode* pInterestNode, math::Quaternion* pOldRotation) { m_pInterestNode = pInterestNode; m_pOldRotation = pOldRotation; } /** * @brief 更新 * * @param inout_pOverAngle0 角度限界を超えた角度0 * @param inout_pOverAngle1 角度限界を超えた角度1 * * @return true:角度制限に引っかかった false:角度制限以内 */ bool InterestJointFunction::Update(f32* inout_pOverAngle0, f32* inout_pOverAngle1) { #if 0 if (this->GetWeight() <= 0.0f) { m_OldAngles[0] = 0.0f; m_OldAngles[1] = 0.0f; return; } #endif bool isRotateLimit = false; // 更新前の回転値を保存 *m_pOldRotation = this->GetJointNode()->GetLocalRotation(); f32 oldOldAngle0 = m_OldAngles[0]; f32 oldOldAngle1 = m_OldAngles[1]; f32 angle0 = *inout_pOverAngle0; f32 angle1 = *inout_pOverAngle1; // 角度制限 switch (this->GetType()) { case renderingengine::InterestType::X: case renderingengine::InterestType::Y: case renderingengine::InterestType::Z: case renderingengine::InterestType::X_M90: case renderingengine::InterestType::Z_180: case renderingengine::InterestType::Y_90: isRotateLimit = this->Clamp(&angle0, inout_pOverAngle0); break; case renderingengine::InterestType::YZ: case renderingengine::InterestType::XZ: case renderingengine::InterestType::XY: case renderingengine::InterestType::ZY: isRotateLimit = this->Clamp2(&angle0, &angle1, inout_pOverAngle0, inout_pOverAngle1); break; } switch (this->GetType()) { case gfl2::renderingengine::InterestType::X: this->UpdateX(angle0, 0); break; case gfl2::renderingengine::InterestType::YZ: this->UpdateY(angle0, 0); this->UpdateZ(angle1, 1); break; case gfl2::renderingengine::InterestType::XZ: this->UpdateX(angle0, 0); this->UpdateZ(angle1, 1); break; case gfl2::renderingengine::InterestType::XY: this->UpdateX(angle0, 0); this->UpdateY(angle1, 1); break; case gfl2::renderingengine::InterestType::ZY: this->UpdateZ(angle0, 0); this->UpdateY(angle1, 1); break; case gfl2::renderingengine::InterestType::Y: this->UpdateY(angle0, 0); break; case gfl2::renderingengine::InterestType::Z: this->UpdateZ(angle0, 0); break; case gfl2::renderingengine::InterestType::X_M90: this->UpdateX(angle0, 0); break; case gfl2::renderingengine::InterestType::Z_180: this->UpdateZ(angle0, 0); break; case gfl2::renderingengine::InterestType::Y_90: this->UpdateY(angle0, 0); break; } // ワールド行列更新 SceneGraphManager::TraverseModelFast(this->GetJointNode()); // 角度制限チェック if (isRotateLimit) { f32 subAngle0 = m_OldAngles[0] - oldOldAngle0; f32 subAngle1 = m_OldAngles[1] - oldOldAngle1; return math::IsAlmostZero(subAngle0) && math::IsAlmostZero(subAngle1); } return false; } /** * @brief 最初の回転角度を取得 * * @param pInterestPosition 注視位置 * @param out_pAngle0 角度0 * @param out_pAngle1 角度1 */ void InterestJointFunction::GetFirstAngle(const math::Vector3* pInterestPosition, f32* out_pAngle0, f32* out_pAngle1) { // NULLなら終了させる // @attention ここに一緒に解除処理が入ってるのは気持ち悪い if (pInterestPosition == NULL) { if (m_AfterFrame == 0) { m_AfterAngles[0] = m_OldAngles[0]; m_AfterAngles[1] = m_OldAngles[1]; } ++m_AfterFrame; f32 rate = static_cast<f32>(m_AfterFrame) / m_AfterFrameMax; if (rate > 1.0f) rate = 1.0f; rate = 1.0f - rate; *out_pAngle0 = m_AfterAngles[0] * rate; *out_pAngle1 = m_AfterAngles[1] * rate; return; } m_AfterFrame = 0; const math::Matrix34& jointMatrix = this->GetJointNode()->GetWorldMatrix(); switch (this->GetType()) { case gfl2::renderingengine::InterestType::XY: GetAngleXY(jointMatrix, *pInterestPosition, false, out_pAngle0, out_pAngle1); break; case gfl2::renderingengine::InterestType::Y: case gfl2::renderingengine::InterestType::YZ: GetAngleYZ(jointMatrix, *pInterestPosition, false, out_pAngle0, out_pAngle1); break; case gfl2::renderingengine::InterestType::ZY: case gfl2::renderingengine::InterestType::Z_180: GetAngleZY(jointMatrix, *pInterestPosition, false, out_pAngle0, out_pAngle1); break; case gfl2::renderingengine::InterestType::X_M90: { math::Matrix34 mat = jointMatrix * math::Matrix34::GetRotationX(-PI * 0.5f); GetAngleXZ(mat, *pInterestPosition, true, out_pAngle0, out_pAngle1); } break; case gfl2::renderingengine::InterestType::Y_90: { math::Matrix34 mat = jointMatrix * math::Matrix34::GetRotationY(PI * 0.5f); GetAngleYZ(mat, *pInterestPosition, true, out_pAngle0, out_pAngle1); } break; default: GetAngleXZ(jointMatrix, *pInterestPosition, true, out_pAngle0, out_pAngle1); break; } } void InterestJointFunction::GetAngleXY(const math::Matrix34& jointMatrix, const math::Vector3& interestPosition, bool reverseFlag, f32* out_pAngle0, f32* out_pAngle1) { math::Vector3 localTargetPosition = jointMatrix.Inverse().TransformCoord(interestPosition); if (reverseFlag) { localTargetPosition = -localTargetPosition; } f32 tmp0 = localTargetPosition.y * localTargetPosition.y + localTargetPosition.z * localTargetPosition.z; if (math::IsAlmostZero(tmp0)) { return; } f32 tmp1 = tmp0 + localTargetPosition.x * localTargetPosition.x; tmp0 = math::FSqrt(tmp0); f32 tmp2 = 1.0f / tmp0; tmp1 = math::FSqrt(tmp1); tmp1 = 1.0f / tmp1; f32 ysin = -localTargetPosition.y * tmp2; f32 ycos = localTargetPosition.z * tmp2; f32 zsin = localTargetPosition.x * tmp1; f32 zcos = tmp0 * tmp1; *out_pAngle0 = atan2f(ysin, ycos); *out_pAngle1 = atan2f(zsin, zcos); } void InterestJointFunction::GetAngleYZ(const math::Matrix34& jointMatrix, const math::Vector3& interestPosition, bool reverseFlag, f32* out_pAngle0, f32* out_pAngle1) { math::Vector3 localTargetPosition = jointMatrix.Inverse() * interestPosition; if (reverseFlag) { localTargetPosition = -localTargetPosition; } f32 tmp0 = localTargetPosition.x * localTargetPosition.x + localTargetPosition.z * localTargetPosition.z; if (math::IsAlmostZero(tmp0)) { return; } f32 tmp1 = tmp0 + localTargetPosition.y * localTargetPosition.y; tmp0 = math::FSqrt(tmp0); f32 tmp2 = 1.0f / tmp0; tmp1 = math::FSqrt(tmp1); tmp1 = 1.0f / tmp1; f32 ysin = -localTargetPosition.z * tmp2; f32 ycos = localTargetPosition.x * tmp2; f32 zsin = localTargetPosition.y * tmp1; f32 zcos = tmp0 * tmp1; *out_pAngle0 = atan2f(ysin, ycos); *out_pAngle1 = atan2f(zsin, zcos); } void InterestJointFunction::GetAngleZY(const math::Matrix34& jointMatrix, const math::Vector3& interestPosition, bool reverseFlag, f32* out_pAngle0, f32* out_pAngle1) { math::Vector3 localTargetPosition = jointMatrix.Inverse() * interestPosition; if (reverseFlag) { localTargetPosition = -localTargetPosition; } f32 tmp0 = localTargetPosition.x * localTargetPosition.x + localTargetPosition.y * localTargetPosition.y; if (math::IsAlmostZero(tmp0)) { return; } f32 tmp1 = tmp0 + localTargetPosition.z * localTargetPosition.z; tmp0 = math::FSqrt(tmp0); f32 tmp2 = 1.0f / tmp0; tmp1 = math::FSqrt(tmp1); tmp1 = 1.0f / tmp1; f32 ysin = localTargetPosition.y * tmp2; f32 ycos = localTargetPosition.x * tmp2; f32 zsin = -localTargetPosition.z * tmp1; f32 zcos = tmp0 * tmp1; *out_pAngle0 = atan2f(ysin, ycos); *out_pAngle1 = atan2f(zsin, zcos); } void InterestJointFunction::GetAngleXZ(const math::Matrix34& jointMatrix, const math::Vector3& interestPosition, bool reverseFlag, f32* out_pAngle0, f32* out_pAngle1) { math::Vector3 localTargetPosition = jointMatrix.Inverse() * interestPosition; if (reverseFlag) { localTargetPosition = -localTargetPosition; } f32 tmp0 = localTargetPosition.y * localTargetPosition.y + localTargetPosition.z * localTargetPosition.z; if (math::IsAlmostZero(tmp0)) { return; } f32 tmp1 = tmp0 + localTargetPosition.x * localTargetPosition.x; tmp0 = math::FSqrt(tmp0); f32 tmp2 = 1.0f / tmp0; tmp1 = math::FSqrt(tmp1); tmp1 = 1.0f / tmp1; f32 ysin = localTargetPosition.z * tmp2; f32 ycos = localTargetPosition.y * tmp2; f32 zsin = -localTargetPosition.x * tmp1; f32 zcos = tmp0 * tmp1; *out_pAngle0 = atan2f(ysin, ycos); *out_pAngle1 = atan2f(zsin, zcos); } bool InterestJointFunction::Clamp(f32* inout_pAngle, f32* out_pOverAngle) { // 通常の角度制限 if (*inout_pAngle < this->GetLow()) { *out_pOverAngle = *inout_pAngle - this->GetLow(); *inout_pAngle = this->GetLow(); return true; } if (*inout_pAngle > this->GetHigh()) { *out_pOverAngle = *inout_pAngle - this->GetHigh(); *inout_pAngle = this->GetHigh(); return true; } return false; } bool InterestJointFunction::Clamp2(f32* inout_pAngle0, f32* inout_pAngle1, f32* out_pOverAngle0, f32* out_pOverAngle1) { // 楕円の角度制限 m_Upper.SetFocus(this->GetHigh(), this->GetHigh2()); m_Lower.SetFocus(this->GetHigh(), (this->GetLow2() < 0.0f) ? -this->GetLow2() : this->GetLow2()); if (0.0f <= *inout_pAngle1) { return m_Upper.Clamp(inout_pAngle0, inout_pAngle1, out_pOverAngle0, out_pOverAngle1); } else { return m_Lower.Clamp(inout_pAngle0, inout_pAngle1, out_pOverAngle0, out_pOverAngle1); } } void InterestJointFunction::UpdateX(f32 angle, u32 angleIndex) { // 行列更新 return this->UpdateMatrix(angle, 1.0f, 0.0f, 0.0f, angleIndex); } void InterestJointFunction::UpdateY(f32 angle, u32 angleIndex) { // 行列更新 return this->UpdateMatrix(angle, 0.0f, 1.0f, 0.0f, angleIndex); } void InterestJointFunction::UpdateZ(f32 angle, u32 angleIndex) { // 行列更新 return this->UpdateMatrix(angle, 0.0f, 0.0f, 1.0f, angleIndex); } void InterestJointFunction::UpdateMatrix(f32 angle, f32 ax, f32 ay, f32 az, u32 angleIndex) { f32 diff = angle - m_OldAngles[angleIndex]; // 解除中は速度制限しない if (m_AfterFrame == 0) { // 速度制限 if (this->GetSpeed() * this->GetSpeed() < diff * diff) { if (diff > 0.0f) { angle = m_OldAngles[angleIndex] + this->GetSpeed(); } else { angle = m_OldAngles[angleIndex] - this->GetSpeed(); } } } m_OldAngles[angleIndex] = angle; this->RotateMatrix(angle, ax, ay, az); #if 0 char buf[512]; sprintf_s(buf, "%s: angle %f, speed %f, diff %f\n", pJointNode->GetNodeName(), angle, this->GetSpeed(), diff); OutputDebugStringA(buf); #endif } void InterestJointFunction::RotateMatrix(f32 angle, f32 ax, f32 ay, f32 az) { // ローカル行列を回転させる f32 cosAngle = cos(angle * 0.5f); f32 sinAngle = sin(angle * 0.5f); math::Quaternion q(sinAngle * ax, sinAngle * ay, sinAngle * az, cosAngle); instance::JointInstanceNode* pJointNode = this->GetJointNode(); pJointNode->SetLocalRotation(pJointNode->GetLocalRotation() * q); instance::JointInstanceNode* pParentNode = pJointNode->GetParent()->SafeCast<instance::JointInstanceNode>(); math::Matrix34 localMatrix = pJointNode->GetLocalSRT().ToMatrixNonInheritanceScale(pParentNode->GetLocalScale()); // ワールド行列を計算 const math::Matrix34& parentMatrix = pParentNode->GetWorldMatrix(); pJointNode->SetWorldMatrix(parentMatrix * localMatrix); } void InterestJointFunction::RotateX(f32 angle) { this->RotateMatrix(angle, 1.0f, 0.0f, 0.0f); } void InterestJointFunction::RotateY(f32 angle) { this->RotateMatrix(angle, 0.0f, 1.0f, 0.0f); } void InterestJointFunction::RotateZ(f32 angle) { this->RotateMatrix(angle, 0.0f, 0.0f, 1.0f); } /** * 顔向け補正行列を計算 */ void InterestJointFunction::CalculateAdjustMatrix(f32 adjustAngle, f32 decline) { if (this->GetAdjustUpdateType() == ADJUST_UPDATE_TYPE_YZ) { this->RotateY(adjustAngle); this->RotateZ(decline); } else { this->RotateZ(adjustAngle); this->RotateX(decline); } // ワールド行列更新 SceneGraphManager::TraverseModelFast(this->GetJointNode()); } InterestJointFunction::AdjustUpdateType InterestJointFunction::GetAdjustUpdateType() const { switch (this->GetType()) { case renderingengine::InterestType::X: case renderingengine::InterestType::Y: case renderingengine::InterestType::XY: case renderingengine::InterestType::ZY: case renderingengine::InterestType::X_M90: case renderingengine::InterestType::Y_90: return ADJUST_UPDATE_TYPE_YZ; case renderingengine::InterestType::Z: case renderingengine::InterestType::YZ: case renderingengine::InterestType::XZ: case renderingengine::InterestType::Z_180: return ADJUST_UPDATE_TYPE_ZX; } // enumに含まれていないおかしなデータ GFL_ASSERT(0); return ADJUST_UPDATE_TYPE_YZ; } }} // eof
[ "forestgamer141@gmail.com" ]
forestgamer141@gmail.com
1a93e8162891d1e704beb6dd202a2d03fc470537
31f5cddb9885fc03b5c05fba5f9727b2f775cf47
/engine/core/io/io.cpp
4751d6638e76db361897b7ebd39f860733f06749
[ "MIT" ]
permissive
timi-liuliang/echo
2935a34b80b598eeb2c2039d686a15d42907d6f7
d6e40d83c86431a819c6ef4ebb0f930c1b4d0f24
refs/heads/master
2023-08-17T05:35:08.104918
2023-08-11T18:10:35
2023-08-11T18:10:35
124,620,874
822
102
MIT
2021-06-11T14:29:03
2018-03-10T04:07:35
C++
UTF-8
C++
false
false
7,040
cpp
#include "engine/core/util/AssertX.h" #include "engine/core/util/Exception.h" #include "engine/core/util/PathUtil.h" #include "engine/core/util/TimeProfiler.h" #include "IO.h" #include "engine/core/log/Log.h" namespace Echo { IO::IO() { } IO::~IO() { } IO* IO::instance() { static IO* inst = EchoNew(IO); return inst; } void IO::bindMethods() { CLASS_BIND_METHOD(IO, isExist); CLASS_BIND_METHOD(IO, loadFileToString); CLASS_BIND_METHOD(IO, saveStringToFile); } void IO::setEngineResPath(const String& enginePath) { String formatPath = enginePath; PathUtil::FormatPathAbsolut(formatPath); m_engineFileSystem.setPath(formatPath, "Engine://"); } const String& IO::getEngineResPath() { return m_engineFileSystem.getPath(); } void IO::addModuleResPath(const String& moduleName, const String& moduleResPath) { if (PathUtil::IsDirExist(moduleResPath)) { FileSystem moduleFileSystem; moduleFileSystem.setPath(moduleResPath, "Module://" + moduleName + "/"); m_moduleFileSystems.emplace_back(moduleFileSystem); } } void IO::setResPath(const String& resPath) { m_resFileSystem.setPath(resPath, "Res://"); loadPackages(); } const String& IO::getResPath() { return m_resFileSystem.getPath(); } void IO::loadPackages() { StringArray packages; PathUtil::EnumFilesInDir(packages, m_resFileSystem.getPath(), false, false, true); for(const String& package : packages) { if(PathUtil::GetFileExt(package, true)==".pkg") { FilePackage* filePackage = EchoNew(FilePackage(package.c_str())); m_resFilePackages.push_back(filePackage); } } } void IO::setUserPath(const String& userPath) { m_userFileSystem.setPath(userPath, "User://"); } const String& IO::getUserPath() { return m_userFileSystem.getPath(); } DataStream* IO::open(const String& resourceName, ui32 accessMode) { if (StringUtil::StartWith(resourceName, "Res://")) { DataStream* stream = m_resFileSystem.open(resourceName, accessMode); if(stream) return stream; for(FilePackage* package : m_resFilePackages) { stream = package->open(resourceName.c_str()); if(stream) return stream; } } else if (StringUtil::StartWith(resourceName, "User://")) { return m_userFileSystem.open(resourceName, accessMode); } else if (StringUtil::StartWith(resourceName, "Engine://")) { return m_engineFileSystem.open(resourceName, accessMode); } else if (StringUtil::StartWith(resourceName, "Module://")) { for (FileSystem& moduleFileSystem : m_moduleFileSystems) { if(StringUtil::StartWith(resourceName, moduleFileSystem.getPrefix())) return moduleFileSystem.open(resourceName); } } else { return m_externalFileSystem.open(resourceName, accessMode); } EchoLogError("Cannot locate a resource [%s] ResourceGroupManager::openResource", resourceName.c_str()); return nullptr; } bool IO::isExist(const String& resourceName) { EE_LOCK_MUTEX(m_mutex) if (StringUtil::StartWith(resourceName, "Res://")) { if(m_resFileSystem.isExist(resourceName)) return true; for(FilePackage* package : m_resFilePackages) { if(package->isExist(resourceName)) return true; } return false; } else if (StringUtil::StartWith(resourceName, "User://")) { return m_userFileSystem.isExist(resourceName); } else if (StringUtil::StartWith(resourceName, "Engine://")) { return m_engineFileSystem.isExist(resourceName); } else if (StringUtil::StartWith(resourceName, "Module://")) { for (FileSystem& moduleFileSystem : m_moduleFileSystems) { if (moduleFileSystem.isExist(resourceName)) return true; } } return PathUtil::IsFileExist(resourceName); } String IO::convertResPathToFullPath(const String& filename) { EE_LOCK_MUTEX(m_mutex) if (StringUtil::StartWith(filename, "Res://")) { return m_resFileSystem.getFullPath(filename); } else if (StringUtil::StartWith(filename, "User://")) { return m_userFileSystem.getFullPath(filename); } else if (StringUtil::StartWith(filename, "Engine://")) { return m_engineFileSystem.getFullPath(filename); } else if (StringUtil::StartWith(filename, "Module://")) { for (FileSystem& moduleFileSystem : m_moduleFileSystems) { if (StringUtil::StartWith(filename, moduleFileSystem.getPrefix())) return moduleFileSystem.getFullPath(filename); } } EchoLogError("getFileLocation [%s] failed", filename.c_str()); return ""; } bool IO::convertFullPathToResPath(const String& fullPath, String& resPath) { String result = StringUtil::Replace(fullPath, m_resFileSystem.getPath(), m_resFileSystem.getPrefix()); if (StringUtil::StartWith(result, "Res://")) { resPath = result; return true; } result = StringUtil::Replace(fullPath, m_userFileSystem.getPath(), m_userFileSystem.getPrefix()); if (StringUtil::StartWith(result, "User://")) { resPath = result; return true; } result = StringUtil::Replace(fullPath, m_engineFileSystem.getPath(), m_engineFileSystem.getPrefix()); if (StringUtil::StartWith(result, "Engine://")) { resPath = result; return true; } for (FileSystem& moduleFileSystem : m_moduleFileSystems) { result = StringUtil::Replace(fullPath, moduleFileSystem.getPath(), moduleFileSystem.getPrefix()); if (StringUtil::StartWith(result, "Module://")) { resPath = result; return true; } } return false; } String IO::loadFileToString(const String& filename) { MemoryReader reader(filename); return reader.getSize() ? reader.getData<const char*>() : StringUtil::BLANK; } bool IO::saveStringToFile(const String& filename, const String& content) { DataStream* stream = open(filename, DataStream::WRITE); if (stream && stream->isWriteable()) { stream->write(content.data(), content.size()); stream->close(); EchoSafeDelete(stream, DataStream); return true; } return false; } }
[ "qq79402005@gmail.com" ]
qq79402005@gmail.com
281950a53954761054ddeefbefbebe155eb7bab7
8899518abbd7c8d56a6ee9be6834ff60fccf378f
/Dynamic Programming/Coin Change/coin_change.h
d971c34ac1909408bd6deb8081a1762fbce6774b
[ "MIT" ]
permissive
Mohammed-Shoaib/WhatsAlgo
7cc23191ea3ef715b9cd057bd99284934d004be2
d6131aaed7fdb2679da93f3eeebcb34073c7eb15
refs/heads/master
2023-04-17T22:21:09.708746
2021-05-02T22:28:34
2021-05-02T22:28:34
175,226,682
17
4
null
null
null
null
UTF-8
C++
false
false
183
h
#pragma once #include <vector> #include <limits> #include <algorithm> const int INF = std::numeric_limits<int>::max() - 1; int coin_change(int target, const std::vector<int>& coins);
[ "shoaib98libra@gmail.com" ]
shoaib98libra@gmail.com
3f39e03c54f83463142416d51952be67af0127b4
bded6d1418e62e0a22ae71ab0ac285bf811826f3
/2048.h
518d876f35dd474423681a8eceb7e736d72db15e
[]
no_license
dbralios/2048-Neuroevolution
664d789afef78037779895c6a0400b8071fbc19f
5e65b07378ef28513a750aba53a5344cb9353648
refs/heads/master
2021-09-23T14:39:56.020104
2018-09-24T20:36:03
2018-09-24T20:36:03
null
0
0
null
null
null
null
UTF-8
C++
false
false
704
h
#ifndef GAME_H #define GAME_H #include "matrix.h" #include "neural.h" #include <vector> #include <utility> #include <random> #include <iostream> class game{ public: game(); game(unsigned int n); friend int play(Net, unsigned int n); friend int play(Net, ostream &out, unsigned int n); private: bool Move(int id); bool Up(); bool Down(); bool Left(); bool Right(); void random(); void restart(); bool isOver(); int getScore(); void printGrid(ostream &out); matrix<int> getGrid(); void availableCells(std::vector<std::pair<int, int>> &cells); bool transform(std::vector<int> &arr); bool isValid(std::vector<int> &arr); int score; const unsigned int N; matrix<int> grid; }; #endif
[ "bnbzor@gmail.com" ]
bnbzor@gmail.com
453f5a18e83813971ce39a7d946df83bd17439b7
d328d1aea80afd6599020542a97d5291dd40405d
/src/Core/Animation/Tweening.cpp
56953ed8f5c004b09b4478e4a4ff0924eb5f2b76
[ "MIT", "BSD-2-Clause", "Zlib" ]
permissive
PierrickLP/ObEngine
69a73cca18f66c724744d8303eaf0020574a88c3
337ad3c62e66e9cf71876c277692216edfe58493
refs/heads/master
2022-12-24T09:55:40.074207
2020-10-07T15:03:34
2020-10-07T15:03:34
106,604,958
1
0
MIT
2019-10-02T16:04:53
2017-10-11T20:19:50
C++
UTF-8
C++
false
false
948
cpp
#include <Animation/Tweening.hpp> #include <iostream> namespace obe::Animation { ValueTweening::ValueTweening(Time::TimeUnit duration) : m_duration(duration) { } ValueTweening::ValueTweening(double from, double to, Time::TimeUnit duration) : m_from(from) , m_to(to - from) , m_duration(duration) { } ValueTweening& ValueTweening::from(double from) { m_from = from; return *this; } ValueTweening& ValueTweening::to(double to) { m_to = to; return *this; } ValueTweening& ValueTweening::ease(const Easing::EasingFunction& easing) { m_easing = easing; return *this; } double ValueTweening::step(double dt) { m_current += dt; const double progression = m_current / m_duration; return (m_easing(progression) * m_to) + m_from; } }
[ "3835355+Sygmei@users.noreply.github.com" ]
3835355+Sygmei@users.noreply.github.com
710c16c36455ad1d515b8c933e8b7c2e23f4aa2e
5390eac0ac54d2c3c1c664ae525881fa988e2cf9
/include/Pothos/serialization/impl/preprocessor/empty.hpp
31503c6b45c33d2480495f8f9519c9c583cd9eb4
[ "BSL-1.0" ]
permissive
pothosware/pothos-serialization
2935b8ab1fe51299a6beba2a3e11611928186849
c59130f916a3e5b833a32ba415063f9cb306a8dd
refs/heads/master
2021-08-16T15:22:12.642058
2015-12-10T03:32:04
2015-12-10T03:32:04
19,961,886
1
0
null
null
null
null
UTF-8
C++
false
false
764
hpp
# /* ************************************************************************** # * * # * (C) Copyright Paul Mensonides 2002. # * Distributed under the Boost Software License, Version 1.0. (See # * accompanying file LICENSE_1_0.txt or copy at # * http://www.boost.org/LICENSE_1_0.txt) # * * # ************************************************************************** */ # # /* See http://www.boost.org for most recent version. */ # # ifndef POTHOS_PREPROCESSOR_EMPTY_HPP # define POTHOS_PREPROCESSOR_EMPTY_HPP # # include <Pothos/serialization/impl/preprocessor/facilities/empty.hpp> # # endif
[ "josh@joshknows.com" ]
josh@joshknows.com
212276eafa4e30bc96018bae696ea78657bb5a50
d0c44dd3da2ef8c0ff835982a437946cbf4d2940
/cmake-build-debug/programs_tiling/function13723/function13723_schedule_7/function13723_schedule_7.cpp
c95b71226f10c149f887710af507b378a927f876
[]
no_license
IsraMekki/tiramisu_code_generator
8b3f1d63cff62ba9f5242c019058d5a3119184a3
5a259d8e244af452e5301126683fa4320c2047a3
refs/heads/master
2020-04-29T17:27:57.987172
2019-04-23T16:50:32
2019-04-23T16:50:32
176,297,755
1
2
null
null
null
null
UTF-8
C++
false
false
1,064
cpp
#include <tiramisu/tiramisu.h> using namespace tiramisu; int main(int argc, char **argv){ tiramisu::init("function13723_schedule_7"); constant c0("c0", 64), c1("c1", 1024), c2("c2", 1024); var i0("i0", 0, c0), i1("i1", 0, c1), i2("i2", 0, c2), i100("i100", 2, c0 - 2), i101("i101", 2, c1 - 2), i102("i102", 2, c2 - 2), i01("i01"), i02("i02"), i03("i03"), i04("i04"); input input0("input0", {i0, i1, i2}, p_int32); computation comp0("comp0", {i100, i101, i102}, (input0(i100, i101, i102) + input0(i100 + 1, i101, i102) + input0(i100 + 2, i101, i102) - input0(i100 - 1, i101, i102) + input0(i100 - 2, i101, i102))); comp0.tile(i101, i102, 64, 64, i01, i02, i03, i04); comp0.parallelize(i100); buffer buf00("buf00", {64, 1024, 1024}, p_int32, a_input); buffer buf0("buf0", {64, 1024, 1024}, p_int32, a_output); input0.store_in(&buf00); comp0.store_in(&buf0); tiramisu::codegen({&buf00, &buf0}, "../data/programs/function13723/function13723_schedule_7/function13723_schedule_7.o"); return 0; }
[ "ei_mekki@esi.dz" ]
ei_mekki@esi.dz
a9059ea2d6f3dda09c6aac77903343dcb124b6ed
9b8e03b2513bb1ab35053356fbd39b7fa02d8936
/C++_primer_code/chapter1/1_20/1_20/stdafx.cpp
a0771cfb5426aa6d4d8a520e5c8492c5a7ff94e7
[]
no_license
pxjw/CppPrimer_solution_MyPractise
5e751008efa6ea0e6cea1e05921a6a23e516a9a1
844a1eab210eca779d028ed6f2d00e9ef5b61e73
refs/heads/master
2021-01-23T12:16:48.636853
2015-06-03T11:42:54
2015-06-03T11:42:54
30,822,114
0
0
null
null
null
null
GB18030
C++
false
false
257
cpp
// stdafx.cpp : 只包括标准包含文件的源文件 // 1_20.pch 将作为预编译头 // stdafx.obj 将包含预编译类型信息 #include "stdafx.h" // TODO: 在 STDAFX.H 中 // 引用任何所需的附加头文件,而不是在此文件中引用
[ "pengjunweiright@163.com" ]
pengjunweiright@163.com
81545f3ea4e03d9111f639878010a33ae2dca0ca
82c5f68bfa2963c4efbcba748fb662ebbb10d1b8
/day_21.cpp
6a68229f17ad232875291859b204772b074a6bd8
[]
no_license
bogdan-kovalchuk/May-leetcoding-challenge
fec86ce8e8f0ade6e0bd284f5dddeb3c2e229042
a2443f0e5e645a105acb9aef2c649a05c5492611
refs/heads/master
2022-09-08T14:33:19.367121
2020-06-01T07:53:32
2020-06-01T07:53:32
260,399,904
0
0
null
null
null
null
UTF-8
C++
false
false
1,189
cpp
#include <iostream> #include <vector> using std::string; using std::vector; class Solution { public: int countSquares(vector<vector<int>> &matrix) { int n = matrix.size(); if (n == 0) return 0; int m = matrix[0].size(); if (m == 0) return 0; int out = 0; vector<vector<int>> din(n + 1, vector<int>(m + 1)); for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { if (matrix[i][j] == 1) { din[i + 1][j + 1] = std::min(std::min(din[i][j + 1], din[i + 1][j]), din[i][j]) + 1; out += din[i + 1][j + 1]; } else { din[i + 1][j + 1] = 0; } } } return out; } }; int main() { Solution solution = Solution(); vector<vector<int>> matrix = {{0, 1, 1, 1}, {1, 1, 1, 1}, {0, 1, 1, 1}}; // vector<vector<int>> matrix = {{1, 0, 1}, // {1, 1, 0}, // {1, 1, 0}}; std::cout << solution.countSquares(matrix) << std::endl; return 0; }
[ "bogdan.kovalchuk@globallogic.com" ]
bogdan.kovalchuk@globallogic.com
51e8df8a937d13a84cb280b2eb1fc3a0d3a2904c
1f4999f62f72617bd3b32e1d450ec30a9291300a
/examples/task2/task2-2_test_p3p_kneip.cc
cceafdea511d1cadf92769365291f51b808090fe
[]
no_license
zhao-xinyu-jim/ImageBasedModellingEdu
4f102988cb546ed5605ab3c91616e132b16a7fdc
29a096618054d4f4208a20702c27727548cd7bc5
refs/heads/main
2023-03-05T10:09:56.343467
2021-02-18T04:04:45
2021-02-18T04:04:45
335,351,138
0
0
null
2021-02-18T04:04:46
2021-02-02T16:23:54
C++
UTF-8
C++
false
false
13,426
cc
// Created by sway on 2018/8/25. /* * POSIT (Pose from Orthography and Scaling with iterations), 比例正交 * 投影迭代变换算法,适用条件是物体在Z轴方向的厚度远小于其在Z轴方向的平均深度。 */ #include <complex> #include <algorithm> #include <set> #include <iostream> #include "math/matrix_tools.h" #include "math/matrix.h" #include "math/vector.h" #include "sfm/correspondence.h" #include "sfm/defines.h" #include "util/system.h" typedef math::Matrix<double, 3, 4> Pose; typedef std::vector<Pose> PutativePoses; /** * * @param factors * @param real_roots */ void solve_quartic_roots(math::Vec5d const &factors, math::Vec4d *real_roots) { double const A = factors[0]; double const B = factors[1]; double const C = factors[2]; double const D = factors[3]; double const E = factors[4]; double const A2 = A * A; double const B2 = B * B; double const A3 = A2 * A; double const B3 = B2 * B; double const A4 = A3 * A; double const B4 = B3 * B; double const alpha = -3.0 * B2 / (8.0 * A2) + C / A; double const beta = B3 / (8.0 * A3) - B * C / (2.0 * A2) + D / A; double const gamma = -3.0 * B4 / (256.0 * A4) + B2 * C / (16.0 * A3) - B * D / (4.0 * A2) + E / A; double const alpha2 = alpha * alpha; double const alpha3 = alpha2 * alpha; double const beta2 = beta * beta; std::complex<double> P(-alpha2 / 12.0 - gamma, 0.0); std::complex<double> Q(-alpha3 / 108.0 + alpha * gamma / 3.0 - beta2 / 8.0, 0.0); std::complex<double> R = -Q / 2.0 + std::sqrt(Q * Q / 4.0 + P * P * P / 27.0); std::complex<double> U = std::pow(R, 1.0 / 3.0); std::complex<double> y = (U.real() == 0.0) ? -5.0 * alpha / 6.0 - std::pow(Q, 1.0 / 3.0) : -5.0 * alpha / 6.0 - P / (3.0 * U) + U; std::complex<double> w = std::sqrt(alpha + 2.0 * y); std::complex<double> part1 = -B / (4.0 * A); std::complex<double> part2 = 3.0 * alpha + 2.0 * y; std::complex<double> part3 = 2.0 * beta / w; std::complex<double> complex_roots[4]; complex_roots[0] = part1 + 0.5 * (w + std::sqrt(-(part2 + part3))); complex_roots[1] = part1 + 0.5 * (w - std::sqrt(-(part2 + part3))); complex_roots[2] = part1 + 0.5 * (-w + std::sqrt(-(part2 - part3))); complex_roots[3] = part1 + 0.5 * (-w - std::sqrt(-(part2 - part3))); for (int i = 0; i < 4; ++i) (*real_roots)[i] = complex_roots[i].real(); } /** * * @param p1 * @param p2 * @param p3 * @param f1 * @param f2 * @param f3 * @param solutions */ void pose_p3p_kneip( math::Vec3d p1, math::Vec3d p2, math::Vec3d p3, math::Vec3d f1, math::Vec3d f2, math::Vec3d f3, std::vector<math::Matrix<double, 3, 4>> *solutions) { /* Check if points are co-linear. In this case return no solution. */ double const colinear_threshold = 1e-10; if ((p2 - p1).cross(p3 - p1).square_norm() < colinear_threshold) { solutions->clear(); return; } /* Normalize directions if necessary. */ double const normalize_epsilon = 1e-10; if (!MATH_EPSILON_EQ(f1.square_norm(), 1.0, normalize_epsilon)) f1.normalize(); if (!MATH_EPSILON_EQ(f2.square_norm(), 1.0, normalize_epsilon)) f2.normalize(); if (!MATH_EPSILON_EQ(f3.square_norm(), 1.0, normalize_epsilon)) f3.normalize(); /* Create camera frame. */ math::Matrix3d T; { math::Vec3d e1 = f1; math::Vec3d e3 = f1.cross(f2).normalized(); math::Vec3d e2 = e3.cross(e1); std::copy(e1.begin(), e1.end(), T.begin() + 0); std::copy(e2.begin(), e2.end(), T.begin() + 3); std::copy(e3.begin(), e3.end(), T.begin() + 6); std::cout<<"T:"<<T<<std::endl; std::cout<<"f1:"<<f1<<std::endl; std::cout<<"t1:"<<T * f1<<std::endl; f3 = T * f3; } /* Change camera frame and point order if f3[2] > 0. */ if (f3[2] > 0.0) { std::swap(p1, p2); std::swap(f1, f2); math::Vec3d e1 = f1; math::Vec3d e3 = f1.cross(f2).normalized(); math::Vec3d e2 = e3.cross(e1); std::copy(e1.begin(), e1.end(), T.begin() + 0); std::copy(e2.begin(), e2.end(), T.begin() + 3); std::copy(e3.begin(), e3.end(), T.begin() + 6); f3 = T * f3; } /* Create world frame. */ math::Matrix3d N; { math::Vec3d n1 = (p2 - p1).normalized(); math::Vec3d n3 = n1.cross(p3 - p1).normalized(); math::Vec3d n2 = n3.cross(n1); std::copy(n1.begin(), n1.end(), N.begin() + 0); std::copy(n2.begin(), n2.end(), N.begin() + 3); std::copy(n3.begin(), n3.end(), N.begin() + 6); } p3 = N * (p3 - p1); /* Extraction of known parameters. */ double d_12 = (p2 - p1).norm(); double f_1 = f3[0] / f3[2]; double f_2 = f3[1] / f3[2]; double p_1 = p3[0]; double p_2 = p3[1]; double cos_beta = f1.dot(f2); double b = 1.0 / (1.0 - MATH_POW2(cos_beta)) - 1; if (cos_beta < 0.0) b = -std::sqrt(b); else b = std::sqrt(b); /* Temporary pre-computed variables. */ double f_1_pw2 = MATH_POW2(f_1); double f_2_pw2 = MATH_POW2(f_2); double p_1_pw2 = MATH_POW2(p_1); double p_1_pw3 = p_1_pw2 * p_1; double p_1_pw4 = p_1_pw3 * p_1; double p_2_pw2 = MATH_POW2(p_2); double p_2_pw3 = p_2_pw2 * p_2; double p_2_pw4 = p_2_pw3 * p_2; double d_12_pw2 = MATH_POW2(d_12); double b_pw2 = MATH_POW2(b); /* Factors of the 4th degree polynomial. */ math::Vec5d factors; factors[0] = - f_2_pw2 * p_2_pw4 - p_2_pw4 * f_1_pw2 - p_2_pw4; factors[1] = 2.0 * p_2_pw3 * d_12 * b + 2.0 * f_2_pw2 * p_2_pw3 * d_12 * b - 2.0 * f_2 * p_2_pw3 * f_1 * d_12; factors[2] = - f_2_pw2 * p_2_pw2 * p_1_pw2 - f_2_pw2 * p_2_pw2 * d_12_pw2 * b_pw2 - f_2_pw2 * p_2_pw2 * d_12_pw2 + f_2_pw2 * p_2_pw4 + p_2_pw4 * f_1_pw2 + 2.0 * p_1 * p_2_pw2 * d_12 + 2.0 * f_1 * f_2 * p_1 * p_2_pw2 * d_12 * b - p_2_pw2 * p_1_pw2 * f_1_pw2 + 2.0 * p_1 * p_2_pw2 * f_2_pw2 * d_12 - p_2_pw2 * d_12_pw2 * b_pw2 - 2.0 * p_1_pw2 * p_2_pw2; factors[3] = 2.0 * p_1_pw2 * p_2 * d_12 * b + 2.0 * f_2 * p_2_pw3 * f_1 * d_12 - 2.0 * f_2_pw2 * p_2_pw3 * d_12 * b - 2.0 * p_1 * p_2 * d_12_pw2 * b; factors[4] = -2.0 * f_2 * p_2_pw2 * f_1 * p_1 * d_12 * b + f_2_pw2 * p_2_pw2 * d_12_pw2 + 2.0 * p_1_pw3 * d_12 - p_1_pw2 * d_12_pw2 + f_2_pw2 * p_2_pw2 * p_1_pw2 - p_1_pw4 - 2.0 * f_2_pw2 * p_2_pw2 * p_1 * d_12 + p_2_pw2 * f_1_pw2 * p_1_pw2 + f_2_pw2 * p_2_pw2 * d_12_pw2 * b_pw2; /* Solve for the roots of the polynomial. */ math::Vec4d real_roots; solve_quartic_roots(factors, &real_roots); /* Back-substitution of each solution. */ solutions->clear(); solutions->resize(4); for (int i = 0; i < 4; ++i) { double cot_alpha = (-f_1 * p_1 / f_2 - real_roots[i] * p_2 + d_12 * b) / (-f_1 * real_roots[i] * p_2 / f_2 + p_1 - d_12); double cos_theta = real_roots[i]; double sin_theta = std::sqrt(1.0 - MATH_POW2(real_roots[i])); double sin_alpha = std::sqrt(1.0 / (MATH_POW2(cot_alpha) + 1)); double cos_alpha = std::sqrt(1.0 - MATH_POW2(sin_alpha)); if (cot_alpha < 0.0) cos_alpha = -cos_alpha; math::Vec3d C( d_12 * cos_alpha * (sin_alpha * b + cos_alpha), cos_theta * d_12 * sin_alpha * (sin_alpha * b + cos_alpha), sin_theta * d_12 * sin_alpha * (sin_alpha * b + cos_alpha)); C = p1 + N.transposed() * C; math::Matrix3d R; R[0] = -cos_alpha; R[1] = -sin_alpha * cos_theta; R[2] = -sin_alpha * sin_theta; R[3] = sin_alpha; R[4] = -cos_alpha * cos_theta; R[5] = -cos_alpha * sin_theta; R[6] = 0.0; R[7] = -sin_theta; R[8] = cos_theta; R = N.transposed().mult(R.transposed()).mult(T); /* Convert camera position and cam-to-world rotation to pose. */ R = R.transposed(); C = -R * C; solutions->at(i) = R.hstack(C); } } /** * * @param corresp * @param inv_k_matrix * @param poses */ void compute_p3p(sfm::Correspondences2D3D const &corresp, math::Matrix<double, 3, 3> const &inv_k_matrix, PutativePoses *poses) { if (corresp.size() < 3) throw std::invalid_argument("At least 3 correspondences required"); /* Draw 3 unique random numbers. */ std::set<int> result; while (result.size() < 3) result.insert(util::system::rand_int() % corresp.size()); std::set<int>::const_iterator iter = result.begin(); sfm::Correspondence2D3D const &c1(corresp[*iter++]); sfm::Correspondence2D3D const &c2(corresp[*iter++]); sfm::Correspondence2D3D const &c3(corresp[*iter]); // pose_p3p_kneip( math::Vec3d(c1.p3d), math::Vec3d(c2.p3d), math::Vec3d(c3.p3d), inv_k_matrix.mult(math::Vec3d(c1.p2d[0], c1.p2d[1], 1.0)), inv_k_matrix.mult(math::Vec3d(c2.p2d[0], c2.p2d[1], 1.0)), inv_k_matrix.mult(math::Vec3d(c3.p2d[0], c3.p2d[1], 1.0)), poses); } int main(int argc, char *argv[]) { // intrinsic matrix math::Matrix<double, 3, 3> k_matrix; k_matrix.fill(0.0); k_matrix[0] = 0.972222; k_matrix[2] = 0.0; // cx =0 图像上的点已经进行了归一化(图像中心为原点,图像尺寸较长的边归一化为1) k_matrix[4] = 0.972222; k_matrix[5] = 0.0; // cy=0 图像上的点已经进行了归一化(图像中心为原点,图像尺寸较长的边归一化为1) k_matrix[8] = 1.0; math::Matrix<double, 3, 3> inv_k_matrix = math::matrix_inverse(k_matrix); std::cout << "inverse k matrix: " << inv_k_matrix << std::endl; // inverse k matrix: 1.02857 0 0 // 0 1.02857 0 // 0 0 1 // 世界坐标系汇总3D点的坐标 math::Vec3d p1(-2.57094, -0.217018, 6.05338); math::Vec3d p2(-0.803123, 0.251818, 6.98383); math::Vec3d p3(2.05584, -0.607918, 7.52573); // 对应的图像坐标系中的坐标(图像中心为原点,以图像长或宽归一化到[-0.5,0.5]之间。 math::Vec2d uv1(-0.441758, -0.185523); math::Vec2d uv2(-0.135753, -0.0920593); math::Vec2d uv3(0.243795, -0.192743); // 计算相机坐标系中对应的摄线 math::Vec3d f1 = inv_k_matrix.mult(math::Vec3d(uv1[0], uv1[1], 1.0)); math::Vec3d f2 = inv_k_matrix.mult(math::Vec3d(uv2[0], uv2[1], 1.0)); math::Vec3d f3 = inv_k_matrix.mult(math::Vec3d(uv3[0], uv3[1], 1.0)); // math::Vec3d f1(-0.454379, -0.190824, 1); // math::Vec3d f2(-0.139631, -0.0946896, 1); // math::Vec3d f3(0.25076, -0.19825, 1); // kneip p3p计算出4组解 std::vector<math::Matrix<double, 3, 4>> solutions; pose_p3p_kneip(p1, p2, p3, f1, f2, f3, &solutions); for (int i = 0; i < solutions.size(); i++) { std::cout << "solution " << i << ": " << std::endl << solutions[i] << std::endl; } std::cout << "the result should be \n" << "solution 0:" << std::endl; std::cout << "0.255193 -0.870436 -0.420972 3.11342\n" << "0.205372 0.474257 -0.856097 5.85432\n" << "0.944825 0.132022 0.299794 0.427496\n\n"; std::cout << "solution 1:" << std::endl; std::cout << "0.255203 -0.870431 -0.420976 3.11345\n" << "0.205372 0.474257 -0.856097 5.85432\n" << "0.944825 0.132022 0.299794 0.427496\n\n"; std::cout << "solution 2:" << std::endl; std::cout << "0.999829 -0.00839209 -0.0164611 -0.0488599\n" << "0.00840016 0.999965 0.000421432 -0.905071\n" << "0.016457 -0.000559636 0.999864 -0.0303736\n\n"; std::cout << "solution 3:" << std::endl; std::cout << "0.975996 0.122885 0.179806 -1.4207\n" << "-0.213274 0.706483 0.67483 -5.68453\n" << "-0.0441038 -0.69698 0.715733 1.71501\n\n"; // 通过第4个点的投影计算正确的姿态 math::Vec3d p4(-0.62611418962478638, -0.80525958538055419, 6.7783102989196777); math::Vec2d uv4(-0.11282696574926376, -0.24667978286743164); //const double thresh = 0.005; /* Check all putative solutions and count inliers. */ for (std::size_t j = 0; j < solutions.size(); ++j) { math::Vec4d p3d(p4[0], p4[1], p4[2], 1.0); math::Vec3d p2d = k_matrix * (solutions[j] * p3d); double square_error = MATH_POW2(p2d[0] / p2d[2] - uv4[0]) + MATH_POW2(p2d[1] / p2d[2] - uv4[1]); std::cout << "reproj err of solution " << j << " " << square_error << std::endl; } return 0; }
[ "jim_zhaoxinyu@sina.com" ]
jim_zhaoxinyu@sina.com
744e89a96540f2c2cc29341f7558204ae2c99af0
c0721b715beb302f0825d8b03e21b3664f0c4379
/bench/locate_indices.cpp
6680752851b269f3cf4565663a03dd37daf48389
[]
no_license
apachecom/grammar_improved_index
8e1165545a67edcef5a56ffff6b174e06acd4f24
a43c1565d547e36df04b9db141ba40f0bdcf7571
refs/heads/master
2022-01-01T20:22:22.826402
2021-07-26T03:45:52
2021-07-26T03:45:52
250,009,626
3
2
null
null
null
null
UTF-8
C++
false
false
17,306
cpp
// // Created by via56 on 02-04-20. // #include <iostream> #include <fstream> #include <benchmark/benchmark.h> #include <slp/RePairSLPIndex.h> #include "../SelfGrammarIndexBS.h" #include <ri/r_index.hpp> #include "../SelfGrammarIndexPTS.h" #include "../SelfGrammarIndexBSQ.h" #include "sdsl/io.hpp" #define MAX_LEN_PATT 100 #define MAX_OCC 1e9 #define MAX_SAMPLES 1000 std::vector<std::string> patterns; uint32_t load_patterns(const std::string& pattern_file){ std::fstream in(pattern_file,std::ios::in|std::ios::binary); if(in.good()){ uint32_t len, samples; in.read((char *)&len,sizeof (uint32_t)); in.read((char *)&samples,sizeof (uint32_t)); char *buff = new char[len]; for (uint32_t i = 0; i < samples ; ++i) { in.read(buff,len); std::string ss;ss.resize(len); std::copy(buff, buff+len,ss.begin()); //std::cout<<ss<<std::endl; patterns.push_back(ss); } delete buff; std::cout<<"Total patterns readed:"<<patterns.size()<<std::endl; return len; } std::cout<<"File not good"<<std::endl; return 0; } auto rilocate = [](benchmark::State &st, const string &file_index, const uint& len //#ifdef MEM_MONITOR // , const std::string file_mem_monitor //#endif ){ /** * load rindex * * */ ri::r_index<> *idx_r; fstream rf(file_index + ".ri",std::ios::in|std::ios::binary); bool fast; rf.read((char*)&fast,sizeof(fast)); idx_r = new ri::r_index<>(); idx_r->load(rf); // std::cout<<"r -index loaded"<<std::endl; uint nocc,ptt; for (auto _ : st) { nocc = 0; ptt = 0; //#ifdef MEM_MONITOR // mm.event("R-INDEX-BUILD"); //#endif for (uint ii= 0; ii < MAX_SAMPLES && ii < patterns.size();++ii) { //std::string query; //query.resize(len); //std::copy(patterns[ii].begin(),patterns[ii].begin()+len,query.begin()); //std::cout<<"r -index query:"<<patterns[ii]<<std::endl; auto occ = idx_r->locate_all(patterns[ii]); nocc += occ.size(); ptt++; } // std::cout<<nocc<<std::endl; // sleep(2); } st.counters["pLen"] = len; st.counters["queries"] = ptt; st.counters["nOcc"] = nocc; st.counters["size"] = idx_r->print_space(); delete idx_r; }; auto slplocate = [](benchmark::State &st, const string &file_index, const uint& len, const uint& sampling , bool bal = false //#ifdef MEM_MONITOR // , const std::string file_mem_monitor //#endif ){ /** * load slpindex * */ cds_static::RePairSLPIndex* idx_slp; std::string filename; if(bal) filename = file_index+"-bal-q"+std::to_string(sampling); else filename = file_index+"-q"+std::to_string(sampling); char* _f = (char *)filename.c_str(); int q = cds_static::RePairSLPIndex::load(_f, &idx_slp); // std::cout<<"slp-index loaded"<<std::endl; uint nocc,ptt; for (auto _ : st) { nocc = 0; ptt = 0; //#ifdef MEM_MONITOR // mm.event("R-INDEX-BUILD"); //#endif for (uint ii= 0; ii < MAX_SAMPLES && ii < patterns.size();++ii) { //std::string query; //query.resize(len); //std::copy(patterns[ii].begin(),patterns[ii].begin()+len,query.begin()); uint occs; uchar *tt = (uchar * )(patterns[ii].c_str()); // std::cout<<"slp -index query:"<<query<<std::endl; std::vector<uint> *pos = idx_slp->RePairSLPIndex::locate(tt,len, &occs); // std::sort(pos->begin(),pos->end()); // auto last = std::unique(pos->begin(),pos->end()); // pos->erase(last,pos->end()); delete pos; // nocc += occs; nocc += occs; ptt++; } // std::cout<<nocc<<std::endl; // sleep(2); } st.counters["pLen"] = len; st.counters["queries"] = ptt; st.counters["nOcc"] = nocc; st.counters["size"] = idx_slp->size(); delete idx_slp; }; auto gibslocate = [](benchmark::State &st, const string &file_index, const uint& len, bool trie //#ifdef MEM_MONITOR // , const std::string file_mem_monitor //#endif ){ /** * load gibsindex * */ std::fstream f (file_index+"-bs.gi",std::ios::in|std::ios::binary); SelfGrammarIndexBS idx_gibs; idx_gibs.load(f); // std::cout<<"bsgi-index loaded"<<std::endl; uint nocc,ptt; for (auto _ : st) { nocc = 0; ptt = 0; //#ifdef MEM_MONITOR // mm.event("R-INDEX-BUILD"); //#endif for (uint ii= 0; ii < MAX_SAMPLES && ii < patterns.size();++ii) { // std::cout<<"query:"<<ii<<std::endl; //std::string query; //query.resize(len); //std::copy(patterns[ii].begin(),patterns[ii].begin()+len,query.begin()); std::vector<uint> X; if(trie) idx_gibs.locate(patterns[ii],X); else idx_gibs.locateNoTrie(patterns[ii],X); // std::sort(X.begin(),X.end()); auto last = std::unique(X.begin(),X.end()); X.erase(last,X.end()); nocc += X.size(); ptt++; } // std::cout<<nocc<<std::endl; // sleep(2); } st.counters["pLen"] = len; st.counters["queries"] = ptt; st.counters["nOcc"] = nocc; if(trie){ st.counters["size"] = idx_gibs.size_in_bytes(); }else{ st.counters["size"] = idx_gibs.size_in_bytes() - idx_gibs.get_grammar().get_right_trie().size_in_bytes() - idx_gibs.get_grammar().get_left_trie().size_in_bytes(); } }; auto giptslocate = [](benchmark::State &st, const string &file_index, const uint& len, const uint& sampling,bool trie //#ifdef MEM_MONITOR // , const std::string file_mem_monitor //#endif ){ /** * load gibsindex * */ std::fstream fpts(file_index+"-pts-<"+std::to_string(sampling)+">.gi",std::ios::in|std::ios::binary); SelfGrammarIndexPTS idx_gipts(sampling); idx_gipts.load(fpts); // std::cout<<"bsgi-index loaded"<<std::endl; uint nocc,ptt; for (auto _ : st) { nocc = 0; ptt = 0; //#ifdef MEM_MONITOR // mm.event("R-INDEX-BUILD"); //#endif for (uint ii= 0; ii < MAX_SAMPLES && ii < patterns.size();++ii) { //std::string query; //query.resize(len); //std::copy(patterns[ii].begin(),patterns[ii].begin()+len,query.begin()); std::vector<uint> X; if(trie) idx_gipts.locate(patterns[ii],X); else idx_gipts.locateNoTrie(patterns[ii],X); std::sort(X.begin(),X.end()); auto last = std::unique(X.begin(),X.end()); X.erase(last,X.end()); nocc += X.size(); ptt++; } // std::cout<<nocc<<std::endl; // sleep(2); } st.counters["pLen"] = len; st.counters["queries"] = ptt; st.counters["nOcc"] = nocc; if(trie){ st.counters["size"] = idx_gipts.size_in_bytes(); }else{ st.counters["size"] = idx_gipts.size_in_bytes() - idx_gipts.get_grammar().get_right_trie().size_in_bytes() - idx_gipts.get_grammar().get_left_trie().size_in_bytes(); } // st.counters["size"] = idx_gipts.size_in_bytes(); }; auto giqgramlocate = [](benchmark::State &st, const string &file_index, const uint& len, const uint& sampling,int op = 0 //#ifdef MEM_MONITOR // , const std::string file_mem_monitor //#endif ){ /** * load gibsindex * */ std::fstream fbs (file_index+"-bs.gi",std::ios::in|std::ios::binary); std::ifstream f (file_index+"-gram-"+std::to_string(sampling)+"-smp.gi",std::ios::in|std::ios::binary); std::ifstream fg (file_index+"-gram-"+std::to_string(sampling)+"-smp-g.gi",std::ios::in|std::ios::binary); std::ifstream frev (file_index+"-gram-"+std::to_string(sampling)+"-smp-rev.gi",std::ios::in|std::ios::binary); std::ifstream fseq (file_index+"-gram-"+std::to_string(sampling)+"-smp-seq.gi",std::ios::in|std::ios::binary); SelfGrammarIndexBSQ idx_giqbs; idx_giqbs.load_basics(fbs); // std::cout<<"basic-index-loaded\n"; if(!f.is_open() || !fg.is_open() || !frev.is_open() || !fseq.is_open()){ std::cout<<file_index+"-gram-"+std::to_string(sampling)+"-smp.gi"<<std::endl; throw "ERROR OPENING FILES QGRAM"; } idx_giqbs.loadSampling(f,fg,frev,fseq); // std::cout<<"bsgi-index loaded"<<std::endl; uint queries,nocc; std::string ss; // ss.resize(len); for (auto _ : st) { queries = 0; nocc =0; //#ifdef MEM_MONITOR // mm.event("R-INDEX-BUILD"); //#endif for (uint ii= 0; ii < MAX_SAMPLES && ii < patterns.size();++ii) { // std::cout<<"start query\n"; //std::string query; //query.resize(len); //std::copy(patterns[ii].begin(),patterns[ii].begin()+len,query.begin()); std::vector<uint> X; // std::cout <<query<<"-"<< queries << std::endl; if(op == 2){ idx_giqbs.qgram_trie_locate(patterns[ii],X); }else{ if(op == 3){ idx_giqbs.qgram_locate_prefix_search(patterns[ii],X); } else{ idx_giqbs.qgram_dfs_locate(patterns[ii],X); } } nocc += X.size(); queries++; } } st.counters["pLen"] = len; st.counters["queries"] = queries; st.counters["nOcc"] = nocc; if(op == 2){ st.counters["size"] = idx_giqbs.size_in_bytes(); }else{ st.counters["size"] = idx_giqbs.size_in_bytes() - idx_giqbs.get_grammar().get_right_trie().size_in_bytes() - idx_giqbs.get_grammar().get_left_trie().size_in_bytes(); } // }; int main (int argc, char *argv[] ){ if(argc < 2){ std::cout<<"bad parameters...."<<std::endl; return 0; } /** * collection-name */ std::string index_prefix = argv[1]; std::string pattern_file = argv[2]; // uint min_len_patten = std::atoi(argv[3]); // uint max_len_patten = std::atoi(argv[4]); // uint gap_len_patten = std::atoi(argv[5]); // // std::cout<<"INV_PI_T: "<<INV_PI_T<<std::endl; std::cout<<"INV_PI_T_TRIE: "<<INV_PI_T_TRIE<<std::endl; std::cout<<"INV_PI_T_QGRAM: "<<INV_PI_T_QGRAM<<std::endl; #ifdef BUILD_EXTERNAL_INDEXES std::cout<<"RUNING EXTERNAL INDEXES: ON"<<std::endl; #endif #ifdef MEM_MONITOR std::cout<<"USING MEM_MONITOR: ON"<<std::endl; #endif #ifdef PRINT_LOGS std::cout<<"MODE LOG ACTIVE:ON"<<std::endl; #endif uint32_t i = load_patterns(pattern_file); if(!i) return 0; // load_patterns(pattern_file+"-"+std::to_string(max_len_patten)+".ptt",max_len_patten,1000); std::cout<<"PATTERNS LOADED FROM: "<<pattern_file<<std::endl; std::cout<<"PATTERN LEN: "<<i<<std::endl; // for (uint i = min_len_patten; i <= max_len_patten; i+=gap_len_patten) { // std::cout<<"PATTERN EXAMPLE: "<<patterns[0]<<std::endl; // std::cout<<"Searching patterns len:"<<i<<std::endl; //#ifdef BUILD_EXTERNAL_INDEXES // benchmark::RegisterBenchmark("R-INDEX",rilocate,index_prefix,i)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX<2>" ,slplocate,index_prefix,i,2)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX<4>" ,slplocate,index_prefix,i,4)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX<6>" ,slplocate,index_prefix,i,6)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX<8>" ,slplocate,index_prefix,i,8)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX<10>",slplocate,index_prefix,i,10)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX<12>",slplocate,index_prefix,i,12)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX-BAL<2>" ,slplocate,index_prefix,i,2,true)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX-BAL<4>" ,slplocate,index_prefix,i,4,true)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX-BAL<6>" ,slplocate,index_prefix,i,6,true)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX-BAL<8>" ,slplocate,index_prefix,i,8,true)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX-BAL<10>",slplocate,index_prefix,i,10,true)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("SLP-INDEX-BAL<12>",slplocate,index_prefix,i,12,true)->Unit(benchmark::kMicrosecond); //#endif // benchmark::RegisterBenchmark("G-INDEX-BINARY_SEARCH-TRIE",gibslocate,index_prefix,i,1)->Unit(benchmark::kMicrosecond); benchmark::RegisterBenchmark("G-INDEX-BINARY_SEARCH-NOTRIE",gibslocate,index_prefix,i,0)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<2>-TRIE",giptslocate,index_prefix,i,2,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<4>-TRIE",giptslocate,index_prefix,i,4,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<8>-TRIE",giptslocate,index_prefix,i,8,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<16>-TRIE",giptslocate,index_prefix,i,16,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<32>-TRIE",giptslocate,index_prefix,i,32,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<64>-TRIE",giptslocate,index_prefix,i,64,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<2>-NOTRIE",giptslocate,index_prefix,i,2,0)->Unit(benchmark::kMicrosecond); benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<4>-NOTRIE",giptslocate,index_prefix,i,4,0)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<8>-NOTRIE",giptslocate,index_prefix,i,8,0)->Unit(benchmark::kMicrosecond); benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<16>-NOTRIE",giptslocate,index_prefix,i,16,0)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<32>-NOTRIE",giptslocate,index_prefix,i,32,0)->Unit(benchmark::kMicrosecond); benchmark::RegisterBenchmark("G-INDEX-PATRICIA_TREE<64>-NOTRIE",giptslocate,index_prefix,i,64,0)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<2>-CMP_DFS" ,giqgramlocate,index_prefix,i,2,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<4>-CMP_DFS" ,giqgramlocate,index_prefix,i,4,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<6>-CMP_DFS" ,giqgramlocate,index_prefix,i,6,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<8>-CMP_DFS" ,giqgramlocate,index_prefix,i,8,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<10>-CMP_DFS",giqgramlocate,index_prefix,i,10,1)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<12>-CMP_DFS",giqgramlocate,index_prefix,i,12,1)->Unit(benchmark::kMicrosecond); // // benchmark::RegisterBenchmark("G-INDEX-QGRAM<2>-CMP_TRIE" ,giqgramlocate,index_prefix,i,2,2)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<4>-CMP_TRIE" ,giqgramlocate,index_prefix,i,4,2)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<6>-CMP_TRIE" ,giqgramlocate,index_prefix,i,6,2)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<8>-CMP_TRIE" ,giqgramlocate,index_prefix,i,8,2)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<10>-CMP_TRIE",giqgramlocate,index_prefix,i,10,2)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<12>-CMP_TRIE",giqgramlocate,index_prefix,i,12,2)->Unit(benchmark::kMicrosecond); // // benchmark::RegisterBenchmark("G-INDEX-QGRAM<2>-CMP_SMP" ,giqgramlocate,index_prefix,i,2,3)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<4>-CMP_SMP" ,giqgramlocate,index_prefix,i,4,3)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<6>-CMP_SMP" ,giqgramlocate,index_prefix,i,6,3)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<8>-CMP_SMP" ,giqgramlocate,index_prefix,i,8,3)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<10>-CMP_SMP",giqgramlocate,index_prefix,i,10,3)->Unit(benchmark::kMicrosecond); // benchmark::RegisterBenchmark("G-INDEX-QGRAM<12>-CMP_SMP",giqgramlocate,index_prefix,i,12,3)->Unit(benchmark::kMicrosecond); } benchmark::Initialize(&argc, argv); benchmark::RunSpecifiedBenchmarks(); return 0; }
[ "apachecom91@gmail.com" ]
apachecom91@gmail.com
7565563e4c95f452397102e39c44b4e8c8ddc93b
98ea884dfa0ccdef32c6a361b848e20f6ea6cbed
/Luni/src/Device/ByteOrder.h
061d8bacd8573ba73f2089b4b17a30785ab20a55
[]
no_license
dhahaj/Arduino-libraries
c95a4818326c6c59537d9e935f0854b98f13a0d4
9a67d0cd1ce80c60b668f6743c3d4ca66c3937b0
refs/heads/master
2021-01-01T18:46:32.105068
2018-02-16T18:55:13
2018-02-16T18:55:13
98,433,137
1
0
null
null
null
null
UTF-8
C++
false
false
3,107
h
#ifndef ByteOrder_h #define ByteOrder_h #include <stdint.h> /** * Extract and pack integer values using consecutive source address pointers. * * The buffer addresses addressOfBytesToPack and addressOfExtractedBytes are * both type uint8_t*. * * The host values that result from packing bytes are returned as signed ints * of the specified length NN (ie, int8_t, int16_t, or int32_t). If these * values are assigned to a wider signed integer type by the caller, they will * be sign extended. * * If you don't want sign extension, cast the macro result to uintNN before * assigning it to the wider variable. * * For example: * * With buf[0] = 0; * buf[1] = 0x80; * * // from16LE to long, no explicit cast of macro result * long value = from16LEToHost(buf); => -32768 (0xFFFF8000) * * // from16LE to long, macro result cast to uint16_t * long value = (uint16_t)from16LEToHost(buf); => 32768 (0x00008000) */ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ // The byte order on the host is Little Endian (LE). // The byte order in the byte array is Little Endian (LE). #define from8LEToHost(addressOfBytesToPack) ByteOrder::p1LE((addressOfBytesToPack)) #define from16LEToHost(addressOfBytesToPack) ByteOrder::p2LE((addressOfBytesToPack)) #define from32LEToHost(addressOfBytesToPack) ByteOrder::p4LE((addressOfBytesToPack)) #define fromHostTo8LE(value,addressOfExtractedBytes) ByteOrder::x1LE((value),(addressOfExtractedBytes)) #define fromHostTo16LE(value,addressOfExtractedBytes) ByteOrder::x2LE((value),(addressOfExtractedBytes)) #define fromHostTo32LE(value,addressOfExtractedBytes) ByteOrder::x4LE((value),(addressOfExtractedBytes)) // The byte order in the byte array is Big Endian (BE). #define from8BEToHost(addressOfBytesToPack) ByteOrder::p1BE((addressOfBytesToPack)) #define from16BEToHost(addressOfBytesToPack) ByteOrder::p2BE((addressOfBytesToPack)) #define from32BEToHost(addressOfBytesToPack) ByteOrder::p4BE((addressOfBytesToPack)) #define fromHostTo8BE(value,addressOfExtractedBytes) ByteOrder::x1BE((value),(addressOfExtractedBytes)) #define fromHostTo16BE(value,addressOfExtractedBytes) ByteOrder::x2BE((value),(addressOfExtractedBytes)) #define fromHostTo32BE(value,addressOfExtractedBytes) ByteOrder::x4BE((value),(addressOfExtractedBytes)) #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #error "ByteOrder is not implemented for BigEndian hosts yet." # else # error "Unrecognized __BYTE_ORDER__ value." # endif // These methods perform the extract, swap, and pack operations class ByteOrder { public: static void x1LE(uint8_t src, uint8_t *dst); static void x2LE(uint16_t src, uint8_t *dst); static void x4LE(uint32_t src, uint8_t *dst); static int8_t p1LE(uint8_t *src); static int16_t p2LE(uint8_t *src); static int32_t p4LE(uint8_t *src); static void x1BE(uint8_t src, uint8_t *dst); static void x2BE(uint16_t src, uint8_t *dst); static void x4BE(uint32_t src, uint8_t *dst); static int8_t p1BE(uint8_t *src); static int16_t p2BE(uint8_t *src); static int32_t p4BE(uint8_t *src); }; #endif
[ "dhahaj@gmail.com" ]
dhahaj@gmail.com
4027ec30a5eb08c9b9b07f7685b3a95349f48aa1
3d8af28c6c52b84d8ed861180bca95293d5b2e9c
/07_Classes/01_section_intro/Sales_data.cpp
5a3453fef338ce55a177051c96ac097060669234
[]
no_license
kwheelerj/Cpp__Primer_Exercises
9defe2ec87bafe114d6391f74763c393d8e5801b
3308636211510c273612743dd06f1c4657d290a0
refs/heads/master
2021-04-18T15:35:24.385064
2020-03-23T22:26:09
2020-03-23T22:26:09
249,558,073
0
0
null
null
null
null
UTF-8
C++
false
false
909
cpp
#include <iostream> #include "Sales_data.h" double Sales_data::avg_price() const { if (units_sold) return revenue / units_sold; return 0; } Sales_data& Sales_data::combine(const Sales_data &rhs) { units_sold += rhs.units_sold; revenue += rhs.revenue; return *this; } /* Nonmember Class-Related Functions */ std::istream &read(std::istream &is, Sales_data &item) { double price = 0; is >> item.bookNo >> item.units_sold >> price; item.revenue = price * item.units_sold; return is; } std::ostream &print(std::ostream &os, const Sales_data &item) { os << item.isbn() << " " << item.units_sold << " " << item.revenue << " " << item.avg_price(); return os; } Sales_data add(const Sales_data &lhs, const Sales_data &rhs) { Sales_data sum = lhs; sum.combine(rhs); return sum; } /* Constructor (defined outside the class body) */ Sales_data::Sales_data(std::istream &is) { read(is, *this); }
[ "kwheelerj@gmail.com" ]
kwheelerj@gmail.com
079dfbeb682e7ba1775a03cbada3162f1e14f86a
ec8ad01c26cdb5218ad70e8c73d139856b4753b7
/src/utils/time.cc
0188ad41629a69a7910c3f951935efb393425dca
[ "Apache-2.0" ]
permissive
shadow-yuan/raptor-lite
6458a78bdcdec7ed4eaaba0629c496e21d75e47d
b5e3c558b8ff4657ecdf298ff7ffe39ff5be7822
refs/heads/master
2023-03-26T21:38:57.092999
2021-03-23T02:32:26
2021-03-23T02:32:26
333,269,167
1
0
null
null
null
null
UTF-8
C++
false
false
1,511
cc
/* * * Copyright (c) 2020 The Raptor Authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include "raptor-lite/utils/time.h" #include <time.h> #ifdef _WIN32 #include <winsock.h> #else #include <sys/time.h> #endif #ifdef _WIN32 int gettimeofday(struct timeval *tp, void *tzp) { uint64_t ns100; FILETIME time; tzp = tzp; GetSystemTimeAsFileTime(&time); ns100 = (((int64_t)time.dwHighDateTime << 32) + time.dwLowDateTime) - 116444736000000000LL; tp->tv_sec = static_cast<int32_t>(ns100 / 10000000); tp->tv_usec = static_cast<int32_t>((ns100 % 10000000) / 10); return (0); } #endif int32_t GetTimeOfDay(raptor_time_spec *rts) { struct timeval tp; int r = gettimeofday(&tp, NULL); rts->tv_sec = tp.tv_sec; rts->tv_usec = tp.tv_usec; return r; } int64_t GetCurrentMilliseconds() { struct timeval tp; gettimeofday(&tp, nullptr); int64_t ret = tp.tv_sec; return ret * 1000 + tp.tv_usec / 1000; }
[ "1092421495@qq.com" ]
1092421495@qq.com
8d438731057bad88af86e8f5097be269ede3ce0b
2583eda260686c71c4f8398e388ee9eb10467f12
/Source/UserInterface/UIRoot.cpp
b049e774157f48266a793e3ee5764d225c45282a
[]
no_license
Niraka/ThirdYearProject
9c3e71a53af089b97e0961c7ae08acf8cb0d6d01
37efa04ec25705efca3797c22bd1b842677b673f
refs/heads/master
2021-01-11T21:57:09.932071
2017-01-13T20:33:45
2017-01-13T20:33:45
78,884,683
0
0
null
null
null
null
UTF-8
C++
false
false
229
cpp
#include "UIRoot.h" UIRoot::UIRoot(std::string sComponentName) : UIComponent(sComponentName) { } UIRoot::~UIRoot() { } void UIRoot::destroy() { } void UIRoot::onUpdate() { } void UIRoot::onDraw(sf::RenderTarget &target) { }
[ "nirakagames@hotmail.co.uk" ]
nirakagames@hotmail.co.uk
20e80a765af69424374f22128068e498f483b09c
6f0701d6fd3f9415c0f6f35723ccbb2ffe6188bd
/src/outputtype.cpp
f449ca4e543d2f1751f986369a46877dee60359b
[ "MIT" ]
permissive
pbitmonkey/bitmonkey-debug
a67729cabfa9c09936cba4830a5e2d664f84e813
f48bab02e88b1fcf445c59380e6fda018d86f462
refs/heads/master
2020-07-04T17:50:46.093449
2019-11-05T22:07:03
2019-11-05T22:07:03
202,359,547
0
1
null
null
null
null
UTF-8
C++
false
false
3,357
cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The bitmonkey Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <outputtype.h> #include <keystore.h> #include <pubkey.h> #include <script/script.h> #include <script/standard.h> #include <assert.h> #include <string> static const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy"; static const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT = "p2sh-segwit"; static const std::string OUTPUT_TYPE_STRING_BECH32 = "bech32"; bool ParseOutputType(const std::string& type, OutputType& output_type) { if (type == OUTPUT_TYPE_STRING_LEGACY) { output_type = OutputType::LEGACY; return true; } else if (type == OUTPUT_TYPE_STRING_P2SH_SEGWIT) { output_type = OutputType::P2SH_SEGWIT; return true; } else if (type == OUTPUT_TYPE_STRING_BECH32) { output_type = OutputType::BECH32; return true; } return false; } const std::string& FormatOutputType(OutputType type) { switch (type) { case OutputType::LEGACY: return OUTPUT_TYPE_STRING_LEGACY; case OutputType::P2SH_SEGWIT: return OUTPUT_TYPE_STRING_P2SH_SEGWIT; case OutputType::BECH32: return OUTPUT_TYPE_STRING_BECH32; default: assert(false); } } CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type) { switch (type) { case OutputType::LEGACY: return PKHash(key); case OutputType::P2SH_SEGWIT: case OutputType::BECH32: { if (!key.IsCompressed()) return PKHash(key); CTxDestination witdest = WitnessV0KeyHash(PKHash(key)); CScript witprog = GetScriptForDestination(witdest); if (type == OutputType::P2SH_SEGWIT) { return ScriptHash(witprog); } else { return witdest; } } default: assert(false); } } std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key) { PKHash keyid(key); if (key.IsCompressed()) { CTxDestination segwit = WitnessV0KeyHash(keyid); CTxDestination p2sh = ScriptHash(GetScriptForDestination(segwit)); return std::vector<CTxDestination>{std::move(keyid), std::move(p2sh), std::move(segwit)}; } else { return std::vector<CTxDestination>{std::move(keyid)}; } } CTxDestination AddAndGetDestinationForScript(CKeyStore& keystore, const CScript& script, OutputType type) { // Add script to keystore keystore.AddCScript(script); // Note that scripts over 520 bytes are not yet supported. switch (type) { case OutputType::LEGACY: return ScriptHash(script); case OutputType::P2SH_SEGWIT: case OutputType::BECH32: { CTxDestination witdest = WitnessV0ScriptHash(script); CScript witprog = GetScriptForDestination(witdest); // Check if the resulting program is solvable (i.e. doesn't use an uncompressed key) if (!IsSolvable(keystore, witprog)) return ScriptHash(script); // Add the redeemscript, so that P2WSH and P2SH-P2WSH outputs are recognized as ours. keystore.AddCScript(witprog); if (type == OutputType::BECH32) { return witdest; } else { return ScriptHash(witprog); } } default: assert(false); } }
[ "52039398+Bitmonkeyp@users.noreply.github.com" ]
52039398+Bitmonkeyp@users.noreply.github.com
812ae33d5810b063841d2aafaeddacab9ba1b50b
67d616bdde1b978f6d43a0d540471ec111a93827
/cpp/oop_in_cpp_part_two/polyhedra_oop_2/PolyhedronFactory.cpp
119ca2c95ec6dc5096a60da131fc0f463cbcd87b
[]
no_license
Crusaton/cs330fall2020
6efad5dcd0d14bca6a2bba00129c9a43e3964769
282827769eb4f737b6c12ac730cee90f73a2ff45
refs/heads/main
2023-01-30T11:19:04.390813
2020-12-08T01:13:28
2020-12-08T01:13:28
314,138,571
0
0
null
null
null
null
UTF-8
C++
false
false
1,632
cpp
#include "PolyhedronFactory.h" #include "Sphere.h" #include "Cylinder.h" #include "Composite.h" #include <iterator> #include <algorithm> PolyhedronFactory::PolyhedronPair PolyhedronFactory::_known_polyhedra[] = { {"sphere" , new Sphere()}, {"composite", new Composite()}, {"cylinder" , new Cylinder()} }; //------------------------------------------------------------------------------ Polyhedron* PolyhedronFactory::createPolyhedron(std::string name) { for(const PolyhedronPair& pair : _known_polyhedra) { if(pair.first == name) { return pair.second->clone(); } } // A polygon with the given name could not be found return nullptr; } //------------------------------------------------------------------------------ bool PolyhedronFactory::isKnown(std::string name) { const auto it = std::find_if(std::begin(_known_polyhedra), std::end(_known_polyhedra), [&name](const PolyhedronPair& pairToCheck) { return pairToCheck.first == name; }); return it != std::end(_known_polyhedra); } //------------------------------------------------------------------------------ void PolyhedronFactory::listKnown(std::ostream& outs) { for(const PolyhedronPair& pair : _known_polyhedra) { outs << " " << pair.first << "\n"; } } //------------------------------------------------------------------------------ int PolyhedronFactory::numberKnown() { return std::end(_known_polyhedra) - std::begin(_known_polyhedra); }
[ "prodr004@odu.edu" ]
prodr004@odu.edu
f7365d5418be77ced89ea2fbbd4cdadba57f5336
dcb75b10a352d9cfc0ae31f28679a2d56b10b875
/Source/Mordhau/MordhauInput.h
f7576b1e2d5920c1300a4a724e0cd2c4dded3184
[]
no_license
Net-Slayer/Mordhau_uSDK
df5a096c21eb43e910c9b90c69ece495384608e0
c4ff76b5d7462fc6ccad176bd8f1db2efdd2c910
refs/heads/master
2023-04-28T02:48:14.072100
2021-12-15T16:35:08
2021-12-15T16:35:08
301,417,546
3
1
null
2021-08-23T13:23:29
2020-10-05T13:26:39
C++
UTF-8
C++
false
false
11,752
h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "UObject/NoExportTypes.h" #include "Mordhau.h" #include "Runtime/InputCore/Classes/InputCoreTypes.h" #include "Runtime/Engine/Classes/GameFramework/PlayerInput.h" #include "MordhauInput.generated.h" /** * */ UCLASS(Blueprintable) class MORDHAU_API UMordhauInput : public UObject { GENERATED_BODY() public: UPROPERTY(BlueprintReadOnly, VisibleAnywhere) TArray<struct FInputActionKeyMapping> ActionMappings; //(ZeroConstructor, Config) UPROPERTY() TArray<struct FInputAxisConfigEntry> AxisConfig; //(ZeroConstructor, Config) UPROPERTY() TArray<struct FInputAxisKeyMapping> AxisMappings; //(ZeroConstructor, Config) UPROPERTY() TArray<struct FKey> ConsoleKeys; //(ZeroConstructor, Config) UPROPERTY() bool bDefaultBindingsChecked; //(ZeroConstructor, IsPlainOldData) UPROPERTY() bool bGamepadLeftXInverted; //(ZeroConstructor, IsPlainOldData) UPROPERTY() bool bGamepadLeftYInverted; //(ZeroConstructor, IsPlainOldData) UPROPERTY() bool bGamepadRightXInverted; //(ZeroConstructor, IsPlainOldData) UPROPERTY() bool bGamepadRightYInverted; //(ZeroConstructor, IsPlainOldData) UPROPERTY() bool bMouseXInverted; //(ZeroConstructor, IsPlainOldData) UPROPERTY() bool bMouseYInverted; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float GamepadLeftXDeadzone; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float GamepadLeftXSensitivity; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float GamepadLeftYDeadzone; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float GamepadLeftYSensitivity; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float GamepadRightXDeadzone; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float GamepadRightXSensitivity; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float GamepadRightYDeadzone; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float GamepadRightYSensitivity; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float MouseXSensitivity; //(ZeroConstructor, IsPlainOldData) UPROPERTY() float MouseYSensitivity; //(ZeroConstructor, IsPlainOldData) UPROPERTY() int AngleAttackAfterPress; //(ZeroConstructor, Config, IsPlainOldData) UPROPERTY() int AngleAttacksWithMovement; //(ZeroConstructor, Config, IsPlainOldData) UPROPERTY() int ControlScheme; //(ZeroConstructor, Config, IsPlainOldData) UPROPERTY() int InverseAttackDirectionX; //(ZeroConstructor, Config, IsPlainOldData) UPROPERTY() int InverseAttackDirectionY; //(ZeroConstructor, Config, IsPlainOldData) UPROPERTY() int MouseXIsFlipAttackSide; //(ZeroConstructor, Config, IsPlainOldData) UPROPERTY() int ToggleSprint; //(ZeroConstructor, Config, IsPlainOldData) UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetToggleSprint(int NewToggleSprint); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetMouseYSensitivity(float NewSensitivity); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetMouseYInverted(bool bNewInverted); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetMouseXSensitivity(float NewSensitivity); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetMouseXIsFlipAttackSide(int NewIsFlipAttackSide); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetMouseXInverted(bool bNewInverted); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetInverseAttackDirectionY(int NewInverseAttackDirectionX); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetInverseAttackDirectionX(int NewInverseAttackDirectionX); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadRightYSensitivity(float NewSensitivity); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadRightYInverted(bool bNewInverted); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadRightYDeadzone(float NewDeadzone); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadRightXSensitivity(float NewSensitivity); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadRightXInverted(bool bNewInverted); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadRightXDeadzone(float NewDeadzone); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadLeftYSensitivity(float NewSensitivity); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadLeftYInverted(bool bNewInverted); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadLeftYDeadzone(float NewDeadzone); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadLeftXSensitivity(float NewSensitivity); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadLeftXInverted(bool bNewInverted); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetGamepadLeftXDeadzone(float NewDeadzone); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetControlScheme(int NewControlScheme); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetAngleAttacksWithMovement(int NewAngleAttacksWithMovement); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SetAngleAttackAfterPress(int NewAngleAttackAfterPress); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void SaveSettings(); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void RestoreDefaultSettings(); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") int GetToggleSprint(); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") struct FInputAxisKeyMapping GetSecondaryAxisKeyBinding(const FName& AxisName); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") struct FInputActionKeyMapping GetSecondaryActionKeyBinding(const FName& ActionName); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") struct FInputAxisKeyMapping GetPrimaryAxisKeyBinding(const FName& AxisName); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") struct FInputActionKeyMapping GetPrimaryActionKeyBinding(const FName& ActionName); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetMouseYSensitivity() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") bool GetMouseYInverted() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetMouseXSensitivity() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") int GetMouseXIsFlipAttackSide() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") bool GetMouseXInverted() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") struct FVector2D GetMouseSensitivityLimits() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") int GetInverseAttackDirectionY() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") int GetInverseAttackDirectionX() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") struct FVector2D GetGamepadSensitivityLimits() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetGamepadRightYSensitivity() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") bool GetGamepadRightYInverted() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetGamepadRightYDeadzone() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetGamepadRightXSensitivity() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") bool GetGamepadRightXInverted() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetGamepadRightXDeadzone() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetGamepadLeftYSensitivity() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") bool GetGamepadLeftYInverted() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetGamepadLeftYDeadzone() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetGamepadLeftXSensitivity() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") bool GetGamepadLeftXInverted() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") float GetGamepadLeftXDeadzone() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") struct FVector2D GetGamepadDeadzoneLimits() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") int GetControlScheme() const; UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") void GetConsoleKeyBindings(TArray<struct FKey>& ConsoleKeyBindings); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") static float GetAxisScale(const struct FInputAxisKeyMapping& AxisKeyBinding); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") static FName GetAxisOppositeDirectionName(const FName& AxisName); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") static FName GetAxisName(const struct FInputAxisKeyMapping& AxisKeyBinding); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") void GetAxisKeyBindings(TArray<struct FInputAxisKeyMapping>& AxisKeyBindings); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") static struct FKey GetAxisKey(const struct FInputAxisKeyMapping& AxisKeyBinding); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") int GetAngleAttacksWithMovement(); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") int GetAngleAttackAfterPress(); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") static FName GetActionName(const struct FInputActionKeyMapping& ActionKeyBinding); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") void GetActionKeyBindings(TArray<struct FInputActionKeyMapping>& ActionKeyBindings); UFUNCTION(BlueprintCallable, BlueprintGetter, BlueprintPure, Category = "MordhauInputFns") static struct FKey GetActionKey(const struct FInputActionKeyMapping& ActionKeyBinding); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void ClearKeyBindings(); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void ApplySettings(); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void AddConsoleKeyBinding(const struct FKey& Key); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void AddAxisKeyBinding(const FName& AxisName, const struct FKey& Key); UFUNCTION(BlueprintCallable, Category = "MordhauInputFns") void AddActionKeyBinding(const FName& ActionName, const struct FKey& Key); };
[ "talon_hq@outlook.com" ]
talon_hq@outlook.com
9c99573cb0c89f42f6499a5009f23270c28f7fa7
fb7efe44f4d9f30d623f880d0eb620f3a81f0fbd
/components/signin/core/browser/account_tracker_service.h
cc4035c4db41711c9395c5b5527c38164b903c7d
[ "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
5,982
h
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ #include <list> #include <map> #include <string> #include <vector> #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/observer_list.h" #include "base/sequence_checker.h" #include "base/timer/timer.h" #include "components/keyed_service/core/keyed_service.h" #include "components/signin/core/browser/account_info.h" #include "google_apis/gaia/gaia_auth_util.h" class PrefService; class SigninClient; namespace base { class DictionaryValue; } namespace user_prefs { class PrefRegistrySyncable; } // AccountTrackerService is a KeyedService that retrieves and caches GAIA // information about Google Accounts. class AccountTrackerService : public KeyedService { public: // Name of the preference property that persists the account information // tracked by this service. static const char kAccountInfoPref[]; // TODO(mlerman): Remove all references to Profile::kNoHostedDomainFound in // favour of this. // Value representing no hosted domain in the kProfileHostedDomain preference. static const char kNoHostedDomainFound[]; // Value representing no picture URL associated with an account. static const char kNoPictureURLFound[]; // TODO(knn): Move to ChildAccountInfoFetcher once deprecated service flags // have been migrated from preferences. // Child account service flag name. static const char kChildAccountServiceFlag[]; // Clients of AccountTrackerService can implement this interface and register // with AddObserver() to learn about account information changes. class Observer { public: virtual ~Observer() {} virtual void OnAccountUpdated(const AccountInfo& info) {} virtual void OnAccountUpdateFailed(const std::string& account_id) {} virtual void OnAccountRemoved(const AccountInfo& info) {} }; // Possible values for the kAccountIdMigrationState preference. enum AccountIdMigrationState { MIGRATION_NOT_STARTED, MIGRATION_IN_PROGRESS, MIGRATION_DONE, // Keep in sync with OAuth2LoginAccountRevokedMigrationState histogram enum. NUM_MIGRATION_STATES }; AccountTrackerService(); ~AccountTrackerService() override; // Registers the preferences used by AccountTrackerService. static void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry); // KeyedService implementation. void Shutdown() override; void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); // Take a SigninClient rather than a PrefService and a URLRequestContextGetter // since RequestContext cannot be created at startup. // (see http://crbug.com/171406) void Initialize(SigninClient* signin_client); // Returns the list of known accounts and for which gaia IDs // have been fetched. std::vector<AccountInfo> GetAccounts() const; AccountInfo GetAccountInfo(const std::string& account_id) const; AccountInfo FindAccountInfoByGaiaId(const std::string& gaia_id) const; AccountInfo FindAccountInfoByEmail(const std::string& email) const; // Picks the correct account_id for the specified account depending on the // migration state. std::string PickAccountIdForAccount(const std::string& gaia, const std::string& email) const; static std::string PickAccountIdForAccount(const PrefService* pref_service, const std::string& gaia, const std::string& email); // Seeds the account whose account_id is given by PickAccountIdForAccount() // with its corresponding gaia id and email address. Returns the same // value PickAccountIdForAccount() when given the same arguments. std::string SeedAccountInfo(const std::string& gaia, const std::string& email); // Seeds the account represented by |info|. If the account is already tracked // and compatible, the empty fields will be updated with values from |info|. // If after the update IsValid() is true, OnAccountUpdated will be fired. std::string SeedAccountInfo(AccountInfo info); void RemoveAccount(const std::string& account_id); AccountIdMigrationState GetMigrationState() const; void SetMigrationDone(); static AccountIdMigrationState GetMigrationState( const PrefService* pref_service); protected: // Available to be called in tests. void SetAccountStateFromUserInfo(const std::string& account_id, const base::DictionaryValue* user_info); void SetIsChildAccount(const std::string& account_id, const bool& is_child_account); private: friend class AccountFetcherService; friend class FakeAccountFetcherService; struct AccountState { AccountInfo info; }; void NotifyAccountUpdated(const AccountState& state); void NotifyAccountUpdateFailed(const std::string& account_id); void NotifyAccountRemoved(const AccountState& state); void StartTrackingAccount(const std::string& account_id); void StopTrackingAccount(const std::string& account_id); // Load the current state of the account info from the preferences file. void LoadFromPrefs(); void SaveToPrefs(const AccountState& account); void RemoveFromPrefs(const AccountState& account); // Gaia id migration. bool IsMigratable() const; void MigrateToGaiaId(); void SetMigrationState(AccountIdMigrationState state); SigninClient* signin_client_; // Not owned. std::map<std::string, AccountState> accounts_; base::ObserverList<Observer> observer_list_; SEQUENCE_CHECKER(sequence_checker_); DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); }; #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_
[ "jacob-chen@iotwrt.com" ]
jacob-chen@iotwrt.com
582ed90a368ed3d815742962402262d7e1978181
95b4c39aa258a484e867027328efc9ff6010b1db
/db/src/Storages/MergeTree/MergeTreeDataMerger.cc
3c32ceac739cb6cd51a1d4b9763736200aeed534
[]
no_license
wusihang/db
d9d1067d4e4a145a56682cffaab64371079833a4
2d17871abd6135fbf60cd3083e78a6f79e7584ea
refs/heads/master
2020-03-13T06:57:04.561319
2018-11-27T00:51:12
2018-11-27T00:51:12
131,015,240
0
1
null
2018-11-27T00:51:13
2018-04-25T14:01:22
C
UTF-8
C++
false
false
1,015
cc
#include<Storages/MergeTree/MergeTreeDataMerger.h> #include<Storages/BackgroundProcessingPool.h> namespace Storage { MergeTreeDataMerger::MergeTreeDataMerger(MergeTreeData& data_, const BackgroundProcessingPool& pool_) :data(data_),pool(pool_) { } size_t MergeTreeDataMerger::estimateDiskSpaceForMerge(const MergeTreeData::DataPartsVector& parts) { return 0; } size_t MergeTreeDataMerger::getMaxPartsSizeForMerge() { return 0; } size_t MergeTreeDataMerger::getMaxPartsSizeForMerge(size_t pool_size, size_t pool_used) { return 0; } bool MergeTreeDataMerger::selectAllPartsToMergeWithinPartition(MergeTreeData::DataPartsVector& what, std::string& merged_name, size_t available_disk_space, const AllowedMergingPredicate& can_merge, const std::string& partition_id) { return true; } bool MergeTreeDataMerger::selectPartsToMerge(MergeTreeData::DataPartsVector& what, std::string& merged_name, bool aggressive, size_t max_total_size_to_merge, const AllowedMergingPredicate& can_merge) { return true; } }
[ "wusihang9@139.com" ]
wusihang9@139.com
8e37cb949889c109952d025b74e7fb9edc9c8006
29c0d375a7aec7887f776f085c8e2b1162fc34e3
/Kulka.h
9f8812697a4d7d5c72ef3fa24aa751e9a04dd8a7
[ "MIT" ]
permissive
sheirys/tankai-praktika
83b43e269f53dc10e384453477fd046140d06f7e
42f77ee3c30560179c2015d7400d18a7d4de5ec0
refs/heads/master
2021-05-16T01:57:43.310666
2016-10-31T18:11:48
2016-10-31T18:11:48
3,422,063
2
0
null
null
null
null
UTF-8
C++
false
false
556
h
#ifndef _KULKA_H_ #define _KULKA_H_ #include <math.h> #include "SDL/SDL.h" #include "SDL/SDL_image.h" #include "SDL/SDL_rotozoom.h" #include "CLoad_image.h" #include "ImageLoader.h" class Kulka { private: int X, Y; double kampas; SDL_Surface* Klk; bool begin(); bool begin(ImageLoader& images); public: SDL_Surface* KPasukta; Kulka(int X, int Y, double kampas); ~Kulka(); int GetX(); int GetY(); void Atnaujinti(); }; #endif
[ "sheirys2@gmail.com" ]
sheirys2@gmail.com
ce1ac037117dcdcc85a2dc1beecef95bc1323d51
5d563699e7a0ee2189c06211ccae65207cae8c0d
/src/BaseDecorator.h
548ae8972c75d3207bba7d96fc1b67445443da0f
[ "MIT" ]
permissive
boynux/arduino-display
a5b7e2b218d9d759c5cbf8a27a465ea048957e54
4588ea919c21694fc18799e04e0aa1c5e036f63b
refs/heads/main
2023-04-02T23:03:35.042557
2021-04-13T21:07:34
2021-04-13T21:07:34
353,483,885
1
0
null
null
null
null
UTF-8
C++
false
false
264
h
#ifndef _BASE_DECORATOR_H #define _BASE_DECORATOR_H #include "BaseGrid.h" class BaseDecorator: public BaseGrid { public: BaseDecorator(int width, int height, BaseGrid *grid): BaseGrid(width, height), _grid(grid) {} protected: BaseGrid *_grid; }; #endif
[ "boynux@gmail.com" ]
boynux@gmail.com
f29c17b6dbe323f0d579e50da013268283a03808
d1e4718197ba3bddd13d6f6958e1d5a492b51af5
/Geometry/intersect.h
3720bd60d3e052dd5d752fcc8c697fbd11771874
[]
no_license
reisoftware/ap2d
1f398664fdc4f8cab9479df18cd2a745f904cdff
e09732655ef66e13e98b8f3b008c91dac541e1f5
refs/heads/master
2022-01-22T05:36:56.295845
2022-01-04T05:31:57
2022-01-04T05:31:57
162,372,004
1
0
null
null
null
null
GB18030
C++
false
false
2,031
h
#ifndef _GEOMETRY_INTERSECT_H_ #define _GEOMETRY_INTERSECT_H_ #include "export.h" #include <set> namespace geo{ class Point; class LLine; class RLine; class SLine; class Circle; class Arc; class Box; ////返回值表示交点数量,没有交点返回0. ////交点写入pt参数. GEOAPI int intersect2d(const LLine& ln1, const LLine& ln2, Point& pt); GEOAPI int intersect2d(const RLine& ln1, const LLine& ln2, Point& pt); GEOAPI int intersect2d(const RLine& ln1, const RLine& ln2, Point& pt); GEOAPI int intersect2d(const SLine& ln1, const LLine& ln2, Point& pt); GEOAPI int intersect2d(const SLine& ln1, const RLine& ln2, Point& pt); GEOAPI int intersect2d(const SLine& ln1, const SLine& ln2, Point& pt); GEOAPI int intersect2d(const Circle& lhs, const LLine & rhs, Point& pt1, Point& pt2); GEOAPI int intersect2d(const Circle& lhs, const RLine & rhs, Point& pt1, Point& pt2); GEOAPI int intersect2d(const Circle& lhs, const SLine & rhs, Point& pt1, Point& pt2); GEOAPI int intersect2d(const Circle& lhs, const Circle& rhs, Point& pt1, Point& pt2); GEOAPI int intersect2d(const Arc& lhs, const LLine & rhs, Point& pt1, Point& pt2); GEOAPI int intersect2d(const Arc& lhs, const RLine & rhs, Point& pt1, Point& pt2); GEOAPI int intersect2d(const Arc& lhs, const SLine & rhs, Point& pt1, Point& pt2); GEOAPI int intersect2d(const Arc& lhs, const Circle& rhs, Point& pt1, Point& pt2); GEOAPI int intersect2d(const Arc& lhs, const Arc & rhs, Point& pt1, Point& pt2); GEOAPI void intersect2d(const LLine& ln, const Box& box, std::set<Point>& pts); GEOAPI void intersect2d(const RLine& rl, const Box& box, std::set<Point>& pts); GEOAPI void intersect2d(const SLine& sl, const Box& box, std::set<Point>& pts); GEOAPI void intersect2d(const Circle& c, const Box& box, std::set<Point>& pts); GEOAPI void intersect2d(const Arc& arc, const Box& box, std::set<Point>& pts); GEOAPI void intersect2d(const Box& box1, const Box& box2, std::set<Point>& pts); }//namespace #endif//FILE
[ "tian_bj@126.com" ]
tian_bj@126.com
a300baed5ec6b62eedba71bfe7b600cba3ce4eb9
26ed6bf23adb58b30034d281316085a707c9561d
/yao/YaoBase.h
686cf3f903d7d9baf84b0b7f999eafe8a6e3c374
[]
no_license
FICS/smcsgx
9d0b49fdab45bd232fce06ad8808315a5ab32d6e
6b8e3cb9e2c82fa12a538f55295a91037dc12d8a
refs/heads/master
2020-05-19T01:54:34.601704
2019-05-08T01:35:51
2019-05-08T01:35:51
184,767,966
7
1
null
null
null
null
UTF-8
C++
false
false
2,860
h
#ifndef YAOBASE_H_ #define YAOBASE_H_ #include <stdio.h> #include <sys/time.h> #include <unistd.h> #include <string> #include <vector> #include "Env.h" #include "NetIO.h" #ifdef GEN_CODE // User mode (code for the generator) #define GEN_BEGIN #define GEN_END #define EVL_BEGIN if (0) { #define EVL_END } #define GEN_SEND(d) Env::remote()->write_bytes(d) #define EVL_RECV() Env::remote()->read_bytes() #define EVL_SEND(d) Env::remote()->write_bytes(d) #define GEN_RECV() Env::remote()->read_bytes() #define GEN_SEND2(d,c) Env::remote()->write_bytes(d,c) #define EVL_RECV2(d,c) Env::remote()->read_bytes(d,c) #elif defined EVL_CODE // User mode (code for the evaluator) #define GEN_BEGIN if (0) { #define GEN_END } #define EVL_BEGIN #define EVL_END #define GEN_SEND(d) Env::remote()->write_bytes(d) #define EVL_RECV() Env::remote()->read_bytes() #define EVL_SEND(d) Env::remote()->write_bytes(d) #define GEN_RECV() Env::remote()->read_bytes() #define GEN_SEND2(d,c) Env::remote()->write_bytes(d,c) #define EVL_RECV2(d,c) Env::remote()->read_bytes(d,c) #else // Simulation mode #define GEN_BEGIN if (!Env::is_evl()) { #define GEN_END } #define GEN_SEND(d) send_data(Env::world_rank()+1, (d)) #define GEN_RECV() recv_data(Env::world_rank()+1) #define EVL_BEGIN if ( Env::is_evl()) { #define EVL_END } #define EVL_SEND(d) send_data(Env::world_rank()-1, (d)) #define EVL_RECV() recv_data(Env::world_rank()-1) #endif class YaoBase { public: void init_private(string s); YaoBase(EnvParams &params); virtual ~YaoBase(); virtual void start() = 0; private: void init_cluster(EnvParams &params); void init_network(EnvParams &params); void init_environ(EnvParams &params); void init_private(EnvParams &params); struct timeval startt, endt; long mtime, seconds, useconds; protected: // subroutines for the communication in the Simulation mode Bytes recv_data(int src_node); void send_data(int dst_node, const Bytes &data); // subroutines for profiling void step_init(); void step_report(std::string step_name); void final_report(); protected: // variables for MPI // variables for profiling double m_timer_gen; double m_timer_evl; double m_timer_com; // inter-cluster communication double m_timer_mpi; // intra-cluster communication uint64_t m_comm_sz; vector<double> m_timer_cmp_vec; vector<double> m_timer_mpi_vec; vector<double> m_timer_cmm_vec; vector<std::string> m_step_name_vec; vector<uint64_t> m_comm_sz_vec; // variables for Yao protocol Bytes m_evl_inp; Bytes m_gen_inp; Bytes m_gen_out; Bytes m_evl_out; Prng m_prng; }; #endif
[ "choijoseph007@ufl.edu" ]
choijoseph007@ufl.edu
15b824e3ed2e2ace0f89695ebf18042a6148a5d5
ca9558ab2a4f63cd3e8fcf9a02877699c5de44a7
/C++_Programming/Binary_Search.cpp
2a8f9aabe0eaa2001a3f81dec987056a869aa509
[]
no_license
InamuddinAhmed/programming.files.github.io
1fb96c0206604f1b99c6fdb90fbafae16406e421
6a268bd92f36de5154d2c351aee94d195d15d6a0
refs/heads/main
2023-08-18T06:21:07.444771
2021-10-12T12:31:38
2021-10-12T12:31:38
412,725,431
0
0
null
null
null
null
UTF-8
C++
false
false
678
cpp
#include<iostream> #include<stdio.h> #include<conio.h> using namespace std; int main() { int c,first,last,middle,n,search,array[100]; cout<<"Enter number of elements :"; cin>>n; cout<<"Enter "<<n<<" elements"<<endl; for(c=0;c<n;c++) cin>>array[c]; cout<<"Enter the value to find :"; cin>>search; first=0; last=n-1; middle=(first+last)/2; while(first<=last) { if(array[middle]<search) first=middle+1; else if(array[middle]==search) { cout<<search<<" found at location "<<middle+1; break; } else last=middle-1; middle=(first+last)/2; } if(first>last) cout<<"Not found! "<<search<<" is not present in the list."; getch(); return 0; }
[ "inamuddinahmed49@gmail.com" ]
inamuddinahmed49@gmail.com
1ce1360bea783e031792a1c4c5d8cdca8236224b
0e8a83f942ff2ef751ae7f38c6069112a384d952
/Tree/606. Construct String from Binary Tree.cpp
957ef26ba66c413abccc673eb8007d9c55c78172
[]
no_license
Jason101616/LeetCode_Solution
b1b9b4dd76e6504d3bbd2f05174ed57f11d690ea
e7e529f2c04dc0cca8d823b7774871974422f7a6
refs/heads/master
2021-06-04T21:45:44.024330
2021-05-06T03:06:03
2021-05-06T03:06:03
83,309,093
2
1
null
null
null
null
UTF-8
C++
false
false
1,547
cpp
/* You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be represented by empty parenthesis pair "()". And you need to omit all the empty parenthesis pairs that don't affect the one-to-one mapping relationship between the string and the original binary tree. Example 1: Input: Binary tree: [1,2,3,4] 1 / \ 2 3 / 4 Output: "1(2(4))(3)" Explanation: Originallay it needs to be "1(2(4)())(3()())", but you need to omit all the unnecessary empty parenthesis pairs. And it will be "1(2(4))(3)". Example 2: Input: Binary tree: [1,2,3,null,4] 1 / \ 2 3 \ 4 Output: "1(2()(4))(3)" Explanation: Almost the same as the first example, except we can't omit the first parenthesis pair to break the one-to-one mapping relationship between the input and the output. */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: string tree2str(TreeNode* t) { if (!t) { return ""; } string ret = to_string(t->val); if (t->left) { ret += ("(" + tree2str(t->left) + ")"); } else if (t->right) { ret += "()"; } if (t->right) { ret += ("(" + tree2str(t->right) + ")"); } return ret; } };
[ "duz1@andrew.cmu.edu" ]
duz1@andrew.cmu.edu
1708856c2a0c9e38d23f9f1ef14c138a6cf9ffaf
97e2233be1e152174f2d7138bccdffd4b438ec35
/src/odil/registry_0038.h
3eeca01301691012f6bcb6e5729ee3c8f0eec54d
[ "LicenseRef-scancode-cecill-b-en" ]
permissive
lamyj/odil
a5eea306c478bacd304fa6bd14808c65e5b059cd
7e50e4eaccb5e7d6d6716705ff6252d342f60685
refs/heads/master
2022-11-21T07:09:24.547750
2022-04-23T07:21:52
2022-04-23T07:21:52
33,601,264
77
25
NOASSERTION
2022-09-12T19:55:28
2015-04-08T10:55:06
C++
UTF-8
C++
false
false
2,174
h
/************************************************************************* * odil - Copyright (C) Universite de Strasbourg * Distributed under the terms of the CeCILL-B license, as published by * the CEA-CNRS-INRIA. Refer to the LICENSE file or to * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html * for details. ************************************************************************/ #ifndef _afc7b2d7_0869_4fea_9a9b_7fe6228baca9_0038 #define _afc7b2d7_0869_4fea_9a9b_7fe6228baca9_0038 #include <map> #include <string> #include "odil/odil.h" #include "odil/Tag.h" namespace odil { namespace registry { Tag const ReferencedPatientAliasSequence(0x0038, 0x0004); Tag const VisitStatusID(0x0038, 0x0008); Tag const AdmissionID(0x0038, 0x0010); Tag const IssuerOfAdmissionID(0x0038, 0x0011); Tag const IssuerOfAdmissionIDSequence(0x0038, 0x0014); Tag const RouteOfAdmissions(0x0038, 0x0016); Tag const ScheduledAdmissionDate(0x0038, 0x001a); Tag const ScheduledAdmissionTime(0x0038, 0x001b); Tag const ScheduledDischargeDate(0x0038, 0x001c); Tag const ScheduledDischargeTime(0x0038, 0x001d); Tag const ScheduledPatientInstitutionResidence(0x0038, 0x001e); Tag const AdmittingDate(0x0038, 0x0020); Tag const AdmittingTime(0x0038, 0x0021); Tag const DischargeDate(0x0038, 0x0030); Tag const DischargeTime(0x0038, 0x0032); Tag const DischargeDiagnosisDescription(0x0038, 0x0040); Tag const DischargeDiagnosisCodeSequence(0x0038, 0x0044); Tag const SpecialNeeds(0x0038, 0x0050); Tag const ServiceEpisodeID(0x0038, 0x0060); Tag const IssuerOfServiceEpisodeID(0x0038, 0x0061); Tag const ServiceEpisodeDescription(0x0038, 0x0062); Tag const IssuerOfServiceEpisodeIDSequence(0x0038, 0x0064); Tag const PertinentDocumentsSequence(0x0038, 0x0100); Tag const PertinentResourcesSequence(0x0038, 0x0101); Tag const ResourceDescription(0x0038, 0x0102); Tag const CurrentPatientLocation(0x0038, 0x0300); Tag const PatientInstitutionResidence(0x0038, 0x0400); Tag const PatientState(0x0038, 0x0500); Tag const PatientClinicalTrialParticipationSequence(0x0038, 0x0502); Tag const VisitComments(0x0038, 0x4000); } } #endif // _afc7b2d7_0869_4fea_9a9b_7fe6228baca9_0038
[ "lamy@unistra.fr" ]
lamy@unistra.fr
9a0be2fac7d439c749d99c190e2be0e101b168da
b6f99e7638f41fe2e2d6cedf6ca130dbbf1aeae4
/Pengine/PengineWindow.cpp
6205473b21478faaa55663bc1b51ecd4077c0576
[]
no_license
spedroq/Bloblin
3ce918324ce09e219c2f50cb3f92292b23eb3453
a248c6735a057a33416a87acf5fbda0236c738d7
refs/heads/master
2021-09-13T11:56:12.313714
2017-09-12T10:35:05
2017-09-12T10:35:05
103,255,420
0
0
null
null
null
null
UTF-8
C++
false
false
2,008
cpp
#include "PengineWindow.h" #include "PengineErrors.h" #include <SDL/SDL_image.h> namespace Pengine { Window::Window() { } Window::~Window() { } int Window::create(std::string windowName, int screenWidth, int screenHeight, unsigned int currentFlags) { // window flags Uint32 flags = SDL_WINDOW_OPENGL; if (currentFlags & INVISIBLE) { flags |= SDL_WINDOW_HIDDEN; } if (currentFlags & FULLSCREEN) { flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; } if (currentFlags & BORDERLESS) { flags |= SDL_WINDOW_BORDERLESS; } // create the window _sdlWindow = SDL_CreateWindow(windowName.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, screenWidth, screenHeight, flags); // check for errors if (_sdlWindow == nullptr) { fatalError("SDL Window could not be created!"); } // context variable // set it up and give it to the _window SDL_GLContext glContext = SDL_GL_CreateContext(_sdlWindow); // check for errors if (glContext == nullptr) { fatalError("SDL_GL context could not be created!"); } // inits glew, setup glew and get all the extentions set up // also do error checking GLenum error = glewInit(); if (error != GLEW_OK) { fatalError("Coud not initialize glew!"); } // check OpenGL version std::printf("*** OpenGL Version: %s ***\n", glGetString(GL_VERSION)); // set background // this function sets the background color to be drawn // when glClear is called over GL_COLOR_BUFFER_BIT glClearColor(0.243f, 0.537f, 0.729f, 1.0); // set VSync on (1) (off is 0) SDL_GL_SetSwapInterval(1); // enable alpha blending (for transparency) glEnable(GL_BLEND); // blend the alpha color from the source with the background glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); SDL_Surface* icon = IMG_Load("../icon/icon.png"); SDL_SetWindowIcon(_sdlWindow, icon); return 0; } void Window::swapBuffer() { // swap frame (flushes everything we had drawn to the screen) SDL_GL_SwapWindow(_sdlWindow); } }
[ "phoquintas@gmail.com" ]
phoquintas@gmail.com
5c70fc63cff8727a93ac1a20ab0a881a84066615
5c31c832b8b6d8a6fb095c89f2aeea2d2c510a8f
/devc_prat/z猪肉价比.cpp
728de52df4f0d98441f51dd1921e1f9388347f6a
[]
no_license
dodoshuai/Practice
5960211f18e7ca945c3554682fe9ff2be1de6597
6d71baa9470be5e41914409647790b95d8e2aa50
refs/heads/master
2022-02-19T01:39:51.687313
2019-09-24T23:40:49
2019-09-24T23:40:49
148,586,441
0
0
null
null
null
null
UTF-8
C++
false
false
176
cpp
#include<iostream> using namespace std; int main(){ int n; while(cin>>n&&n!=0){ int q=0; while(n>1){ if(n%3!=0){ n=n/3+1;}else{ n=n/3; } q++; } cout<<q<<endl; } return 0; }
[ "1115112505@qq.com" ]
1115112505@qq.com
79704d30da4c0a76ca28e9640c957d98e60c662c
c776476e9d06b3779d744641e758ac3a2c15cddc
/examples/litmus/c/run-scripts/tmp_5/LB-GRW+R-A+OB-O+R-A+OB-OB.c.cbmc.cpp
e16a4a42df88c905b776e10ada081fe22eb64738
[]
no_license
ashutosh0gupta/llvm_bmc
aaac7961c723ba6f7ffd77a39559e0e52432eade
0287c4fb180244e6b3c599a9902507f05c8a7234
refs/heads/master
2023-08-02T17:14:06.178723
2023-07-31T10:46:53
2023-07-31T10:46:53
143,100,825
3
4
null
2023-05-25T05:50:55
2018-08-01T03:47:00
C++
UTF-8
C++
false
false
97,861
cpp
// Global variabls: // 0:vars:6 // 6:atom_0_X0_1:1 // 7:atom_1_X0_1:1 // 11:atom_5_X0_1:1 // 8:atom_2_X0_1:1 // 9:atom_3_X0_1:1 // 10:atom_4_X0_1:1 // Local global variabls: // 0:thr0:1 // 1:thr1:1 // 2:thr2:1 // 3:thr3:1 // 4:thr4:1 // 5:thr5:1 #define ADDRSIZE 12 #define LOCALADDRSIZE 6 #define NTHREAD 7 #define NCONTEXT 5 #define ASSUME(stmt) __CPROVER_assume(stmt) #define ASSERT(stmt) __CPROVER_assert(stmt, "error") #define max(a,b) (a>b?a:b) char __get_rng(); char get_rng( char from, char to ) { char ret = __get_rng(); ASSUME(ret >= from && ret <= to); return ret; } char get_rng_th( char from, char to ) { char ret = __get_rng(); ASSUME(ret >= from && ret <= to); return ret; } int main(int argc, char **argv) { // Declare arrays for intial value version in contexts int local_mem[LOCALADDRSIZE]; // Dumping initializations local_mem[0+0] = 0; local_mem[1+0] = 0; local_mem[2+0] = 0; local_mem[3+0] = 0; local_mem[4+0] = 0; local_mem[5+0] = 0; int cstart[NTHREAD]; int creturn[NTHREAD]; // declare arrays for contexts activity int active[NCONTEXT]; int ctx_used[NCONTEXT]; // declare arrays for intial value version in contexts int meminit_[ADDRSIZE*NCONTEXT]; #define meminit(x,k) meminit_[(x)*NCONTEXT+k] int coinit_[ADDRSIZE*NCONTEXT]; #define coinit(x,k) coinit_[(x)*NCONTEXT+k] int deltainit_[ADDRSIZE*NCONTEXT]; #define deltainit(x,k) deltainit_[(x)*NCONTEXT+k] // declare arrays for running value version in contexts int mem_[ADDRSIZE*NCONTEXT]; #define mem(x,k) mem_[(x)*NCONTEXT+k] int co_[ADDRSIZE*NCONTEXT]; #define co(x,k) co_[(x)*NCONTEXT+k] int delta_[ADDRSIZE*NCONTEXT]; #define delta(x,k) delta_[(x)*NCONTEXT+k] // declare arrays for local buffer and observed writes int buff_[NTHREAD*ADDRSIZE]; #define buff(x,k) buff_[(x)*ADDRSIZE+k] int pw_[NTHREAD*ADDRSIZE]; #define pw(x,k) pw_[(x)*ADDRSIZE+k] // declare arrays for context stamps char cr_[NTHREAD*ADDRSIZE]; #define cr(x,k) cr_[(x)*ADDRSIZE+k] char iw_[NTHREAD*ADDRSIZE]; #define iw(x,k) iw_[(x)*ADDRSIZE+k] char cw_[NTHREAD*ADDRSIZE]; #define cw(x,k) cw_[(x)*ADDRSIZE+k] char cx_[NTHREAD*ADDRSIZE]; #define cx(x,k) cx_[(x)*ADDRSIZE+k] char is_[NTHREAD*ADDRSIZE]; #define is(x,k) is_[(x)*ADDRSIZE+k] char cs_[NTHREAD*ADDRSIZE]; #define cs(x,k) cs_[(x)*ADDRSIZE+k] char crmax_[NTHREAD*ADDRSIZE]; #define crmax(x,k) crmax_[(x)*ADDRSIZE+k] char sforbid_[ADDRSIZE*NCONTEXT]; #define sforbid(x,k) sforbid_[(x)*NCONTEXT+k] // declare arrays for synchronizations int cl[NTHREAD]; int cdy[NTHREAD]; int cds[NTHREAD]; int cdl[NTHREAD]; int cisb[NTHREAD]; int caddr[NTHREAD]; int cctrl[NTHREAD]; __LOCALS__ buff(0,0) = 0; pw(0,0) = 0; cr(0,0) = 0; iw(0,0) = 0; cw(0,0) = 0; cx(0,0) = 0; is(0,0) = 0; cs(0,0) = 0; crmax(0,0) = 0; buff(0,1) = 0; pw(0,1) = 0; cr(0,1) = 0; iw(0,1) = 0; cw(0,1) = 0; cx(0,1) = 0; is(0,1) = 0; cs(0,1) = 0; crmax(0,1) = 0; buff(0,2) = 0; pw(0,2) = 0; cr(0,2) = 0; iw(0,2) = 0; cw(0,2) = 0; cx(0,2) = 0; is(0,2) = 0; cs(0,2) = 0; crmax(0,2) = 0; buff(0,3) = 0; pw(0,3) = 0; cr(0,3) = 0; iw(0,3) = 0; cw(0,3) = 0; cx(0,3) = 0; is(0,3) = 0; cs(0,3) = 0; crmax(0,3) = 0; buff(0,4) = 0; pw(0,4) = 0; cr(0,4) = 0; iw(0,4) = 0; cw(0,4) = 0; cx(0,4) = 0; is(0,4) = 0; cs(0,4) = 0; crmax(0,4) = 0; buff(0,5) = 0; pw(0,5) = 0; cr(0,5) = 0; iw(0,5) = 0; cw(0,5) = 0; cx(0,5) = 0; is(0,5) = 0; cs(0,5) = 0; crmax(0,5) = 0; buff(0,6) = 0; pw(0,6) = 0; cr(0,6) = 0; iw(0,6) = 0; cw(0,6) = 0; cx(0,6) = 0; is(0,6) = 0; cs(0,6) = 0; crmax(0,6) = 0; buff(0,7) = 0; pw(0,7) = 0; cr(0,7) = 0; iw(0,7) = 0; cw(0,7) = 0; cx(0,7) = 0; is(0,7) = 0; cs(0,7) = 0; crmax(0,7) = 0; buff(0,8) = 0; pw(0,8) = 0; cr(0,8) = 0; iw(0,8) = 0; cw(0,8) = 0; cx(0,8) = 0; is(0,8) = 0; cs(0,8) = 0; crmax(0,8) = 0; buff(0,9) = 0; pw(0,9) = 0; cr(0,9) = 0; iw(0,9) = 0; cw(0,9) = 0; cx(0,9) = 0; is(0,9) = 0; cs(0,9) = 0; crmax(0,9) = 0; buff(0,10) = 0; pw(0,10) = 0; cr(0,10) = 0; iw(0,10) = 0; cw(0,10) = 0; cx(0,10) = 0; is(0,10) = 0; cs(0,10) = 0; crmax(0,10) = 0; buff(0,11) = 0; pw(0,11) = 0; cr(0,11) = 0; iw(0,11) = 0; cw(0,11) = 0; cx(0,11) = 0; is(0,11) = 0; cs(0,11) = 0; crmax(0,11) = 0; cl[0] = 0; cdy[0] = 0; cds[0] = 0; cdl[0] = 0; cisb[0] = 0; caddr[0] = 0; cctrl[0] = 0; cstart[0] = get_rng(0,NCONTEXT-1); creturn[0] = get_rng(0,NCONTEXT-1); buff(1,0) = 0; pw(1,0) = 0; cr(1,0) = 0; iw(1,0) = 0; cw(1,0) = 0; cx(1,0) = 0; is(1,0) = 0; cs(1,0) = 0; crmax(1,0) = 0; buff(1,1) = 0; pw(1,1) = 0; cr(1,1) = 0; iw(1,1) = 0; cw(1,1) = 0; cx(1,1) = 0; is(1,1) = 0; cs(1,1) = 0; crmax(1,1) = 0; buff(1,2) = 0; pw(1,2) = 0; cr(1,2) = 0; iw(1,2) = 0; cw(1,2) = 0; cx(1,2) = 0; is(1,2) = 0; cs(1,2) = 0; crmax(1,2) = 0; buff(1,3) = 0; pw(1,3) = 0; cr(1,3) = 0; iw(1,3) = 0; cw(1,3) = 0; cx(1,3) = 0; is(1,3) = 0; cs(1,3) = 0; crmax(1,3) = 0; buff(1,4) = 0; pw(1,4) = 0; cr(1,4) = 0; iw(1,4) = 0; cw(1,4) = 0; cx(1,4) = 0; is(1,4) = 0; cs(1,4) = 0; crmax(1,4) = 0; buff(1,5) = 0; pw(1,5) = 0; cr(1,5) = 0; iw(1,5) = 0; cw(1,5) = 0; cx(1,5) = 0; is(1,5) = 0; cs(1,5) = 0; crmax(1,5) = 0; buff(1,6) = 0; pw(1,6) = 0; cr(1,6) = 0; iw(1,6) = 0; cw(1,6) = 0; cx(1,6) = 0; is(1,6) = 0; cs(1,6) = 0; crmax(1,6) = 0; buff(1,7) = 0; pw(1,7) = 0; cr(1,7) = 0; iw(1,7) = 0; cw(1,7) = 0; cx(1,7) = 0; is(1,7) = 0; cs(1,7) = 0; crmax(1,7) = 0; buff(1,8) = 0; pw(1,8) = 0; cr(1,8) = 0; iw(1,8) = 0; cw(1,8) = 0; cx(1,8) = 0; is(1,8) = 0; cs(1,8) = 0; crmax(1,8) = 0; buff(1,9) = 0; pw(1,9) = 0; cr(1,9) = 0; iw(1,9) = 0; cw(1,9) = 0; cx(1,9) = 0; is(1,9) = 0; cs(1,9) = 0; crmax(1,9) = 0; buff(1,10) = 0; pw(1,10) = 0; cr(1,10) = 0; iw(1,10) = 0; cw(1,10) = 0; cx(1,10) = 0; is(1,10) = 0; cs(1,10) = 0; crmax(1,10) = 0; buff(1,11) = 0; pw(1,11) = 0; cr(1,11) = 0; iw(1,11) = 0; cw(1,11) = 0; cx(1,11) = 0; is(1,11) = 0; cs(1,11) = 0; crmax(1,11) = 0; cl[1] = 0; cdy[1] = 0; cds[1] = 0; cdl[1] = 0; cisb[1] = 0; caddr[1] = 0; cctrl[1] = 0; cstart[1] = get_rng(0,NCONTEXT-1); creturn[1] = get_rng(0,NCONTEXT-1); buff(2,0) = 0; pw(2,0) = 0; cr(2,0) = 0; iw(2,0) = 0; cw(2,0) = 0; cx(2,0) = 0; is(2,0) = 0; cs(2,0) = 0; crmax(2,0) = 0; buff(2,1) = 0; pw(2,1) = 0; cr(2,1) = 0; iw(2,1) = 0; cw(2,1) = 0; cx(2,1) = 0; is(2,1) = 0; cs(2,1) = 0; crmax(2,1) = 0; buff(2,2) = 0; pw(2,2) = 0; cr(2,2) = 0; iw(2,2) = 0; cw(2,2) = 0; cx(2,2) = 0; is(2,2) = 0; cs(2,2) = 0; crmax(2,2) = 0; buff(2,3) = 0; pw(2,3) = 0; cr(2,3) = 0; iw(2,3) = 0; cw(2,3) = 0; cx(2,3) = 0; is(2,3) = 0; cs(2,3) = 0; crmax(2,3) = 0; buff(2,4) = 0; pw(2,4) = 0; cr(2,4) = 0; iw(2,4) = 0; cw(2,4) = 0; cx(2,4) = 0; is(2,4) = 0; cs(2,4) = 0; crmax(2,4) = 0; buff(2,5) = 0; pw(2,5) = 0; cr(2,5) = 0; iw(2,5) = 0; cw(2,5) = 0; cx(2,5) = 0; is(2,5) = 0; cs(2,5) = 0; crmax(2,5) = 0; buff(2,6) = 0; pw(2,6) = 0; cr(2,6) = 0; iw(2,6) = 0; cw(2,6) = 0; cx(2,6) = 0; is(2,6) = 0; cs(2,6) = 0; crmax(2,6) = 0; buff(2,7) = 0; pw(2,7) = 0; cr(2,7) = 0; iw(2,7) = 0; cw(2,7) = 0; cx(2,7) = 0; is(2,7) = 0; cs(2,7) = 0; crmax(2,7) = 0; buff(2,8) = 0; pw(2,8) = 0; cr(2,8) = 0; iw(2,8) = 0; cw(2,8) = 0; cx(2,8) = 0; is(2,8) = 0; cs(2,8) = 0; crmax(2,8) = 0; buff(2,9) = 0; pw(2,9) = 0; cr(2,9) = 0; iw(2,9) = 0; cw(2,9) = 0; cx(2,9) = 0; is(2,9) = 0; cs(2,9) = 0; crmax(2,9) = 0; buff(2,10) = 0; pw(2,10) = 0; cr(2,10) = 0; iw(2,10) = 0; cw(2,10) = 0; cx(2,10) = 0; is(2,10) = 0; cs(2,10) = 0; crmax(2,10) = 0; buff(2,11) = 0; pw(2,11) = 0; cr(2,11) = 0; iw(2,11) = 0; cw(2,11) = 0; cx(2,11) = 0; is(2,11) = 0; cs(2,11) = 0; crmax(2,11) = 0; cl[2] = 0; cdy[2] = 0; cds[2] = 0; cdl[2] = 0; cisb[2] = 0; caddr[2] = 0; cctrl[2] = 0; cstart[2] = get_rng(0,NCONTEXT-1); creturn[2] = get_rng(0,NCONTEXT-1); buff(3,0) = 0; pw(3,0) = 0; cr(3,0) = 0; iw(3,0) = 0; cw(3,0) = 0; cx(3,0) = 0; is(3,0) = 0; cs(3,0) = 0; crmax(3,0) = 0; buff(3,1) = 0; pw(3,1) = 0; cr(3,1) = 0; iw(3,1) = 0; cw(3,1) = 0; cx(3,1) = 0; is(3,1) = 0; cs(3,1) = 0; crmax(3,1) = 0; buff(3,2) = 0; pw(3,2) = 0; cr(3,2) = 0; iw(3,2) = 0; cw(3,2) = 0; cx(3,2) = 0; is(3,2) = 0; cs(3,2) = 0; crmax(3,2) = 0; buff(3,3) = 0; pw(3,3) = 0; cr(3,3) = 0; iw(3,3) = 0; cw(3,3) = 0; cx(3,3) = 0; is(3,3) = 0; cs(3,3) = 0; crmax(3,3) = 0; buff(3,4) = 0; pw(3,4) = 0; cr(3,4) = 0; iw(3,4) = 0; cw(3,4) = 0; cx(3,4) = 0; is(3,4) = 0; cs(3,4) = 0; crmax(3,4) = 0; buff(3,5) = 0; pw(3,5) = 0; cr(3,5) = 0; iw(3,5) = 0; cw(3,5) = 0; cx(3,5) = 0; is(3,5) = 0; cs(3,5) = 0; crmax(3,5) = 0; buff(3,6) = 0; pw(3,6) = 0; cr(3,6) = 0; iw(3,6) = 0; cw(3,6) = 0; cx(3,6) = 0; is(3,6) = 0; cs(3,6) = 0; crmax(3,6) = 0; buff(3,7) = 0; pw(3,7) = 0; cr(3,7) = 0; iw(3,7) = 0; cw(3,7) = 0; cx(3,7) = 0; is(3,7) = 0; cs(3,7) = 0; crmax(3,7) = 0; buff(3,8) = 0; pw(3,8) = 0; cr(3,8) = 0; iw(3,8) = 0; cw(3,8) = 0; cx(3,8) = 0; is(3,8) = 0; cs(3,8) = 0; crmax(3,8) = 0; buff(3,9) = 0; pw(3,9) = 0; cr(3,9) = 0; iw(3,9) = 0; cw(3,9) = 0; cx(3,9) = 0; is(3,9) = 0; cs(3,9) = 0; crmax(3,9) = 0; buff(3,10) = 0; pw(3,10) = 0; cr(3,10) = 0; iw(3,10) = 0; cw(3,10) = 0; cx(3,10) = 0; is(3,10) = 0; cs(3,10) = 0; crmax(3,10) = 0; buff(3,11) = 0; pw(3,11) = 0; cr(3,11) = 0; iw(3,11) = 0; cw(3,11) = 0; cx(3,11) = 0; is(3,11) = 0; cs(3,11) = 0; crmax(3,11) = 0; cl[3] = 0; cdy[3] = 0; cds[3] = 0; cdl[3] = 0; cisb[3] = 0; caddr[3] = 0; cctrl[3] = 0; cstart[3] = get_rng(0,NCONTEXT-1); creturn[3] = get_rng(0,NCONTEXT-1); buff(4,0) = 0; pw(4,0) = 0; cr(4,0) = 0; iw(4,0) = 0; cw(4,0) = 0; cx(4,0) = 0; is(4,0) = 0; cs(4,0) = 0; crmax(4,0) = 0; buff(4,1) = 0; pw(4,1) = 0; cr(4,1) = 0; iw(4,1) = 0; cw(4,1) = 0; cx(4,1) = 0; is(4,1) = 0; cs(4,1) = 0; crmax(4,1) = 0; buff(4,2) = 0; pw(4,2) = 0; cr(4,2) = 0; iw(4,2) = 0; cw(4,2) = 0; cx(4,2) = 0; is(4,2) = 0; cs(4,2) = 0; crmax(4,2) = 0; buff(4,3) = 0; pw(4,3) = 0; cr(4,3) = 0; iw(4,3) = 0; cw(4,3) = 0; cx(4,3) = 0; is(4,3) = 0; cs(4,3) = 0; crmax(4,3) = 0; buff(4,4) = 0; pw(4,4) = 0; cr(4,4) = 0; iw(4,4) = 0; cw(4,4) = 0; cx(4,4) = 0; is(4,4) = 0; cs(4,4) = 0; crmax(4,4) = 0; buff(4,5) = 0; pw(4,5) = 0; cr(4,5) = 0; iw(4,5) = 0; cw(4,5) = 0; cx(4,5) = 0; is(4,5) = 0; cs(4,5) = 0; crmax(4,5) = 0; buff(4,6) = 0; pw(4,6) = 0; cr(4,6) = 0; iw(4,6) = 0; cw(4,6) = 0; cx(4,6) = 0; is(4,6) = 0; cs(4,6) = 0; crmax(4,6) = 0; buff(4,7) = 0; pw(4,7) = 0; cr(4,7) = 0; iw(4,7) = 0; cw(4,7) = 0; cx(4,7) = 0; is(4,7) = 0; cs(4,7) = 0; crmax(4,7) = 0; buff(4,8) = 0; pw(4,8) = 0; cr(4,8) = 0; iw(4,8) = 0; cw(4,8) = 0; cx(4,8) = 0; is(4,8) = 0; cs(4,8) = 0; crmax(4,8) = 0; buff(4,9) = 0; pw(4,9) = 0; cr(4,9) = 0; iw(4,9) = 0; cw(4,9) = 0; cx(4,9) = 0; is(4,9) = 0; cs(4,9) = 0; crmax(4,9) = 0; buff(4,10) = 0; pw(4,10) = 0; cr(4,10) = 0; iw(4,10) = 0; cw(4,10) = 0; cx(4,10) = 0; is(4,10) = 0; cs(4,10) = 0; crmax(4,10) = 0; buff(4,11) = 0; pw(4,11) = 0; cr(4,11) = 0; iw(4,11) = 0; cw(4,11) = 0; cx(4,11) = 0; is(4,11) = 0; cs(4,11) = 0; crmax(4,11) = 0; cl[4] = 0; cdy[4] = 0; cds[4] = 0; cdl[4] = 0; cisb[4] = 0; caddr[4] = 0; cctrl[4] = 0; cstart[4] = get_rng(0,NCONTEXT-1); creturn[4] = get_rng(0,NCONTEXT-1); buff(5,0) = 0; pw(5,0) = 0; cr(5,0) = 0; iw(5,0) = 0; cw(5,0) = 0; cx(5,0) = 0; is(5,0) = 0; cs(5,0) = 0; crmax(5,0) = 0; buff(5,1) = 0; pw(5,1) = 0; cr(5,1) = 0; iw(5,1) = 0; cw(5,1) = 0; cx(5,1) = 0; is(5,1) = 0; cs(5,1) = 0; crmax(5,1) = 0; buff(5,2) = 0; pw(5,2) = 0; cr(5,2) = 0; iw(5,2) = 0; cw(5,2) = 0; cx(5,2) = 0; is(5,2) = 0; cs(5,2) = 0; crmax(5,2) = 0; buff(5,3) = 0; pw(5,3) = 0; cr(5,3) = 0; iw(5,3) = 0; cw(5,3) = 0; cx(5,3) = 0; is(5,3) = 0; cs(5,3) = 0; crmax(5,3) = 0; buff(5,4) = 0; pw(5,4) = 0; cr(5,4) = 0; iw(5,4) = 0; cw(5,4) = 0; cx(5,4) = 0; is(5,4) = 0; cs(5,4) = 0; crmax(5,4) = 0; buff(5,5) = 0; pw(5,5) = 0; cr(5,5) = 0; iw(5,5) = 0; cw(5,5) = 0; cx(5,5) = 0; is(5,5) = 0; cs(5,5) = 0; crmax(5,5) = 0; buff(5,6) = 0; pw(5,6) = 0; cr(5,6) = 0; iw(5,6) = 0; cw(5,6) = 0; cx(5,6) = 0; is(5,6) = 0; cs(5,6) = 0; crmax(5,6) = 0; buff(5,7) = 0; pw(5,7) = 0; cr(5,7) = 0; iw(5,7) = 0; cw(5,7) = 0; cx(5,7) = 0; is(5,7) = 0; cs(5,7) = 0; crmax(5,7) = 0; buff(5,8) = 0; pw(5,8) = 0; cr(5,8) = 0; iw(5,8) = 0; cw(5,8) = 0; cx(5,8) = 0; is(5,8) = 0; cs(5,8) = 0; crmax(5,8) = 0; buff(5,9) = 0; pw(5,9) = 0; cr(5,9) = 0; iw(5,9) = 0; cw(5,9) = 0; cx(5,9) = 0; is(5,9) = 0; cs(5,9) = 0; crmax(5,9) = 0; buff(5,10) = 0; pw(5,10) = 0; cr(5,10) = 0; iw(5,10) = 0; cw(5,10) = 0; cx(5,10) = 0; is(5,10) = 0; cs(5,10) = 0; crmax(5,10) = 0; buff(5,11) = 0; pw(5,11) = 0; cr(5,11) = 0; iw(5,11) = 0; cw(5,11) = 0; cx(5,11) = 0; is(5,11) = 0; cs(5,11) = 0; crmax(5,11) = 0; cl[5] = 0; cdy[5] = 0; cds[5] = 0; cdl[5] = 0; cisb[5] = 0; caddr[5] = 0; cctrl[5] = 0; cstart[5] = get_rng(0,NCONTEXT-1); creturn[5] = get_rng(0,NCONTEXT-1); buff(6,0) = 0; pw(6,0) = 0; cr(6,0) = 0; iw(6,0) = 0; cw(6,0) = 0; cx(6,0) = 0; is(6,0) = 0; cs(6,0) = 0; crmax(6,0) = 0; buff(6,1) = 0; pw(6,1) = 0; cr(6,1) = 0; iw(6,1) = 0; cw(6,1) = 0; cx(6,1) = 0; is(6,1) = 0; cs(6,1) = 0; crmax(6,1) = 0; buff(6,2) = 0; pw(6,2) = 0; cr(6,2) = 0; iw(6,2) = 0; cw(6,2) = 0; cx(6,2) = 0; is(6,2) = 0; cs(6,2) = 0; crmax(6,2) = 0; buff(6,3) = 0; pw(6,3) = 0; cr(6,3) = 0; iw(6,3) = 0; cw(6,3) = 0; cx(6,3) = 0; is(6,3) = 0; cs(6,3) = 0; crmax(6,3) = 0; buff(6,4) = 0; pw(6,4) = 0; cr(6,4) = 0; iw(6,4) = 0; cw(6,4) = 0; cx(6,4) = 0; is(6,4) = 0; cs(6,4) = 0; crmax(6,4) = 0; buff(6,5) = 0; pw(6,5) = 0; cr(6,5) = 0; iw(6,5) = 0; cw(6,5) = 0; cx(6,5) = 0; is(6,5) = 0; cs(6,5) = 0; crmax(6,5) = 0; buff(6,6) = 0; pw(6,6) = 0; cr(6,6) = 0; iw(6,6) = 0; cw(6,6) = 0; cx(6,6) = 0; is(6,6) = 0; cs(6,6) = 0; crmax(6,6) = 0; buff(6,7) = 0; pw(6,7) = 0; cr(6,7) = 0; iw(6,7) = 0; cw(6,7) = 0; cx(6,7) = 0; is(6,7) = 0; cs(6,7) = 0; crmax(6,7) = 0; buff(6,8) = 0; pw(6,8) = 0; cr(6,8) = 0; iw(6,8) = 0; cw(6,8) = 0; cx(6,8) = 0; is(6,8) = 0; cs(6,8) = 0; crmax(6,8) = 0; buff(6,9) = 0; pw(6,9) = 0; cr(6,9) = 0; iw(6,9) = 0; cw(6,9) = 0; cx(6,9) = 0; is(6,9) = 0; cs(6,9) = 0; crmax(6,9) = 0; buff(6,10) = 0; pw(6,10) = 0; cr(6,10) = 0; iw(6,10) = 0; cw(6,10) = 0; cx(6,10) = 0; is(6,10) = 0; cs(6,10) = 0; crmax(6,10) = 0; buff(6,11) = 0; pw(6,11) = 0; cr(6,11) = 0; iw(6,11) = 0; cw(6,11) = 0; cx(6,11) = 0; is(6,11) = 0; cs(6,11) = 0; crmax(6,11) = 0; cl[6] = 0; cdy[6] = 0; cds[6] = 0; cdl[6] = 0; cisb[6] = 0; caddr[6] = 0; cctrl[6] = 0; cstart[6] = get_rng(0,NCONTEXT-1); creturn[6] = get_rng(0,NCONTEXT-1); // Dumping initializations mem(0+0,0) = 0; mem(0+1,0) = 0; mem(0+2,0) = 0; mem(0+3,0) = 0; mem(0+4,0) = 0; mem(0+5,0) = 0; mem(6+0,0) = 0; mem(7+0,0) = 0; mem(11+0,0) = 0; mem(8+0,0) = 0; mem(9+0,0) = 0; mem(10+0,0) = 0; // Dumping context matching equalities co(0,0) = 0; delta(0,0) = -1; mem(0,1) = meminit(0,1); co(0,1) = coinit(0,1); delta(0,1) = deltainit(0,1); mem(0,2) = meminit(0,2); co(0,2) = coinit(0,2); delta(0,2) = deltainit(0,2); mem(0,3) = meminit(0,3); co(0,3) = coinit(0,3); delta(0,3) = deltainit(0,3); mem(0,4) = meminit(0,4); co(0,4) = coinit(0,4); delta(0,4) = deltainit(0,4); co(1,0) = 0; delta(1,0) = -1; mem(1,1) = meminit(1,1); co(1,1) = coinit(1,1); delta(1,1) = deltainit(1,1); mem(1,2) = meminit(1,2); co(1,2) = coinit(1,2); delta(1,2) = deltainit(1,2); mem(1,3) = meminit(1,3); co(1,3) = coinit(1,3); delta(1,3) = deltainit(1,3); mem(1,4) = meminit(1,4); co(1,4) = coinit(1,4); delta(1,4) = deltainit(1,4); co(2,0) = 0; delta(2,0) = -1; mem(2,1) = meminit(2,1); co(2,1) = coinit(2,1); delta(2,1) = deltainit(2,1); mem(2,2) = meminit(2,2); co(2,2) = coinit(2,2); delta(2,2) = deltainit(2,2); mem(2,3) = meminit(2,3); co(2,3) = coinit(2,3); delta(2,3) = deltainit(2,3); mem(2,4) = meminit(2,4); co(2,4) = coinit(2,4); delta(2,4) = deltainit(2,4); co(3,0) = 0; delta(3,0) = -1; mem(3,1) = meminit(3,1); co(3,1) = coinit(3,1); delta(3,1) = deltainit(3,1); mem(3,2) = meminit(3,2); co(3,2) = coinit(3,2); delta(3,2) = deltainit(3,2); mem(3,3) = meminit(3,3); co(3,3) = coinit(3,3); delta(3,3) = deltainit(3,3); mem(3,4) = meminit(3,4); co(3,4) = coinit(3,4); delta(3,4) = deltainit(3,4); co(4,0) = 0; delta(4,0) = -1; mem(4,1) = meminit(4,1); co(4,1) = coinit(4,1); delta(4,1) = deltainit(4,1); mem(4,2) = meminit(4,2); co(4,2) = coinit(4,2); delta(4,2) = deltainit(4,2); mem(4,3) = meminit(4,3); co(4,3) = coinit(4,3); delta(4,3) = deltainit(4,3); mem(4,4) = meminit(4,4); co(4,4) = coinit(4,4); delta(4,4) = deltainit(4,4); co(5,0) = 0; delta(5,0) = -1; mem(5,1) = meminit(5,1); co(5,1) = coinit(5,1); delta(5,1) = deltainit(5,1); mem(5,2) = meminit(5,2); co(5,2) = coinit(5,2); delta(5,2) = deltainit(5,2); mem(5,3) = meminit(5,3); co(5,3) = coinit(5,3); delta(5,3) = deltainit(5,3); mem(5,4) = meminit(5,4); co(5,4) = coinit(5,4); delta(5,4) = deltainit(5,4); co(6,0) = 0; delta(6,0) = -1; mem(6,1) = meminit(6,1); co(6,1) = coinit(6,1); delta(6,1) = deltainit(6,1); mem(6,2) = meminit(6,2); co(6,2) = coinit(6,2); delta(6,2) = deltainit(6,2); mem(6,3) = meminit(6,3); co(6,3) = coinit(6,3); delta(6,3) = deltainit(6,3); mem(6,4) = meminit(6,4); co(6,4) = coinit(6,4); delta(6,4) = deltainit(6,4); co(7,0) = 0; delta(7,0) = -1; mem(7,1) = meminit(7,1); co(7,1) = coinit(7,1); delta(7,1) = deltainit(7,1); mem(7,2) = meminit(7,2); co(7,2) = coinit(7,2); delta(7,2) = deltainit(7,2); mem(7,3) = meminit(7,3); co(7,3) = coinit(7,3); delta(7,3) = deltainit(7,3); mem(7,4) = meminit(7,4); co(7,4) = coinit(7,4); delta(7,4) = deltainit(7,4); co(8,0) = 0; delta(8,0) = -1; mem(8,1) = meminit(8,1); co(8,1) = coinit(8,1); delta(8,1) = deltainit(8,1); mem(8,2) = meminit(8,2); co(8,2) = coinit(8,2); delta(8,2) = deltainit(8,2); mem(8,3) = meminit(8,3); co(8,3) = coinit(8,3); delta(8,3) = deltainit(8,3); mem(8,4) = meminit(8,4); co(8,4) = coinit(8,4); delta(8,4) = deltainit(8,4); co(9,0) = 0; delta(9,0) = -1; mem(9,1) = meminit(9,1); co(9,1) = coinit(9,1); delta(9,1) = deltainit(9,1); mem(9,2) = meminit(9,2); co(9,2) = coinit(9,2); delta(9,2) = deltainit(9,2); mem(9,3) = meminit(9,3); co(9,3) = coinit(9,3); delta(9,3) = deltainit(9,3); mem(9,4) = meminit(9,4); co(9,4) = coinit(9,4); delta(9,4) = deltainit(9,4); co(10,0) = 0; delta(10,0) = -1; mem(10,1) = meminit(10,1); co(10,1) = coinit(10,1); delta(10,1) = deltainit(10,1); mem(10,2) = meminit(10,2); co(10,2) = coinit(10,2); delta(10,2) = deltainit(10,2); mem(10,3) = meminit(10,3); co(10,3) = coinit(10,3); delta(10,3) = deltainit(10,3); mem(10,4) = meminit(10,4); co(10,4) = coinit(10,4); delta(10,4) = deltainit(10,4); co(11,0) = 0; delta(11,0) = -1; mem(11,1) = meminit(11,1); co(11,1) = coinit(11,1); delta(11,1) = deltainit(11,1); mem(11,2) = meminit(11,2); co(11,2) = coinit(11,2); delta(11,2) = deltainit(11,2); mem(11,3) = meminit(11,3); co(11,3) = coinit(11,3); delta(11,3) = deltainit(11,3); mem(11,4) = meminit(11,4); co(11,4) = coinit(11,4); delta(11,4) = deltainit(11,4); // Dumping thread 1 int ret_thread_1 = 0; cdy[1] = get_rng(0,NCONTEXT-1); ASSUME(cdy[1] >= cstart[1]); T1BLOCK0: // call void @llvm.dbg.value(metadata i8* %arg, metadata !44, metadata !DIExpression()), !dbg !55 // br label %label_1, !dbg !56 goto T1BLOCK1; T1BLOCK1: // call void @llvm.dbg.label(metadata !54), !dbg !57 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 1), metadata !46, metadata !DIExpression()), !dbg !58 // %0 = load atomic i64, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !59 // LD: Guess old_cr = cr(1,0+1*1); cr(1,0+1*1) = get_rng(0,NCONTEXT-1);// 1 ASSIGN LDCOM _l24_c15 // Check ASSUME(active[cr(1,0+1*1)] == 1); ASSUME(cr(1,0+1*1) >= iw(1,0+1*1)); ASSUME(cr(1,0+1*1) >= 0); ASSUME(cr(1,0+1*1) >= cdy[1]); ASSUME(cr(1,0+1*1) >= cisb[1]); ASSUME(cr(1,0+1*1) >= cdl[1]); ASSUME(cr(1,0+1*1) >= cl[1]); // Update creg_r0 = cr(1,0+1*1); crmax(1,0+1*1) = max(crmax(1,0+1*1),cr(1,0+1*1)); caddr[1] = max(caddr[1],0); if(cr(1,0+1*1) < cw(1,0+1*1)) { r0 = buff(1,0+1*1); ASSUME((!(( (cw(1,0+1*1) < 1) && (1 < crmax(1,0+1*1)) )))||(sforbid(0+1*1,1)> 0)); ASSUME((!(( (cw(1,0+1*1) < 2) && (2 < crmax(1,0+1*1)) )))||(sforbid(0+1*1,2)> 0)); ASSUME((!(( (cw(1,0+1*1) < 3) && (3 < crmax(1,0+1*1)) )))||(sforbid(0+1*1,3)> 0)); ASSUME((!(( (cw(1,0+1*1) < 4) && (4 < crmax(1,0+1*1)) )))||(sforbid(0+1*1,4)> 0)); } else { if(pw(1,0+1*1) != co(0+1*1,cr(1,0+1*1))) { ASSUME(cr(1,0+1*1) >= old_cr); } pw(1,0+1*1) = co(0+1*1,cr(1,0+1*1)); r0 = mem(0+1*1,cr(1,0+1*1)); } ASSUME(creturn[1] >= cr(1,0+1*1)); // call void @llvm.dbg.value(metadata i64 %0, metadata !49, metadata !DIExpression()), !dbg !58 // %conv = trunc i64 %0 to i32, !dbg !60 // call void @llvm.dbg.value(metadata i32 %conv, metadata !45, metadata !DIExpression()), !dbg !55 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 0), metadata !50, metadata !DIExpression()), !dbg !61 // call void @llvm.dbg.value(metadata i64 1, metadata !52, metadata !DIExpression()), !dbg !61 // store atomic i64 1, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 0) release, align 8, !dbg !62 // ST: Guess // : Release iw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW _l25_c3 old_cw = cw(1,0); cw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM _l25_c3 // Check ASSUME(active[iw(1,0)] == 1); ASSUME(active[cw(1,0)] == 1); ASSUME(sforbid(0,cw(1,0))== 0); ASSUME(iw(1,0) >= 0); ASSUME(iw(1,0) >= 0); ASSUME(cw(1,0) >= iw(1,0)); ASSUME(cw(1,0) >= old_cw); ASSUME(cw(1,0) >= cr(1,0)); ASSUME(cw(1,0) >= cl[1]); ASSUME(cw(1,0) >= cisb[1]); ASSUME(cw(1,0) >= cdy[1]); ASSUME(cw(1,0) >= cdl[1]); ASSUME(cw(1,0) >= cds[1]); ASSUME(cw(1,0) >= cctrl[1]); ASSUME(cw(1,0) >= caddr[1]); ASSUME(cw(1,0) >= cr(1,0+0)); ASSUME(cw(1,0) >= cr(1,0+1)); ASSUME(cw(1,0) >= cr(1,0+2)); ASSUME(cw(1,0) >= cr(1,0+3)); ASSUME(cw(1,0) >= cr(1,0+4)); ASSUME(cw(1,0) >= cr(1,0+5)); ASSUME(cw(1,0) >= cr(1,6+0)); ASSUME(cw(1,0) >= cr(1,7+0)); ASSUME(cw(1,0) >= cr(1,11+0)); ASSUME(cw(1,0) >= cr(1,8+0)); ASSUME(cw(1,0) >= cr(1,9+0)); ASSUME(cw(1,0) >= cr(1,10+0)); ASSUME(cw(1,0) >= cw(1,0+0)); ASSUME(cw(1,0) >= cw(1,0+1)); ASSUME(cw(1,0) >= cw(1,0+2)); ASSUME(cw(1,0) >= cw(1,0+3)); ASSUME(cw(1,0) >= cw(1,0+4)); ASSUME(cw(1,0) >= cw(1,0+5)); ASSUME(cw(1,0) >= cw(1,6+0)); ASSUME(cw(1,0) >= cw(1,7+0)); ASSUME(cw(1,0) >= cw(1,11+0)); ASSUME(cw(1,0) >= cw(1,8+0)); ASSUME(cw(1,0) >= cw(1,9+0)); ASSUME(cw(1,0) >= cw(1,10+0)); // Update caddr[1] = max(caddr[1],0); buff(1,0) = 1; mem(0,cw(1,0)) = 1; co(0,cw(1,0))+=1; delta(0,cw(1,0)) = -1; is(1,0) = iw(1,0); cs(1,0) = cw(1,0); ASSUME(creturn[1] >= cw(1,0)); // %cmp = icmp eq i32 %conv, 1, !dbg !63 creg__r0__1_ = max(0,creg_r0); // %conv1 = zext i1 %cmp to i32, !dbg !63 // call void @llvm.dbg.value(metadata i32 %conv1, metadata !53, metadata !DIExpression()), !dbg !55 // store i32 %conv1, i32* @atom_0_X0_1, align 4, !dbg !64, !tbaa !65 // ST: Guess iw(1,6) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW _l27_c15 old_cw = cw(1,6); cw(1,6) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM _l27_c15 // Check ASSUME(active[iw(1,6)] == 1); ASSUME(active[cw(1,6)] == 1); ASSUME(sforbid(6,cw(1,6))== 0); ASSUME(iw(1,6) >= creg__r0__1_); ASSUME(iw(1,6) >= 0); ASSUME(cw(1,6) >= iw(1,6)); ASSUME(cw(1,6) >= old_cw); ASSUME(cw(1,6) >= cr(1,6)); ASSUME(cw(1,6) >= cl[1]); ASSUME(cw(1,6) >= cisb[1]); ASSUME(cw(1,6) >= cdy[1]); ASSUME(cw(1,6) >= cdl[1]); ASSUME(cw(1,6) >= cds[1]); ASSUME(cw(1,6) >= cctrl[1]); ASSUME(cw(1,6) >= caddr[1]); // Update caddr[1] = max(caddr[1],0); buff(1,6) = (r0==1); mem(6,cw(1,6)) = (r0==1); co(6,cw(1,6))+=1; delta(6,cw(1,6)) = -1; ASSUME(creturn[1] >= cw(1,6)); // ret i8* null, !dbg !69 ret_thread_1 = (- 1); goto T1BLOCK_END; T1BLOCK_END: // Dumping thread 2 int ret_thread_2 = 0; cdy[2] = get_rng(0,NCONTEXT-1); ASSUME(cdy[2] >= cstart[2]); T2BLOCK0: // call void @llvm.dbg.value(metadata i8* %arg, metadata !72, metadata !DIExpression()), !dbg !82 // br label %label_2, !dbg !56 goto T2BLOCK1; T2BLOCK1: // call void @llvm.dbg.label(metadata !81), !dbg !84 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 0), metadata !74, metadata !DIExpression()), !dbg !85 // %0 = load atomic i64, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 0) acquire, align 8, !dbg !59 // LD: Guess // : Acquire old_cr = cr(2,0); cr(2,0) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM _l33_c15 // Check ASSUME(active[cr(2,0)] == 2); ASSUME(cr(2,0) >= iw(2,0)); ASSUME(cr(2,0) >= 0); ASSUME(cr(2,0) >= cdy[2]); ASSUME(cr(2,0) >= cisb[2]); ASSUME(cr(2,0) >= cdl[2]); ASSUME(cr(2,0) >= cl[2]); ASSUME(cr(2,0) >= cx(2,0)); ASSUME(cr(2,0) >= cs(2,0+0)); ASSUME(cr(2,0) >= cs(2,0+1)); ASSUME(cr(2,0) >= cs(2,0+2)); ASSUME(cr(2,0) >= cs(2,0+3)); ASSUME(cr(2,0) >= cs(2,0+4)); ASSUME(cr(2,0) >= cs(2,0+5)); ASSUME(cr(2,0) >= cs(2,6+0)); ASSUME(cr(2,0) >= cs(2,7+0)); ASSUME(cr(2,0) >= cs(2,11+0)); ASSUME(cr(2,0) >= cs(2,8+0)); ASSUME(cr(2,0) >= cs(2,9+0)); ASSUME(cr(2,0) >= cs(2,10+0)); // Update creg_r1 = cr(2,0); crmax(2,0) = max(crmax(2,0),cr(2,0)); caddr[2] = max(caddr[2],0); if(cr(2,0) < cw(2,0)) { r1 = buff(2,0); ASSUME((!(( (cw(2,0) < 1) && (1 < crmax(2,0)) )))||(sforbid(0,1)> 0)); ASSUME((!(( (cw(2,0) < 2) && (2 < crmax(2,0)) )))||(sforbid(0,2)> 0)); ASSUME((!(( (cw(2,0) < 3) && (3 < crmax(2,0)) )))||(sforbid(0,3)> 0)); ASSUME((!(( (cw(2,0) < 4) && (4 < crmax(2,0)) )))||(sforbid(0,4)> 0)); } else { if(pw(2,0) != co(0,cr(2,0))) { ASSUME(cr(2,0) >= old_cr); } pw(2,0) = co(0,cr(2,0)); r1 = mem(0,cr(2,0)); } cl[2] = max(cl[2],cr(2,0)); ASSUME(creturn[2] >= cr(2,0)); // call void @llvm.dbg.value(metadata i64 %0, metadata !76, metadata !DIExpression()), !dbg !85 // %conv = trunc i64 %0 to i32, !dbg !60 // call void @llvm.dbg.value(metadata i32 %conv, metadata !73, metadata !DIExpression()), !dbg !82 // call void (...) @dmbsy(), !dbg !61 // dumbsy: Guess old_cdy = cdy[2]; cdy[2] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[2] >= old_cdy); ASSUME(cdy[2] >= cisb[2]); ASSUME(cdy[2] >= cdl[2]); ASSUME(cdy[2] >= cds[2]); ASSUME(cdy[2] >= cctrl[2]); ASSUME(cdy[2] >= cw(2,0+0)); ASSUME(cdy[2] >= cw(2,0+1)); ASSUME(cdy[2] >= cw(2,0+2)); ASSUME(cdy[2] >= cw(2,0+3)); ASSUME(cdy[2] >= cw(2,0+4)); ASSUME(cdy[2] >= cw(2,0+5)); ASSUME(cdy[2] >= cw(2,6+0)); ASSUME(cdy[2] >= cw(2,7+0)); ASSUME(cdy[2] >= cw(2,11+0)); ASSUME(cdy[2] >= cw(2,8+0)); ASSUME(cdy[2] >= cw(2,9+0)); ASSUME(cdy[2] >= cw(2,10+0)); ASSUME(cdy[2] >= cr(2,0+0)); ASSUME(cdy[2] >= cr(2,0+1)); ASSUME(cdy[2] >= cr(2,0+2)); ASSUME(cdy[2] >= cr(2,0+3)); ASSUME(cdy[2] >= cr(2,0+4)); ASSUME(cdy[2] >= cr(2,0+5)); ASSUME(cdy[2] >= cr(2,6+0)); ASSUME(cdy[2] >= cr(2,7+0)); ASSUME(cdy[2] >= cr(2,11+0)); ASSUME(cdy[2] >= cr(2,8+0)); ASSUME(cdy[2] >= cr(2,9+0)); ASSUME(cdy[2] >= cr(2,10+0)); ASSUME(creturn[2] >= cdy[2]); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 2), metadata !77, metadata !DIExpression()), !dbg !89 // call void @llvm.dbg.value(metadata i64 1, metadata !79, metadata !DIExpression()), !dbg !89 // store atomic i64 1, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !63 // ST: Guess iw(2,0+2*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW _l35_c3 old_cw = cw(2,0+2*1); cw(2,0+2*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM _l35_c3 // Check ASSUME(active[iw(2,0+2*1)] == 2); ASSUME(active[cw(2,0+2*1)] == 2); ASSUME(sforbid(0+2*1,cw(2,0+2*1))== 0); ASSUME(iw(2,0+2*1) >= 0); ASSUME(iw(2,0+2*1) >= 0); ASSUME(cw(2,0+2*1) >= iw(2,0+2*1)); ASSUME(cw(2,0+2*1) >= old_cw); ASSUME(cw(2,0+2*1) >= cr(2,0+2*1)); ASSUME(cw(2,0+2*1) >= cl[2]); ASSUME(cw(2,0+2*1) >= cisb[2]); ASSUME(cw(2,0+2*1) >= cdy[2]); ASSUME(cw(2,0+2*1) >= cdl[2]); ASSUME(cw(2,0+2*1) >= cds[2]); ASSUME(cw(2,0+2*1) >= cctrl[2]); ASSUME(cw(2,0+2*1) >= caddr[2]); // Update caddr[2] = max(caddr[2],0); buff(2,0+2*1) = 1; mem(0+2*1,cw(2,0+2*1)) = 1; co(0+2*1,cw(2,0+2*1))+=1; delta(0+2*1,cw(2,0+2*1)) = -1; ASSUME(creturn[2] >= cw(2,0+2*1)); // %cmp = icmp eq i32 %conv, 1, !dbg !64 creg__r1__1_ = max(0,creg_r1); // %conv1 = zext i1 %cmp to i32, !dbg !64 // call void @llvm.dbg.value(metadata i32 %conv1, metadata !80, metadata !DIExpression()), !dbg !82 // store i32 %conv1, i32* @atom_1_X0_1, align 4, !dbg !65, !tbaa !66 // ST: Guess iw(2,7) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW _l37_c15 old_cw = cw(2,7); cw(2,7) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM _l37_c15 // Check ASSUME(active[iw(2,7)] == 2); ASSUME(active[cw(2,7)] == 2); ASSUME(sforbid(7,cw(2,7))== 0); ASSUME(iw(2,7) >= creg__r1__1_); ASSUME(iw(2,7) >= 0); ASSUME(cw(2,7) >= iw(2,7)); ASSUME(cw(2,7) >= old_cw); ASSUME(cw(2,7) >= cr(2,7)); ASSUME(cw(2,7) >= cl[2]); ASSUME(cw(2,7) >= cisb[2]); ASSUME(cw(2,7) >= cdy[2]); ASSUME(cw(2,7) >= cdl[2]); ASSUME(cw(2,7) >= cds[2]); ASSUME(cw(2,7) >= cctrl[2]); ASSUME(cw(2,7) >= caddr[2]); // Update caddr[2] = max(caddr[2],0); buff(2,7) = (r1==1); mem(7,cw(2,7)) = (r1==1); co(7,cw(2,7))+=1; delta(7,cw(2,7)) = -1; ASSUME(creturn[2] >= cw(2,7)); // ret i8* null, !dbg !70 ret_thread_2 = (- 1); goto T2BLOCK_END; T2BLOCK_END: // Dumping thread 3 int ret_thread_3 = 0; cdy[3] = get_rng(0,NCONTEXT-1); ASSUME(cdy[3] >= cstart[3]); T3BLOCK0: // call void @llvm.dbg.value(metadata i8* %arg, metadata !96, metadata !DIExpression()), !dbg !106 // br label %label_3, !dbg !56 goto T3BLOCK1; T3BLOCK1: // call void @llvm.dbg.label(metadata !105), !dbg !108 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 2), metadata !98, metadata !DIExpression()), !dbg !109 // %0 = load atomic i64, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !59 // LD: Guess old_cr = cr(3,0+2*1); cr(3,0+2*1) = get_rng(0,NCONTEXT-1);// 3 ASSIGN LDCOM _l43_c15 // Check ASSUME(active[cr(3,0+2*1)] == 3); ASSUME(cr(3,0+2*1) >= iw(3,0+2*1)); ASSUME(cr(3,0+2*1) >= 0); ASSUME(cr(3,0+2*1) >= cdy[3]); ASSUME(cr(3,0+2*1) >= cisb[3]); ASSUME(cr(3,0+2*1) >= cdl[3]); ASSUME(cr(3,0+2*1) >= cl[3]); // Update creg_r2 = cr(3,0+2*1); crmax(3,0+2*1) = max(crmax(3,0+2*1),cr(3,0+2*1)); caddr[3] = max(caddr[3],0); if(cr(3,0+2*1) < cw(3,0+2*1)) { r2 = buff(3,0+2*1); ASSUME((!(( (cw(3,0+2*1) < 1) && (1 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,1)> 0)); ASSUME((!(( (cw(3,0+2*1) < 2) && (2 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,2)> 0)); ASSUME((!(( (cw(3,0+2*1) < 3) && (3 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,3)> 0)); ASSUME((!(( (cw(3,0+2*1) < 4) && (4 < crmax(3,0+2*1)) )))||(sforbid(0+2*1,4)> 0)); } else { if(pw(3,0+2*1) != co(0+2*1,cr(3,0+2*1))) { ASSUME(cr(3,0+2*1) >= old_cr); } pw(3,0+2*1) = co(0+2*1,cr(3,0+2*1)); r2 = mem(0+2*1,cr(3,0+2*1)); } ASSUME(creturn[3] >= cr(3,0+2*1)); // call void @llvm.dbg.value(metadata i64 %0, metadata !100, metadata !DIExpression()), !dbg !109 // %conv = trunc i64 %0 to i32, !dbg !60 // call void @llvm.dbg.value(metadata i32 %conv, metadata !97, metadata !DIExpression()), !dbg !106 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 3), metadata !101, metadata !DIExpression()), !dbg !112 // call void @llvm.dbg.value(metadata i64 1, metadata !103, metadata !DIExpression()), !dbg !112 // store atomic i64 1, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 3) release, align 8, !dbg !62 // ST: Guess // : Release iw(3,0+3*1) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STIW _l44_c3 old_cw = cw(3,0+3*1); cw(3,0+3*1) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STCOM _l44_c3 // Check ASSUME(active[iw(3,0+3*1)] == 3); ASSUME(active[cw(3,0+3*1)] == 3); ASSUME(sforbid(0+3*1,cw(3,0+3*1))== 0); ASSUME(iw(3,0+3*1) >= 0); ASSUME(iw(3,0+3*1) >= 0); ASSUME(cw(3,0+3*1) >= iw(3,0+3*1)); ASSUME(cw(3,0+3*1) >= old_cw); ASSUME(cw(3,0+3*1) >= cr(3,0+3*1)); ASSUME(cw(3,0+3*1) >= cl[3]); ASSUME(cw(3,0+3*1) >= cisb[3]); ASSUME(cw(3,0+3*1) >= cdy[3]); ASSUME(cw(3,0+3*1) >= cdl[3]); ASSUME(cw(3,0+3*1) >= cds[3]); ASSUME(cw(3,0+3*1) >= cctrl[3]); ASSUME(cw(3,0+3*1) >= caddr[3]); ASSUME(cw(3,0+3*1) >= cr(3,0+0)); ASSUME(cw(3,0+3*1) >= cr(3,0+1)); ASSUME(cw(3,0+3*1) >= cr(3,0+2)); ASSUME(cw(3,0+3*1) >= cr(3,0+3)); ASSUME(cw(3,0+3*1) >= cr(3,0+4)); ASSUME(cw(3,0+3*1) >= cr(3,0+5)); ASSUME(cw(3,0+3*1) >= cr(3,6+0)); ASSUME(cw(3,0+3*1) >= cr(3,7+0)); ASSUME(cw(3,0+3*1) >= cr(3,11+0)); ASSUME(cw(3,0+3*1) >= cr(3,8+0)); ASSUME(cw(3,0+3*1) >= cr(3,9+0)); ASSUME(cw(3,0+3*1) >= cr(3,10+0)); ASSUME(cw(3,0+3*1) >= cw(3,0+0)); ASSUME(cw(3,0+3*1) >= cw(3,0+1)); ASSUME(cw(3,0+3*1) >= cw(3,0+2)); ASSUME(cw(3,0+3*1) >= cw(3,0+3)); ASSUME(cw(3,0+3*1) >= cw(3,0+4)); ASSUME(cw(3,0+3*1) >= cw(3,0+5)); ASSUME(cw(3,0+3*1) >= cw(3,6+0)); ASSUME(cw(3,0+3*1) >= cw(3,7+0)); ASSUME(cw(3,0+3*1) >= cw(3,11+0)); ASSUME(cw(3,0+3*1) >= cw(3,8+0)); ASSUME(cw(3,0+3*1) >= cw(3,9+0)); ASSUME(cw(3,0+3*1) >= cw(3,10+0)); // Update caddr[3] = max(caddr[3],0); buff(3,0+3*1) = 1; mem(0+3*1,cw(3,0+3*1)) = 1; co(0+3*1,cw(3,0+3*1))+=1; delta(0+3*1,cw(3,0+3*1)) = -1; is(3,0+3*1) = iw(3,0+3*1); cs(3,0+3*1) = cw(3,0+3*1); ASSUME(creturn[3] >= cw(3,0+3*1)); // %cmp = icmp eq i32 %conv, 1, !dbg !63 creg__r2__1_ = max(0,creg_r2); // %conv1 = zext i1 %cmp to i32, !dbg !63 // call void @llvm.dbg.value(metadata i32 %conv1, metadata !104, metadata !DIExpression()), !dbg !106 // store i32 %conv1, i32* @atom_2_X0_1, align 4, !dbg !64, !tbaa !65 // ST: Guess iw(3,8) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STIW _l46_c15 old_cw = cw(3,8); cw(3,8) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STCOM _l46_c15 // Check ASSUME(active[iw(3,8)] == 3); ASSUME(active[cw(3,8)] == 3); ASSUME(sforbid(8,cw(3,8))== 0); ASSUME(iw(3,8) >= creg__r2__1_); ASSUME(iw(3,8) >= 0); ASSUME(cw(3,8) >= iw(3,8)); ASSUME(cw(3,8) >= old_cw); ASSUME(cw(3,8) >= cr(3,8)); ASSUME(cw(3,8) >= cl[3]); ASSUME(cw(3,8) >= cisb[3]); ASSUME(cw(3,8) >= cdy[3]); ASSUME(cw(3,8) >= cdl[3]); ASSUME(cw(3,8) >= cds[3]); ASSUME(cw(3,8) >= cctrl[3]); ASSUME(cw(3,8) >= caddr[3]); // Update caddr[3] = max(caddr[3],0); buff(3,8) = (r2==1); mem(8,cw(3,8)) = (r2==1); co(8,cw(3,8))+=1; delta(8,cw(3,8)) = -1; ASSUME(creturn[3] >= cw(3,8)); // ret i8* null, !dbg !69 ret_thread_3 = (- 1); goto T3BLOCK_END; T3BLOCK_END: // Dumping thread 4 int ret_thread_4 = 0; cdy[4] = get_rng(0,NCONTEXT-1); ASSUME(cdy[4] >= cstart[4]); T4BLOCK0: // call void @llvm.dbg.value(metadata i8* %arg, metadata !119, metadata !DIExpression()), !dbg !129 // br label %label_4, !dbg !56 goto T4BLOCK1; T4BLOCK1: // call void @llvm.dbg.label(metadata !128), !dbg !131 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 3), metadata !121, metadata !DIExpression()), !dbg !132 // %0 = load atomic i64, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 3) acquire, align 8, !dbg !59 // LD: Guess // : Acquire old_cr = cr(4,0+3*1); cr(4,0+3*1) = get_rng(0,NCONTEXT-1);// 4 ASSIGN LDCOM _l52_c16 // Check ASSUME(active[cr(4,0+3*1)] == 4); ASSUME(cr(4,0+3*1) >= iw(4,0+3*1)); ASSUME(cr(4,0+3*1) >= 0); ASSUME(cr(4,0+3*1) >= cdy[4]); ASSUME(cr(4,0+3*1) >= cisb[4]); ASSUME(cr(4,0+3*1) >= cdl[4]); ASSUME(cr(4,0+3*1) >= cl[4]); ASSUME(cr(4,0+3*1) >= cx(4,0+3*1)); ASSUME(cr(4,0+3*1) >= cs(4,0+0)); ASSUME(cr(4,0+3*1) >= cs(4,0+1)); ASSUME(cr(4,0+3*1) >= cs(4,0+2)); ASSUME(cr(4,0+3*1) >= cs(4,0+3)); ASSUME(cr(4,0+3*1) >= cs(4,0+4)); ASSUME(cr(4,0+3*1) >= cs(4,0+5)); ASSUME(cr(4,0+3*1) >= cs(4,6+0)); ASSUME(cr(4,0+3*1) >= cs(4,7+0)); ASSUME(cr(4,0+3*1) >= cs(4,11+0)); ASSUME(cr(4,0+3*1) >= cs(4,8+0)); ASSUME(cr(4,0+3*1) >= cs(4,9+0)); ASSUME(cr(4,0+3*1) >= cs(4,10+0)); // Update creg_r3 = cr(4,0+3*1); crmax(4,0+3*1) = max(crmax(4,0+3*1),cr(4,0+3*1)); caddr[4] = max(caddr[4],0); if(cr(4,0+3*1) < cw(4,0+3*1)) { r3 = buff(4,0+3*1); ASSUME((!(( (cw(4,0+3*1) < 1) && (1 < crmax(4,0+3*1)) )))||(sforbid(0+3*1,1)> 0)); ASSUME((!(( (cw(4,0+3*1) < 2) && (2 < crmax(4,0+3*1)) )))||(sforbid(0+3*1,2)> 0)); ASSUME((!(( (cw(4,0+3*1) < 3) && (3 < crmax(4,0+3*1)) )))||(sforbid(0+3*1,3)> 0)); ASSUME((!(( (cw(4,0+3*1) < 4) && (4 < crmax(4,0+3*1)) )))||(sforbid(0+3*1,4)> 0)); } else { if(pw(4,0+3*1) != co(0+3*1,cr(4,0+3*1))) { ASSUME(cr(4,0+3*1) >= old_cr); } pw(4,0+3*1) = co(0+3*1,cr(4,0+3*1)); r3 = mem(0+3*1,cr(4,0+3*1)); } cl[4] = max(cl[4],cr(4,0+3*1)); ASSUME(creturn[4] >= cr(4,0+3*1)); // call void @llvm.dbg.value(metadata i64 %0, metadata !123, metadata !DIExpression()), !dbg !132 // %conv = trunc i64 %0 to i32, !dbg !60 // call void @llvm.dbg.value(metadata i32 %conv, metadata !120, metadata !DIExpression()), !dbg !129 // call void (...) @dmbsy(), !dbg !61 // dumbsy: Guess old_cdy = cdy[4]; cdy[4] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[4] >= old_cdy); ASSUME(cdy[4] >= cisb[4]); ASSUME(cdy[4] >= cdl[4]); ASSUME(cdy[4] >= cds[4]); ASSUME(cdy[4] >= cctrl[4]); ASSUME(cdy[4] >= cw(4,0+0)); ASSUME(cdy[4] >= cw(4,0+1)); ASSUME(cdy[4] >= cw(4,0+2)); ASSUME(cdy[4] >= cw(4,0+3)); ASSUME(cdy[4] >= cw(4,0+4)); ASSUME(cdy[4] >= cw(4,0+5)); ASSUME(cdy[4] >= cw(4,6+0)); ASSUME(cdy[4] >= cw(4,7+0)); ASSUME(cdy[4] >= cw(4,11+0)); ASSUME(cdy[4] >= cw(4,8+0)); ASSUME(cdy[4] >= cw(4,9+0)); ASSUME(cdy[4] >= cw(4,10+0)); ASSUME(cdy[4] >= cr(4,0+0)); ASSUME(cdy[4] >= cr(4,0+1)); ASSUME(cdy[4] >= cr(4,0+2)); ASSUME(cdy[4] >= cr(4,0+3)); ASSUME(cdy[4] >= cr(4,0+4)); ASSUME(cdy[4] >= cr(4,0+5)); ASSUME(cdy[4] >= cr(4,6+0)); ASSUME(cdy[4] >= cr(4,7+0)); ASSUME(cdy[4] >= cr(4,11+0)); ASSUME(cdy[4] >= cr(4,8+0)); ASSUME(cdy[4] >= cr(4,9+0)); ASSUME(cdy[4] >= cr(4,10+0)); ASSUME(creturn[4] >= cdy[4]); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 4), metadata !124, metadata !DIExpression()), !dbg !136 // call void @llvm.dbg.value(metadata i64 1, metadata !126, metadata !DIExpression()), !dbg !136 // store atomic i64 1, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 4) monotonic, align 8, !dbg !63 // ST: Guess iw(4,0+4*1) = get_rng(0,NCONTEXT-1);// 4 ASSIGN STIW _l54_c3 old_cw = cw(4,0+4*1); cw(4,0+4*1) = get_rng(0,NCONTEXT-1);// 4 ASSIGN STCOM _l54_c3 // Check ASSUME(active[iw(4,0+4*1)] == 4); ASSUME(active[cw(4,0+4*1)] == 4); ASSUME(sforbid(0+4*1,cw(4,0+4*1))== 0); ASSUME(iw(4,0+4*1) >= 0); ASSUME(iw(4,0+4*1) >= 0); ASSUME(cw(4,0+4*1) >= iw(4,0+4*1)); ASSUME(cw(4,0+4*1) >= old_cw); ASSUME(cw(4,0+4*1) >= cr(4,0+4*1)); ASSUME(cw(4,0+4*1) >= cl[4]); ASSUME(cw(4,0+4*1) >= cisb[4]); ASSUME(cw(4,0+4*1) >= cdy[4]); ASSUME(cw(4,0+4*1) >= cdl[4]); ASSUME(cw(4,0+4*1) >= cds[4]); ASSUME(cw(4,0+4*1) >= cctrl[4]); ASSUME(cw(4,0+4*1) >= caddr[4]); // Update caddr[4] = max(caddr[4],0); buff(4,0+4*1) = 1; mem(0+4*1,cw(4,0+4*1)) = 1; co(0+4*1,cw(4,0+4*1))+=1; delta(0+4*1,cw(4,0+4*1)) = -1; ASSUME(creturn[4] >= cw(4,0+4*1)); // %cmp = icmp eq i32 %conv, 1, !dbg !64 creg__r3__1_ = max(0,creg_r3); // %conv1 = zext i1 %cmp to i32, !dbg !64 // call void @llvm.dbg.value(metadata i32 %conv1, metadata !127, metadata !DIExpression()), !dbg !129 // store i32 %conv1, i32* @atom_3_X0_1, align 4, !dbg !65, !tbaa !66 // ST: Guess iw(4,9) = get_rng(0,NCONTEXT-1);// 4 ASSIGN STIW _l56_c15 old_cw = cw(4,9); cw(4,9) = get_rng(0,NCONTEXT-1);// 4 ASSIGN STCOM _l56_c15 // Check ASSUME(active[iw(4,9)] == 4); ASSUME(active[cw(4,9)] == 4); ASSUME(sforbid(9,cw(4,9))== 0); ASSUME(iw(4,9) >= creg__r3__1_); ASSUME(iw(4,9) >= 0); ASSUME(cw(4,9) >= iw(4,9)); ASSUME(cw(4,9) >= old_cw); ASSUME(cw(4,9) >= cr(4,9)); ASSUME(cw(4,9) >= cl[4]); ASSUME(cw(4,9) >= cisb[4]); ASSUME(cw(4,9) >= cdy[4]); ASSUME(cw(4,9) >= cdl[4]); ASSUME(cw(4,9) >= cds[4]); ASSUME(cw(4,9) >= cctrl[4]); ASSUME(cw(4,9) >= caddr[4]); // Update caddr[4] = max(caddr[4],0); buff(4,9) = (r3==1); mem(9,cw(4,9)) = (r3==1); co(9,cw(4,9))+=1; delta(9,cw(4,9)) = -1; ASSUME(creturn[4] >= cw(4,9)); // ret i8* null, !dbg !70 ret_thread_4 = (- 1); goto T4BLOCK_END; T4BLOCK_END: // Dumping thread 5 int ret_thread_5 = 0; cdy[5] = get_rng(0,NCONTEXT-1); ASSUME(cdy[5] >= cstart[5]); T5BLOCK0: // call void @llvm.dbg.value(metadata i8* %arg, metadata !143, metadata !DIExpression()), !dbg !153 // br label %label_5, !dbg !56 goto T5BLOCK1; T5BLOCK1: // call void @llvm.dbg.label(metadata !152), !dbg !155 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 4), metadata !145, metadata !DIExpression()), !dbg !156 // %0 = load atomic i64, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 4) monotonic, align 8, !dbg !59 // LD: Guess old_cr = cr(5,0+4*1); cr(5,0+4*1) = get_rng(0,NCONTEXT-1);// 5 ASSIGN LDCOM _l62_c16 // Check ASSUME(active[cr(5,0+4*1)] == 5); ASSUME(cr(5,0+4*1) >= iw(5,0+4*1)); ASSUME(cr(5,0+4*1) >= 0); ASSUME(cr(5,0+4*1) >= cdy[5]); ASSUME(cr(5,0+4*1) >= cisb[5]); ASSUME(cr(5,0+4*1) >= cdl[5]); ASSUME(cr(5,0+4*1) >= cl[5]); // Update creg_r4 = cr(5,0+4*1); crmax(5,0+4*1) = max(crmax(5,0+4*1),cr(5,0+4*1)); caddr[5] = max(caddr[5],0); if(cr(5,0+4*1) < cw(5,0+4*1)) { r4 = buff(5,0+4*1); ASSUME((!(( (cw(5,0+4*1) < 1) && (1 < crmax(5,0+4*1)) )))||(sforbid(0+4*1,1)> 0)); ASSUME((!(( (cw(5,0+4*1) < 2) && (2 < crmax(5,0+4*1)) )))||(sforbid(0+4*1,2)> 0)); ASSUME((!(( (cw(5,0+4*1) < 3) && (3 < crmax(5,0+4*1)) )))||(sforbid(0+4*1,3)> 0)); ASSUME((!(( (cw(5,0+4*1) < 4) && (4 < crmax(5,0+4*1)) )))||(sforbid(0+4*1,4)> 0)); } else { if(pw(5,0+4*1) != co(0+4*1,cr(5,0+4*1))) { ASSUME(cr(5,0+4*1) >= old_cr); } pw(5,0+4*1) = co(0+4*1,cr(5,0+4*1)); r4 = mem(0+4*1,cr(5,0+4*1)); } ASSUME(creturn[5] >= cr(5,0+4*1)); // call void @llvm.dbg.value(metadata i64 %0, metadata !147, metadata !DIExpression()), !dbg !156 // %conv = trunc i64 %0 to i32, !dbg !60 // call void @llvm.dbg.value(metadata i32 %conv, metadata !144, metadata !DIExpression()), !dbg !153 // call void (...) @dmbsy(), !dbg !61 // dumbsy: Guess old_cdy = cdy[5]; cdy[5] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[5] >= old_cdy); ASSUME(cdy[5] >= cisb[5]); ASSUME(cdy[5] >= cdl[5]); ASSUME(cdy[5] >= cds[5]); ASSUME(cdy[5] >= cctrl[5]); ASSUME(cdy[5] >= cw(5,0+0)); ASSUME(cdy[5] >= cw(5,0+1)); ASSUME(cdy[5] >= cw(5,0+2)); ASSUME(cdy[5] >= cw(5,0+3)); ASSUME(cdy[5] >= cw(5,0+4)); ASSUME(cdy[5] >= cw(5,0+5)); ASSUME(cdy[5] >= cw(5,6+0)); ASSUME(cdy[5] >= cw(5,7+0)); ASSUME(cdy[5] >= cw(5,11+0)); ASSUME(cdy[5] >= cw(5,8+0)); ASSUME(cdy[5] >= cw(5,9+0)); ASSUME(cdy[5] >= cw(5,10+0)); ASSUME(cdy[5] >= cr(5,0+0)); ASSUME(cdy[5] >= cr(5,0+1)); ASSUME(cdy[5] >= cr(5,0+2)); ASSUME(cdy[5] >= cr(5,0+3)); ASSUME(cdy[5] >= cr(5,0+4)); ASSUME(cdy[5] >= cr(5,0+5)); ASSUME(cdy[5] >= cr(5,6+0)); ASSUME(cdy[5] >= cr(5,7+0)); ASSUME(cdy[5] >= cr(5,11+0)); ASSUME(cdy[5] >= cr(5,8+0)); ASSUME(cdy[5] >= cr(5,9+0)); ASSUME(cdy[5] >= cr(5,10+0)); ASSUME(creturn[5] >= cdy[5]); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 5), metadata !148, metadata !DIExpression()), !dbg !160 // call void @llvm.dbg.value(metadata i64 1, metadata !150, metadata !DIExpression()), !dbg !160 // store atomic i64 1, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 5) monotonic, align 8, !dbg !63 // ST: Guess iw(5,0+5*1) = get_rng(0,NCONTEXT-1);// 5 ASSIGN STIW _l64_c3 old_cw = cw(5,0+5*1); cw(5,0+5*1) = get_rng(0,NCONTEXT-1);// 5 ASSIGN STCOM _l64_c3 // Check ASSUME(active[iw(5,0+5*1)] == 5); ASSUME(active[cw(5,0+5*1)] == 5); ASSUME(sforbid(0+5*1,cw(5,0+5*1))== 0); ASSUME(iw(5,0+5*1) >= 0); ASSUME(iw(5,0+5*1) >= 0); ASSUME(cw(5,0+5*1) >= iw(5,0+5*1)); ASSUME(cw(5,0+5*1) >= old_cw); ASSUME(cw(5,0+5*1) >= cr(5,0+5*1)); ASSUME(cw(5,0+5*1) >= cl[5]); ASSUME(cw(5,0+5*1) >= cisb[5]); ASSUME(cw(5,0+5*1) >= cdy[5]); ASSUME(cw(5,0+5*1) >= cdl[5]); ASSUME(cw(5,0+5*1) >= cds[5]); ASSUME(cw(5,0+5*1) >= cctrl[5]); ASSUME(cw(5,0+5*1) >= caddr[5]); // Update caddr[5] = max(caddr[5],0); buff(5,0+5*1) = 1; mem(0+5*1,cw(5,0+5*1)) = 1; co(0+5*1,cw(5,0+5*1))+=1; delta(0+5*1,cw(5,0+5*1)) = -1; ASSUME(creturn[5] >= cw(5,0+5*1)); // %cmp = icmp eq i32 %conv, 1, !dbg !64 creg__r4__1_ = max(0,creg_r4); // %conv1 = zext i1 %cmp to i32, !dbg !64 // call void @llvm.dbg.value(metadata i32 %conv1, metadata !151, metadata !DIExpression()), !dbg !153 // store i32 %conv1, i32* @atom_4_X0_1, align 4, !dbg !65, !tbaa !66 // ST: Guess iw(5,10) = get_rng(0,NCONTEXT-1);// 5 ASSIGN STIW _l66_c15 old_cw = cw(5,10); cw(5,10) = get_rng(0,NCONTEXT-1);// 5 ASSIGN STCOM _l66_c15 // Check ASSUME(active[iw(5,10)] == 5); ASSUME(active[cw(5,10)] == 5); ASSUME(sforbid(10,cw(5,10))== 0); ASSUME(iw(5,10) >= creg__r4__1_); ASSUME(iw(5,10) >= 0); ASSUME(cw(5,10) >= iw(5,10)); ASSUME(cw(5,10) >= old_cw); ASSUME(cw(5,10) >= cr(5,10)); ASSUME(cw(5,10) >= cl[5]); ASSUME(cw(5,10) >= cisb[5]); ASSUME(cw(5,10) >= cdy[5]); ASSUME(cw(5,10) >= cdl[5]); ASSUME(cw(5,10) >= cds[5]); ASSUME(cw(5,10) >= cctrl[5]); ASSUME(cw(5,10) >= caddr[5]); // Update caddr[5] = max(caddr[5],0); buff(5,10) = (r4==1); mem(10,cw(5,10)) = (r4==1); co(10,cw(5,10))+=1; delta(10,cw(5,10)) = -1; ASSUME(creturn[5] >= cw(5,10)); // ret i8* null, !dbg !70 ret_thread_5 = (- 1); goto T5BLOCK_END; T5BLOCK_END: // Dumping thread 6 int ret_thread_6 = 0; cdy[6] = get_rng(0,NCONTEXT-1); ASSUME(cdy[6] >= cstart[6]); T6BLOCK0: // call void @llvm.dbg.value(metadata i8* %arg, metadata !167, metadata !DIExpression()), !dbg !177 // br label %label_6, !dbg !56 goto T6BLOCK1; T6BLOCK1: // call void @llvm.dbg.label(metadata !176), !dbg !179 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 5), metadata !169, metadata !DIExpression()), !dbg !180 // %0 = load atomic i64, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 5) monotonic, align 8, !dbg !59 // LD: Guess old_cr = cr(6,0+5*1); cr(6,0+5*1) = get_rng(0,NCONTEXT-1);// 6 ASSIGN LDCOM _l72_c16 // Check ASSUME(active[cr(6,0+5*1)] == 6); ASSUME(cr(6,0+5*1) >= iw(6,0+5*1)); ASSUME(cr(6,0+5*1) >= 0); ASSUME(cr(6,0+5*1) >= cdy[6]); ASSUME(cr(6,0+5*1) >= cisb[6]); ASSUME(cr(6,0+5*1) >= cdl[6]); ASSUME(cr(6,0+5*1) >= cl[6]); // Update creg_r5 = cr(6,0+5*1); crmax(6,0+5*1) = max(crmax(6,0+5*1),cr(6,0+5*1)); caddr[6] = max(caddr[6],0); if(cr(6,0+5*1) < cw(6,0+5*1)) { r5 = buff(6,0+5*1); ASSUME((!(( (cw(6,0+5*1) < 1) && (1 < crmax(6,0+5*1)) )))||(sforbid(0+5*1,1)> 0)); ASSUME((!(( (cw(6,0+5*1) < 2) && (2 < crmax(6,0+5*1)) )))||(sforbid(0+5*1,2)> 0)); ASSUME((!(( (cw(6,0+5*1) < 3) && (3 < crmax(6,0+5*1)) )))||(sforbid(0+5*1,3)> 0)); ASSUME((!(( (cw(6,0+5*1) < 4) && (4 < crmax(6,0+5*1)) )))||(sforbid(0+5*1,4)> 0)); } else { if(pw(6,0+5*1) != co(0+5*1,cr(6,0+5*1))) { ASSUME(cr(6,0+5*1) >= old_cr); } pw(6,0+5*1) = co(0+5*1,cr(6,0+5*1)); r5 = mem(0+5*1,cr(6,0+5*1)); } ASSUME(creturn[6] >= cr(6,0+5*1)); // call void @llvm.dbg.value(metadata i64 %0, metadata !171, metadata !DIExpression()), !dbg !180 // %conv = trunc i64 %0 to i32, !dbg !60 // call void @llvm.dbg.value(metadata i32 %conv, metadata !168, metadata !DIExpression()), !dbg !177 // call void (...) @dmbsy(), !dbg !61 // dumbsy: Guess old_cdy = cdy[6]; cdy[6] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[6] >= old_cdy); ASSUME(cdy[6] >= cisb[6]); ASSUME(cdy[6] >= cdl[6]); ASSUME(cdy[6] >= cds[6]); ASSUME(cdy[6] >= cctrl[6]); ASSUME(cdy[6] >= cw(6,0+0)); ASSUME(cdy[6] >= cw(6,0+1)); ASSUME(cdy[6] >= cw(6,0+2)); ASSUME(cdy[6] >= cw(6,0+3)); ASSUME(cdy[6] >= cw(6,0+4)); ASSUME(cdy[6] >= cw(6,0+5)); ASSUME(cdy[6] >= cw(6,6+0)); ASSUME(cdy[6] >= cw(6,7+0)); ASSUME(cdy[6] >= cw(6,11+0)); ASSUME(cdy[6] >= cw(6,8+0)); ASSUME(cdy[6] >= cw(6,9+0)); ASSUME(cdy[6] >= cw(6,10+0)); ASSUME(cdy[6] >= cr(6,0+0)); ASSUME(cdy[6] >= cr(6,0+1)); ASSUME(cdy[6] >= cr(6,0+2)); ASSUME(cdy[6] >= cr(6,0+3)); ASSUME(cdy[6] >= cr(6,0+4)); ASSUME(cdy[6] >= cr(6,0+5)); ASSUME(cdy[6] >= cr(6,6+0)); ASSUME(cdy[6] >= cr(6,7+0)); ASSUME(cdy[6] >= cr(6,11+0)); ASSUME(cdy[6] >= cr(6,8+0)); ASSUME(cdy[6] >= cr(6,9+0)); ASSUME(cdy[6] >= cr(6,10+0)); ASSUME(creturn[6] >= cdy[6]); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 1), metadata !172, metadata !DIExpression()), !dbg !184 // call void @llvm.dbg.value(metadata i64 1, metadata !174, metadata !DIExpression()), !dbg !184 // store atomic i64 1, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !63 // ST: Guess iw(6,0+1*1) = get_rng(0,NCONTEXT-1);// 6 ASSIGN STIW _l74_c3 old_cw = cw(6,0+1*1); cw(6,0+1*1) = get_rng(0,NCONTEXT-1);// 6 ASSIGN STCOM _l74_c3 // Check ASSUME(active[iw(6,0+1*1)] == 6); ASSUME(active[cw(6,0+1*1)] == 6); ASSUME(sforbid(0+1*1,cw(6,0+1*1))== 0); ASSUME(iw(6,0+1*1) >= 0); ASSUME(iw(6,0+1*1) >= 0); ASSUME(cw(6,0+1*1) >= iw(6,0+1*1)); ASSUME(cw(6,0+1*1) >= old_cw); ASSUME(cw(6,0+1*1) >= cr(6,0+1*1)); ASSUME(cw(6,0+1*1) >= cl[6]); ASSUME(cw(6,0+1*1) >= cisb[6]); ASSUME(cw(6,0+1*1) >= cdy[6]); ASSUME(cw(6,0+1*1) >= cdl[6]); ASSUME(cw(6,0+1*1) >= cds[6]); ASSUME(cw(6,0+1*1) >= cctrl[6]); ASSUME(cw(6,0+1*1) >= caddr[6]); // Update caddr[6] = max(caddr[6],0); buff(6,0+1*1) = 1; mem(0+1*1,cw(6,0+1*1)) = 1; co(0+1*1,cw(6,0+1*1))+=1; delta(0+1*1,cw(6,0+1*1)) = -1; ASSUME(creturn[6] >= cw(6,0+1*1)); // %cmp = icmp eq i32 %conv, 1, !dbg !64 creg__r5__1_ = max(0,creg_r5); // %conv1 = zext i1 %cmp to i32, !dbg !64 // call void @llvm.dbg.value(metadata i32 %conv1, metadata !175, metadata !DIExpression()), !dbg !177 // store i32 %conv1, i32* @atom_5_X0_1, align 4, !dbg !65, !tbaa !66 // ST: Guess iw(6,11) = get_rng(0,NCONTEXT-1);// 6 ASSIGN STIW _l76_c15 old_cw = cw(6,11); cw(6,11) = get_rng(0,NCONTEXT-1);// 6 ASSIGN STCOM _l76_c15 // Check ASSUME(active[iw(6,11)] == 6); ASSUME(active[cw(6,11)] == 6); ASSUME(sforbid(11,cw(6,11))== 0); ASSUME(iw(6,11) >= creg__r5__1_); ASSUME(iw(6,11) >= 0); ASSUME(cw(6,11) >= iw(6,11)); ASSUME(cw(6,11) >= old_cw); ASSUME(cw(6,11) >= cr(6,11)); ASSUME(cw(6,11) >= cl[6]); ASSUME(cw(6,11) >= cisb[6]); ASSUME(cw(6,11) >= cdy[6]); ASSUME(cw(6,11) >= cdl[6]); ASSUME(cw(6,11) >= cds[6]); ASSUME(cw(6,11) >= cctrl[6]); ASSUME(cw(6,11) >= caddr[6]); // Update caddr[6] = max(caddr[6],0); buff(6,11) = (r5==1); mem(11,cw(6,11)) = (r5==1); co(11,cw(6,11))+=1; delta(11,cw(6,11)) = -1; ASSUME(creturn[6] >= cw(6,11)); // ret i8* null, !dbg !70 ret_thread_6 = (- 1); goto T6BLOCK_END; T6BLOCK_END: // Dumping thread 0 int ret_thread_0 = 0; cdy[0] = get_rng(0,NCONTEXT-1); ASSUME(cdy[0] >= cstart[0]); T0BLOCK0: // %thr0 = alloca i64, align 8 // %thr1 = alloca i64, align 8 // %thr2 = alloca i64, align 8 // %thr3 = alloca i64, align 8 // %thr4 = alloca i64, align 8 // %thr5 = alloca i64, align 8 // call void @llvm.dbg.value(metadata i32 %argc, metadata !196, metadata !DIExpression()), !dbg !236 // call void @llvm.dbg.value(metadata i8** %argv, metadata !197, metadata !DIExpression()), !dbg !236 // %0 = bitcast i64* %thr0 to i8*, !dbg !89 // call void @llvm.lifetime.start.p0i8(i64 8, i8* %0) #7, !dbg !89 // call void @llvm.dbg.declare(metadata i64* %thr0, metadata !198, metadata !DIExpression()), !dbg !238 // %1 = bitcast i64* %thr1 to i8*, !dbg !91 // call void @llvm.lifetime.start.p0i8(i64 8, i8* %1) #7, !dbg !91 // call void @llvm.dbg.declare(metadata i64* %thr1, metadata !202, metadata !DIExpression()), !dbg !240 // %2 = bitcast i64* %thr2 to i8*, !dbg !93 // call void @llvm.lifetime.start.p0i8(i64 8, i8* %2) #7, !dbg !93 // call void @llvm.dbg.declare(metadata i64* %thr2, metadata !203, metadata !DIExpression()), !dbg !242 // %3 = bitcast i64* %thr3 to i8*, !dbg !95 // call void @llvm.lifetime.start.p0i8(i64 8, i8* %3) #7, !dbg !95 // call void @llvm.dbg.declare(metadata i64* %thr3, metadata !204, metadata !DIExpression()), !dbg !244 // %4 = bitcast i64* %thr4 to i8*, !dbg !97 // call void @llvm.lifetime.start.p0i8(i64 8, i8* %4) #7, !dbg !97 // call void @llvm.dbg.declare(metadata i64* %thr4, metadata !205, metadata !DIExpression()), !dbg !246 // %5 = bitcast i64* %thr5 to i8*, !dbg !99 // call void @llvm.lifetime.start.p0i8(i64 8, i8* %5) #7, !dbg !99 // call void @llvm.dbg.declare(metadata i64* %thr5, metadata !206, metadata !DIExpression()), !dbg !248 // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 5), metadata !207, metadata !DIExpression()), !dbg !249 // call void @llvm.dbg.value(metadata i64 0, metadata !209, metadata !DIExpression()), !dbg !249 // store atomic i64 0, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 5) monotonic, align 8, !dbg !102 // ST: Guess iw(0,0+5*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l88_c3 old_cw = cw(0,0+5*1); cw(0,0+5*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l88_c3 // Check ASSUME(active[iw(0,0+5*1)] == 0); ASSUME(active[cw(0,0+5*1)] == 0); ASSUME(sforbid(0+5*1,cw(0,0+5*1))== 0); ASSUME(iw(0,0+5*1) >= 0); ASSUME(iw(0,0+5*1) >= 0); ASSUME(cw(0,0+5*1) >= iw(0,0+5*1)); ASSUME(cw(0,0+5*1) >= old_cw); ASSUME(cw(0,0+5*1) >= cr(0,0+5*1)); ASSUME(cw(0,0+5*1) >= cl[0]); ASSUME(cw(0,0+5*1) >= cisb[0]); ASSUME(cw(0,0+5*1) >= cdy[0]); ASSUME(cw(0,0+5*1) >= cdl[0]); ASSUME(cw(0,0+5*1) >= cds[0]); ASSUME(cw(0,0+5*1) >= cctrl[0]); ASSUME(cw(0,0+5*1) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,0+5*1) = 0; mem(0+5*1,cw(0,0+5*1)) = 0; co(0+5*1,cw(0,0+5*1))+=1; delta(0+5*1,cw(0,0+5*1)) = -1; ASSUME(creturn[0] >= cw(0,0+5*1)); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 4), metadata !210, metadata !DIExpression()), !dbg !251 // call void @llvm.dbg.value(metadata i64 0, metadata !212, metadata !DIExpression()), !dbg !251 // store atomic i64 0, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 4) monotonic, align 8, !dbg !104 // ST: Guess iw(0,0+4*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l89_c3 old_cw = cw(0,0+4*1); cw(0,0+4*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l89_c3 // Check ASSUME(active[iw(0,0+4*1)] == 0); ASSUME(active[cw(0,0+4*1)] == 0); ASSUME(sforbid(0+4*1,cw(0,0+4*1))== 0); ASSUME(iw(0,0+4*1) >= 0); ASSUME(iw(0,0+4*1) >= 0); ASSUME(cw(0,0+4*1) >= iw(0,0+4*1)); ASSUME(cw(0,0+4*1) >= old_cw); ASSUME(cw(0,0+4*1) >= cr(0,0+4*1)); ASSUME(cw(0,0+4*1) >= cl[0]); ASSUME(cw(0,0+4*1) >= cisb[0]); ASSUME(cw(0,0+4*1) >= cdy[0]); ASSUME(cw(0,0+4*1) >= cdl[0]); ASSUME(cw(0,0+4*1) >= cds[0]); ASSUME(cw(0,0+4*1) >= cctrl[0]); ASSUME(cw(0,0+4*1) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,0+4*1) = 0; mem(0+4*1,cw(0,0+4*1)) = 0; co(0+4*1,cw(0,0+4*1))+=1; delta(0+4*1,cw(0,0+4*1)) = -1; ASSUME(creturn[0] >= cw(0,0+4*1)); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 3), metadata !213, metadata !DIExpression()), !dbg !253 // call void @llvm.dbg.value(metadata i64 0, metadata !215, metadata !DIExpression()), !dbg !253 // store atomic i64 0, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 3) monotonic, align 8, !dbg !106 // ST: Guess iw(0,0+3*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l90_c3 old_cw = cw(0,0+3*1); cw(0,0+3*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l90_c3 // Check ASSUME(active[iw(0,0+3*1)] == 0); ASSUME(active[cw(0,0+3*1)] == 0); ASSUME(sforbid(0+3*1,cw(0,0+3*1))== 0); ASSUME(iw(0,0+3*1) >= 0); ASSUME(iw(0,0+3*1) >= 0); ASSUME(cw(0,0+3*1) >= iw(0,0+3*1)); ASSUME(cw(0,0+3*1) >= old_cw); ASSUME(cw(0,0+3*1) >= cr(0,0+3*1)); ASSUME(cw(0,0+3*1) >= cl[0]); ASSUME(cw(0,0+3*1) >= cisb[0]); ASSUME(cw(0,0+3*1) >= cdy[0]); ASSUME(cw(0,0+3*1) >= cdl[0]); ASSUME(cw(0,0+3*1) >= cds[0]); ASSUME(cw(0,0+3*1) >= cctrl[0]); ASSUME(cw(0,0+3*1) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,0+3*1) = 0; mem(0+3*1,cw(0,0+3*1)) = 0; co(0+3*1,cw(0,0+3*1))+=1; delta(0+3*1,cw(0,0+3*1)) = -1; ASSUME(creturn[0] >= cw(0,0+3*1)); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 2), metadata !216, metadata !DIExpression()), !dbg !255 // call void @llvm.dbg.value(metadata i64 0, metadata !218, metadata !DIExpression()), !dbg !255 // store atomic i64 0, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !108 // ST: Guess iw(0,0+2*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l91_c3 old_cw = cw(0,0+2*1); cw(0,0+2*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l91_c3 // Check ASSUME(active[iw(0,0+2*1)] == 0); ASSUME(active[cw(0,0+2*1)] == 0); ASSUME(sforbid(0+2*1,cw(0,0+2*1))== 0); ASSUME(iw(0,0+2*1) >= 0); ASSUME(iw(0,0+2*1) >= 0); ASSUME(cw(0,0+2*1) >= iw(0,0+2*1)); ASSUME(cw(0,0+2*1) >= old_cw); ASSUME(cw(0,0+2*1) >= cr(0,0+2*1)); ASSUME(cw(0,0+2*1) >= cl[0]); ASSUME(cw(0,0+2*1) >= cisb[0]); ASSUME(cw(0,0+2*1) >= cdy[0]); ASSUME(cw(0,0+2*1) >= cdl[0]); ASSUME(cw(0,0+2*1) >= cds[0]); ASSUME(cw(0,0+2*1) >= cctrl[0]); ASSUME(cw(0,0+2*1) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,0+2*1) = 0; mem(0+2*1,cw(0,0+2*1)) = 0; co(0+2*1,cw(0,0+2*1))+=1; delta(0+2*1,cw(0,0+2*1)) = -1; ASSUME(creturn[0] >= cw(0,0+2*1)); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 1), metadata !219, metadata !DIExpression()), !dbg !257 // call void @llvm.dbg.value(metadata i64 0, metadata !221, metadata !DIExpression()), !dbg !257 // store atomic i64 0, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !110 // ST: Guess iw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l92_c3 old_cw = cw(0,0+1*1); cw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l92_c3 // Check ASSUME(active[iw(0,0+1*1)] == 0); ASSUME(active[cw(0,0+1*1)] == 0); ASSUME(sforbid(0+1*1,cw(0,0+1*1))== 0); ASSUME(iw(0,0+1*1) >= 0); ASSUME(iw(0,0+1*1) >= 0); ASSUME(cw(0,0+1*1) >= iw(0,0+1*1)); ASSUME(cw(0,0+1*1) >= old_cw); ASSUME(cw(0,0+1*1) >= cr(0,0+1*1)); ASSUME(cw(0,0+1*1) >= cl[0]); ASSUME(cw(0,0+1*1) >= cisb[0]); ASSUME(cw(0,0+1*1) >= cdy[0]); ASSUME(cw(0,0+1*1) >= cdl[0]); ASSUME(cw(0,0+1*1) >= cds[0]); ASSUME(cw(0,0+1*1) >= cctrl[0]); ASSUME(cw(0,0+1*1) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,0+1*1) = 0; mem(0+1*1,cw(0,0+1*1)) = 0; co(0+1*1,cw(0,0+1*1))+=1; delta(0+1*1,cw(0,0+1*1)) = -1; ASSUME(creturn[0] >= cw(0,0+1*1)); // call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 0), metadata !222, metadata !DIExpression()), !dbg !259 // call void @llvm.dbg.value(metadata i64 0, metadata !224, metadata !DIExpression()), !dbg !259 // store atomic i64 0, i64* getelementptr inbounds ([6 x i64], [6 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !112 // ST: Guess iw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l93_c3 old_cw = cw(0,0); cw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l93_c3 // Check ASSUME(active[iw(0,0)] == 0); ASSUME(active[cw(0,0)] == 0); ASSUME(sforbid(0,cw(0,0))== 0); ASSUME(iw(0,0) >= 0); ASSUME(iw(0,0) >= 0); ASSUME(cw(0,0) >= iw(0,0)); ASSUME(cw(0,0) >= old_cw); ASSUME(cw(0,0) >= cr(0,0)); ASSUME(cw(0,0) >= cl[0]); ASSUME(cw(0,0) >= cisb[0]); ASSUME(cw(0,0) >= cdy[0]); ASSUME(cw(0,0) >= cdl[0]); ASSUME(cw(0,0) >= cds[0]); ASSUME(cw(0,0) >= cctrl[0]); ASSUME(cw(0,0) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,0) = 0; mem(0,cw(0,0)) = 0; co(0,cw(0,0))+=1; delta(0,cw(0,0)) = -1; ASSUME(creturn[0] >= cw(0,0)); // store i32 0, i32* @atom_5_X0_1, align 4, !dbg !113, !tbaa !114 // ST: Guess iw(0,11) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l94_c15 old_cw = cw(0,11); cw(0,11) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l94_c15 // Check ASSUME(active[iw(0,11)] == 0); ASSUME(active[cw(0,11)] == 0); ASSUME(sforbid(11,cw(0,11))== 0); ASSUME(iw(0,11) >= 0); ASSUME(iw(0,11) >= 0); ASSUME(cw(0,11) >= iw(0,11)); ASSUME(cw(0,11) >= old_cw); ASSUME(cw(0,11) >= cr(0,11)); ASSUME(cw(0,11) >= cl[0]); ASSUME(cw(0,11) >= cisb[0]); ASSUME(cw(0,11) >= cdy[0]); ASSUME(cw(0,11) >= cdl[0]); ASSUME(cw(0,11) >= cds[0]); ASSUME(cw(0,11) >= cctrl[0]); ASSUME(cw(0,11) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,11) = 0; mem(11,cw(0,11)) = 0; co(11,cw(0,11))+=1; delta(11,cw(0,11)) = -1; ASSUME(creturn[0] >= cw(0,11)); // store i32 0, i32* @atom_0_X0_1, align 4, !dbg !118, !tbaa !114 // ST: Guess iw(0,6) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l95_c15 old_cw = cw(0,6); cw(0,6) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l95_c15 // Check ASSUME(active[iw(0,6)] == 0); ASSUME(active[cw(0,6)] == 0); ASSUME(sforbid(6,cw(0,6))== 0); ASSUME(iw(0,6) >= 0); ASSUME(iw(0,6) >= 0); ASSUME(cw(0,6) >= iw(0,6)); ASSUME(cw(0,6) >= old_cw); ASSUME(cw(0,6) >= cr(0,6)); ASSUME(cw(0,6) >= cl[0]); ASSUME(cw(0,6) >= cisb[0]); ASSUME(cw(0,6) >= cdy[0]); ASSUME(cw(0,6) >= cdl[0]); ASSUME(cw(0,6) >= cds[0]); ASSUME(cw(0,6) >= cctrl[0]); ASSUME(cw(0,6) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,6) = 0; mem(6,cw(0,6)) = 0; co(6,cw(0,6))+=1; delta(6,cw(0,6)) = -1; ASSUME(creturn[0] >= cw(0,6)); // store i32 0, i32* @atom_1_X0_1, align 4, !dbg !119, !tbaa !114 // ST: Guess iw(0,7) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l96_c15 old_cw = cw(0,7); cw(0,7) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l96_c15 // Check ASSUME(active[iw(0,7)] == 0); ASSUME(active[cw(0,7)] == 0); ASSUME(sforbid(7,cw(0,7))== 0); ASSUME(iw(0,7) >= 0); ASSUME(iw(0,7) >= 0); ASSUME(cw(0,7) >= iw(0,7)); ASSUME(cw(0,7) >= old_cw); ASSUME(cw(0,7) >= cr(0,7)); ASSUME(cw(0,7) >= cl[0]); ASSUME(cw(0,7) >= cisb[0]); ASSUME(cw(0,7) >= cdy[0]); ASSUME(cw(0,7) >= cdl[0]); ASSUME(cw(0,7) >= cds[0]); ASSUME(cw(0,7) >= cctrl[0]); ASSUME(cw(0,7) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,7) = 0; mem(7,cw(0,7)) = 0; co(7,cw(0,7))+=1; delta(7,cw(0,7)) = -1; ASSUME(creturn[0] >= cw(0,7)); // store i32 0, i32* @atom_2_X0_1, align 4, !dbg !120, !tbaa !114 // ST: Guess iw(0,8) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l97_c15 old_cw = cw(0,8); cw(0,8) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l97_c15 // Check ASSUME(active[iw(0,8)] == 0); ASSUME(active[cw(0,8)] == 0); ASSUME(sforbid(8,cw(0,8))== 0); ASSUME(iw(0,8) >= 0); ASSUME(iw(0,8) >= 0); ASSUME(cw(0,8) >= iw(0,8)); ASSUME(cw(0,8) >= old_cw); ASSUME(cw(0,8) >= cr(0,8)); ASSUME(cw(0,8) >= cl[0]); ASSUME(cw(0,8) >= cisb[0]); ASSUME(cw(0,8) >= cdy[0]); ASSUME(cw(0,8) >= cdl[0]); ASSUME(cw(0,8) >= cds[0]); ASSUME(cw(0,8) >= cctrl[0]); ASSUME(cw(0,8) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,8) = 0; mem(8,cw(0,8)) = 0; co(8,cw(0,8))+=1; delta(8,cw(0,8)) = -1; ASSUME(creturn[0] >= cw(0,8)); // store i32 0, i32* @atom_3_X0_1, align 4, !dbg !121, !tbaa !114 // ST: Guess iw(0,9) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l98_c15 old_cw = cw(0,9); cw(0,9) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l98_c15 // Check ASSUME(active[iw(0,9)] == 0); ASSUME(active[cw(0,9)] == 0); ASSUME(sforbid(9,cw(0,9))== 0); ASSUME(iw(0,9) >= 0); ASSUME(iw(0,9) >= 0); ASSUME(cw(0,9) >= iw(0,9)); ASSUME(cw(0,9) >= old_cw); ASSUME(cw(0,9) >= cr(0,9)); ASSUME(cw(0,9) >= cl[0]); ASSUME(cw(0,9) >= cisb[0]); ASSUME(cw(0,9) >= cdy[0]); ASSUME(cw(0,9) >= cdl[0]); ASSUME(cw(0,9) >= cds[0]); ASSUME(cw(0,9) >= cctrl[0]); ASSUME(cw(0,9) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,9) = 0; mem(9,cw(0,9)) = 0; co(9,cw(0,9))+=1; delta(9,cw(0,9)) = -1; ASSUME(creturn[0] >= cw(0,9)); // store i32 0, i32* @atom_4_X0_1, align 4, !dbg !122, !tbaa !114 // ST: Guess iw(0,10) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW _l99_c15 old_cw = cw(0,10); cw(0,10) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM _l99_c15 // Check ASSUME(active[iw(0,10)] == 0); ASSUME(active[cw(0,10)] == 0); ASSUME(sforbid(10,cw(0,10))== 0); ASSUME(iw(0,10) >= 0); ASSUME(iw(0,10) >= 0); ASSUME(cw(0,10) >= iw(0,10)); ASSUME(cw(0,10) >= old_cw); ASSUME(cw(0,10) >= cr(0,10)); ASSUME(cw(0,10) >= cl[0]); ASSUME(cw(0,10) >= cisb[0]); ASSUME(cw(0,10) >= cdy[0]); ASSUME(cw(0,10) >= cdl[0]); ASSUME(cw(0,10) >= cds[0]); ASSUME(cw(0,10) >= cctrl[0]); ASSUME(cw(0,10) >= caddr[0]); // Update caddr[0] = max(caddr[0],0); buff(0,10) = 0; mem(10,cw(0,10)) = 0; co(10,cw(0,10))+=1; delta(10,cw(0,10)) = -1; ASSUME(creturn[0] >= cw(0,10)); // %call = call i32 @pthread_create(i64* noundef %thr0, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t0, i8* noundef null) #7, !dbg !123 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cstart[1] >= cdy[0]); // %call11 = call i32 @pthread_create(i64* noundef %thr1, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t1, i8* noundef null) #7, !dbg !124 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cstart[2] >= cdy[0]); // %call12 = call i32 @pthread_create(i64* noundef %thr2, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t2, i8* noundef null) #7, !dbg !125 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cstart[3] >= cdy[0]); // %call13 = call i32 @pthread_create(i64* noundef %thr3, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t3, i8* noundef null) #7, !dbg !126 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cstart[4] >= cdy[0]); // %call14 = call i32 @pthread_create(i64* noundef %thr4, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t4, i8* noundef null) #7, !dbg !127 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cstart[5] >= cdy[0]); // %call15 = call i32 @pthread_create(i64* noundef %thr5, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t5, i8* noundef null) #7, !dbg !128 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cstart[6] >= cdy[0]); // %6 = load i64, i64* %thr0, align 8, !dbg !129, !tbaa !130 r7 = local_mem[0]; // %call16 = call i32 @pthread_join(i64 noundef %6, i8** noundef null), !dbg !132 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cdy[0] >= creturn[1]); // %7 = load i64, i64* %thr1, align 8, !dbg !133, !tbaa !130 r8 = local_mem[1]; // %call17 = call i32 @pthread_join(i64 noundef %7, i8** noundef null), !dbg !134 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cdy[0] >= creturn[2]); // %8 = load i64, i64* %thr2, align 8, !dbg !135, !tbaa !130 r9 = local_mem[2]; // %call18 = call i32 @pthread_join(i64 noundef %8, i8** noundef null), !dbg !136 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cdy[0] >= creturn[3]); // %9 = load i64, i64* %thr3, align 8, !dbg !137, !tbaa !130 r10 = local_mem[3]; // %call19 = call i32 @pthread_join(i64 noundef %9, i8** noundef null), !dbg !138 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cdy[0] >= creturn[4]); // %10 = load i64, i64* %thr4, align 8, !dbg !139, !tbaa !130 r11 = local_mem[4]; // %call20 = call i32 @pthread_join(i64 noundef %10, i8** noundef null), !dbg !140 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cdy[0] >= creturn[5]); // %11 = load i64, i64* %thr5, align 8, !dbg !141, !tbaa !130 r12 = local_mem[5]; // %call21 = call i32 @pthread_join(i64 noundef %11, i8** noundef null), !dbg !142 // dumbsy: Guess old_cdy = cdy[0]; cdy[0] = get_rng(0,NCONTEXT-1); // Check ASSUME(cdy[0] >= old_cdy); ASSUME(cdy[0] >= cisb[0]); ASSUME(cdy[0] >= cdl[0]); ASSUME(cdy[0] >= cds[0]); ASSUME(cdy[0] >= cctrl[0]); ASSUME(cdy[0] >= cw(0,0+0)); ASSUME(cdy[0] >= cw(0,0+1)); ASSUME(cdy[0] >= cw(0,0+2)); ASSUME(cdy[0] >= cw(0,0+3)); ASSUME(cdy[0] >= cw(0,0+4)); ASSUME(cdy[0] >= cw(0,0+5)); ASSUME(cdy[0] >= cw(0,6+0)); ASSUME(cdy[0] >= cw(0,7+0)); ASSUME(cdy[0] >= cw(0,11+0)); ASSUME(cdy[0] >= cw(0,8+0)); ASSUME(cdy[0] >= cw(0,9+0)); ASSUME(cdy[0] >= cw(0,10+0)); ASSUME(cdy[0] >= cr(0,0+0)); ASSUME(cdy[0] >= cr(0,0+1)); ASSUME(cdy[0] >= cr(0,0+2)); ASSUME(cdy[0] >= cr(0,0+3)); ASSUME(cdy[0] >= cr(0,0+4)); ASSUME(cdy[0] >= cr(0,0+5)); ASSUME(cdy[0] >= cr(0,6+0)); ASSUME(cdy[0] >= cr(0,7+0)); ASSUME(cdy[0] >= cr(0,11+0)); ASSUME(cdy[0] >= cr(0,8+0)); ASSUME(cdy[0] >= cr(0,9+0)); ASSUME(cdy[0] >= cr(0,10+0)); ASSUME(creturn[0] >= cdy[0]); ASSUME(cdy[0] >= creturn[6]); // %12 = load i32, i32* @atom_5_X0_1, align 4, !dbg !143, !tbaa !114 // LD: Guess old_cr = cr(0,11); cr(0,11) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l115_c13 // Check ASSUME(active[cr(0,11)] == 0); ASSUME(cr(0,11) >= iw(0,11)); ASSUME(cr(0,11) >= 0); ASSUME(cr(0,11) >= cdy[0]); ASSUME(cr(0,11) >= cisb[0]); ASSUME(cr(0,11) >= cdl[0]); ASSUME(cr(0,11) >= cl[0]); // Update creg_r13 = cr(0,11); crmax(0,11) = max(crmax(0,11),cr(0,11)); caddr[0] = max(caddr[0],0); if(cr(0,11) < cw(0,11)) { r13 = buff(0,11); ASSUME((!(( (cw(0,11) < 1) && (1 < crmax(0,11)) )))||(sforbid(11,1)> 0)); ASSUME((!(( (cw(0,11) < 2) && (2 < crmax(0,11)) )))||(sforbid(11,2)> 0)); ASSUME((!(( (cw(0,11) < 3) && (3 < crmax(0,11)) )))||(sforbid(11,3)> 0)); ASSUME((!(( (cw(0,11) < 4) && (4 < crmax(0,11)) )))||(sforbid(11,4)> 0)); } else { if(pw(0,11) != co(11,cr(0,11))) { ASSUME(cr(0,11) >= old_cr); } pw(0,11) = co(11,cr(0,11)); r13 = mem(11,cr(0,11)); } ASSUME(creturn[0] >= cr(0,11)); // call void @llvm.dbg.value(metadata i32 %12, metadata !225, metadata !DIExpression()), !dbg !236 // %13 = load i32, i32* @atom_0_X0_1, align 4, !dbg !144, !tbaa !114 // LD: Guess old_cr = cr(0,6); cr(0,6) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l116_c13 // Check ASSUME(active[cr(0,6)] == 0); ASSUME(cr(0,6) >= iw(0,6)); ASSUME(cr(0,6) >= 0); ASSUME(cr(0,6) >= cdy[0]); ASSUME(cr(0,6) >= cisb[0]); ASSUME(cr(0,6) >= cdl[0]); ASSUME(cr(0,6) >= cl[0]); // Update creg_r14 = cr(0,6); crmax(0,6) = max(crmax(0,6),cr(0,6)); caddr[0] = max(caddr[0],0); if(cr(0,6) < cw(0,6)) { r14 = buff(0,6); ASSUME((!(( (cw(0,6) < 1) && (1 < crmax(0,6)) )))||(sforbid(6,1)> 0)); ASSUME((!(( (cw(0,6) < 2) && (2 < crmax(0,6)) )))||(sforbid(6,2)> 0)); ASSUME((!(( (cw(0,6) < 3) && (3 < crmax(0,6)) )))||(sforbid(6,3)> 0)); ASSUME((!(( (cw(0,6) < 4) && (4 < crmax(0,6)) )))||(sforbid(6,4)> 0)); } else { if(pw(0,6) != co(6,cr(0,6))) { ASSUME(cr(0,6) >= old_cr); } pw(0,6) = co(6,cr(0,6)); r14 = mem(6,cr(0,6)); } ASSUME(creturn[0] >= cr(0,6)); // call void @llvm.dbg.value(metadata i32 %13, metadata !226, metadata !DIExpression()), !dbg !236 // %14 = load i32, i32* @atom_1_X0_1, align 4, !dbg !145, !tbaa !114 // LD: Guess old_cr = cr(0,7); cr(0,7) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l117_c13 // Check ASSUME(active[cr(0,7)] == 0); ASSUME(cr(0,7) >= iw(0,7)); ASSUME(cr(0,7) >= 0); ASSUME(cr(0,7) >= cdy[0]); ASSUME(cr(0,7) >= cisb[0]); ASSUME(cr(0,7) >= cdl[0]); ASSUME(cr(0,7) >= cl[0]); // Update creg_r15 = cr(0,7); crmax(0,7) = max(crmax(0,7),cr(0,7)); caddr[0] = max(caddr[0],0); if(cr(0,7) < cw(0,7)) { r15 = buff(0,7); ASSUME((!(( (cw(0,7) < 1) && (1 < crmax(0,7)) )))||(sforbid(7,1)> 0)); ASSUME((!(( (cw(0,7) < 2) && (2 < crmax(0,7)) )))||(sforbid(7,2)> 0)); ASSUME((!(( (cw(0,7) < 3) && (3 < crmax(0,7)) )))||(sforbid(7,3)> 0)); ASSUME((!(( (cw(0,7) < 4) && (4 < crmax(0,7)) )))||(sforbid(7,4)> 0)); } else { if(pw(0,7) != co(7,cr(0,7))) { ASSUME(cr(0,7) >= old_cr); } pw(0,7) = co(7,cr(0,7)); r15 = mem(7,cr(0,7)); } ASSUME(creturn[0] >= cr(0,7)); // call void @llvm.dbg.value(metadata i32 %14, metadata !227, metadata !DIExpression()), !dbg !236 // %15 = load i32, i32* @atom_2_X0_1, align 4, !dbg !146, !tbaa !114 // LD: Guess old_cr = cr(0,8); cr(0,8) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l118_c13 // Check ASSUME(active[cr(0,8)] == 0); ASSUME(cr(0,8) >= iw(0,8)); ASSUME(cr(0,8) >= 0); ASSUME(cr(0,8) >= cdy[0]); ASSUME(cr(0,8) >= cisb[0]); ASSUME(cr(0,8) >= cdl[0]); ASSUME(cr(0,8) >= cl[0]); // Update creg_r16 = cr(0,8); crmax(0,8) = max(crmax(0,8),cr(0,8)); caddr[0] = max(caddr[0],0); if(cr(0,8) < cw(0,8)) { r16 = buff(0,8); ASSUME((!(( (cw(0,8) < 1) && (1 < crmax(0,8)) )))||(sforbid(8,1)> 0)); ASSUME((!(( (cw(0,8) < 2) && (2 < crmax(0,8)) )))||(sforbid(8,2)> 0)); ASSUME((!(( (cw(0,8) < 3) && (3 < crmax(0,8)) )))||(sforbid(8,3)> 0)); ASSUME((!(( (cw(0,8) < 4) && (4 < crmax(0,8)) )))||(sforbid(8,4)> 0)); } else { if(pw(0,8) != co(8,cr(0,8))) { ASSUME(cr(0,8) >= old_cr); } pw(0,8) = co(8,cr(0,8)); r16 = mem(8,cr(0,8)); } ASSUME(creturn[0] >= cr(0,8)); // call void @llvm.dbg.value(metadata i32 %15, metadata !228, metadata !DIExpression()), !dbg !236 // %16 = load i32, i32* @atom_3_X0_1, align 4, !dbg !147, !tbaa !114 // LD: Guess old_cr = cr(0,9); cr(0,9) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l119_c13 // Check ASSUME(active[cr(0,9)] == 0); ASSUME(cr(0,9) >= iw(0,9)); ASSUME(cr(0,9) >= 0); ASSUME(cr(0,9) >= cdy[0]); ASSUME(cr(0,9) >= cisb[0]); ASSUME(cr(0,9) >= cdl[0]); ASSUME(cr(0,9) >= cl[0]); // Update creg_r17 = cr(0,9); crmax(0,9) = max(crmax(0,9),cr(0,9)); caddr[0] = max(caddr[0],0); if(cr(0,9) < cw(0,9)) { r17 = buff(0,9); ASSUME((!(( (cw(0,9) < 1) && (1 < crmax(0,9)) )))||(sforbid(9,1)> 0)); ASSUME((!(( (cw(0,9) < 2) && (2 < crmax(0,9)) )))||(sforbid(9,2)> 0)); ASSUME((!(( (cw(0,9) < 3) && (3 < crmax(0,9)) )))||(sforbid(9,3)> 0)); ASSUME((!(( (cw(0,9) < 4) && (4 < crmax(0,9)) )))||(sforbid(9,4)> 0)); } else { if(pw(0,9) != co(9,cr(0,9))) { ASSUME(cr(0,9) >= old_cr); } pw(0,9) = co(9,cr(0,9)); r17 = mem(9,cr(0,9)); } ASSUME(creturn[0] >= cr(0,9)); // call void @llvm.dbg.value(metadata i32 %16, metadata !229, metadata !DIExpression()), !dbg !236 // %17 = load i32, i32* @atom_4_X0_1, align 4, !dbg !148, !tbaa !114 // LD: Guess old_cr = cr(0,10); cr(0,10) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM _l120_c13 // Check ASSUME(active[cr(0,10)] == 0); ASSUME(cr(0,10) >= iw(0,10)); ASSUME(cr(0,10) >= 0); ASSUME(cr(0,10) >= cdy[0]); ASSUME(cr(0,10) >= cisb[0]); ASSUME(cr(0,10) >= cdl[0]); ASSUME(cr(0,10) >= cl[0]); // Update creg_r18 = cr(0,10); crmax(0,10) = max(crmax(0,10),cr(0,10)); caddr[0] = max(caddr[0],0); if(cr(0,10) < cw(0,10)) { r18 = buff(0,10); ASSUME((!(( (cw(0,10) < 1) && (1 < crmax(0,10)) )))||(sforbid(10,1)> 0)); ASSUME((!(( (cw(0,10) < 2) && (2 < crmax(0,10)) )))||(sforbid(10,2)> 0)); ASSUME((!(( (cw(0,10) < 3) && (3 < crmax(0,10)) )))||(sforbid(10,3)> 0)); ASSUME((!(( (cw(0,10) < 4) && (4 < crmax(0,10)) )))||(sforbid(10,4)> 0)); } else { if(pw(0,10) != co(10,cr(0,10))) { ASSUME(cr(0,10) >= old_cr); } pw(0,10) = co(10,cr(0,10)); r18 = mem(10,cr(0,10)); } ASSUME(creturn[0] >= cr(0,10)); // call void @llvm.dbg.value(metadata i32 %17, metadata !230, metadata !DIExpression()), !dbg !236 // %and = and i32 %16, %17, !dbg !149 creg_r19 = max(creg_r17,creg_r18); r19 = r17 & r18; // call void @llvm.dbg.value(metadata i32 %and, metadata !231, metadata !DIExpression()), !dbg !236 // %and22 = and i32 %15, %and, !dbg !150 creg_r20 = max(creg_r16,creg_r19); r20 = r16 & r19; // call void @llvm.dbg.value(metadata i32 %and22, metadata !232, metadata !DIExpression()), !dbg !236 // %and23 = and i32 %14, %and22, !dbg !151 creg_r21 = max(creg_r15,creg_r20); r21 = r15 & r20; // call void @llvm.dbg.value(metadata i32 %and23, metadata !233, metadata !DIExpression()), !dbg !236 // %and24 = and i32 %13, %and23, !dbg !152 creg_r22 = max(creg_r14,creg_r21); r22 = r14 & r21; // call void @llvm.dbg.value(metadata i32 %and24, metadata !234, metadata !DIExpression()), !dbg !236 // %and25 = and i32 %12, %and24, !dbg !153 creg_r23 = max(creg_r13,creg_r22); r23 = r13 & r22; // call void @llvm.dbg.value(metadata i32 %and25, metadata !235, metadata !DIExpression()), !dbg !236 // %cmp = icmp eq i32 %and25, 1, !dbg !154 creg__r23__1_ = max(0,creg_r23); // br i1 %cmp, label %if.then, label %if.end, !dbg !156 old_cctrl = cctrl[0]; cctrl[0] = get_rng(0,NCONTEXT-1); ASSUME(cctrl[0] >= old_cctrl); ASSUME(cctrl[0] >= creg__r23__1_); if((r23==1)) { goto T0BLOCK1; } else { goto T0BLOCK2; } T0BLOCK1: // call void @__assert_fail(i8* noundef getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* noundef getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0), i32 noundef 126, i8* noundef getelementptr inbounds ([23 x i8], [23 x i8]* @__PRETTY_FUNCTION__.main, i64 0, i64 0)) #8, !dbg !157 // unreachable, !dbg !157 r24 = 1; goto T0BLOCK_END; T0BLOCK2: // %18 = bitcast i64* %thr5 to i8*, !dbg !160 // call void @llvm.lifetime.end.p0i8(i64 8, i8* %18) #7, !dbg !160 // %19 = bitcast i64* %thr4 to i8*, !dbg !160 // call void @llvm.lifetime.end.p0i8(i64 8, i8* %19) #7, !dbg !160 // %20 = bitcast i64* %thr3 to i8*, !dbg !160 // call void @llvm.lifetime.end.p0i8(i64 8, i8* %20) #7, !dbg !160 // %21 = bitcast i64* %thr2 to i8*, !dbg !160 // call void @llvm.lifetime.end.p0i8(i64 8, i8* %21) #7, !dbg !160 // %22 = bitcast i64* %thr1 to i8*, !dbg !160 // call void @llvm.lifetime.end.p0i8(i64 8, i8* %22) #7, !dbg !160 // %23 = bitcast i64* %thr0 to i8*, !dbg !160 // call void @llvm.lifetime.end.p0i8(i64 8, i8* %23) #7, !dbg !160 // ret i32 0, !dbg !161 ret_thread_0 = 0; goto T0BLOCK_END; T0BLOCK_END: ASSUME(meminit(0,1) == mem(0,0)); ASSUME(coinit(0,1) == co(0,0)); ASSUME(deltainit(0,1) == delta(0,0)); ASSUME(meminit(0,2) == mem(0,1)); ASSUME(coinit(0,2) == co(0,1)); ASSUME(deltainit(0,2) == delta(0,1)); ASSUME(meminit(0,3) == mem(0,2)); ASSUME(coinit(0,3) == co(0,2)); ASSUME(deltainit(0,3) == delta(0,2)); ASSUME(meminit(0,4) == mem(0,3)); ASSUME(coinit(0,4) == co(0,3)); ASSUME(deltainit(0,4) == delta(0,3)); ASSUME(meminit(1,1) == mem(1,0)); ASSUME(coinit(1,1) == co(1,0)); ASSUME(deltainit(1,1) == delta(1,0)); ASSUME(meminit(1,2) == mem(1,1)); ASSUME(coinit(1,2) == co(1,1)); ASSUME(deltainit(1,2) == delta(1,1)); ASSUME(meminit(1,3) == mem(1,2)); ASSUME(coinit(1,3) == co(1,2)); ASSUME(deltainit(1,3) == delta(1,2)); ASSUME(meminit(1,4) == mem(1,3)); ASSUME(coinit(1,4) == co(1,3)); ASSUME(deltainit(1,4) == delta(1,3)); ASSUME(meminit(2,1) == mem(2,0)); ASSUME(coinit(2,1) == co(2,0)); ASSUME(deltainit(2,1) == delta(2,0)); ASSUME(meminit(2,2) == mem(2,1)); ASSUME(coinit(2,2) == co(2,1)); ASSUME(deltainit(2,2) == delta(2,1)); ASSUME(meminit(2,3) == mem(2,2)); ASSUME(coinit(2,3) == co(2,2)); ASSUME(deltainit(2,3) == delta(2,2)); ASSUME(meminit(2,4) == mem(2,3)); ASSUME(coinit(2,4) == co(2,3)); ASSUME(deltainit(2,4) == delta(2,3)); ASSUME(meminit(3,1) == mem(3,0)); ASSUME(coinit(3,1) == co(3,0)); ASSUME(deltainit(3,1) == delta(3,0)); ASSUME(meminit(3,2) == mem(3,1)); ASSUME(coinit(3,2) == co(3,1)); ASSUME(deltainit(3,2) == delta(3,1)); ASSUME(meminit(3,3) == mem(3,2)); ASSUME(coinit(3,3) == co(3,2)); ASSUME(deltainit(3,3) == delta(3,2)); ASSUME(meminit(3,4) == mem(3,3)); ASSUME(coinit(3,4) == co(3,3)); ASSUME(deltainit(3,4) == delta(3,3)); ASSUME(meminit(4,1) == mem(4,0)); ASSUME(coinit(4,1) == co(4,0)); ASSUME(deltainit(4,1) == delta(4,0)); ASSUME(meminit(4,2) == mem(4,1)); ASSUME(coinit(4,2) == co(4,1)); ASSUME(deltainit(4,2) == delta(4,1)); ASSUME(meminit(4,3) == mem(4,2)); ASSUME(coinit(4,3) == co(4,2)); ASSUME(deltainit(4,3) == delta(4,2)); ASSUME(meminit(4,4) == mem(4,3)); ASSUME(coinit(4,4) == co(4,3)); ASSUME(deltainit(4,4) == delta(4,3)); ASSUME(meminit(5,1) == mem(5,0)); ASSUME(coinit(5,1) == co(5,0)); ASSUME(deltainit(5,1) == delta(5,0)); ASSUME(meminit(5,2) == mem(5,1)); ASSUME(coinit(5,2) == co(5,1)); ASSUME(deltainit(5,2) == delta(5,1)); ASSUME(meminit(5,3) == mem(5,2)); ASSUME(coinit(5,3) == co(5,2)); ASSUME(deltainit(5,3) == delta(5,2)); ASSUME(meminit(5,4) == mem(5,3)); ASSUME(coinit(5,4) == co(5,3)); ASSUME(deltainit(5,4) == delta(5,3)); ASSUME(meminit(6,1) == mem(6,0)); ASSUME(coinit(6,1) == co(6,0)); ASSUME(deltainit(6,1) == delta(6,0)); ASSUME(meminit(6,2) == mem(6,1)); ASSUME(coinit(6,2) == co(6,1)); ASSUME(deltainit(6,2) == delta(6,1)); ASSUME(meminit(6,3) == mem(6,2)); ASSUME(coinit(6,3) == co(6,2)); ASSUME(deltainit(6,3) == delta(6,2)); ASSUME(meminit(6,4) == mem(6,3)); ASSUME(coinit(6,4) == co(6,3)); ASSUME(deltainit(6,4) == delta(6,3)); ASSUME(meminit(7,1) == mem(7,0)); ASSUME(coinit(7,1) == co(7,0)); ASSUME(deltainit(7,1) == delta(7,0)); ASSUME(meminit(7,2) == mem(7,1)); ASSUME(coinit(7,2) == co(7,1)); ASSUME(deltainit(7,2) == delta(7,1)); ASSUME(meminit(7,3) == mem(7,2)); ASSUME(coinit(7,3) == co(7,2)); ASSUME(deltainit(7,3) == delta(7,2)); ASSUME(meminit(7,4) == mem(7,3)); ASSUME(coinit(7,4) == co(7,3)); ASSUME(deltainit(7,4) == delta(7,3)); ASSUME(meminit(8,1) == mem(8,0)); ASSUME(coinit(8,1) == co(8,0)); ASSUME(deltainit(8,1) == delta(8,0)); ASSUME(meminit(8,2) == mem(8,1)); ASSUME(coinit(8,2) == co(8,1)); ASSUME(deltainit(8,2) == delta(8,1)); ASSUME(meminit(8,3) == mem(8,2)); ASSUME(coinit(8,3) == co(8,2)); ASSUME(deltainit(8,3) == delta(8,2)); ASSUME(meminit(8,4) == mem(8,3)); ASSUME(coinit(8,4) == co(8,3)); ASSUME(deltainit(8,4) == delta(8,3)); ASSUME(meminit(9,1) == mem(9,0)); ASSUME(coinit(9,1) == co(9,0)); ASSUME(deltainit(9,1) == delta(9,0)); ASSUME(meminit(9,2) == mem(9,1)); ASSUME(coinit(9,2) == co(9,1)); ASSUME(deltainit(9,2) == delta(9,1)); ASSUME(meminit(9,3) == mem(9,2)); ASSUME(coinit(9,3) == co(9,2)); ASSUME(deltainit(9,3) == delta(9,2)); ASSUME(meminit(9,4) == mem(9,3)); ASSUME(coinit(9,4) == co(9,3)); ASSUME(deltainit(9,4) == delta(9,3)); ASSUME(meminit(10,1) == mem(10,0)); ASSUME(coinit(10,1) == co(10,0)); ASSUME(deltainit(10,1) == delta(10,0)); ASSUME(meminit(10,2) == mem(10,1)); ASSUME(coinit(10,2) == co(10,1)); ASSUME(deltainit(10,2) == delta(10,1)); ASSUME(meminit(10,3) == mem(10,2)); ASSUME(coinit(10,3) == co(10,2)); ASSUME(deltainit(10,3) == delta(10,2)); ASSUME(meminit(10,4) == mem(10,3)); ASSUME(coinit(10,4) == co(10,3)); ASSUME(deltainit(10,4) == delta(10,3)); ASSUME(meminit(11,1) == mem(11,0)); ASSUME(coinit(11,1) == co(11,0)); ASSUME(deltainit(11,1) == delta(11,0)); ASSUME(meminit(11,2) == mem(11,1)); ASSUME(coinit(11,2) == co(11,1)); ASSUME(deltainit(11,2) == delta(11,1)); ASSUME(meminit(11,3) == mem(11,2)); ASSUME(coinit(11,3) == co(11,2)); ASSUME(deltainit(11,3) == delta(11,2)); ASSUME(meminit(11,4) == mem(11,3)); ASSUME(coinit(11,4) == co(11,3)); ASSUME(deltainit(11,4) == delta(11,3)); ASSERT(r24== 0); }
[ "tuan-phong.ngo@it.uu.se" ]
tuan-phong.ngo@it.uu.se
81dcfcd6f1b4b9e2216f0161a9d793ba372d1e15
8fc80bcb8af186e8d4233d5159c9b3097c212e42
/Y86-Simulator-Net/y86Control/execute.h
49e9ad982bdab4efca7abb1bfb287ffe6f804f98
[]
no_license
JuntaoLiu01/Y86Simulator
65474db96699f7b5cb39e072cd82a397c61b5afc
8e6101e84cff9f0c5d48ff8a838714640e6af4a6
refs/heads/master
2021-01-21T18:06:51.920673
2017-05-22T16:39:20
2017-05-22T16:39:20
92,017,876
2
0
null
2017-05-22T06:15:16
2017-05-22T06:15:16
null
UTF-8
C++
false
false
458
h
#ifndef EXECUTE_H #define EXECUTE_H #include <QUdpSocket> #include <QTcpSocket> #include <QTcpServer> #include <QObject> class Execute:QObject { Q_OBJECT public: explicit Execute(); ~Execute(); QTcpServer *serverForDecode; QTcpSocket *socketForDecode; QTcpSocket *clientToMemory; private slots: void dealDecodeConnection(); void dealDecodeData(); void dealMemoryData(); private: void init(); }; #endif // EXECUTE_H
[ "hzshang15@gmail.com" ]
hzshang15@gmail.com
83d997781cb1b274592ff0bac6b60872e50bc75d
b97883b439c01e5daed6c36174b3ff575e676c67
/openfpga/src/fpga_verilog/verilog_submodule_utils.cpp
faf965068bb3de5854fe7e78c9d315a7d34a8e73
[ "MIT" ]
permissive
curliph/OpenFPGA
5712e8ecd60b024db9988b4fb5a5f6883d597995
8b85f22533ecba6a6d9ebd0edc0b4efcc38b19af
refs/heads/master
2023-01-01T11:27:06.163374
2020-10-28T03:52:35
2020-10-28T03:52:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
10,331
cpp
/************************************************ * This file includes most utilized functions for * generating Verilog sub-modules * such as timing matrix and signal initialization ***********************************************/ #include <fstream> #include <limits> #include <iomanip> /* Headers from vtrutil library */ #include "vtr_assert.h" #include "vtr_log.h" /* Headers from openfpgautil library */ #include "openfpga_port.h" #include "openfpga_digest.h" /* Headers from readarchopenfpga library */ #include "circuit_types.h" #include "module_manager_utils.h" #include "verilog_constants.h" #include "verilog_writer_utils.h" #include "verilog_submodule_utils.h" /* begin namespace openfpga */ namespace openfpga { /* All values are printed with this precision value. The higher the * value, the more accurate timing assignment is. Using a number of 6 * guarentees that a precision of femtosecond which is sufficent for * electrical simulation (simulation timescale is 10-9 */ /* constexpr int FLOAT_PRECISION = std::numeric_limits<float>::max_digits10; */ constexpr int FLOAT_PRECISION = 6; /************************************************ * Print a timing matrix defined in theecircuit model * into a Verilog format. * This function print all the timing edges available * in the circuit model (any pin-to-pin delay) ***********************************************/ void print_verilog_submodule_timing(std::fstream& fp, const CircuitLibrary& circuit_lib, const CircuitModelId& circuit_model) { /* return if there is no delay info */ if ( 0 == circuit_lib.num_delay_info(circuit_model)) { return; } /* Return if there is no ports */ if (0 == circuit_lib.num_model_ports(circuit_model)) { return; } /* Ensure a valid file handler*/ VTR_ASSERT(true == valid_file_stream(fp)); fp << std::endl; fp << "`ifdef " << VERILOG_TIMING_PREPROC_FLAG << std::endl; print_verilog_comment(fp, std::string("------ BEGIN Pin-to-pin Timing constraints -----")); fp << "\tspecify" << std::endl; /* Read out pin-to-pin delays by finding out all the edges belonging to a circuit model */ for (const auto& timing_edge : circuit_lib.timing_edges_by_model(circuit_model)) { CircuitPortId src_port = circuit_lib.timing_edge_src_port(timing_edge); size_t src_pin = circuit_lib.timing_edge_src_pin(timing_edge); BasicPort src_port_info(circuit_lib.port_lib_name(src_port), src_pin, src_pin); CircuitPortId sink_port = circuit_lib.timing_edge_sink_port(timing_edge); size_t sink_pin = circuit_lib.timing_edge_sink_pin(timing_edge); BasicPort sink_port_info(circuit_lib.port_lib_name(sink_port), sink_pin, sink_pin); fp << "\t\t"; fp << "(" << generate_verilog_port(VERILOG_PORT_CONKT, src_port_info); fp << " => "; fp << generate_verilog_port(VERILOG_PORT_CONKT, sink_port_info) << ")"; fp << " = "; fp << "(" << std::setprecision(FLOAT_PRECISION) << circuit_lib.timing_edge_delay(timing_edge, CIRCUIT_MODEL_DELAY_RISE) / VERILOG_SIM_TIMESCALE; fp << ", "; fp << std::setprecision(FLOAT_PRECISION) << circuit_lib.timing_edge_delay(timing_edge, CIRCUIT_MODEL_DELAY_FALL) / VERILOG_SIM_TIMESCALE << ")"; fp << ";" << std::endl; } fp << "\tendspecify" << std::endl; print_verilog_comment(fp, std::string("------ END Pin-to-pin Timing constraints -----")); fp << "`endif" << std::endl; } void print_verilog_submodule_signal_init(std::fstream& fp, const CircuitLibrary& circuit_lib, const CircuitModelId& circuit_model) { /* Ensure a valid file handler*/ VTR_ASSERT(true == valid_file_stream(fp)); fp << std::endl; fp << "`ifdef " << VERILOG_SIGNAL_INIT_PREPROC_FLAG << std::endl; print_verilog_comment(fp, std::string("------ BEGIN driver initialization -----")); fp << "\tinitial begin" << std::endl; fp << "\t`ifdef " << VERILOG_FORMAL_VERIFICATION_PREPROC_FLAG << std::endl; /* Only for formal verification: deposite a zero signal values */ /* Initialize each input port */ for (const auto& input_port : circuit_lib.model_input_ports(circuit_model)) { BasicPort input_port_info(circuit_lib.port_lib_name(input_port), circuit_lib.port_size(input_port)); fp << "\t\t$deposit("; fp << generate_verilog_port(VERILOG_PORT_CONKT, input_port_info); fp << ", " << circuit_lib.port_size(input_port) << "'b" << std::string(circuit_lib.port_size(input_port), '0'); fp << ");" << std::endl; } fp << "\t`else" << std::endl; /* Regular case: deposite initial signal values: a random value */ for (const auto& input_port : circuit_lib.model_input_ports(circuit_model)) { BasicPort input_port_info(circuit_lib.port_lib_name(input_port), circuit_lib.port_size(input_port)); fp << "\t\t$deposit("; fp << generate_verilog_port(VERILOG_PORT_CONKT, input_port_info); fp << ", $random);" << std::endl; } fp << "\t`endif\n" << std::endl; fp << "\tend" << std::endl; print_verilog_comment(fp, std::string("------ END driver initialization -----")); fp << "`endif" << std::endl; } /********************************************************************* * Register all the user-defined modules in the module manager * Walk through the circuit library and add user-defined circuit models * to the module_manager ********************************************************************/ void add_user_defined_verilog_modules(ModuleManager& module_manager, const CircuitLibrary& circuit_lib) { VTR_LOG("Registering user-defined modules..."); /* Iterate over Verilog modules */ for (const auto& model : circuit_lib.models()) { /* We only care about user-defined models */ if (true == circuit_lib.model_verilog_netlist(model).empty()) { continue; } /* Skip Routing channel wire models because they need a different name. Do it later */ if (CIRCUIT_MODEL_CHAN_WIRE == circuit_lib.model_type(model)) { continue; } /* Reach here, the model requires a user-defined Verilog netlist, * Try to find it in the module manager * If not found, register it in the module_manager */ ModuleId module_id = module_manager.find_module(circuit_lib.model_name(model)); if (ModuleId::INVALID() == module_id) { add_circuit_model_to_module_manager(module_manager, circuit_lib, model); VTR_LOG("Registered user-defined circuit model '%s'\n", circuit_lib.model_name(model).c_str()); } } VTR_LOG("Done\n"); } /********************************************************************* * Print a template for a user-defined circuit model * The template will include just the port declaration of the Verilog module * The template aims to help user to write Verilog codes with a guaranteed * module definition, which can be correctly instanciated (with correct * port mapping) in the FPGA fabric ********************************************************************/ static void print_one_verilog_template_module(const ModuleManager& module_manager, std::fstream& fp, const std::string& module_name) { /* Ensure a valid file handler*/ VTR_ASSERT(true == valid_file_stream(fp)); print_verilog_comment(fp, std::string("----- Template Verilog module for " + module_name + " -----")); /* Find the module in module manager, which should be already registered */ /* TODO: routing channel wire model may have a different name! */ ModuleId template_module = module_manager.find_module(module_name); VTR_ASSERT(ModuleId::INVALID() != template_module); /* dump module definition + ports */ print_verilog_module_declaration(fp, module_manager, template_module); /* Finish dumping ports */ print_verilog_comment(fp, std::string("----- Internal logic should start here -----")); /* Add some empty lines as placeholders for the internal logic*/ fp << std::endl << std::endl; print_verilog_comment(fp, std::string("----- Internal logic should end here -----")); /* Put an end to the Verilog module */ print_verilog_module_end(fp, module_name); /* Add an empty line as a splitter */ fp << std::endl; } /********************************************************************* * Print a template of all the submodules that are user-defined * The template will include just the port declaration of the submodule * The template aims to help user to write Verilog codes with a guaranteed * module definition, which can be correctly instanciated (with correct * port mapping) in the FPGA fabric ********************************************************************/ void print_verilog_submodule_templates(const ModuleManager& module_manager, const CircuitLibrary& circuit_lib, const std::string& submodule_dir) { std::string verilog_fname(submodule_dir + USER_DEFINED_TEMPLATE_VERILOG_FILE_NAME); /* Create the file stream */ std::fstream fp; fp.open(verilog_fname, std::fstream::out | std::fstream::trunc); check_file_stream(verilog_fname.c_str(), fp); /* Print out debugging information for if the file is not opened/created properly */ VTR_LOG("Creating template for user-defined Verilog modules '%s'...", verilog_fname.c_str()); print_verilog_file_header(fp, "Template for user-defined Verilog modules"); /* Output essential models*/ for (const auto& model : circuit_lib.models()) { /* Focus on user-defined modules, which must have a Verilog netlist defined */ if (circuit_lib.model_verilog_netlist(model).empty()) { continue; } /* Skip Routing channel wire models because they need a different name. Do it later */ if (CIRCUIT_MODEL_CHAN_WIRE == circuit_lib.model_type(model)) { continue; } /* Print a Verilog template for the circuit model */ print_one_verilog_template_module(module_manager, fp, circuit_lib.model_name(model)); } /* close file stream */ fp.close(); /* No need to add the template to the subckt include files! */ VTR_LOG("Done\n"); } } /* end namespace openfpga */
[ "tangxifan@gmail.com" ]
tangxifan@gmail.com
9dcc8ab44feebd426161bab84631cfe04df0001a
eb120dfc702e5a6944448575962115bb0df60477
/4AJ.2.2/mydroid/external/skia/src/core/SkSpriteBlitter_ARGB32.cpp
e546fef8f4b1dc585d8d4add01c0dc1b5441b536
[ "BSD-3-Clause", "SGI-B-2.0" ]
permissive
faridazhar/panda-a4
5dd215387c71a42e1d3f1517ca1f0c642f269050
ff88df36a11e3af5c85d565351ad72ce62406e5e
refs/heads/master
2020-04-06T05:21:41.192262
2015-05-20T22:11:06
2015-05-20T22:11:06
34,291,586
1
5
null
2020-03-08T23:51:30
2015-04-20T23:11:26
C
UTF-8
C++
false
false
21,656
cpp
/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "SkSpriteBlitter.h" #include "SkBlitRow.h" #include "SkColorFilter.h" #include "SkColorPriv.h" #include "SkTemplates.h" #include "SkUtils.h" #include "SkXfermode.h" #ifdef BLTSVILLE_ENHANCEMENT #include <bltsville.h> extern void* hbvlib; extern BVFN_MAP bv_map; extern BVFN_BLT bv_blt; extern BVFN_UNMAP bv_unmap; #endif /////////////////////////////////////////////////////////////////////////////// class Sprite_D32_S32 : public SkSpriteBlitter { public: Sprite_D32_S32(const SkBitmap& src, U8CPU alpha) : INHERITED(src) { SkASSERT(src.config() == SkBitmap::kARGB_8888_Config); unsigned flags32 = 0; if (255 != alpha) { flags32 |= SkBlitRow::kGlobalAlpha_Flag32; } if (!src.isOpaque()) { flags32 |= SkBlitRow::kSrcPixelAlpha_Flag32; } fProc32 = SkBlitRow::Factory32(flags32); fAlpha = alpha; } virtual void blitRect(int x, int y, int width, int height) { SkASSERT(width > 0 && height > 0); uint32_t* SK_RESTRICT dst = fDevice->getAddr32(x, y); const uint32_t* SK_RESTRICT src = fSource->getAddr32(x - fLeft, y - fTop); size_t dstRB = fDevice->rowBytes(); size_t srcRB = fSource->rowBytes(); SkBlitRow::Proc32 proc = fProc32; U8CPU alpha = fAlpha; do { proc(dst, src, width, alpha); dst = (uint32_t* SK_RESTRICT)((char*)dst + dstRB); src = (const uint32_t* SK_RESTRICT)((const char*)src + srcRB); } while (--height != 0); } private: SkBlitRow::Proc32 fProc32; U8CPU fAlpha; typedef SkSpriteBlitter INHERITED; }; /////////////////////////////////////////////////////////////////////////////// class Sprite_D32_XferFilter : public SkSpriteBlitter { public: Sprite_D32_XferFilter(const SkBitmap& source, const SkPaint& paint) : SkSpriteBlitter(source) { fColorFilter = paint.getColorFilter(); SkSafeRef(fColorFilter); fXfermode = paint.getXfermode(); SkSafeRef(fXfermode); fBufferSize = 0; fBuffer = NULL; unsigned flags32 = 0; if (255 != paint.getAlpha()) { flags32 |= SkBlitRow::kGlobalAlpha_Flag32; } if (!source.isOpaque()) { flags32 |= SkBlitRow::kSrcPixelAlpha_Flag32; } fProc32 = SkBlitRow::Factory32(flags32); fAlpha = paint.getAlpha(); } virtual ~Sprite_D32_XferFilter() { delete[] fBuffer; SkSafeUnref(fXfermode); SkSafeUnref(fColorFilter); } virtual void setup(const SkBitmap& device, int left, int top, const SkPaint& paint) { this->INHERITED::setup(device, left, top, paint); int width = device.width(); if (width > fBufferSize) { fBufferSize = width; delete[] fBuffer; fBuffer = new SkPMColor[width]; } } protected: SkColorFilter* fColorFilter; SkXfermode* fXfermode; int fBufferSize; SkPMColor* fBuffer; SkBlitRow::Proc32 fProc32; U8CPU fAlpha; private: typedef SkSpriteBlitter INHERITED; }; /////////////////////////////////////////////////////////////////////////////// class Sprite_D32_S32A_XferFilter : public Sprite_D32_XferFilter { public: Sprite_D32_S32A_XferFilter(const SkBitmap& source, const SkPaint& paint) : Sprite_D32_XferFilter(source, paint) {} virtual void blitRect(int x, int y, int width, int height) { SkASSERT(width > 0 && height > 0); #ifdef BLTSVILLE_ENHANCEMENT enum bverror bverr = BVERR_UNK; if (hbvlib && (width > 1) && (height > 1)) { struct bvbltparams params; struct bvbuffdesc srcdesc, dstdesc; struct bvsurfgeom srcgeom, dstgeom; memset(&params, 0, sizeof(params)); params.structsize = sizeof(params); params.src1.desc = &srcdesc; params.src1geom = &srcgeom; params.src2.desc = &dstdesc; params.src2geom = &dstgeom; params.dstdesc = &dstdesc; params.dstgeom = &dstgeom; memset(&srcgeom, 0, sizeof(srcgeom)); srcgeom.structsize = sizeof(srcgeom); memset(&srcdesc, 0, sizeof(srcdesc)); srcdesc.structsize = sizeof(srcdesc); memset(&dstgeom, 0, sizeof(dstgeom)); dstgeom.structsize = sizeof(dstgeom); memset(&dstdesc, 0, sizeof(dstdesc)); dstdesc.structsize = sizeof(dstdesc); params.src1rect.left = x - fLeft; params.src1rect.top = y - fTop; params.src1rect.width = width; params.src1rect.height = height; params.src2rect.left = x; params.src2rect.top = y; params.src2rect.width = width; params.src2rect.height = height; params.dstrect.left = x; params.dstrect.top = y; params.dstrect.width = width; params.dstrect.height = height; dstgeom.width = fDevice->width(); dstgeom.height = fDevice->height(); dstgeom.virtstride = fDevice->rowBytes(); srcgeom.width = fSource->width(); srcgeom.height = fSource->height(); srcgeom.virtstride = fSource->rowBytes(); srcdesc.virtaddr = fSource->getPixels(); srcdesc.length = srcgeom.virtstride * srcgeom.height; dstdesc.virtaddr = fDevice->getPixels(); dstdesc.length = dstgeom.virtstride * dstgeom.height; if(srcdesc.virtaddr == 0 || dstdesc.virtaddr == 0) { goto SKIA; } SkXfermode* xfer = fPaint->getXfermode(); int alpha = fPaint->getAlpha(); int operation = 0; SkXfermode::Mode mode; bool getMode = SkXfermode::IsMode(xfer, &mode); if (SkXfermode::kSrcOver_Mode == mode) { if (0 == alpha) { mode = SkXfermode::kDst_Mode; } else if (0xFF == alpha && fSource->isOpaque()) { mode = SkXfermode::kSrc_Mode; } } if (fPaint->getColorFilter() != NULL || fPaint->getTypeface() != NULL || fPaint->getShader() != NULL || fPaint->getMaskFilter() != NULL || fPaint->getLooper() != NULL) { goto SKIA; } switch(mode) { case SkXfermode::kSrc_Mode: srcgeom.format = OCDFMT_RGBA24; dstgeom.format = OCDFMT_RGBA24; if(fAlpha != 255) { params.flags = BVFLAG_BLEND; params.op.blend = (enum bvblend)((unsigned int)BVBLEND_SRC1 + BVBLENDDEF_GLOBAL_UCHAR); params.globalalpha.size8 = alpha; } else { params.flags = BVFLAG_ROP; params.op.rop = 0xCCCC; } break; case SkXfermode::kSrcOver_Mode: params.flags = BVFLAG_BLEND; if(alpha == 255 && fSource->isOpaque()) { operation = 1; //ROP 0xCCCC -dst RGB1|src RGBx } else if(alpha == 255 && fDevice->isOpaque()) { operation = 2; //BLEND -dst RGB1|src RGBA } else if(alpha == 255) { operation = 3; //BLEND -dst RGBA|src RGBA } else if(fSource->isOpaque() && fDevice->isOpaque()) { operation = 4; //BLEND -dst RGB1|src RGBx + global alpha } else if(fSource->isOpaque()) { operation = 5; //BLEND -dst RGBA|src RGBx + global alpha } else if(fDevice->isOpaque()) { operation = 6; //BLEND -dst RGB1|src RGBA + global alpha } else { operation = 7; //BLEND -dst RGBA|src RGBA + global alpha } switch(operation) { case 1://ROP 0xCCCC -dst RGB1|src RGBx if(alpha != 255) { params.flags = BVFLAG_BLEND; params.op.blend = (enum bvblend)((unsigned int)BVBLEND_SRC1 + BVBLENDDEF_GLOBAL_UCHAR); params.globalalpha.size8 = alpha; } else { params.flags = BVFLAG_ROP; params.op.rop = 0xCCCC; } srcgeom.format = OCDFMT_RGBA24; dstgeom.format = OCDFMT_RGBA24; break; case 2://BLEND -dst RGB1|src RGBA params.op.blend = (enum bvblend)((unsigned int)BVBLEND_SRC1OVER); srcgeom.format = OCDFMT_RGBA24; dstgeom.format = OCDFMT_RGB124; break; case 3://BLEND -dst RGBA|src RGBA params.op.blend = (enum bvblend)((unsigned int)BVBLEND_SRC1OVER); srcgeom.format = OCDFMT_RGBA24; dstgeom.format = OCDFMT_RGBA24; break; case 4: //BLEND -dst RGB1|src RGBx + global alpha params.op.blend = (enum bvblend)((unsigned int)BVBLEND_SRC1OVER + BVBLENDDEF_GLOBAL_UCHAR); params.globalalpha.size8 = alpha; srcgeom.format = OCDFMT_RGB124; dstgeom.format = OCDFMT_RGB124; break; case 5://BLEND -dst RGBA|src RGBx + global alpha params.op.blend = (enum bvblend)((unsigned int)BVBLEND_SRC1OVER + BVBLENDDEF_GLOBAL_UCHAR); params.globalalpha.size8 = alpha; srcgeom.format = OCDFMT_RGB124; dstgeom.format = OCDFMT_RGBA24; break; case 6://BLEND -dst RGB1|src RGBA + global alpha params.op.blend = (enum bvblend)((unsigned int)BVBLEND_SRC1OVER + BVBLENDDEF_GLOBAL_UCHAR); params.globalalpha.size8 = alpha; srcgeom.format = OCDFMT_RGBA24; dstgeom.format = OCDFMT_RGB124; break; case 7://BLEND -dst RGBA|src RGBA + global alpha params.op.blend = (enum bvblend)((unsigned int)BVBLEND_SRC1OVER + BVBLENDDEF_GLOBAL_UCHAR); params.globalalpha.size8 = alpha; srcgeom.format = OCDFMT_RGBA24; dstgeom.format = OCDFMT_RGBA24; break; } break; default: goto SKIA; break; } bverr = bv_blt(&params); } SKIA: if(bverr != BVERR_NONE) { #endif uint32_t* SK_RESTRICT dst = fDevice->getAddr32(x, y); const uint32_t* SK_RESTRICT src = fSource->getAddr32(x - fLeft, y - fTop); unsigned dstRB = fDevice->rowBytes(); unsigned srcRB = fSource->rowBytes(); SkColorFilter* colorFilter = fColorFilter; SkXfermode* xfermode = fXfermode; do { const SkPMColor* tmp = src; if (NULL != colorFilter) { colorFilter->filterSpan(src, width, fBuffer); tmp = fBuffer; } if (NULL != xfermode) { xfermode->xfer32(dst, tmp, width, NULL); } else { fProc32(dst, tmp, width, fAlpha); } dst = (uint32_t* SK_RESTRICT)((char*)dst + dstRB); src = (const uint32_t* SK_RESTRICT)((const char*)src + srcRB); } while (--height != 0); #ifdef BLTSVILLE_ENHANCEMENT } #endif } private: typedef Sprite_D32_XferFilter INHERITED; }; static void fillbuffer(SkPMColor* SK_RESTRICT dst, const SkPMColor16* SK_RESTRICT src, int count) { SkASSERT(count > 0); do { *dst++ = SkPixel4444ToPixel32(*src++); } while (--count != 0); } class Sprite_D32_S4444_XferFilter : public Sprite_D32_XferFilter { public: Sprite_D32_S4444_XferFilter(const SkBitmap& source, const SkPaint& paint) : Sprite_D32_XferFilter(source, paint) {} virtual void blitRect(int x, int y, int width, int height) { SkASSERT(width > 0 && height > 0); SkPMColor* SK_RESTRICT dst = fDevice->getAddr32(x, y); const SkPMColor16* SK_RESTRICT src = fSource->getAddr16(x - fLeft, y - fTop); unsigned dstRB = fDevice->rowBytes(); unsigned srcRB = fSource->rowBytes(); SkPMColor* SK_RESTRICT buffer = fBuffer; SkColorFilter* colorFilter = fColorFilter; SkXfermode* xfermode = fXfermode; do { fillbuffer(buffer, src, width); if (NULL != colorFilter) { colorFilter->filterSpan(buffer, width, buffer); } if (NULL != xfermode) { xfermode->xfer32(dst, buffer, width, NULL); } else { fProc32(dst, buffer, width, fAlpha); } dst = (SkPMColor* SK_RESTRICT)((char*)dst + dstRB); src = (const SkPMColor16* SK_RESTRICT)((const char*)src + srcRB); } while (--height != 0); } private: typedef Sprite_D32_XferFilter INHERITED; }; /////////////////////////////////////////////////////////////////////////////// static void src_row(SkPMColor* SK_RESTRICT dst, const SkPMColor16* SK_RESTRICT src, int count) { do { *dst = SkPixel4444ToPixel32(*src); src += 1; dst += 1; } while (--count != 0); } class Sprite_D32_S4444_Opaque : public SkSpriteBlitter { public: Sprite_D32_S4444_Opaque(const SkBitmap& source) : SkSpriteBlitter(source) {} virtual void blitRect(int x, int y, int width, int height) { SkASSERT(width > 0 && height > 0); SkPMColor* SK_RESTRICT dst = fDevice->getAddr32(x, y); const SkPMColor16* SK_RESTRICT src = fSource->getAddr16(x - fLeft, y - fTop); unsigned dstRB = fDevice->rowBytes(); unsigned srcRB = fSource->rowBytes(); do { src_row(dst, src, width); dst = (SkPMColor* SK_RESTRICT)((char*)dst + dstRB); src = (const SkPMColor16* SK_RESTRICT)((const char*)src + srcRB); } while (--height != 0); } }; static void srcover_row(SkPMColor* SK_RESTRICT dst, const SkPMColor16* SK_RESTRICT src, int count) { do { *dst = SkPMSrcOver(SkPixel4444ToPixel32(*src), *dst); src += 1; dst += 1; } while (--count != 0); } class Sprite_D32_S4444 : public SkSpriteBlitter { public: Sprite_D32_S4444(const SkBitmap& source) : SkSpriteBlitter(source) {} virtual void blitRect(int x, int y, int width, int height) { SkASSERT(width > 0 && height > 0); SkPMColor* SK_RESTRICT dst = fDevice->getAddr32(x, y); const SkPMColor16* SK_RESTRICT src = fSource->getAddr16(x - fLeft, y - fTop); unsigned dstRB = fDevice->rowBytes(); unsigned srcRB = fSource->rowBytes(); do { srcover_row(dst, src, width); dst = (SkPMColor* SK_RESTRICT)((char*)dst + dstRB); src = (const SkPMColor16* SK_RESTRICT)((const char*)src + srcRB); } while (--height != 0); } }; #ifdef BLTSVILLE_ENHANCEMENT class Sprite_D32_S16_Opaque : public SkSpriteBlitter { public: Sprite_D32_S16_Opaque(const SkBitmap& source) : SkSpriteBlitter(source) {} // overrides virtual void blitRect(int x, int y, int width, int height) { enum bverror bverr = BVERR_UNK; if (hbvlib && (width > 1) && (height > 1)) { struct bvbltparams params; struct bvbuffdesc srcdesc, dstdesc; struct bvsurfgeom srcgeom, dstgeom; memset(&params, 0, sizeof(params)); params.structsize = sizeof(params); params.src1.desc = &srcdesc; params.src1geom = &srcgeom; params.dstdesc = &dstdesc; params.dstgeom = &dstgeom; memset(&srcgeom, 0, sizeof(srcgeom)); srcgeom.structsize = sizeof(srcgeom); srcgeom.format = OCDFMT_RGB16; memset(&srcdesc, 0, sizeof(srcdesc)); srcdesc.structsize = sizeof(srcdesc); memset(&dstgeom, 0, sizeof(dstgeom)); dstgeom.structsize = sizeof(dstgeom); dstgeom.format = OCDFMT_RGB124; memset(&dstdesc, 0, sizeof(dstdesc)); dstdesc.structsize = sizeof(dstdesc); params.flags = BVFLAG_ROP; params.op.rop = 0xCCCC; params.src1rect.left = x - fLeft; params.src1rect.top = y - fTop; params.src1rect.width = width; params.src1rect.height = height; params.dstrect.left = x; params.dstrect.top = y; params.dstrect.width = width; params.dstrect.height = height; dstgeom.width = fDevice->width(); dstgeom.height = fDevice->height(); dstgeom.virtstride = fDevice->rowBytes(); srcgeom.width = fSource->width(); srcgeom.height = fSource->height(); srcgeom.virtstride = fSource->rowBytes(); srcdesc.virtaddr = fSource->getPixels(); srcdesc.length = srcgeom.virtstride * srcgeom.height; dstdesc.virtaddr = fDevice->getPixels(); dstdesc.length = dstgeom.virtstride * dstgeom.height; if(srcdesc.virtaddr == 0 || dstdesc.virtaddr == 0) { goto SKIA_D32_S16; } bverr = bv_blt(&params); } SKIA_D32_S16: if(bverr != BVERR_NONE) { SK_RESTRICT uint32_t* dst = fDevice->getAddr32(x, y); const SK_RESTRICT uint16_t* src = fSource->getAddr16(x - fLeft, y - fTop); unsigned dstRB = fDevice->rowBytes(); unsigned srcRB = fSource->rowBytes(); int i; while (--height >= 0) { for ( i = 0; i < width; i++ ) { dst[i] = SkPixel16ToPixel32(src[i]); } dst = (uint32_t*)((char*)dst + dstRB); src = (const uint16_t*)((const char*)src + srcRB); } } } }; #endif /////////////////////////////////////////////////////////////////////////////// #include "SkTemplatesPriv.h" SkSpriteBlitter* SkSpriteBlitter::ChooseD32(const SkBitmap& source, const SkPaint& paint, void* storage, size_t storageSize) { if (paint.getMaskFilter() != NULL) { return NULL; } U8CPU alpha = paint.getAlpha(); SkXfermode* xfermode = paint.getXfermode(); SkColorFilter* filter = paint.getColorFilter(); SkSpriteBlitter* blitter = NULL; switch (source.getConfig()) { case SkBitmap::kARGB_4444_Config: if (alpha != 0xFF) { return NULL; // we only have opaque sprites } if (xfermode || filter) { SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D32_S4444_XferFilter, storage, storageSize, (source, paint)); } else if (source.isOpaque()) { SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D32_S4444_Opaque, storage, storageSize, (source)); } else { SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D32_S4444, storage, storageSize, (source)); } break; case SkBitmap::kARGB_8888_Config: if (xfermode || filter) { if (255 == alpha) { // this can handle xfermode or filter, but not alpha SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D32_S32A_XferFilter, storage, storageSize, (source, paint)); } } else { // this can handle alpha, but not xfermode or filter SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D32_S32, storage, storageSize, (source, alpha)); } break; #ifdef BLTSVILLE_ENHANCEMENT case SkBitmap::kRGB_565_Config: if (hbvlib && (255 == alpha)) { SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D32_S16_Opaque, storage, storageSize, (source)); } break; #endif default: break; } return blitter; }
[ "fazrnet@gmail.com" ]
fazrnet@gmail.com
dba15ffb591467dc4bc198c4d9489e03e3408162
b22588340d7925b614a735bbbde1b351ad657ffc
/athena/MuonSpectrometer/MuonAlignment/MuonAlignExample/scripts/unbiasedResPlots_x.cpp
a3f4e5d1a8bf36008663d82cccc66daf4738d15e
[]
no_license
rushioda/PIXELVALID_athena
90befe12042c1249cbb3655dde1428bb9b9a42ce
22df23187ef85e9c3120122c8375ea0e7d8ea440
refs/heads/master
2020-12-14T22:01:15.365949
2020-01-19T03:59:35
2020-01-19T03:59:35
234,836,993
1
0
null
null
null
null
UTF-8
C++
false
false
49,135
cpp
/* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ #include "TFile.h" #include "TH1F.h" #include "TH2F.h" #include "TF1.h" #include "TCanvas.h" #include "TStyle.h" #include "TGraphErrors.h" #include "TText.h" #include "TLegend.h" #include "TF1.h" #include "TChain.h" #include "TPaveStats.h" #include "TProfile.h" #include <vector> #include <iostream> #include <dirent.h> #include <sstream> #include <stdlib.h> #include <cmath> using namespace std; const bool USETGCETA=true; //const string outputdir=(USETGCETA)?"align_withTGCEta":"align_noTGCEta"; const string outputdir="align_tgcEtaOutlier"; const bool DOCSC=false; const bool DOBEE=false; const bool DOEC =true; const int NVALBINS = 101; const int NYX=(DOCSC)?2:1; const int NMOM = 16; const double mommin= 4.; const double mommax= 20.; double* momMin; double momCut=10.; const int twocolors[2]={kRed,kBlue}; const int phicolor[16]={kRed+4,kRed+2,kRed, kMagenta+4,kMagenta+2,kMagenta, kBlue+4,kBlue+2,kBlue, kCyan+4,kCyan+2,kCyan, kGreen+4,kGreen+2,kGreen, kYellow+2}; // Declaration of leaf types Int_t nPixHits; Int_t nSCTHits; Int_t nTRTHits; Int_t nCSCHits; Int_t nMDTHits; Int_t nInnerMDTHits; Int_t nMiddleMDTHits; Int_t nOuterMDTHits; Int_t nTriggerPhiHits; Int_t author; Int_t hIndex; Int_t phiSector; Int_t isEndcap; Int_t identifier; Int_t isCSide; Int_t detType; Int_t layer; Int_t stName; Int_t stPhi; Int_t stEta; Double_t momentum; Double_t charge; Double_t d0; Double_t z0; Double_t phi0; Double_t theta0; Double_t eta0; Double_t calEnergyLoss; Double_t calEnergyLossErr; Double_t materialOnTrack; Double_t dR; Double_t dZlocal; Double_t dXlocal; Double_t dYlocal; Double_t dXlocalAngle; Double_t dYlocalAngle; Double_t dXglobal; Double_t dYglobal; Double_t dZglobal; Int_t nInnerChambers; Int_t nMiddleChambers; Int_t nOuterChambers; Int_t nOtherChambers; Double_t detTheta; Int_t innerStEta[10]; Int_t middleStEta[10]; Int_t outerStEta[10]; Int_t otherStEta[10]; void setBranchAddresses(TTree* tree); void getHistograms(bool histsDone); void makeLargeSmallWidthPlots(TFile* outputHists); void makePhiWidthPlots(TFile* outputHists); void makeWidthPlots(TFile* outputHists, const string& type); void makeCSCResPlots(TFile* outputHists); void makeCSCResVTanThetaPlots(TFile* outputHists); void makeMDTResPlots(TFile* outputHists); void makeMDTResVTanThetaPlots(TFile* outputHists); string mdtChamberNameNoPhi(int iecAC, int ilayer, int ieta); string mdtChamberNameNoEta(int iecAC, int ilayer); string mdtChamberName(int iecAC, int ilayer, int ieta, int iphi); void plotLgSmSummary(TPad* canv, TH1F** hists, const string& canvname); TFile* inputHistsFile; TH2F**** lgsmHistsCSC; TH2F**** ecHistsCSC; TH1F**** phiSecHistsCSC; TH1F*** phiSecHistsMDT; TH2F**** resVTanThetaHistsCSC; TH1F****** phiSecEtaHistsMDT; TH2F****** resVTanThetaHistsMDT; double** tanThetaMin; double** tanThetaMax; int allowedInnerLayerForMiddleFixed[6]={0,1,2,2,4,0}; int allowedOuterLayerForMiddleFixed[6]={2,3,5,6,6,0}; //int allowedOuterLayerForMiddleFixed[6]={1,3,5,6,6,0}; //________________________________________________________________________ int main() { // set up tan theta bins tanThetaMin=new double*[3]; tanThetaMax=new double*[3]; for (int ilayer=0;ilayer<3;ilayer++) { tanThetaMin[ilayer]=new double[6]; tanThetaMax[ilayer]=new double[6]; } tanThetaMin[0][0]=0.24; tanThetaMax[0][0]=0.44; tanThetaMin[0][1]=0.25; tanThetaMax[0][1]=0.75; tanThetaMin[0][2]=0.4; tanThetaMax[0][2]=0.65; tanThetaMin[0][3]=0.4; tanThetaMax[0][3]=1.3; tanThetaMin[0][4]=0.7; tanThetaMax[0][4]=1.2; tanThetaMin[0][5]=0.; tanThetaMax[0][5]=1.; tanThetaMin[1][0]=0.17; tanThetaMax[1][0]=0.26; tanThetaMin[1][1]=0.24; tanThetaMax[1][1]=0.36; tanThetaMin[1][2]=0.39; tanThetaMax[1][2]=0.51; tanThetaMin[1][3]=0.51; tanThetaMax[1][3]=0.58; tanThetaMin[1][4]=0.72; tanThetaMax[1][4]=0.82; tanThetaMin[1][5]=0.; tanThetaMax[1][5]=1.; tanThetaMin[2][0]=0.05; tanThetaMax[2][0]=0.3; tanThetaMin[2][1]=0.12; tanThetaMax[2][1]=0.4; tanThetaMin[2][2]=0.2; tanThetaMax[2][2]=0.5; tanThetaMin[2][3]=0.3; tanThetaMax[2][3]=0.6; tanThetaMin[2][4]=0.35; tanThetaMax[2][4]=0.65; tanThetaMin[2][5]=0.4; tanThetaMax[2][5]=0.75; // set up momentum bins momMin=new double[NMOM+1]; for (int imom=0;imom<NMOM;imom++) { momMin[imom]=mommin + (mommax-mommin)/(double)NMOM*imom; } momMin[NMOM]=mommax; // fill histograms or get from input histogram file bool histsDone=true; getHistograms(histsDone); // make output histograms TFile* outputHists=new TFile((outputdir+"outputhists.root").c_str(),"RECREATE"); // make plots if (DOCSC) { makeWidthPlots(outputHists,"LargeSmall"); makeWidthPlots(outputHists,"EndcapAC"); makeCSCResPlots(outputHists); makeCSCResVTanThetaPlots(outputHists); } else { makeWidthPlots(outputHists,"LargeSmall"); makeWidthPlots(outputHists,"EndcapAC"); if (!DOBEE) { makePhiWidthPlots(outputHists); makeMDTResPlots(outputHists); makeMDTResVTanThetaPlots(outputHists); } } outputHists->Close(); } //________________________________________________________________________ void makePhiWidthPlots(TFile* outputHists) { gStyle->SetOptStat(1); gStyle->SetOptFit(111); TCanvas* canv=new TCanvas("canv","canv"); canv->SetFillColor(10); TCanvas* ctmp=new TCanvas("ctmp","ctmp"); for (int iecAC=0;iecAC<2;iecAC++) { cout<<"iecAC: "<<iecAC<<endl; canv->Clear(); canv->Divide(4,4); TF1** fits=new TF1*[16]; TH1F** hMeans =new TH1F*[2]; TH1F** hWidths =new TH1F*[2]; TH1F** hOuterWidths=new TH1F*[2]; TH1F** hEntries =new TH1F*[2]; hMeans[0] =new TH1F("hMeanLg", "Unbiased Residual Mean vs. #phi", 16,0.,16.); hWidths[0] =new TH1F("hWidthLg","Unbiased Residual Inner Width vs. #phi",16,0.,16.); hOuterWidths[0]=new TH1F("hOuterWidthLg","Unbiased Residual Outer Width vs. #phi",16,0.,16.); hEntries[0] =new TH1F("hEntriesLg", "Number Residuals vs. #phi",16,0.,16.); hMeans[1] =new TH1F("hMeanSm", "PhiMeansSm", 16,0.,16.); hWidths[1] =new TH1F("hWidthSm","PhiWidthsSm",16,0.,16.); hOuterWidths[1]=new TH1F("hOuterWidthSm","PhiOuterWidthsSm",16,0.,16.); hEntries[1] =new TH1F("hEntriesSm", "PhiEntriesSm",16,0.,16.); for (int iphi=0;iphi<16;iphi++) { cout<<"iphi: "<<iphi<<endl; stringstream histname; histname<<"Sector"<<iphi+1; if (iecAC==0) histname<<"A"; else histname<<"C"; histname<<"_dY_MDT"; cout<<"getting hist: "<<histname.str()<<endl; TH1F* hist=phiSecHistsMDT[iecAC][iphi]; cout<<"hist has "<<hist->GetEntries()<<" entries"<<endl; stringstream fitname; fitname<<"fit_"<<iphi; ctmp->cd(); //fits[iphi]=new TF1(fitname.str().c_str(),"gaus(0)+gaus(3)",-30.,30.); fits[iphi]=new TF1(fitname.str().c_str(), "[0]*exp(-0.5*((x-[1])/[2])^2)+[3]*[0]*exp(-0.5*((x-[1])/[4])^2)", -30.,30.); fits[iphi]->SetParameters(hist->GetMaximum(),0,5.5,.6,20.); fits[iphi]->SetParLimits(4,0.,999.); hist->Fit(fits[iphi],"RQ"); int histindex=(iphi%2); stringstream binLabel; binLabel<<iphi+1; if (iecAC==0) binLabel<<"A"; else binLabel<<"C"; // mean double mean =fits[iphi]->GetParameter(1); double meanerr=fits[iphi]->GetParError(1); hMeans[histindex]->SetBinContent(iphi+1,mean); hMeans[histindex]->SetBinError(iphi+1,meanerr); hMeans[0]->GetXaxis()->SetBinLabel(iphi+1,binLabel.str().c_str()); hMeans[0]->SetMinimum(-1.4); hMeans[0]->SetMaximum(1.4); // inner width double width =fits[iphi]->GetParameter(2); double widtherr=fits[iphi]->GetParError(2); hWidths[histindex]->SetBinContent(iphi+1,width); hWidths[histindex]->SetBinError(iphi+1,widtherr); hWidths[0]->GetXaxis()->SetBinLabel(iphi+1,binLabel.str().c_str()); hWidths[0]->SetMinimum(4.); hWidths[0]->SetMaximum(8.5); // outer width double owidth =fits[iphi]->GetParameter(4); double owidtherr=fits[iphi]->GetParError(4); hOuterWidths[histindex]->SetBinContent(iphi+1,owidth); hOuterWidths[histindex]->SetBinError(iphi+1,owidtherr); hOuterWidths[0]->GetXaxis()->SetBinLabel(iphi+1,binLabel.str().c_str()); hOuterWidths[0]->SetMinimum(14.); hOuterWidths[0]->SetMaximum(26.); // # entries double entries =hist->GetEntries(); hEntries[histindex]->SetBinContent(iphi+1,entries); hEntries[histindex]->SetBinError(iphi+1,sqrt(entries)); hEntries[0]->GetXaxis()->SetBinLabel(iphi+1,binLabel.str().c_str()); hEntries[0]->SetMinimum(0.); hEntries[0]->SetMaximum(35000.); canv->cd(iphi+1); hist->SetLineColor(phicolor[iphi]); fits[iphi]->SetLineColor(phicolor[iphi]); hist->Draw(); fits[iphi]->Draw("same"); canv->Modified(); } stringstream canvname; canvname<<"MDTSectorPlots_"; if (iecAC==0) canvname<<"Aside"; else canvname<<"Cside"; canv->Print((outputdir+"/"+canvname.str()+".eps").c_str()); plotLgSmSummary(canv,hMeans,outputdir+"/"+canvname.str()+"_Means.eps"); plotLgSmSummary(canv,hWidths,outputdir+"/"+canvname.str()+"_Widths.eps"); plotLgSmSummary(canv,hOuterWidths,outputdir+"/"+canvname.str()+"_OuterWidths.eps"); plotLgSmSummary(canv,hEntries,outputdir+"/"+canvname.str()+"_Entries.eps"); delete [] fits; } delete canv; delete ctmp; } //________________________________________________________________________ void makeCSCResPlots(TFile* outputHists) { gStyle->SetOptStat(1); gStyle->SetOptFit(111); // tan((detTheta-11.59)/360.*6.28), theta<25. TH1F*** hMeans=new TH1F**[2]; TF1**** fits=new TF1***[2]; for (int iecAC=0;iecAC<2;iecAC++) { hMeans[iecAC]=new TH1F*[NYX]; fits[iecAC]=new TF1**[NYX]; int ixy=0; for (int iyx=NYX-1;iyx>=0;iyx--,ixy++) { string title="#Delta "; if (iyx==0) title+="y"; else title+="x"; title+=" (mm)"; string hmeanname=(DOCSC)?"CSC":"MDT"; if (iecAC==0) hmeanname+="_EndcapA"; else hmeanname+="_EndcapC"; if (iyx==0) hmeanname+="_dY"; else hmeanname+="_dX"; hMeans[iecAC][iyx]=new TH1F(hmeanname.c_str(),hmeanname.c_str(),16,0.,16.); fits[iecAC][iyx]=new TF1*[16]; TCanvas* canv=new TCanvas("canv","canv"); canv->SetFillColor(10); canv->Divide(4,4); for (int iphi=0;iphi<16;iphi++) { canv->cd(iphi+1); stringstream fitname; fitname<<"fitRes_"<<iphi+1; if (iecAC==0) fitname<<"A"; else fitname<<"C"; if (iyx==0) fitname<<"_dY"; else fitname<<"_dX"; double fitrange=(iyx==0) ? 40. : 80.; fits[iecAC][iyx][iphi]= new TF1(fitname.str().c_str(), "[0]*exp(-0.5*((x-[1])/[2])^2)+[3]*[0]*exp(-0.5*((x-[1])/[4])^2)", -fitrange,fitrange); TH1F* hist=phiSecHistsCSC[iecAC][iphi][iyx]; TF1* fit =fits[iecAC][iyx][iphi]; double innerwidth=(iyx==0)?8.:16.; double outerwidth=(iyx==0)?20.:40.; fit->SetParameters(hist->GetMaximum(),hist->GetMean(),innerwidth,0.8,outerwidth); fit->SetParLimits(2,innerwidth/4.,outerwidth*1.5); hist->Fit(fit,"RQ"); hist->GetXaxis()->SetTitle(title.c_str()); hist->Draw(); fit->Draw("same"); stringstream binLabel; binLabel<<iphi+1; if (iecAC==0) binLabel<<"A"; else binLabel<<"C"; hMeans[iecAC][iyx]->GetXaxis()->SetBinLabel(iphi+1,binLabel.str().c_str()); if (fit->GetChisquare()/fit->GetNDF()<5. && hist->GetEntries()>1000.) { hMeans[iecAC][iyx]->SetBinContent(iphi+1,fit->GetParameter(1)); hMeans[iecAC][iyx]->SetBinError (iphi+1,fit->GetParError(1)); if (iyx==0) cout<<"dY: "; else cout<<"dX: "; cout<<iphi+1; if (iecAC==0) cout<<"A"; else cout<<"C"; cout<<" "<<fit->GetParameter(1)<<" +/- "<<fit->GetParError(1)<<endl; } } string canvname="CSC"; if (iecAC==0) canvname+="_EndcapA"; else canvname+="_EndcapC"; if (iyx==0) canvname+="_dY"; else canvname+="_dX"; canv->Print((outputdir+"/"+canvname+".eps").c_str()); canv->Clear(); if (hMeans[iecAC][iyx]->GetMaximum()>20.) hMeans[iecAC][iyx]->SetMaximum(20.); if (hMeans[iecAC][iyx]->GetMinimum()<-20.) hMeans[iecAC][iyx]->SetMinimum(-20.); hMeans[iecAC][iyx]->Draw(); hMeans[iecAC][iyx]->GetYaxis()->SetTitle(title.c_str()); canv->Modified(); canv->Print((outputdir+"/"+canvname+"_allPhi.eps").c_str()); delete canv; } } return; } //________________________________________________________________________ void makeCSCResVTanThetaPlots(TFile* outputHists) { gStyle->SetOptStat(1); gStyle->SetOptFit(111); gStyle->SetPalette(1); TH1F*** hMeans =new TH1F**[2]; TF1**** fits =new TF1***[2]; TH1F**** resVTanTheta=new TH1F***[2]; for (int iecAC=0;iecAC<2;iecAC++) { hMeans [iecAC]=new TH1F*[NYX]; fits [iecAC]=new TF1**[NYX]; resVTanTheta[iecAC]=new TH1F**[NYX]; int ixy=NYX-1; for (int iyx=0;iyx<NYX;iyx++,ixy--) { string title="#Delta "; if (iyx==0) title+="y"; else title+="x"; title+=" (mm)"; string hmeanname=(iecAC==0)?"EndcapA":"EndcapC"; if (iyx==0) hmeanname+="_dY"; else hmeanname+="_dX"; hMeans [iecAC][iyx]=new TH1F(hmeanname.c_str(),hmeanname.c_str(),16,0.,16.); fits [iecAC][iyx]=new TF1*[16]; resVTanTheta[iecAC][iyx]=new TH1F*[16]; TCanvas* canv=new TCanvas("canv","canv"); canv->SetFillColor(10); canv->Divide(4,4); for (int iphi=0;iphi<16;iphi++) { canv->cd(iphi+1); TH2F* hist=resVTanThetaHistsCSC[iecAC][iphi][iyx]; double fitrange=(iyx==0)?20.:40.; string resHistName=string(hist->GetName())+"Fits"; resVTanTheta[iecAC][iyx][iphi]=new TH1F(resHistName.c_str(),resHistName.c_str(), 5,-.04,.06); TH1F** slices=new TH1F*[5]; for (int i=0;i<5;i++) { stringstream tmphistname; tmphistname<<hist->GetName()<<"_slice"<<i; slices[i]=(TH1F*)hist->ProjectionY(tmphistname.str().c_str(),i+1,i+2); slices[i]->Draw(); TF1* fit= new TF1("fit", "gaus",-fitrange,fitrange); slices[i]->Fit(fit,"QR"); resVTanTheta[iecAC][iyx][iphi]->SetBinContent(i+1,fit->GetParameter(1)); resVTanTheta[iecAC][iyx][iphi]->SetBinError(i+1,fit->GetParError(1)); delete fit; } string fitname=string(hist->GetName())+"_fit"; fits[iecAC][iyx][iphi]=new TF1(fitname.c_str(),"pol1",-fitrange,fitrange); resVTanTheta[iecAC][iyx][iphi]->Fit(fits[iecAC][iyx][iphi],"RQ"); //canv->cd(iphi+1); hist->GetYaxis()->SetRangeUser(-fitrange,fitrange); //hist->Draw("colz"); resVTanTheta[iecAC][iyx][iphi]->Draw("same"); fits[iecAC][iyx][iphi]->Draw("same"); } string canvname="CSC"; if (iecAC==0) canvname+="_EndcapA"; else canvname+="_EndcapC"; if (iyx==0) canvname+="_dY"; else canvname+="_dX"; canv->Print((outputdir+"/"+canvname+"_tantheta.eps").c_str()); canv->Clear(); hMeans[iecAC][iyx]->Draw(); hMeans[iecAC][iyx]->GetYaxis()->SetTitle(title.c_str()); canv->Modified(); canv->Print((outputdir+"/"+canvname+"_allPhi_tantheta.eps").c_str()); delete canv; } } return; } //________________________________________________________________________ void makeMDTResVTanThetaPlots(TFile* outputHists) { gStyle->SetOptStat(1); gStyle->SetOptFit(111); gStyle->SetPalette(1); TH1F***** hMeans =new TH1F****[2]; TF1****** fits =new TF1*****[2]; TH1F****** resVTanTheta=new TH1F*****[2]; for (int iecAC=0;iecAC<2;iecAC++) { hMeans [iecAC]=new TH1F***[3]; fits [iecAC]=new TF1****[3]; resVTanTheta[iecAC]=new TH1F****[3]; for (int ilayer=0;ilayer<3;ilayer++) { hMeans [iecAC][ilayer]=new TH1F**[6]; fits [iecAC][ilayer]=new TF1***[6]; resVTanTheta[iecAC][ilayer]=new TH1F***[6]; for (int ieta=0;ieta<6;ieta++) { hMeans [iecAC][ilayer][ieta]=new TH1F*[NYX]; fits [iecAC][ilayer][ieta]=new TF1**[NYX]; resVTanTheta[iecAC][ilayer][ieta]=new TH1F**[NYX]; int ixy=NYX-1; for (int iyx=0;iyx<NYX;iyx++,ixy--) { string title="#Delta "; if (iyx==0) title+="y"; else title+="x"; title+=" (mm)"; string hmeanname="mean_resVTanTheta"+mdtChamberNameNoPhi(iecAC,ilayer,ieta); if (iyx==0) hmeanname+="_dY"; else hmeanname+="_dX"; hMeans [iecAC][ilayer][ieta][iyx]=new TH1F(hmeanname.c_str(),hmeanname.c_str(),16,0.,16.); fits [iecAC][ilayer][ieta][iyx]=new TF1*[16]; resVTanTheta[iecAC][ilayer][ieta][iyx]=new TH1F*[16]; TCanvas* canv=new TCanvas("canv","canv"); canv->SetFillColor(10); canv->Divide(4,4); for (int iphi=0;iphi<16;iphi++) { canv->cd(iphi+1); string fitname="fitRes_"+mdtChamberName(iecAC,ilayer,ieta,iphi)+"_dY"; double fitrange=(iyx==0)?20.:40.; if (ilayer==1) fitrange*=0.5; TH2F* hist=resVTanThetaHistsMDT[iecAC][ilayer][ieta][iphi][iyx]; cout<<"hist has "<<hist->GetEntries()<<" entries"<<endl; string resHistName=string(hist->GetName())+"Fits"; resVTanTheta[iecAC][ilayer][ieta][iyx][iphi]= new TH1F(resHistName.c_str(),resHistName.c_str(),5,tanThetaMin[ilayer][ieta],tanThetaMax[ilayer][ieta]); TH1F** slices=new TH1F*[5]; for (int i=0;i<5;i++) { stringstream tmphistname; tmphistname<<hist->GetName()<<"_slice"<<i; slices[i]=(TH1F*)hist->ProjectionY(tmphistname.str().c_str(),i+1,i+2); slices[i]->Draw(); TF1* fit= new TF1("fit", "gaus",-fitrange,fitrange); slices[i]->Fit(fit,"QR"); cout<<"mean["<<i<<"]: "<<fit->GetParameter(1)<<" +/- "<<fit->GetParError(1)<<endl; resVTanTheta[iecAC][ilayer][ieta][iyx][iphi]->SetBinContent(i+1,fit->GetParameter(1)); resVTanTheta[iecAC][ilayer][ieta][iyx][iphi]->SetBinError(i+1,fit->GetParError(1)); delete fit; } fits[iecAC][ilayer][ieta][iyx][iphi]=new TF1(fitname.c_str(),"pol1",-fitrange,fitrange); TF1* fitpol1=fits[iecAC][ilayer][ieta][iyx][iphi]; resVTanTheta[iecAC][ilayer][ieta][iyx][iphi]-> Fit(fitpol1,"RQ"); hMeans[iecAC][ilayer][ieta][iyx]->SetBinContent(iphi+1,fitpol1->GetParameter(0)); hMeans[iecAC][ilayer][ieta][iyx]->SetBinError(iphi+1,fitpol1->GetParError(0)); //canv->cd(iphi+1); hist->GetYaxis()->SetRangeUser(-fitrange,fitrange); //hist->Draw("colz"); resVTanTheta[iecAC][ilayer][ieta][iyx][iphi]->Draw("same"); fits[iecAC][ilayer][ieta][iyx][iphi]->Draw("same"); } string canvname=mdtChamberNameNoPhi(iecAC,ilayer,ieta); if (iyx==0) canvname+="_dY"; else canvname+="_dX"; canv->Print((outputdir+"/"+canvname+"_tantheta.eps").c_str()); //exit(3); canv->Clear(); hMeans[iecAC][ilayer][ieta][iyx]->Draw(); hMeans[iecAC][ilayer][ieta][iyx]->GetYaxis()->SetTitle(title.c_str()); canv->Modified(); hMeans[iecAC][ilayer][ieta][iyx]->Write(); canv->Print((outputdir+"/"+canvname+"_allPhi_tantheta.eps").c_str()); delete canv; } } } } return; } //________________________________________________________________________ void makeMDTResPlots(TFile* outputHists) { gStyle->SetOptStat("uon"); gStyle->SetOptFit(111); TH1F**** hPull =new TH1F***[2]; TH1F***** hMeans=new TH1F****[2]; TF1****** fits =new TF1*****[2]; for (int iecAC=0;iecAC<2;iecAC++) { hMeans[iecAC]=new TH1F***[3]; fits [iecAC]=new TF1****[3]; hPull [iecAC]=new TH1F**[3]; for (int ilayer=0;ilayer<3;ilayer++) { hMeans[iecAC][ilayer]=new TH1F**[6]; fits [iecAC][ilayer]=new TF1***[6]; hPull [iecAC][ilayer]=new TH1F*[6]; for (int ieta=0;ieta<6;ieta++) { hMeans[iecAC][ilayer][ieta]=new TH1F*[NYX]; fits [iecAC][ilayer][ieta]=new TF1**[NYX]; int ixy=0; for (int iyx=NYX-1;iyx>=0;iyx--,ixy++) { string title="#Delta "; if (iyx==0) title+="y"; else title+="x"; title+=" (mm)"; string hmeanname="mean_"+mdtChamberNameNoPhi(iecAC,ilayer,ieta); if (iyx==0) hmeanname+="_dY"; else hmeanname+="_dX"; hMeans[iecAC][ilayer][ieta][iyx]=new TH1F(hmeanname.c_str(),hmeanname.c_str(),16,0.,16.); fits [iecAC][ilayer][ieta][iyx]=new TF1*[16]; if (ieta==0) { string histname="mean_"+mdtChamberNameNoEta(iecAC,ilayer)+"_dY_all"; hPull [iecAC][ilayer][iyx]=new TH1F(histname.c_str(), histname.c_str(), 40,-10.,10.); } TCanvas* canv=new TCanvas("canv","canv"); canv->SetFillColor(10); canv->Divide(4,4); for (int iphi=0;iphi<16;iphi++) { canv->cd(iphi+1); string fitname="fitRes_"+mdtChamberName(iecAC,ilayer,ieta,iphi); if (iyx==0) fitname+="_dY"; else fitname+="_dX"; double fitrange=(iyx==0) ? 25. : 40.; if (ilayer==1) fitrange*=0.5; TH1F* hist=phiSecEtaHistsMDT[iecAC][ilayer][ieta][iphi][iyx]; double innerwidth=(iyx==0)?4.:8.; double outerwidth=(iyx==0)?10.:20.; //if (ilayer<2) { //innerwidth*=2; //outerwidth*=2; //} if (hist->GetEntries()>1000&&ilayer==2) { fits[iecAC][ilayer][ieta][iyx][iphi]= new TF1(fitname.c_str(), "[0]*exp(-0.5*((x-[1])/[2])^2)+[3]*[0]*exp(-0.5*((x-[1])/[4])^2)", -fitrange,fitrange); fits[iecAC][ilayer][ieta][iyx][iphi] ->SetParameters(hist->GetMaximum(),hist->GetMean(),innerwidth,0.8,outerwidth); fits[iecAC][ilayer][ieta][iyx][iphi] ->SetParLimits(4,innerwidth*2.,outerwidth*5.); } else { fits[iecAC][ilayer][ieta][iyx][iphi]= new TF1(fitname.c_str(),"gaus",-fitrange,fitrange); fits[iecAC][ilayer][ieta][iyx][iphi] ->SetParameters(hist->GetMaximum(),hist->GetMean(),innerwidth); } TF1* fit =fits[iecAC][ilayer][ieta][iyx][iphi]; fit->SetParLimits(2,innerwidth/4.,innerwidth*2.); hist->Fit(fit,"RQL"); hist->GetXaxis()->SetTitle(title.c_str()); hist->Draw(); fit->Draw("same"); stringstream binLabel; binLabel<<iphi+1; if (iecAC==0) binLabel<<"A"; else binLabel<<"C"; hMeans[iecAC][ilayer][ieta][iyx]->GetXaxis()->SetBinLabel(iphi+1,binLabel.str().c_str()); //if (fit->GetChisquare()/fit->GetNDF()<5. && hist->GetEntries()>1000.) { hMeans[iecAC][ilayer][ieta][iyx]->SetBinContent(iphi+1,fit->GetParameter(1)); hMeans[iecAC][ilayer][ieta][iyx]->SetBinError (iphi+1,fit->GetParError(1)); if (iyx==0) cout<<"dY: "; else cout<<"dX: "; cout<<iphi+1; if (iecAC==0) cout<<"A"; else cout<<"C"; cout<<" "<<fit->GetParameter(1)<<" +/- "<<fit->GetParError(1)<<endl; if ((ilayer==0&&ieta<2) || (ilayer==1&&ieta<3) || (ilayer==2)) hPull[iecAC][ilayer][iyx]->Fill(fit->GetParameter(1)/fit->GetParError(1)); //} } string canvname=mdtChamberNameNoPhi(iecAC,ilayer,ieta); if (iyx==0) canvname+="_dY"; else canvname+="_dX"; canv->Print((outputdir+"/"+canvname+".eps").c_str()); canv->Clear(); if (hMeans[iecAC][ilayer][ieta][iyx]->GetMaximum()>20. || hMeans[iecAC][ilayer][ieta][iyx]->GetMaximum()<-20.) { hMeans[iecAC][ilayer][ieta][iyx]->SetMaximum(20.); hMeans[iecAC][ilayer][ieta][iyx]->SetMinimum(-20.); } hMeans[iecAC][ilayer][ieta][iyx]->Draw(); hMeans[iecAC][ilayer][ieta][iyx]->GetYaxis()->SetTitle(title.c_str()); canv->Modified(); hMeans[iecAC][ilayer][ieta][iyx]->Write(); canv->Print((outputdir+"/"+canvname+"_allPhi.eps").c_str()); canv->Clear(); if (ieta==5) { hPull[iecAC][ilayer][iyx]->Draw(); hPull[iecAC][ilayer][iyx]->Fit("gaus","LQ"); hPull[iecAC][ilayer][iyx]->GetXaxis()->SetTitle("pull"); canv->Modified(); hPull[iecAC][ilayer][iyx]->Write(); string canvname2=mdtChamberNameNoEta(iecAC,ilayer)+"_dY"; canv->Print((outputdir+"/"+canvname2+"_all.eps").c_str()); } delete canv; } } } } return; } /* //________________________________________________________________________ void makeWidthPlots(TFile* outputHists, const string& type) { gStyle->SetOptStat(1); gStyle->SetOptFit(111); TF1*** fits=new TF1**[2]; TH1F**** slices=new TH1F***[2]; TH1F*** hSigmas=new TH1F**[2]; TH2F*** hists; if (type=="EndcapAC") hists=ecHistsCSC; else if (type=="LargeSmall") hists=lgsmHistsCSC; else cout<<"bad type"<<endl; int nplots=2; for (int iplot=0;iplot<nplots;iplot++) { fits [iplot]=new TF1* [NYX]; slices[iplot]=new TH1F**[NYX]; hSigmas[iplot]=new TH1F*[NYX]; for (int iyx=NYX-1;iyx>=0;iyx--) { double fitrange=(iyx==0)?40.:80.; stringstream fitname; fitname<<"fit_"<<iplot<<"_"<<iyx; //fits[iplot][iyx]=new TF1(fitname.str().c_str(),"[0]*exp(-0.5*((x-[1])/[2])^2)+[3]*[0]*exp(-0.5*((x-[4])/[5])^2)",-fitrange,fitrange); fits[iplot][iyx]=new TF1(fitname.str().c_str(),"gaus",-fitrange,fitrange); TObjArray aSlices; hists[iplot][iyx]->FitSlicesY(fits[iplot][iyx],0,NMOM,0,"QNR",&aSlices); const int nSlices=aSlices.GetEntriesFast(); slices[iplot][iyx]=new TH1F*[nSlices]; for (int islice=0;islice<nSlices;islice++) { slices[iplot][iyx][islice]=(TH1F*)aSlices[islice]->Clone(); } string hname=hists[iplot][iyx]->GetName()+string("_2"); hSigmas[iplot][iyx]=(TH1F*)gDirectory->Get(hname.c_str())->Clone((hists[iplot][iyx]->GetName()+string("_sigma")).c_str()); } } TCanvas* ctmp=new TCanvas("ctmp","ctmp"); TF1*** fits1OverP=new TF1**[NYX]; TPaveStats*** paves=new TPaveStats**[NYX]; double min[2]={999.,999.}; double max[2]={0., 0.}; for (int iyx=NYX-1;iyx>=0;iyx--) { fits1OverP[iyx]=new TF1*[2]; paves[iyx]=new TPaveStats*[2]; // fit to 1/p and get min/max for (int iplot=0;iplot<nplots;iplot++) { for (int ibin=0;ibin<(int)hSigmas[iplot][iyx]->GetNbinsX();ibin++) { double bc=hSigmas[iplot][iyx]->GetBinContent(ibin+1); if (bc>max[iyx]) max[iyx]=bc; if (bc>0.&&bc<min[iyx]) min[iyx]=bc; } stringstream fitname; fitname<<"fit1OverP_"<<iyx<<"_ecAC"<<iplot; //fits1OverP[iyx][iplot]=new TF1(fitname.str().c_str(),"[0]+[1]/(x-3.)",9.,mommax); fits1OverP[iyx][iplot]=new TF1(fitname.str().c_str(),"TMath::Sqrt([0]*[0]+[1]*[1]/(x-3.5)/(x-3.5))",9.,mommax); hSigmas[iplot][iyx]->Fit(fits1OverP[iyx][iplot],"RQ"); ctmp->Update(); paves[iyx][iplot]=(TPaveStats*)hSigmas[iplot][iyx]->FindObject("stats"); if (iplot==0) { paves[iyx][iplot]->SetY1NDC(0.8); paves[iyx][iplot]->SetY2NDC(1.0); } if (iplot==1) { paves[iyx][iplot]->SetY1NDC(0.6); paves[iyx][iplot]->SetY2NDC(0.8); } paves[iyx][iplot]->SetTextColor(twocolors[iplot]); ctmp->Modified(); } if (max[iyx]>0.) max[iyx]*=1.1; else max[iyx]*=0.8; if (min[iyx]<0.) min[iyx]*=1.1; else min[iyx]*=0.8; } delete ctmp; TCanvas* canv=new TCanvas("canv","canv"); canv->SetFillColor(10); canv->Divide(NYX,1); int ixy=0; for (int iyx=NYX-1;iyx>=0;iyx--,ixy++) { canv->cd(ixy+1); for (int iplot=0;iplot<nplots;iplot++) { hSigmas[iplot][iyx]->SetMinimum(min[iyx]); hSigmas[iplot][iyx]->SetMaximum(1.1*max[iyx]); hSigmas[iplot][iyx]->SetLineColor(twocolors[iplot]); fits1OverP[iyx][iplot]->SetLineWidth(2); fits1OverP[iyx][iplot]->SetLineColor(twocolors[iplot]); if (iplot==0) hSigmas[iplot][iyx]->Draw(); else hSigmas[iplot][iyx]->Draw("same"); fits1OverP[iyx][iplot]->Draw("same"); } } string detStr=(DOCSC)?"CSC":"MDT"; if (DOBEE) detStr="BEE"; if (type=="EndcapAC") canv->Print((outputdir+"/"+detStr+"_EndcapACWidth.eps").c_str()); else if (type=="LargeSmall") canv->Print((outputdir+"/"+detStr+"_LgSmWidth.eps").c_str()); else cout<<"bad type"<<endl; delete canv; delete [] hSigmas; return; } */ //________________________________________________________________________ void makeWidthPlots(TFile* outputHists, const string& type) { gStyle->SetOptStat(1); gStyle->SetOptFit(111); int nplots=2; TF1**** fits=new TF1***[nplots]; TH1F***** slices=new TH1F****[nplots]; TH1F**** hSigmas=new TH1F***[nplots]; TH2F**** hists; if (type=="EndcapAC") hists=ecHistsCSC; else if (type=="LargeSmall") hists=lgsmHistsCSC; else cout<<"bad type"<<endl; for (int iplot=0;iplot<nplots;iplot++) { fits [iplot]=new TF1** [3]; slices[iplot]=new TH1F***[3]; hSigmas[iplot]=new TH1F**[3]; for (int ilayer=0;ilayer<3;ilayer++) { fits [iplot][ilayer]=new TF1* [3]; slices[iplot][ilayer]=new TH1F**[3]; hSigmas[iplot][ilayer]=new TH1F*[3]; for (int iyx=NYX-1;iyx>=0;iyx--) { double fitrange=(iyx==0)?40.:80.; stringstream fitname; fitname<<"fit_"<<iplot<<"_"<<ilayer<<"_"<<iyx; //fits[iplot][iyx]=new TF1(fitname.str().c_str(),"[0]*exp(-0.5*((x-[1])/[2])^2)+[3]*[0]*exp(-0.5*((x-[4])/[5])^2)",-fitrange,fitrange); fits[iplot][ilayer][iyx]=new TF1(fitname.str().c_str(),"gaus",-fitrange,fitrange); TObjArray aSlices; hists[iplot][ilayer][iyx]->FitSlicesY(fits[iplot][ilayer][iyx],0,NMOM,0,"QNR",&aSlices); const int nSlices=aSlices.GetEntriesFast(); slices[iplot][ilayer][iyx]=new TH1F*[nSlices]; for (int islice=0;islice<nSlices;islice++) { slices[iplot][ilayer][iyx][islice]=(TH1F*)aSlices[islice]->Clone(); } string hname=hists[iplot][ilayer][iyx]->GetName()+string("_2"); hSigmas[iplot][ilayer][iyx]=(TH1F*)gDirectory->Get(hname.c_str())->Clone((hists[iplot][ilayer][iyx]->GetName()+string("_sigma")).c_str()); } } } TCanvas* ctmp=new TCanvas("ctmp","ctmp"); TF1**** fits1OverP=new TF1***[3]; TPaveStats**** paves=new TPaveStats***[3]; double min[2]={999.,999.}; double max[2]={0., 0.}; for (int ilayer=0;ilayer<3;ilayer++) { fits1OverP[ilayer]=new TF1**[NYX]; paves [ilayer]=new TPaveStats**[NYX]; for (int iyx=NYX-1;iyx>=0;iyx--) { fits1OverP[ilayer][iyx]=new TF1*[2]; paves[ilayer][iyx]=new TPaveStats*[2]; // fit to 1/p and get min/max for (int iplot=0;iplot<nplots;iplot++) { for (int ibin=0;ibin<(int)hSigmas[iplot][ilayer][iyx]->GetNbinsX();ibin++) { double bc=hSigmas[iplot][ilayer][iyx]->GetBinContent(ibin+1); if (bc>max[iyx]) max[iyx]=bc; if (bc>0.&&bc<min[iyx]) min[iyx]=bc; } stringstream fitname; fitname<<"fit1OverP_"<<ilayer<<"_"<<iyx<<"_ecAC"<<iplot; fits1OverP[ilayer][iyx][iplot]= new TF1(fitname.str().c_str(),"TMath::Sqrt([0]*[0]+[1]*[1]/(x-3.5)/(x-3.5))",9.,mommax); hSigmas[iplot][ilayer][iyx]->Fit(fits1OverP[ilayer][iyx][iplot],"RQ"); ctmp->Update(); paves[ilayer][iyx][iplot]=(TPaveStats*)hSigmas[iplot][ilayer][iyx]->FindObject("stats"); if (iplot==0) { paves[ilayer][iyx][iplot]->SetY1NDC(0.8); paves[ilayer][iyx][iplot]->SetY2NDC(1.0); } if (iplot==1) { paves[ilayer][iyx][iplot]->SetY1NDC(0.6); paves[ilayer][iyx][iplot]->SetY2NDC(0.8); } paves[ilayer][iyx][iplot]->SetTextColor(twocolors[iplot]); ctmp->Modified(); } if (max[iyx]>0.) max[iyx]*=1.1; else max[iyx]*=0.8; if (min[iyx]<0.) min[iyx]*=1.1; else min[iyx]*=0.8; } } delete ctmp; TCanvas* canv=new TCanvas("canv","canv"); canv->SetFillColor(10); canv->Divide(NYX,1); for (int ilayer=0;ilayer<3;ilayer++) { int ixy=0; for (int iyx=NYX-1;iyx>=0;iyx--,ixy++) { canv->cd(ixy+1); for (int iplot=0;iplot<nplots;iplot++) { hSigmas[iplot][ilayer][iyx]->SetMinimum(min[iyx]); hSigmas[iplot][ilayer][iyx]->SetMaximum(1.1*max[iyx]); hSigmas[iplot][ilayer][iyx]->SetLineColor(twocolors[iplot]); fits1OverP[ilayer][iyx][iplot]->SetLineWidth(2); fits1OverP[ilayer][iyx][iplot]->SetLineColor(twocolors[iplot]); if (iplot==0) hSigmas[iplot][ilayer][iyx]->Draw(); else hSigmas[iplot][ilayer][iyx]->Draw("same"); fits1OverP[ilayer][iyx][iplot]->Draw("same"); } } string detStr=(DOCSC)?"CSC":"MDT"; if (DOBEE) detStr="BEE"; string layerStr; switch (ilayer) { case 0: layerStr="inner"; break; case 1: layerStr="middle"; break; case 2: layerStr="outer"; break; default: layerStr=""; break; } if (type=="EndcapAC") canv->Print((outputdir+"/"+detStr+"_"+layerStr+"_EndcapACWidth.eps").c_str()); else if (type=="LargeSmall") canv->Print((outputdir+"/"+detStr+"_"+layerStr+"_LgSmWidth.eps").c_str()); else cout<<"bad type"<<endl; } delete canv; delete [] hSigmas; return; } //________________________________________________________________________ void setBranchAddresses(TTree* tree) { tree->SetBranchAddress("nPixHits", &nPixHits); tree->SetBranchAddress("nSCTHits", &nSCTHits); tree->SetBranchAddress("nTRTHits", &nTRTHits); tree->SetBranchAddress("nCSCHits", &nCSCHits); tree->SetBranchAddress("nMDTHits", &nMDTHits); tree->SetBranchAddress("nInnerMDTHits", &nInnerMDTHits); tree->SetBranchAddress("nMiddleMDTHits", &nMiddleMDTHits); tree->SetBranchAddress("nOuterMDTHits", &nOuterMDTHits); tree->SetBranchAddress("nTriggerPhiHits", &nTriggerPhiHits); tree->SetBranchAddress("author", &author); tree->SetBranchAddress("hIndex", &hIndex); tree->SetBranchAddress("phiSector", &phiSector); tree->SetBranchAddress("isEndcap", &isEndcap); tree->SetBranchAddress("identifier", &identifier); tree->SetBranchAddress("isCSide", &isCSide); tree->SetBranchAddress("detType", &detType); tree->SetBranchAddress("layer", &layer); tree->SetBranchAddress("stName", &stName); tree->SetBranchAddress("stPhi", &stPhi); tree->SetBranchAddress("stEta", &stEta); tree->SetBranchAddress("momentum", &momentum); tree->SetBranchAddress("charge", &charge); tree->SetBranchAddress("d0", &d0); tree->SetBranchAddress("z0", &z0); tree->SetBranchAddress("phi0", &phi0); tree->SetBranchAddress("theta0", &theta0); tree->SetBranchAddress("eta0", &eta0); tree->SetBranchAddress("calEnergyLoss", &calEnergyLoss); tree->SetBranchAddress("calEnergyLossErr", &calEnergyLossErr); tree->SetBranchAddress("materialOnTrack", &materialOnTrack); tree->SetBranchAddress("dR", &dR); tree->SetBranchAddress("dZlocal", &dZlocal); tree->SetBranchAddress("dXlocal", &dXlocal); tree->SetBranchAddress("dYlocal", &dYlocal); tree->SetBranchAddress("dXlocalAngle", &dXlocalAngle); tree->SetBranchAddress("dYlocalAngle", &dYlocalAngle); tree->SetBranchAddress("dXglobal", &dXglobal); tree->SetBranchAddress("dYglobal", &dYglobal); tree->SetBranchAddress("dZglobal", &dZglobal); tree->SetBranchAddress("nInnerChambers", &nInnerChambers); tree->SetBranchAddress("nMiddleChambers", &nMiddleChambers); tree->SetBranchAddress("nOuterChambers", &nOuterChambers); tree->SetBranchAddress("nOtherChambers", &nOtherChambers); tree->SetBranchAddress("detTheta", &detTheta); tree->SetBranchAddress("innerStEta", innerStEta); tree->SetBranchAddress("middleStEta", middleStEta); tree->SetBranchAddress("outerStEta", outerStEta); tree->SetBranchAddress("otherStEta", otherStEta); return; } //________________________________________________________________________ void getHistograms(bool histsDone) { string histname=outputdir+"/inputHists"; string detStr=(DOCSC)?"CSC":"MDT"; if (!DOCSC && DOBEE) detStr="BEE"; if (DOCSC) histname+="_CSC.root"; else if (!DOBEE) histname+="_MDT.root"; else histname+="_MDT_BEE.root"; if (histsDone) inputHistsFile=new TFile(histname.c_str(),"READ"); // large/small hists lgsmHistsCSC=new TH2F***[2]; for (int ilgsm=0;ilgsm<2;ilgsm++) { lgsmHistsCSC[ilgsm]=new TH2F**[3]; for (int ilayer=0;ilayer<3;ilayer++) { lgsmHistsCSC[ilgsm][ilayer]=new TH2F*[2]; for (int iyx=0;iyx<NYX;iyx++) { double valmax=(iyx==0) ? 40.4: 80.8; double valmin=-valmax; string name=(ilgsm==0)?"LargeHists":"SmallHists"; if (ilayer==0) name+="_inner"; else if (ilayer==1) name+="_middle"; else name+="_outer"; if (iyx==0) name+="_dY"; else name+="_dX"; name+="_"+detStr; if (!histsDone) { cout<<"writing "<<name<<endl; lgsmHistsCSC[ilgsm][ilayer][iyx]=new TH2F(name.c_str(), name.c_str(), NMOM,mommin,mommax,NVALBINS,valmin,valmax); } else { cout<<"getting "<<name<<endl; lgsmHistsCSC[ilgsm][ilayer][iyx]=(TH2F*)inputHistsFile->Get(name.c_str()); cout<<"hist has "<<lgsmHistsCSC[ilgsm][ilayer][iyx]->GetEntries()<<" entries"<<endl; } } } } // endcap AC hists ecHistsCSC=new TH2F***[2]; for (int iecAC=0;iecAC<2;iecAC++) { ecHistsCSC[iecAC]=new TH2F**[3]; for (int ilayer=0;ilayer<3;ilayer++) { ecHistsCSC[iecAC][ilayer]=new TH2F*[NYX]; for (int iyx=0;iyx<NYX;iyx++) { double valmax=(iyx==0) ? 40.4: 80.8; double valmin=-valmax; string name=(iecAC==0)?"EndcapA":"EndcapC"; if (ilayer==0) name+="_inner"; else if (ilayer==1) name+="_middle"; else name+="_outer"; if (iyx==0) name+="_dY"; else name+="_dX"; name+="_"+detStr; if (!histsDone) { cout<<"writing "<<name<<endl; ecHistsCSC[iecAC][ilayer][iyx]=new TH2F(name.c_str(), name.c_str(), NMOM,mommin,mommax,NVALBINS,valmin,valmax); } else { cout<<"getting "<<name<<endl; ecHistsCSC[iecAC][ilayer][iyx]=(TH2F*)inputHistsFile->Get(name.c_str()); cout<<"hist has "<<ecHistsCSC[iecAC][ilayer][iyx]->GetEntries()<<" entries"<<endl; } } } } // CSC chamber hists phiSecHistsCSC =new TH1F***[2]; resVTanThetaHistsCSC=new TH2F***[2]; for (int iecAC=0;iecAC<2;iecAC++) { phiSecHistsCSC [iecAC]=new TH1F**[16]; resVTanThetaHistsCSC[iecAC]=new TH2F**[16]; for (int iphi=0;iphi<16;iphi++) { phiSecHistsCSC [iecAC][iphi]=new TH1F*[2]; resVTanThetaHistsCSC[iecAC][iphi]=new TH2F*[2]; for (int iyx=0;iyx<NYX;iyx++) { double valmax=(iyx==0) ? 40.4 : 80.8; double valmin=-valmax; stringstream name; name<<"Sector"<<iphi+1; if (iecAC==0) name<<"A"; else name<<"C"; if (iyx==0) name<<"_dY"; else name<<"_dX"; name<<"_CSC"; if (!histsDone) { phiSecHistsCSC[iecAC][iphi][iyx]=new TH1F(name.str().c_str(),name.str().c_str(), NVALBINS,valmin,valmax); double min=std::tan(-2.5*3.14159/180.); double max=std::tan( 3.5*3.14159/180.); resVTanThetaHistsCSC[iecAC][iphi][iyx]= new TH2F((name.str()+"_resVTanTheta").c_str(), (name.str()+"_resVTanTheta").c_str(), 5,min,max,50,valmin,valmax); } else { phiSecHistsCSC[iecAC][iphi][iyx]=(TH1F*)inputHistsFile->Get(name.str().c_str()); resVTanThetaHistsCSC[iecAC][iphi][iyx]=(TH2F*)inputHistsFile->Get((name.str()+"_resVTanTheta").c_str()); } } } } // MDT phi-sector hists phiSecHistsMDT=new TH1F**[2]; for (int iecAC=0;iecAC<2;iecAC++) { phiSecHistsMDT[iecAC]=new TH1F*[16]; for (int iphi=0;iphi<16;iphi++) { double valmax=40.4; double valmin=-valmax; stringstream name; name<<"Sector"<<iphi+1; if (iecAC==0) name<<"A"; else name<<"C"; name<<"_dY_MDT"; if (!histsDone) { phiSecHistsMDT[iecAC][iphi]=new TH1F(name.str().c_str(),name.str().c_str(), NVALBINS,valmin,valmax); double min=std::tan(-2.5*3.14159/180.); double max=std::tan( 3.5*3.14159/180.); } else { phiSecHistsMDT[iecAC][iphi]=(TH1F*)inputHistsFile->Get(name.str().c_str()); } } } // EC MDT chamber hists phiSecEtaHistsMDT =new TH1F*****[2]; resVTanThetaHistsMDT=new TH2F*****[2]; for (int iecAC=0;iecAC<2;iecAC++) { phiSecEtaHistsMDT [iecAC]=new TH1F****[3]; resVTanThetaHistsMDT[iecAC]=new TH2F****[3]; for (int ilayer=0;ilayer<3;ilayer++) { phiSecEtaHistsMDT [iecAC][ilayer]=new TH1F***[6]; resVTanThetaHistsMDT[iecAC][ilayer]=new TH2F***[6]; for (int ieta=0;ieta<6;ieta++) { phiSecEtaHistsMDT [iecAC][ilayer][ieta]=new TH1F**[16]; resVTanThetaHistsMDT[iecAC][ilayer][ieta]=new TH2F**[16]; for (int iphi=0;iphi<16;iphi++) { phiSecEtaHistsMDT [iecAC][ilayer][ieta][iphi]=new TH1F*[2]; resVTanThetaHistsMDT[iecAC][ilayer][ieta][iphi]=new TH2F*[2]; for (int iyx=0;iyx<NYX;iyx++) { double valmax=(iyx==0) ? 40.4 : 80.8; if (ilayer==1) valmax*=.5; double valmin=-valmax; stringstream name; name<<mdtChamberName(iecAC,ilayer,ieta,iphi); /* name<<"E"; if (ilayer==0) name<<"I"; else if (ilayer==1) name<<"M"; else if (ilayer==2) name<<"O"; if (iphi%2==0) name<<"L"; else name<<"S"; name<<ieta+1; if (iecAC==0) name<<"A"; else name<<"C"; if (iphi%2==0) name<<iphi/2+1; else name<<(iphi-1)/2+1; */ if (iyx==0) name<<"_dY"; else name<<"_dX"; if (!histsDone) { phiSecEtaHistsMDT[iecAC][ilayer][ieta][iphi][iyx]= new TH1F(name.str().c_str(),name.str().c_str(), NVALBINS,valmin,valmax); resVTanThetaHistsMDT[iecAC][ilayer][ieta][iphi][iyx]= new TH2F((name.str()+"VTanTheta").c_str(), (name.str()+"VTanTheta").c_str(), 5,tanThetaMin[ilayer][ieta],tanThetaMax[ilayer][ieta], 50,valmin,valmax); } else { phiSecEtaHistsMDT[iecAC][ilayer][ieta][iphi][iyx]= (TH1F*)inputHistsFile->Get(name.str().c_str()); resVTanThetaHistsMDT[iecAC][ilayer][ieta][iphi][iyx]= (TH2F*)inputHistsFile->Get((name.str()+"VTanTheta").c_str()); } } } } } } if (!histsDone) { //string filename=(!USETGCETA)?"/data/roberth/bfieldoff_V6_noTGC/UnbiasedMuonResiduals.root":"/data/roberth/bfieldoff_V6/UnbiasedMuonResiduals.root"; //string filename=(!USETGCETA)?"/data/roberth/bfieldoff_V6_noTGC/UnbiasedMuonResiduals.root":"/data/roberth/bfieldoff_V6/UnbiasedMuonResiduals.root"; string filename="/data/roberth/bfieldoff_V10/UnbiasedMuonResiduals.root"; /* TFile* inputfile=new TFile(filename.c_str(),"READ"); TTree* tree=(TTree*)inputfile->Get("unbiasedMuonResiduals"); */ TChain* tree=new TChain("unbiasedMuonResiduals"); tree->Add("/data/roberth/bfieldoff_V10/UnbiasedMuonResiduals*root"); setBranchAddresses(tree); cout<<"tree has "<<tree->GetEntries()<<" entries"<<endl; for (int ientry=0;ientry<(int)tree->GetEntries();ientry++) { tree->GetEntry(ientry); // CSC hists // single inner layer hit if (DOCSC && nInnerChambers>1) continue; if (DOBEE) { if (nOtherChambers<1) continue; } else { if (nOtherChambers>0) continue; } // CSC/MDT selection if (DOCSC && detType==0) continue; if (!DOCSC) { if (detType==1) continue; //if (layer!=0 || (stEta!=1&&stEta!=-1)) continue; } // select Muid/Moore track if (hIndex!=0) continue; // select endcap if (DOEC && isEndcap==0) continue; // I don't know what's going on with these guys //if ((stEta>0&&detTheta>25.) || (stEta<0&&detTheta<(180.-25.))) continue; // fill histogram int ilgsm=(phiSector%2==1)?0:1; int iecAC=(stEta>0)?0:1; int iphi =phiSector-1; for (int iyx=0;iyx<NYX;iyx++) { double val=(iyx==0)?dYlocal:dXlocal; int theta=(stEta>0)?detTheta : 180.-detTheta; if (layer<3) { lgsmHistsCSC[ilgsm][layer][iyx]->Fill(momentum,val); ecHistsCSC [iecAC][layer][iyx]->Fill(momentum,val); } if (DOCSC) { if (momentum>=momCut) { phiSecHistsCSC[iecAC][iphi][iyx]->Fill(val); double tanTheta=std::tan((theta-11.59)*3.14159/180.); resVTanThetaHistsCSC[iecAC][iphi][iyx]->Fill(tanTheta,val); } } else { if (layer>2) continue; /* if (layer==0&&nInnerChambers>1) continue; if (layer==1&&nMiddleChambers>1) continue; if (layer==2&&nOuterChambers>1) continue; */ // require only 1 chamber in each layer if (nInnerChambers!=1||nMiddleChambers!=1||nOuterChambers!=1) continue; //cout<<"stEta: "<<stEta<<", innerStEta[0]="<<innerStEta[0]<<", "<<"middleStEta[0]="<<middleStEta[0]<<", "<<"outerStEta[0]="<<outerStEta[0]<<endl; /* if (layer==1) { int ieta=(stEta>0)?stEta-1:-stEta-1; int thisInnerEta=(stEta>0)?innerStEta[0]:-innerStEta[0]; int thisOuterEta=(stEta>0)?outerStEta[0]:-outerStEta[0]; if (thisInnerEta!=allowedInnerLayerForMiddleFixed[ieta]) continue; if (thisOuterEta!=allowedOuterLayerForMiddleFixed[ieta]) continue; } */ int ieta=abs(stEta)-1; if (momentum>=momCut) { phiSecEtaHistsMDT[iecAC][layer][ieta][iphi][iyx]->Fill(val); phiSecHistsMDT[iecAC][iphi]->Fill(val); double tanTheta=std::tan(theta*3.14159/180.); resVTanThetaHistsMDT[iecAC][layer][ieta][iphi][iyx]->Fill(tanTheta,val); } } } } //inputfile->Close(); inputHistsFile=new TFile(histname.c_str(),"RECREATE"); for (int ilgsm=0;ilgsm<2;ilgsm++) { for (int ilayer=0;ilayer<3;ilayer++) { for (int iyx=0;iyx<NYX;iyx++) { lgsmHistsCSC[ilgsm][ilayer][iyx]->Write(); } } } for (int iecAC=0;iecAC<2;iecAC++) { for (int ilayer=0;ilayer<3;ilayer++) { for (int iyx=0;iyx<NYX;iyx++) { ecHistsCSC[iecAC][ilayer][iyx]->Write(); } } } if (DOCSC) { for (int iecAC=0;iecAC<2;iecAC++) { for (int iphi=0;iphi<16;iphi++) { for (int iyx=0;iyx<NYX;iyx++) { phiSecHistsCSC[iecAC][iphi][iyx]->Write(); resVTanThetaHistsCSC[iecAC][iphi][iyx]->Write(); } } } } else { // MDT hists for (int iecAC=0;iecAC<2;iecAC++) { for (int iphi=0;iphi<16;iphi++) phiSecHistsMDT[iecAC][iphi]->Write(); for (int ilayer=0;ilayer<3;ilayer++) { for (int ieta=0;ieta<6;ieta++) { for (int iphi=0;iphi<16;iphi++) { for (int iyx=0;iyx<NYX;iyx++) { phiSecEtaHistsMDT[iecAC][ilayer][ieta][iphi][iyx]->Write(); resVTanThetaHistsMDT[iecAC][ilayer][ieta][iphi][iyx]->Write(); } } } } } } } return; } //________________________________________________________________________ string mdtChamberName(int iecAC, int ilayer, int ieta, int iphi) { stringstream name; name<<"E"; if (ilayer==0) name<<"I"; else if (ilayer==1) name<<"M"; else if (ilayer==2) name<<"O"; else cout<<"bad layer"<<endl; if (iphi%2==0) name<<"L"; else name<<"S"; name<<ieta+1; if (iecAC==0) name<<"A"; else name<<"C"; if (iphi%2==0) name<<iphi/2+1; else name<<(iphi-1)/2+1; return name.str(); } //________________________________________________________________________ string mdtChamberNameNoEta(int iecAC, int ilayer) { stringstream name; name<<"E"; if (ilayer==0) name<<"I"; else if (ilayer==1) name<<"M"; else if (ilayer==2) name<<"O"; else cout<<"bad layer"<<endl; name<<"X"; if (iecAC==0) name<<"A"; else name<<"C"; return name.str(); } //________________________________________________________________________ string mdtChamberNameNoPhi(int iecAC, int ilayer, int ieta) { stringstream name; name<<"E"; if (ilayer==0) name<<"I"; else if (ilayer==1) name<<"M"; else if (ilayer==2) name<<"O"; else cout<<"bad layer"<<endl; name<<"X"; name<<ieta+1; if (iecAC==0) name<<"A"; else name<<"C"; return name.str(); } //________________________________________________________________________ void plotLgSmSummary(TPad* canv, TH1F** hists, const string& canvname) { gStyle->SetOptStat(0); gStyle->SetOptFit(111); canv->Clear(); /* double max=-999.; double min=999.; for (int i=0;i<2;i++) { for (int j=0;j<16;j++) { double val=hists[i]->GetBinContent(j+1); double err=hists[i]->GetBinError(j+1); if (val>0) val+=err; else val-=err; if (val>max && val!=0.) max=val; if (val<min && val!=0.) min=val; } } if (max>0) max*=1.1; else max*=0.9; if (min<0) min*=1.1; else min*=0.9; for (int i=0;i<2;i++) { hists[i]->SetMaximum(max); hists[i]->SetMinimum(min); } */ hists[0]->SetLineColor(twocolors[0]); hists[0]->Draw(); TCanvas* ctmp=new TCanvas("ctmpLgSmSummary","ctmpLgSmSummary"); TF1** fits=new TF1*[2]; TPaveStats** paves=new TPaveStats*[2]; fits[0]=new TF1("fitLg","pol0",0.,16.); fits[1]=new TF1("fitSm","pol0",0.,16.); for (int i=0;i<2;i++) { hists[i]->SetLineColor(twocolors[i]); ctmp->cd(); hists[i]->Fit(fits[i],"RQ"); ctmp->Update(); paves[i]=(TPaveStats*)hists[i]->FindObject("stats"); if (i==0) { paves[i]->SetY1NDC(0.92); paves[i]->SetY2NDC(1.0); } else { paves[i]->SetY1NDC(0.84); paves[i]->SetY2NDC(0.92); } paves[i]->SetTextColor(twocolors[i]); ctmp->Modified(); canv->cd(); fits[i]->SetLineColor(twocolors[i]); if (i==0) hists[i]->Draw(); else hists[i]->Draw("same"); fits[i]->Draw("same"); } canv->Update(); canv->Print(canvname.c_str()); delete [] fits; delete ctmp; return; }
[ "rushioda@lxplus754.cern.ch" ]
rushioda@lxplus754.cern.ch
0032118335313c1c90a2abd2c4d6634ba86c5d44
5cad8d9664c8316cce7bc57128ca4b378a93998a
/CI/rule/pclint/pclint_include/include_linux/c++/4.8.2/gnu/java/security/der/DERReader.h
7e59f85db35ccf61e7bfe317798f5eb751983594
[ "LicenseRef-scancode-unknown-license-reference", "GPL-2.0-only", "GPL-3.0-only", "curl", "Zlib", "LicenseRef-scancode-warranty-disclaimer", "OpenSSL", "GPL-1.0-or-later", "MIT", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-openssl", "LicenseRef-scancode-ssleay-windows", "BSD-3-...
permissive
huaweicloud/huaweicloud-sdk-c-obs
0c60d61e16de5c0d8d3c0abc9446b5269e7462d4
fcd0bf67f209cc96cf73197e9c0df143b1d097c4
refs/heads/master
2023-09-05T11:42:28.709499
2023-08-05T08:52:56
2023-08-05T08:52:56
163,231,391
41
21
Apache-2.0
2023-06-28T07:18:06
2018-12-27T01:15:05
C
UTF-8
C++
false
false
1,498
h
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __gnu_java_security_der_DERReader__ #define __gnu_java_security_der_DERReader__ #pragma interface #include <java/lang/Object.h> #include <gcj/array.h> extern "Java" { namespace gnu { namespace java { namespace security { namespace der { class DERReader; class DERValue; } } } } } class gnu::java::security::der::DERReader : public ::java::lang::Object { public: DERReader(JArray< jbyte > *); DERReader(JArray< jbyte > *, jint, jint); DERReader(::java::io::InputStream *); static ::gnu::java::security::der::DERValue * read(JArray< jbyte > *); virtual void skip(jint); virtual ::gnu::java::security::der::DERValue * read(); public: // actually protected virtual jint readLength(); private: ::java::lang::Object * readUniversal(jint, jint); static ::java::lang::String * makeString(jint, JArray< jbyte > *); static ::java::lang::String * fromIso88591(JArray< jbyte > *); static ::java::lang::String * fromUtf16Be(JArray< jbyte > *); static ::java::lang::String * fromUtf8(JArray< jbyte > *); ::java::util::Date * makeTime(jint, JArray< jbyte > *); public: // actually protected ::java::io::InputStream * __attribute__((aligned(__alignof__( ::java::lang::Object)))) in; ::java::io::ByteArrayOutputStream * encBuf; public: static ::java::lang::Class class$; }; #endif // __gnu_java_security_der_DERReader__
[ "xiangshijian1@huawei.com" ]
xiangshijian1@huawei.com
9ddfbd76d982317d961b5dd8dc16acf464184fbf
e22e98887a96124fd8e5bdf685f301bc59660556
/test/protobuf-dcom-plugin-unittest/TestVoidMessages.h
33938e6845d565bee68a9ae2b41e1f806b84e95f
[ "MIT" ]
permissive
end2endzone/protobuf-dcom-plugin
8a8babe3a0597744de9145af07add8ccbad9de70
33186be769bf86c1f76aa1e13b08b5edbb9d514a
refs/heads/master
2020-04-26T13:39:45.519539
2019-03-16T14:54:39
2019-03-16T14:54:39
173,586,333
1
0
null
null
null
null
UTF-8
C++
false
false
222
h
#ifndef TESTVOIDMESSAGES_H #define TESTVOIDMESSAGES_H #include <gtest/gtest.h> class TestVoidMessages : public ::testing::Test { public: virtual void SetUp(); virtual void TearDown(); }; #endif //TESTVOIDMESSAGES_H
[ "end2endzone@gmail.com" ]
end2endzone@gmail.com
5f23cdfaf1f0fb8243e6b98b6827163c2d0a5b24
994c009c07e28708e696ea40d54a055a8feb140b
/env/BallAgent.hpp
61adb407d8ef59036f703850d4552baf488c1e49
[]
no_license
dev-bz/ppo
bb7ad362fda91f3c1f41bf66335c5ca4264c5234
7529e79dd5b8858069b4ef8c95e79cc6ca5869b8
refs/heads/master
2020-07-15T20:34:39.725269
2019-12-21T12:59:48
2019-12-21T13:03:50
205,643,463
2
0
null
null
null
null
UTF-8
C++
false
false
312
hpp
#pragma once #include "Agent.h" int agentStateSize(); int agentActionSize(); void threadAt(int id); Agent *createAgent(int id, b2World *w, const b2Vec2 &position, const float32 &angle); int mirrorAgent(DataType *ob_, DataType *ob, DataType *act, const DataType *_ob_, const DataType *_ob, const DataType *_act);
[ "zmz3001@163.com" ]
zmz3001@163.com
ce5639dde3143b30437b466ccfa1ee2d08027c18
edab58696afb07657232f17490b24c8e1e11b6c2
/miscellanious/fcfs.cpp
f5df96e826ce0dab3df21dfd47ab7415cd93a5e6
[]
no_license
mhcayan/competitive-programming
cd8e08da67138cfbdcd2d47cd70572a7fc6435fd
f80ab6929a5d2eb780d35679688ea39138cf9e8a
refs/heads/master
2022-05-27T15:03:46.147224
2022-05-22T00:21:29
2022-05-22T00:21:29
161,851,714
0
0
null
null
null
null
UTF-8
C++
false
false
1,095
cpp
#include<cstdio> #include<cstdlib> #include<vector> using namespace std; typedef struct{ int no,bt,ar; }process; int cmp(const void *a,const void *b) { process *x=(process *)a; process *y=(process *)b; return x->ar-y->ar; } int main() { int n,i,total1,total2,wt[100],tat[100],t; process p[100]; while(scanf("%d",&n)==1) { printf("Enter process number:\n"); for(i=0;i<n;i++) scanf("%d",&p[i].no); printf("Enter cpu burst time of the processes:\n"); for(i=0;i<n;i++) scanf("%d",&p[i].bt); printf("Enter arrival order of the process:\n"); for(i=0;i<n;i++) { scanf("%d",&t); p[t-1].ar=i; } qsort(p,n,sizeof(p[0]),cmp); tat[0]=p[0].bt; wt[0]=0; total1=0; total2=tat[0]; for(i=1;i<n;i++) { tat[i]=tat[i-1]+p[i].bt; total2+=tat[i]; wt[i]=tat[i-1]; total1+=wt[i]; } printf("Process order -- waiting time -- turn around time\n"); for(i=0;i<n;i++) printf(" %2d %2d %2d \n",p[i].no,wt[i],tat[i]); printf("Average waiting time=%.2lf\nAverage turn arond time=%2lf\n",(double)total1/n,(double)total2/n); } return 0; }
[ "ayanctg@gmail.com" ]
ayanctg@gmail.com
7d4d8fa10f670e25ed8c3ba9941cf03ef666270d
607e69f9e4440ef3ab9c33b7b6e85e95b5e982fb
/deps/museum/8.1.0/external/libcxx/shared_mutex
aab7fb53a30b8f76118b4c904050df9b839eb0b1
[ "Apache-2.0", "NCSA", "MIT" ]
permissive
simpleton/profilo
8bda2ebf057036a55efd4dea1564b1f114229d1a
91ef4ba1a8316bad2b3080210316dfef4761e180
refs/heads/master
2023-03-12T13:34:27.037783
2018-04-24T22:45:58
2018-04-24T22:45:58
125,419,173
0
0
Apache-2.0
2018-03-15T19:54:00
2018-03-15T19:54:00
null
UTF-8
C++
false
false
14,935
// -*- C++ -*- //===------------------------ shared_mutex --------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef _MUSEUM_LIBCPP_SHARED_MUTEX #define _MUSEUM_LIBCPP_SHARED_MUTEX /* shared_mutex synopsis // C++1y namespace std { class shared_mutex // C++17 { public: shared_mutex(); ~shared_mutex(); shared_mutex(const shared_mutex&) = delete; shared_mutex& operator=(const shared_mutex&) = delete; // Exclusive ownership void lock(); // blocking bool try_lock(); void unlock(); // Shared ownership void lock_shared(); // blocking bool try_lock_shared(); void unlock_shared(); typedef implementation-defined native_handle_type; // See 30.2.3 native_handle_type native_handle(); // See 30.2.3 }; class shared_timed_mutex { public: shared_timed_mutex(); ~shared_timed_mutex(); shared_timed_mutex(const shared_timed_mutex&) = delete; shared_timed_mutex& operator=(const shared_timed_mutex&) = delete; // Exclusive ownership void lock(); // blocking bool try_lock(); template <class Rep, class Period> bool try_lock_for(const chrono::duration<Rep, Period>& rel_time); template <class Clock, class Duration> bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time); void unlock(); // Shared ownership void lock_shared(); // blocking bool try_lock_shared(); template <class Rep, class Period> bool try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time); template <class Clock, class Duration> bool try_lock_shared_until(const chrono::time_point<Clock, Duration>& abs_time); void unlock_shared(); }; template <class Mutex> class shared_lock { public: typedef Mutex mutex_type; // Shared locking shared_lock() noexcept; explicit shared_lock(mutex_type& m); // blocking shared_lock(mutex_type& m, defer_lock_t) noexcept; shared_lock(mutex_type& m, try_to_lock_t); shared_lock(mutex_type& m, adopt_lock_t); template <class Clock, class Duration> shared_lock(mutex_type& m, const chrono::time_point<Clock, Duration>& abs_time); template <class Rep, class Period> shared_lock(mutex_type& m, const chrono::duration<Rep, Period>& rel_time); ~shared_lock(); shared_lock(shared_lock const&) = delete; shared_lock& operator=(shared_lock const&) = delete; shared_lock(shared_lock&& u) noexcept; shared_lock& operator=(shared_lock&& u) noexcept; void lock(); // blocking bool try_lock(); template <class Rep, class Period> bool try_lock_for(const chrono::duration<Rep, Period>& rel_time); template <class Clock, class Duration> bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time); void unlock(); // Setters void swap(shared_lock& u) noexcept; mutex_type* release() noexcept; // Getters bool owns_lock() const noexcept; explicit operator bool () const noexcept; mutex_type* mutex() const noexcept; }; template <class Mutex> void swap(shared_lock<Mutex>& x, shared_lock<Mutex>& y) noexcept; } // std */ #include <museum/8.1.0/external/libcxx/__config> #if _MUSEUM_LIBCPP_STD_VER > 11 || defined(_MUSEUM_LIBCPP_BUILDING_SHARED_MUTEX) #include <museum/8.1.0/external/libcxx/__mutex_base> #include <museum/8.1.0/external/libcxx/__undef_min_max> #if !defined(_MUSEUM_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif #ifdef _MUSEUM_LIBCPP_HAS_NO_THREADS #error <shared_mutex> is not supported on this single threaded system #else // !_MUSEUM_LIBCPP_HAS_NO_THREADS _MUSEUM_LIBCPP_BEGIN_NAMESPACE_STD struct _MUSEUM_LIBCPP_TYPE_VIS __shared_mutex_base { mutex __mut_; condition_variable __gate1_; condition_variable __gate2_; unsigned __state_; static const unsigned __write_entered_ = 1U << (sizeof(unsigned)*__CHAR_BIT__ - 1); static const unsigned __n_readers_ = ~__write_entered_; __shared_mutex_base(); _MUSEUM_LIBCPP_INLINE_VISIBILITY ~__shared_mutex_base() = default; __shared_mutex_base(const __shared_mutex_base&) = delete; __shared_mutex_base& operator=(const __shared_mutex_base&) = delete; // Exclusive ownership void lock(); // blocking bool try_lock(); void unlock(); // Shared ownership void lock_shared(); // blocking bool try_lock_shared(); void unlock_shared(); // typedef implementation-defined native_handle_type; // See 30.2.3 // native_handle_type native_handle(); // See 30.2.3 }; #if _MUSEUM_LIBCPP_STD_VER > 14 class _MUSEUM_LIBCPP_TYPE_VIS shared_mutex { __shared_mutex_base __base; public: shared_mutex() : __base() {} _MUSEUM_LIBCPP_INLINE_VISIBILITY ~shared_mutex() = default; shared_mutex(const shared_mutex&) = delete; shared_mutex& operator=(const shared_mutex&) = delete; // Exclusive ownership _MUSEUM_LIBCPP_INLINE_VISIBILITY void lock() { return __base.lock(); } _MUSEUM_LIBCPP_INLINE_VISIBILITY bool try_lock() { return __base.try_lock(); } _MUSEUM_LIBCPP_INLINE_VISIBILITY void unlock() { return __base.unlock(); } // Shared ownership _MUSEUM_LIBCPP_INLINE_VISIBILITY void lock_shared() { return __base.lock_shared(); } _MUSEUM_LIBCPP_INLINE_VISIBILITY bool try_lock_shared() { return __base.try_lock_shared(); } _MUSEUM_LIBCPP_INLINE_VISIBILITY void unlock_shared() { return __base.unlock_shared(); } // typedef __shared_mutex_base::native_handle_type native_handle_type; // _MUSEUM_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() { return __base::unlock_shared(); } }; #endif class _MUSEUM_LIBCPP_TYPE_VIS shared_timed_mutex { __shared_mutex_base __base; public: shared_timed_mutex(); _MUSEUM_LIBCPP_INLINE_VISIBILITY ~shared_timed_mutex() = default; shared_timed_mutex(const shared_timed_mutex&) = delete; shared_timed_mutex& operator=(const shared_timed_mutex&) = delete; // Exclusive ownership void lock(); bool try_lock(); template <class _Rep, class _Period> _MUSEUM_LIBCPP_INLINE_VISIBILITY bool try_lock_for(const chrono::duration<_Rep, _Period>& __rel_time) { return try_lock_until(chrono::steady_clock::now() + __rel_time); } template <class _Clock, class _Duration> _MUSEUM_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time); void unlock(); // Shared ownership void lock_shared(); bool try_lock_shared(); template <class _Rep, class _Period> _MUSEUM_LIBCPP_INLINE_VISIBILITY bool try_lock_shared_for(const chrono::duration<_Rep, _Period>& __rel_time) { return try_lock_shared_until(chrono::steady_clock::now() + __rel_time); } template <class _Clock, class _Duration> _MUSEUM_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_shared_until(const chrono::time_point<_Clock, _Duration>& __abs_time); void unlock_shared(); }; template <class _Clock, class _Duration> bool shared_timed_mutex::try_lock_until( const chrono::time_point<_Clock, _Duration>& __abs_time) { unique_lock<mutex> __lk(__base.__mut_); if (__base.__state_ & __base.__write_entered_) { while (true) { cv_status __status = __base.__gate1_.wait_until(__lk, __abs_time); if ((__base.__state_ & __base.__write_entered_) == 0) break; if (__status == cv_status::timeout) return false; } } __base.__state_ |= __base.__write_entered_; if (__base.__state_ & __base.__n_readers_) { while (true) { cv_status __status = __base.__gate2_.wait_until(__lk, __abs_time); if ((__base.__state_ & __base.__n_readers_) == 0) break; if (__status == cv_status::timeout) { __base.__state_ &= ~__base.__write_entered_; __base.__gate1_.notify_all(); return false; } } } return true; } template <class _Clock, class _Duration> bool shared_timed_mutex::try_lock_shared_until( const chrono::time_point<_Clock, _Duration>& __abs_time) { unique_lock<mutex> __lk(__base.__mut_); if ((__base.__state_ & __base.__write_entered_) || (__base.__state_ & __base.__n_readers_) == __base.__n_readers_) { while (true) { cv_status status = __base.__gate1_.wait_until(__lk, __abs_time); if ((__base.__state_ & __base.__write_entered_) == 0 && (__base.__state_ & __base.__n_readers_) < __base.__n_readers_) break; if (status == cv_status::timeout) return false; } } unsigned __num_readers = (__base.__state_ & __base.__n_readers_) + 1; __base.__state_ &= ~__base.__n_readers_; __base.__state_ |= __num_readers; return true; } template <class _Mutex> class shared_lock { public: typedef _Mutex mutex_type; private: mutex_type* __m_; bool __owns_; public: _MUSEUM_LIBCPP_INLINE_VISIBILITY shared_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {} _MUSEUM_LIBCPP_INLINE_VISIBILITY explicit shared_lock(mutex_type& __m) : __m_(_MUSEUM_VSTD::addressof(__m)), __owns_(true) {__m_->lock_shared();} _MUSEUM_LIBCPP_INLINE_VISIBILITY shared_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT : __m_(_MUSEUM_VSTD::addressof(__m)), __owns_(false) {} _MUSEUM_LIBCPP_INLINE_VISIBILITY shared_lock(mutex_type& __m, try_to_lock_t) : __m_(_MUSEUM_VSTD::addressof(__m)), __owns_(__m.try_lock_shared()) {} _MUSEUM_LIBCPP_INLINE_VISIBILITY shared_lock(mutex_type& __m, adopt_lock_t) : __m_(_MUSEUM_VSTD::addressof(__m)), __owns_(true) {} template <class _Clock, class _Duration> _MUSEUM_LIBCPP_INLINE_VISIBILITY shared_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __abs_time) : __m_(_MUSEUM_VSTD::addressof(__m)), __owns_(__m.try_lock_shared_until(__abs_time)) {} template <class _Rep, class _Period> _MUSEUM_LIBCPP_INLINE_VISIBILITY shared_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __rel_time) : __m_(_MUSEUM_VSTD::addressof(__m)), __owns_(__m.try_lock_shared_for(__rel_time)) {} _MUSEUM_LIBCPP_INLINE_VISIBILITY ~shared_lock() { if (__owns_) __m_->unlock_shared(); } shared_lock(shared_lock const&) = delete; shared_lock& operator=(shared_lock const&) = delete; _MUSEUM_LIBCPP_INLINE_VISIBILITY shared_lock(shared_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) { __u.__m_ = nullptr; __u.__owns_ = false; } _MUSEUM_LIBCPP_INLINE_VISIBILITY shared_lock& operator=(shared_lock&& __u) _NOEXCEPT { if (__owns_) __m_->unlock_shared(); __m_ = nullptr; __owns_ = false; __m_ = __u.__m_; __owns_ = __u.__owns_; __u.__m_ = nullptr; __u.__owns_ = false; return *this; } void lock(); bool try_lock(); template <class Rep, class Period> bool try_lock_for(const chrono::duration<Rep, Period>& rel_time); template <class Clock, class Duration> bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time); void unlock(); // Setters _MUSEUM_LIBCPP_INLINE_VISIBILITY void swap(shared_lock& __u) _NOEXCEPT { _MUSEUM_VSTD::swap(__m_, __u.__m_); _MUSEUM_VSTD::swap(__owns_, __u.__owns_); } _MUSEUM_LIBCPP_INLINE_VISIBILITY mutex_type* release() _NOEXCEPT { mutex_type* __m = __m_; __m_ = nullptr; __owns_ = false; return __m; } // Getters _MUSEUM_LIBCPP_INLINE_VISIBILITY bool owns_lock() const _NOEXCEPT {return __owns_;} _MUSEUM_LIBCPP_INLINE_VISIBILITY explicit operator bool () const _NOEXCEPT {return __owns_;} _MUSEUM_LIBCPP_INLINE_VISIBILITY mutex_type* mutex() const _NOEXCEPT {return __m_;} }; template <class _Mutex> void shared_lock<_Mutex>::lock() { if (__m_ == nullptr) __throw_system_error(EPERM, "shared_lock::lock: references null mutex"); if (__owns_) __throw_system_error(EDEADLK, "shared_lock::lock: already locked"); __m_->lock_shared(); __owns_ = true; } template <class _Mutex> bool shared_lock<_Mutex>::try_lock() { if (__m_ == nullptr) __throw_system_error(EPERM, "shared_lock::try_lock: references null mutex"); if (__owns_) __throw_system_error(EDEADLK, "shared_lock::try_lock: already locked"); __owns_ = __m_->try_lock_shared(); return __owns_; } template <class _Mutex> template <class _Rep, class _Period> bool shared_lock<_Mutex>::try_lock_for(const chrono::duration<_Rep, _Period>& __d) { if (__m_ == nullptr) __throw_system_error(EPERM, "shared_lock::try_lock_for: references null mutex"); if (__owns_) __throw_system_error(EDEADLK, "shared_lock::try_lock_for: already locked"); __owns_ = __m_->try_lock_shared_for(__d); return __owns_; } template <class _Mutex> template <class _Clock, class _Duration> bool shared_lock<_Mutex>::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t) { if (__m_ == nullptr) __throw_system_error(EPERM, "shared_lock::try_lock_until: references null mutex"); if (__owns_) __throw_system_error(EDEADLK, "shared_lock::try_lock_until: already locked"); __owns_ = __m_->try_lock_shared_until(__t); return __owns_; } template <class _Mutex> void shared_lock<_Mutex>::unlock() { if (!__owns_) __throw_system_error(EPERM, "shared_lock::unlock: not locked"); __m_->unlock_shared(); __owns_ = false; } template <class _Mutex> inline _MUSEUM_LIBCPP_INLINE_VISIBILITY void swap(shared_lock<_Mutex>& __x, shared_lock<_Mutex>& __y) _NOEXCEPT {__x.swap(__y);} _MUSEUM_LIBCPP_END_NAMESPACE_STD #endif // !_MUSEUM_LIBCPP_HAS_NO_THREADS #endif // _MUSEUM_LIBCPP_STD_VER > 11 #endif // _MUSEUM_LIBCPP_SHARED_MUTEX
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
2e5396b8d351f1913efe6af4b1c62aeb4ebeb50c
ee507b3010c903ec716315f7df2ba4ef5ae5921a
/editor/unit_properties.h
63b310e452d469a34a0d1bd1f4096345b6756b70
[]
no_license
sopyer/Shadowgrounds
ac6b281cd95d762096dfc04ddae70d3f3e63be05
691cb389c7d8121eda85ea73409bbbb74bfdb103
refs/heads/master
2020-03-29T18:25:48.103837
2017-06-24T17:08:50
2017-06-24T17:08:50
9,700,603
0
1
null
null
null
null
UTF-8
C++
false
false
652
h
// Copyright 2002-2004 Frozenbyte Ltd. #ifndef INCLUDED_EDITOR_UNIT_PROPERTIES_H #define INCLUDED_EDITOR_UNIT_PROPERTIES_H #include <map> #include <string> namespace frozenbyte { namespace filesystem { class OutputStream; class InputStream; } namespace editor { struct UnitProperties { enum Difficulty { All = 0, EasyOnly = 1, HardOnly = 2 }; std::map<std::string, std::string> strings; Difficulty difficulty; int layout; UnitProperties() : difficulty(All), layout(0) { } void writeStream(filesystem::OutputStream &stream) const; void readStream(filesystem::InputStream &stream); }; } // editor } // frozenbyte #endif
[ "sopyer@gmail.com" ]
sopyer@gmail.com
2cca9ad244b171c8c384524e4103cba6718ffdf9
3dc0930fd1917250c8476c42293fde29139886ed
/Week 3/Program11_Weather Menu/Weather Menu/Source.cpp
9e038a4aec07aef0fb4fa7e8bccfbe710ea729b5
[]
no_license
charlottemarriner/Semester-1-GEC
e62ccd9cfb6d3c69ab7eb4be97bed5f49f0d9678
a32a7306fd305972ef9bf3a8d5374c3654178ddd
refs/heads/master
2022-04-08T01:08:04.194855
2020-03-20T14:46:35
2020-03-20T14:46:35
241,207,361
0
0
null
null
null
null
UTF-8
C++
false
false
960
cpp
#include <iostream> using namespace std; int main() { //Initialise variable int weather; //Output that requires the user to enter a number input cout << "Hello there human, what is the weather today? Is it:" << endl << "Sunny - 1" << endl << "Cloudy - 2" << endl << "Raining - 3" << endl << "EXIT - 4" << endl << "Please input the approprite number." << endl << endl; cin >> weather; //Switch statement based off of the number that the user inputs switch (weather) { case 1: cout << "It's hot outside, make sure you wear your sunscreen!" << endl; break; case 2: cout << "It's cloudy out there, make sure you wear something a little warmer!" << endl; break; case 3: cout << "It's raining outside, make sure you wear a raincoat!" << endl; break; case 4: cout << "This program will exit now" << endl; break; default: cout << "This program will exit now" << endl; break; } //Get user input cin.get(); return 0; }
[ "57407155+charlottemarriner@users.noreply.github.com" ]
57407155+charlottemarriner@users.noreply.github.com
562cdd4cdeacfeadefeca3c9662c56423e630726
9f861ad4864448d9372c798cc95822e7a9218bd2
/src/include/mcs/subset/detail/aic.hh
041945fcac4daaadd1bff4bc1f5649df1c1da7f9
[]
no_license
cccfran/lmSubsets
340bac7b9ee1badd006409c8771dd21e3195684a
0b4b27f1de01d383a8505782320358bc6ac42f21
refs/heads/master
2020-08-12T02:36:50.913359
2019-10-30T16:32:41
2019-10-30T16:32:41
214,672,632
0
0
null
2019-10-12T15:45:40
2019-10-12T15:45:40
null
UTF-8
C++
false
false
1,587
hh
// Copyright 2018 Marc Hofmann // // This file is part of the 'mcs' library (see // <https://github.com/marc-hofmann/mcs.cc/>). // // 'mcs' is free software: you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // 'mcs' is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License // along with 'mcs'. If not, see <http://www.gnu.org/licenses/>. #ifndef MCS_SUBSET_DETAIL_AIC_HH #define MCS_SUBSET_DETAIL_AIC_HH #include "mcs/subset/detail/log_lik.hh" namespace mcs { namespace subset { namespace detail { template<typename Scalar> class aic { using log_lik = detail::log_lik<Scalar>; private: Scalar k_; log_lik ll_; public: constexpr aic( const Scalar k, const int nobs ) noexcept : k_(k), ll_(nobs) { } constexpr Scalar operator ()( const int size, const Scalar rss ) const noexcept { // size + 1 to account for sd as estimated parameter // const int npar = size + 1; return Scalar(-2.0) * ll_(rss) + k_ * Scalar(size + 1); } }; } // end namespace detail } // end namespace subset } // end namespace mcs #endif
[ "csardi.gabor+cran@gmail.com" ]
csardi.gabor+cran@gmail.com
ab27fb80f5016b05225c01788083b5f477783e90
ab2f9cbe2a35fa2d06fb284c4e478c971530a837
/visual/tile_test_gpu/test3.cpp
a91ce9e6f7b92744f37972c57a9b830cb5c50563
[ "MIT" ]
permissive
timrobot/Tachikoma-Project
79979b1c3aa81b8c19981b0980697579aaa2b6ef
c7af70f2c58fe43f25331fd03589845480ae0f16
refs/heads/master
2021-06-01T15:04:47.305740
2020-09-06T17:15:56
2020-09-06T17:15:56
48,158,676
1
0
null
null
null
null
UTF-8
C++
false
false
2,299
cpp
#include "gpu_util.h" #include "gcube.h" #include "highgui.h" #include "imgproc.h" #include "centroid.h" #include <iostream> #include <cstdio> #include <unistd.h> using namespace std; int main() { srand(271828183); gcube img1 = load_gcube("img01.png"), img2; // resize for speed size_t newsize = 240; img1 = gpu_imresize2(img1, newsize, newsize); // img1 = gpu_conv2(img1, gpu_gauss2(5, 1.2f)); // disp_gcube("train image", img1); // disp_gcube("test image", img2); // disp_wait(); // after choosing the centroids, claim the first to be the background, and the rest to be the foreground gcube centroids1, centroids2; size_t mx = img1.n_cols/2; size_t my = img1.n_rows/2; gcube hyp1(img1.n_slices, 2); hyp1.set(img1.get(0, 0, 0), 0, 0); hyp1.set(img1.get(0, 0, 1), 1, 0); hyp1.set(img1.get(0, 0, 2), 2, 0); hyp1.set(img1.get(my, mx, 0), 0, 1); hyp1.set(img1.get(my, mx, 1), 1, 1); hyp1.set(img1.get(my, mx, 2), 2, 1); centroids1 = gpu_hist_segment2(img1, 2, 5, hyp1, true); // filter out background by selecting only the object's colors gcube hyp2(centroids1.n_rows, centroids1.n_cols - 1); checkCudaErrors(cudaMemcpy(hyp2.d_pixels, &centroids1.d_pixels[IJ2C(0, 1, centroids1.n_rows)], sizeof(float) * hyp2.n_elem, cudaMemcpyDeviceToDevice)); printf("hyp2:\n"); print_gcube(hyp2); gcube I, E; // once the object's color is filtered, use that to get the objects for (;;) { img2 = load_gcube("test00.png"); img2 = gpu_imresize2(img2, newsize, newsize); centroids2 = gpu_hist_segment2(img2, 5, 5, hyp2, true); // the best matching colors are the hypotheses I = gpu_filter_colors(img2, centroids2, 1); // show the resulting filter // disp_gcube("filtered", I); // disp_wait(); // get the centroid of the image I = gpu_rgb2gray(I); double cx, cy; gpu_centroid(I, cx, cy); printf("c: %lf %lf\n", cx, cy); E = gpu_gray2rgb(gpu_edge2(I)); size_t i = (size_t)round(cy); size_t j = (size_t)round(cx); printf("%zu %zu\n", i, j); E.set(0.0f, i, j, 0); E.set(1.0f, i, j, 1); E.set(1.0f, i, j, 2); disp_gcube("centroids", E); disp_keyPressed(); img2.destroy(); centroids2.destroy(); I.destroy(); E.destroy(); } return 0; }
[ "tyong_23@hotmail.com" ]
tyong_23@hotmail.com