blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9348ef1d700b5a26469c59d381ccf6baad94c917 | aa1942498b50e96c66f908105f01313bf2d6764c | /SWO3/uebung08/Queue/src/PData.cpp | abc24d01c023e0c2706bb5f2fcb4bbdd53faf82c | [] | no_license | romanlum/StudyCode | b87a5e62bef3f95562653e56d9c60f3822a1c452 | e8a5f5b90b38b4d8f957f5e14c555a204caaa350 | refs/heads/master | 2020-12-14T15:40:18.276993 | 2016-05-28T09:41:21 | 2016-05-28T09:41:21 | 33,830,960 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 492 | cpp | #include "PData.h"
#include <string>
#include <iostream>
using namespace std;
PData::PData(string value, int priority) :Data(value), priority(priority) {
cout << "Pdata (" <<value <<", "<< priority << ") constructed" <<endl;
}
PData::~PData(){
cout << "Pdata (" <<value <<", "<< priority << ") deconstructed" <<endl;
}
int PData::getPriority() const {
return priority;
}
void PData::print(std::ostream& os) const {
Data::print(os);
os << '(' << priority << ')' << flush;
}
| [
"romanlum"
] | romanlum |
6fca2bff988fc871303f914c15c101848593534a | 4cd9cf94e373877034ff9b90af8be566ad42c6b7 | /libnaucrates/include/naucrates/dxl/operators/CDXLScalarComp.h | 2ed99b706fa0cd74e0291457ad17f43f615a7222 | [
"Apache-2.0"
] | permissive | ppmht/gporca | 6a912edac14b52d67636f6d51c90ef3b63f41304 | 7131e3e134e6e608f7e9fef9152a8b5d71e6a59e | refs/heads/master | 2020-03-15T16:06:19.229839 | 2018-05-04T19:16:11 | 2018-05-04T19:17:14 | 132,228,406 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,632 | h | //---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2010 Greenplum, Inc.
//
// @filename:
// CDXLScalarComp.h
//
// @doc:
// Class for representing DXL scalar comparison operators.
//---------------------------------------------------------------------------
#ifndef GPDXL_CDXLScalarComp_H
#define GPDXL_CDXLScalarComp_H
#include "gpos/base.h"
#include "naucrates/dxl/operators/CDXLScalar.h"
#include "naucrates/md/IMDId.h"
namespace gpdxl
{
using namespace gpos;
using namespace gpmd;
// indices of scalar comparison elements in the children array
enum Edxlsccmp
{
EdxlsccmpIndexLeft = 0,
EdxlsccmpIndexRight,
EdxlsccmpSentinel
};
//---------------------------------------------------------------------------
// @class:
// CDXLScalarComp
//
// @doc:
// Class for representing DXL scalar comparison operators
//
//---------------------------------------------------------------------------
class CDXLScalarComp : public CDXLScalar
{
protected:
// operator number in the catalog
IMDId *m_pmdid;
// comparison operator name
const CWStringConst *m_pstrCompOpName;
private:
// private copy ctor
CDXLScalarComp(CDXLScalarComp&);
public:
// ctor/dtor
CDXLScalarComp
(
IMemoryPool *pmp,
IMDId *pmdidOp,
const CWStringConst *pstrCompOpName
);
virtual
~CDXLScalarComp();
// accessor
// ident accessors
Edxlopid Edxlop() const;
// name of the DXL operator
const CWStringConst *PstrOpName() const;
// name of the comparison operator
const CWStringConst *PstrCmpOpName() const;
// operator id
IMDId *Pmdid() const;
// serialize operator in DXL format
virtual
void SerializeToDXL(CXMLSerializer *pxmlser, const CDXLNode *pdxln) const;
// conversion function
static
CDXLScalarComp *PdxlopConvert
(
CDXLOperator *pdxlop
)
{
GPOS_ASSERT(NULL != pdxlop);
GPOS_ASSERT(EdxlopScalarCmp == pdxlop->Edxlop()
|| EdxlopScalarDistinct == pdxlop->Edxlop()
|| EdxlopScalarArrayComp == pdxlop->Edxlop());
return dynamic_cast<CDXLScalarComp*>(pdxlop);
}
// does the operator return a boolean result
virtual
BOOL FBoolean
(
CMDAccessor *//pmda
)
const
{
return true;
}
#ifdef GPOS_DEBUG
// checks whether the operator has valid structure, i.e. number and
// types of child nodes
void AssertValid(const CDXLNode *pdxln, BOOL fValidateChildren) const;
#endif // GPOS_DEBUG
};
}
#endif // !GPDXL_CDXLScalarComp_H
// EOF
| [
"eshen@pivotal.io"
] | eshen@pivotal.io |
5de02e9dfe47e749ebdc17326c486f7435856755 | 0ee6d96dd836a5302c7fd58baa24055f296c3204 | /catkin_ws/src/vision/obj_reco_dishwasher/include/obj_reco_dishwasher/SegmenterDishwasher.h | 16e892eed3199e264b35f8abc14a02d2a847a039 | [] | no_license | RobotJustina/JUSTINA | 42876b3734c981fad6d002d549b3f8f05807938b | c2b4de807d5f3a18b317b9b01fdeb0cec3f7327e | refs/heads/master | 2021-12-14T08:08:22.408310 | 2018-08-27T18:13:07 | 2018-08-27T18:13:07 | 58,512,410 | 7 | 13 | null | 2018-08-27T18:13:08 | 2016-05-11T03:46:07 | C | UTF-8 | C++ | false | false | 3,018 | h | #ifndef _SEGMENTADOR_H_
#define _SEGMENTADOR_H_
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/imgproc/imgproc.hpp"
using namespace cv;
class SegmenterDishwasher{
public:
static Mat colorSegmentHSV(Mat bgr,Mat element, int minvalueH, int maxvalueH, int minvalueS, int maxvalueS, int minvalueV, int maxvalueV){
Scalar minHSV(minvalueH,minvalueS,minvalueV);
Scalar maxHSV(maxvalueH, maxvalueS, maxvalueV);
return colorSegmentHSV(bgr,element, minHSV, maxHSV);
}
static Mat colorSegmentHSV(Mat bgr,Mat element, Scalar minHSV, Scalar maxHSV)
{
Mat hsv;
Mat maskHSV;
cvtColor(bgr, hsv, CV_BGR2HSV);
inRange(hsv, minHSV, maxHSV, maskHSV);
dilate(maskHSV,maskHSV, element);
erode(maskHSV,maskHSV, element);
return maskHSV;
}
static Mat colorSegmentHLS(Mat bgr,Mat element, int minvalueH, int maxvalueH, int minvalueL, int maxvalueL, int minvalueS, int maxvalueS)
{
Scalar minHLS(minvalueH,minvalueL,minvalueS);
Scalar maxHLS(maxvalueH, maxvalueL, maxvalueS);
return SegmenterDishwasher::colorSegmentHLS(bgr,element, minHLS, maxHLS);
}
static Mat colorSegmentHLS(Mat bgr,Mat element, Scalar minHLS, Scalar maxHLS)
{
Mat hls;
Mat maskHLS;
cvtColor(bgr, hls, CV_BGR2HLS);
inRange(hls, minHLS, maxHLS, maskHLS);
dilate(maskHLS,maskHLS, element);
erode(maskHLS,maskHLS, element);
return maskHLS;
}
static Mat colorSegmentH(Mat bgr,Mat element, int minvalueH, int maxvalueH)
{
Mat hls_s[3]; //destination array
Mat hls;
Mat h;
Mat maskH;
cvtColor(bgr, hls, CV_BGR2HLS);
split(hls,hls_s);//split source
h=hls_s[0];
inRange(h, minvalueH, maxvalueH,maskH);
dilate(maskH,maskH, element);
erode(maskH,maskH, element);
dilate(maskH,maskH, element);
erode(maskH,maskH, element);
dilate(maskH,maskH, element);
return maskH;
}
static Mat colorSegmentBGR(Mat bgr,Mat element, int minvalueB, int maxvalueB, int minvalueG, int maxvalueG, int minvalueR, int maxvalueR)
{
Scalar minBGR(minvalueB,minvalueG,minvalueR);
Scalar maxBGR(maxvalueB, maxvalueG, maxvalueR);
return SegmenterDishwasher::colorSegmentBGR(bgr,element, minBGR, maxBGR);;
}
static Mat colorSegmentBGR(Mat bgr,Mat element, Scalar minBGR, Scalar maxBGR )
{
Mat maskBGR;
inRange(bgr, minBGR, maxBGR, maskBGR);
dilate(maskBGR,maskBGR, element);
erode(maskBGR,maskBGR, element);
return maskBGR;
}
};
#endif
| [
"dougbel.unam@gmail.com"
] | dougbel.unam@gmail.com |
131c1182d74276915d38ec4f53c446cb576e8ee4 | 03b4c45968c88d191fbb82348856e75729462827 | /owl/include/owl/common/math/LinearSpace.h | ec97b39f1246d1f428d77735cfc837244e504571 | [
"Apache-2.0"
] | permissive | Twinklebear/owl | c87159e85c1c61ad740298a976403c34bb0d2434 | b53431aba3c46ff944344105c886ab49056ddc0b | refs/heads/master | 2022-06-17T17:48:38.704048 | 2020-05-08T21:40:17 | 2020-05-08T21:40:17 | 259,375,722 | 0 | 0 | Apache-2.0 | 2020-04-27T15:38:06 | 2020-04-27T15:38:05 | null | UTF-8 | C++ | false | false | 20,496 | h | // ======================================================================== //
// Copyright 2018-2019 Ingo Wald //
// //
// 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. //
// ======================================================================== //
/* originally taken (and adapted) from ospray, under following license */
// ======================================================================== //
// Copyright 2009-2018 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
// You may obtain a copy of the License at //
// //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
// Unless required by applicable law or agreed to in writing, software //
// distributed under the License is distributed on an "AS IS" BASIS, //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and //
// limitations under the License. //
// ======================================================================== //
#pragma once
#include "../math/vec.h"
#include "../math/Quaternion.h"
namespace owl {
namespace common {
////////////////////////////////////////////////////////////////////////////////
/// 2D Linear Transform (2x2 Matrix)
////////////////////////////////////////////////////////////////////////////////
template<typename T> struct OWL_INTERFACE LinearSpace2
{
using vector_t = T;
// using Scalar = typename T::scalar_t;
// using vector_t = T;
using scalar_t = typename T::scalar_t;
/*! default matrix constructor */
inline LinearSpace2 ( ) = default;
inline __both__ LinearSpace2 ( const LinearSpace2& other ) { vx = other.vx; vy = other.vy; }
inline __both__ LinearSpace2& operator=( const LinearSpace2& other ) { vx = other.vx; vy = other.vy; return *this; }
template<typename L1> inline __both__ LinearSpace2( const LinearSpace2<L1>& s ) : vx(s.vx), vy(s.vy) {}
/*! matrix construction from column vectors */
inline __both__ LinearSpace2(const vector_t& vx, const vector_t& vy)
: vx(vx), vy(vy) {}
/*! matrix construction from row mayor data */
inline __both__ LinearSpace2(const scalar_t& m00, const scalar_t& m01,
const scalar_t& m10, const scalar_t& m11)
: vx(m00,m10), vy(m01,m11) {}
/*! compute the determinant of the matrix */
inline __both__ const scalar_t det() const { return vx.x*vy.y - vx.y*vy.x; }
/*! compute adjoint matrix */
inline __both__ const LinearSpace2 adjoint() const { return LinearSpace2(vy.y,-vy.x,-vx.y,vx.x); }
/*! compute inverse matrix */
inline __both__ const LinearSpace2 inverse() const { return adjoint()/det(); }
/*! compute transposed matrix */
inline __both__ const LinearSpace2 transposed() const { return LinearSpace2(vx.x,vx.y,vy.x,vy.y); }
/*! returns first row of matrix */
inline const vector_t row0() const { return vector_t(vx.x,vy.x); }
/*! returns second row of matrix */
inline const vector_t row1() const { return vector_t(vx.y,vy.y); }
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
inline LinearSpace2( ZeroTy ) : vx(zero), vy(zero) {}
inline LinearSpace2( OneTy ) : vx(one, zero), vy(zero, one) {}
/*! return matrix for scaling */
static inline LinearSpace2 scale(const vector_t& s) {
return LinearSpace2(s.x, 0,
0 , s.y);
}
/*! return matrix for rotation */
static inline LinearSpace2 rotate(const scalar_t& r) {
scalar_t s = sin(r), c = cos(r);
return LinearSpace2(c, -s,
s, c);
}
/*! return closest orthogonal matrix (i.e. a general rotation including reflection) */
LinearSpace2 orthogonal() const {
LinearSpace2 m = *this;
// mirrored?
scalar_t mirror(one);
if (m.det() < scalar_t(zero)) {
m.vx = -m.vx;
mirror = -mirror;
}
// rotation
for (int i = 0; i < 99; i++) {
const LinearSpace2 m_next = 0.5 * (m + m.transposed().inverse());
const LinearSpace2 d = m_next - m;
m = m_next;
// norm^2 of difference small enough?
if (max(dot(d.vx, d.vx), dot(d.vy, d.vy)) < 1e-8)
break;
}
// rotation * mirror_x
return LinearSpace2(mirror*m.vx, m.vy);
}
public:
/*! the column vectors of the matrix */
vector_t vx,vy;
};
////////////////////////////////////////////////////////////////////////////////
// Unary Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> __both__ inline LinearSpace2<T> operator -( const LinearSpace2<T>& a ) { return LinearSpace2<T>(-a.vx,-a.vy); }
template<typename T> __both__ inline LinearSpace2<T> operator +( const LinearSpace2<T>& a ) { return LinearSpace2<T>(+a.vx,+a.vy); }
template<typename T> __both__ inline LinearSpace2<T> rcp ( const LinearSpace2<T>& a ) { return a.inverse(); }
////////////////////////////////////////////////////////////////////////////////
// Binary Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> inline LinearSpace2<T> operator +( const LinearSpace2<T>& a, const LinearSpace2<T>& b ) { return LinearSpace2<T>(a.vx+b.vx,a.vy+b.vy); }
template<typename T> inline LinearSpace2<T> operator -( const LinearSpace2<T>& a, const LinearSpace2<T>& b ) { return LinearSpace2<T>(a.vx-b.vx,a.vy-b.vy); }
template<typename T> inline LinearSpace2<T> operator*(const typename T::scalar_t & a, const LinearSpace2<T>& b) { return LinearSpace2<T>(a*b.vx, a*b.vy); }
template<typename T> inline T operator*(const LinearSpace2<T>& a, const T & b) { return b.x*a.vx + b.y*a.vy; }
template<typename T> inline LinearSpace2<T> operator*(const LinearSpace2<T>& a, const LinearSpace2<T>& b) { return LinearSpace2<T>(a*b.vx, a*b.vy); }
template<typename T> inline LinearSpace2<T> operator/(const LinearSpace2<T>& a, const typename T::scalar_t & b) { return LinearSpace2<T>(a.vx/b, a.vy/b); }
template<typename T> inline LinearSpace2<T> operator/(const LinearSpace2<T>& a, const LinearSpace2<T>& b) { return a * rcp(b); }
template<typename T> inline LinearSpace2<T>& operator *=( LinearSpace2<T>& a, const LinearSpace2<T>& b ) { return a = a * b; }
template<typename T> inline LinearSpace2<T>& operator /=( LinearSpace2<T>& a, const LinearSpace2<T>& b ) { return a = a / b; }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> inline bool operator ==( const LinearSpace2<T>& a, const LinearSpace2<T>& b ) { return a.vx == b.vx && a.vy == b.vy; }
template<typename T> inline bool operator !=( const LinearSpace2<T>& a, const LinearSpace2<T>& b ) { return a.vx != b.vx || a.vy != b.vy; }
////////////////////////////////////////////////////////////////////////////////
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> static std::ostream& operator<<(std::ostream& cout, const LinearSpace2<T>& m) {
return cout << "{ vx = " << m.vx << ", vy = " << m.vy << "}";
}
////////////////////////////////////////////////////////////////////////////////
/// 3D Linear Transform (3x3 Matrix)
////////////////////////////////////////////////////////////////////////////////
template<typename T>
struct OWL_INTERFACE LinearSpace3
{
// using vector_t = T;
using scalar_t = typename T::scalar_t;
using vector_t = T;
// using scalar_t = typename T::scalar_t;
/*! default matrix constructor */
// inline LinearSpace3 ( ) = default;
inline __both__ LinearSpace3()
: vx(OneTy(),ZeroTy(),ZeroTy()),
vy(ZeroTy(),OneTy(),ZeroTy()),
vz(ZeroTy(),ZeroTy(),OneTy())
{}
inline __both__ LinearSpace3 ( const LinearSpace3& other ) { vx = other.vx; vy = other.vy; vz = other.vz; }
inline __both__ LinearSpace3& operator=( const LinearSpace3& other ) { vx = other.vx; vy = other.vy; vz = other.vz; return *this; }
template<typename L1> inline __both__ LinearSpace3( const LinearSpace3<L1>& s ) : vx(s.vx), vy(s.vy), vz(s.vz) {}
/*! matrix construction from column vectors */
inline __both__ LinearSpace3(const vector_t& vx, const vector_t& vy, const vector_t& vz)
: vx(vx), vy(vy), vz(vz) {}
/*! construction from quaternion */
inline __both__ LinearSpace3( const QuaternionT<scalar_t>& q )
: vx((q.r*q.r + q.i*q.i - q.j*q.j - q.k*q.k), 2.0f*(q.i*q.j + q.r*q.k), 2.0f*(q.i*q.k - q.r*q.j))
, vy(2.0f*(q.i*q.j - q.r*q.k), (q.r*q.r - q.i*q.i + q.j*q.j - q.k*q.k), 2.0f*(q.j*q.k + q.r*q.i))
, vz(2.0f*(q.i*q.k + q.r*q.j), 2.0f*(q.j*q.k - q.r*q.i), (q.r*q.r - q.i*q.i - q.j*q.j + q.k*q.k)) {}
/*! matrix construction from row mayor data */
inline __both__ LinearSpace3(const scalar_t& m00, const scalar_t& m01, const scalar_t& m02,
const scalar_t& m10, const scalar_t& m11, const scalar_t& m12,
const scalar_t& m20, const scalar_t& m21, const scalar_t& m22)
: vx(m00,m10,m20), vy(m01,m11,m21), vz(m02,m12,m22) {}
/*! compute the determinant of the matrix */
inline __both__ const scalar_t det() const { return dot(vx,cross(vy,vz)); }
/*! compute adjoint matrix */
inline __both__ const LinearSpace3 adjoint() const { return LinearSpace3(cross(vy,vz),cross(vz,vx),cross(vx,vy)).transposed(); }
/*! compute inverse matrix */
inline __both__ const LinearSpace3 inverse() const { return adjoint()/det(); }
/*! compute transposed matrix */
inline __both__ const LinearSpace3 transposed() const { return LinearSpace3(vx.x,vx.y,vx.z,vy.x,vy.y,vy.z,vz.x,vz.y,vz.z); }
/*! returns first row of matrix */
inline __both__ const vector_t row0() const { return vector_t(vx.x,vy.x,vz.x); }
/*! returns second row of matrix */
inline __both__ const vector_t row1() const { return vector_t(vx.y,vy.y,vz.y); }
/*! returns third row of matrix */
inline __both__ const vector_t row2() const { return vector_t(vx.z,vy.z,vz.z); }
////////////////////////////////////////////////////////////////////////////////
/// Constants
////////////////////////////////////////////////////////////////////////////////
#ifdef __CUDA_ARCH__
inline __both__ LinearSpace3( const ZeroTy & )
: vx(ZeroTy()), vy(ZeroTy()), vz(ZeroTy())
{}
inline __both__ LinearSpace3( const OneTy & )
: vx(OneTy(), ZeroTy(), ZeroTy()),
vy(ZeroTy(), OneTy(), ZeroTy()),
vz(ZeroTy(), ZeroTy(), OneTy())
{}
#else
inline __both__ LinearSpace3( ZeroTy ) : vx(zero), vy(zero), vz(zero) {}
inline __both__ LinearSpace3( OneTy ) : vx(one, zero, zero), vy(zero, one, zero), vz(zero, zero, one) {}
#endif
/*! return matrix for scaling */
static inline __both__ LinearSpace3 scale(const vector_t& s) {
return LinearSpace3(s.x, 0, 0,
0 , s.y, 0,
0 , 0, s.z);
}
/*! return matrix for rotation around arbitrary axis */
static inline __both__ LinearSpace3 rotate(const vector_t& _u, const scalar_t& r) {
vector_t u = normalize(_u);
scalar_t s = sin(r), c = cos(r);
return LinearSpace3(u.x*u.x+(1-u.x*u.x)*c, u.x*u.y*(1-c)-u.z*s, u.x*u.z*(1-c)+u.y*s,
u.x*u.y*(1-c)+u.z*s, u.y*u.y+(1-u.y*u.y)*c, u.y*u.z*(1-c)-u.x*s,
u.x*u.z*(1-c)-u.y*s, u.y*u.z*(1-c)+u.x*s, u.z*u.z+(1-u.z*u.z)*c);
}
/*! return quaternion for given rotation matrix */
static inline __both__ QuaternionT<scalar_t> rotation(const LinearSpace3 &a) {
scalar_t tr = a.vx.x+a.vy.y+a.vz.z+1;
vector_t diag(a.vx.x,a.vy.y,a.vz.z);
if (tr > 1) {
scalar_t s = owl::common::polymorphic::sqrt(tr) * 2;
return QuaternionT<scalar_t>(.25f * s,
(a.vz.y-a.vy.z)/s,
(a.vx.z-a.vz.x)/s,
(a.vy.x-a.vx.y)/s);
} else if (arg_min(diag) == 0) {
scalar_t s = owl::common::polymorphic::sqrt(1.f+diag.x-diag.y-diag.z)*2.f;
return QuaternionT<scalar_t>((a.vz.y-a.vy.z)/s,
.25f * s,
(a.vx.y-a.vy.x)/s,
(a.vx.z-a.vz.x)/s);
} else if (arg_min(diag) == 1) {
scalar_t s = owl::common::polymorphic::sqrt(1.f+diag.y-diag.x-diag.z)*2.f;
return QuaternionT<scalar_t>((a.vx.z-a.vz.x)/s,
(a.vx.y-a.vy.x)/s,
.25f * s,
(a.vy.z-a.vz.y)/s);
} else {
scalar_t s = owl::common::polymorphic::sqrt(1.f+diag.z-diag.x-diag.y)*2.f;
return QuaternionT<scalar_t>((a.vy.x-a.vx.y)/s,
(a.vx.z-a.vz.x)/s,
(a.vy.z-a.vz.y)/s,
.25f * s);
}
}
public:
/*! the column vectors of the matrix */
T vx,vy,vz;
};
////////////////////////////////////////////////////////////////////////////////
// Unary Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> inline __both__ LinearSpace3<T> operator -( const LinearSpace3<T>& a ) { return LinearSpace3<T>(-a.vx,-a.vy,-a.vz); }
template<typename T> inline __both__ LinearSpace3<T> operator +( const LinearSpace3<T>& a ) { return LinearSpace3<T>(+a.vx,+a.vy,+a.vz); }
template<typename T> inline __both__ LinearSpace3<T> rcp ( const LinearSpace3<T>& a ) { return a.inverse(); }
/* constructs a coordinate frame form a normalized normal */
template<typename T> inline __both__ LinearSpace3<T> frame(const T& N)
{
const T dx0 = cross(T(one,zero,zero),N);
const T dx1 = cross(T(zero,one,zero),N);
const T dx = normalize(select(dot(dx0,dx0) > dot(dx1,dx1),dx0,dx1));
const T dy = normalize(cross(N,dx));
return LinearSpace3<T>(dx,dy,N);
}
/* constructs a coordinate frame from a normal and approximate x-direction */
template<typename T> inline __both__ LinearSpace3<T> frame(const T& N, const T& dxi)
{
if (abs(dot(dxi,N)) > 0.99f) return frame(N); // fallback in case N and dxi are very parallel
const T dx = normalize(cross(dxi,N));
const T dy = normalize(cross(N,dx));
return LinearSpace3<T>(dx,dy,N);
}
/* clamps linear space to range -1 to +1 */
template<typename T> inline __both__ LinearSpace3<T> clamp(const LinearSpace3<T>& space) {
return LinearSpace3<T>(clamp(space.vx,T(-1.0f),T(1.0f)),
clamp(space.vy,T(-1.0f),T(1.0f)),
clamp(space.vz,T(-1.0f),T(1.0f)));
}
////////////////////////////////////////////////////////////////////////////////
// Binary Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> inline __both__ LinearSpace3<T> operator +( const LinearSpace3<T>& a, const LinearSpace3<T>& b ) { return LinearSpace3<T>(a.vx+b.vx,a.vy+b.vy,a.vz+b.vz); }
template<typename T> inline __both__ LinearSpace3<T> operator -( const LinearSpace3<T>& a, const LinearSpace3<T>& b ) { return LinearSpace3<T>(a.vx-b.vx,a.vy-b.vy,a.vz-b.vz); }
template<typename T> inline __both__ LinearSpace3<T> operator*(const typename T::scalar_t & a, const LinearSpace3<T>& b) { return LinearSpace3<T>(a*b.vx, a*b.vy, a*b.vz); }
template<typename T> inline T operator*(const LinearSpace3<T>& a, const T & b) { return b.x*a.vx + b.y*a.vy + b.z*a.vz; }
template<typename T> inline __both__ LinearSpace3<T> operator*(const LinearSpace3<T>& a, const LinearSpace3<T>& b) { return LinearSpace3<T>(a*b.vx, a*b.vy, a*b.vz); }
template<typename T> __both__ inline LinearSpace3<T> operator/(const LinearSpace3<T>& a, const typename T::scalar_t & b) { return LinearSpace3<T>(a.vx/b, a.vy/b, a.vz/b); }
template<typename T> __both__ inline LinearSpace3<T> operator/(const LinearSpace3<T>& a, const LinearSpace3<T>& b) { return a * rcp(b); }
template<typename T> inline LinearSpace3<T>& operator *=( LinearSpace3<T>& a, const LinearSpace3<T>& b ) { return a = a * b; }
template<typename T> inline LinearSpace3<T>& operator /=( LinearSpace3<T>& a, const LinearSpace3<T>& b ) { return a = a / b; }
template<typename T> inline __both__ T xfmPoint (const LinearSpace3<T>& s, const T& a) { return madd(T(a.x),s.vx,madd(T(a.y),s.vy,T(a.z*s.vz))); }
template<typename T> inline __both__ T xfmVector(const LinearSpace3<T>& s, const T& a) { return madd(T(a.x),s.vx,madd(T(a.y),s.vy,T(a.z*s.vz))); }
template<typename T> inline __both__ T xfmNormal(const LinearSpace3<T>& s, const T& a) { return xfmVector(s.inverse().transposed(),a); }
////////////////////////////////////////////////////////////////////////////////
/// Comparison Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> inline bool operator ==( const LinearSpace3<T>& a, const LinearSpace3<T>& b ) { return a.vx == b.vx && a.vy == b.vy && a.vz == b.vz; }
template<typename T> inline bool operator !=( const LinearSpace3<T>& a, const LinearSpace3<T>& b ) { return a.vx != b.vx || a.vy != b.vy || a.vz != b.vz; }
////////////////////////////////////////////////////////////////////////////////
/// Output Operators
////////////////////////////////////////////////////////////////////////////////
template<typename T> inline std::ostream& operator<<(std::ostream& cout, const LinearSpace3<T>& m) {
return cout << "{ vx = " << m.vx << ", vy = " << m.vy << ", vz = " << m.vz << "}";
}
/*! Shortcuts for common linear spaces. */
using LinearSpace2f = LinearSpace2<vec2f> ;
using LinearSpace3f = LinearSpace3<vec3f> ;
using LinearSpace3fa = LinearSpace3<vec3fa>;
using linear2f = LinearSpace2f;
using linear3f = LinearSpace3f;
} // ::owl::common
} // ::owl
| [
"ingowald@gmail.com"
] | ingowald@gmail.com |
aa684012d78078db7ac77863cb7518b829a25696 | 3a4651255b75dd82e201deda268e0b1d80c867c2 | /word_wrap.cpp | d8e6260ddad7ba3eedc5378f7337529ff44ecc62 | [] | no_license | Shikhar21121999/ds-algo-busted | 7b5f46ec88cd6d64e70ac422c5ae0d6bcc0cb0cc | 2b102313a55147e14bf890f4184509b74e928842 | refs/heads/main | 2023-08-10T05:04:16.434039 | 2021-06-03T05:23:48 | 2021-06-03T05:23:48 | 312,954,116 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,696 | cpp | // template
#include <bits/stdc++.h>
# define C continue
# define R return
# define D double
# define I insert
# define ll long long
# define ld long double
# define ull unsigned long long
# define ui unsigned int
# define pb push_back
# define pf push_front
# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue
# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >
# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp
# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >
# define pipii pair<int, pii >
# define pcpii pair<char,pii>
# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >
# define vvpii vector < vector < pii > >
# define vpipii vector< pipii >
# define F first
# define S second
# define mp make_pair
# define unm unordered_map
# define unmii unm< int , int >
# define unmll unm< ll , ll >
# define unms unm<string,int>
# define unmci unm<char,int>
# define sortvia sort(a.begin(),a.end());
# define sortvib sort(b.begin(),b.end());
# define revsorta sort(a.begin(), a.end(), greater <int>());
# define revsortb sort(b.begin(), b.end(), greater <>());
# define loop(q,n) for(int i=q;i<n;i++)
# define loop2(q,n) for(int j=q;j<n;j++)
# define test int t;cin >> t;while(t--)
# define nextline "\n"
# define tab "\t"
# define space " "
# define get_arr_size_n int n;cin>>n;int arr[n];loop(0,n)cin>>arr[i];
//vector<vector<int> > vec( n , vector<int> (m, 0));
//YES
//NO
//cout
//true
//false
//yes
//no
const ll mod9=1e9+7;
const ll maxsize=2e9+1;
// const ll mod =998244353;
const ll mod2=1073741824;
const ll INF=1e18L+5;
const int IINF=1e9+5;
const int two_pow_fiv=200008;
using namespace std;
int n;
vector <int> arr;
vector <vector <pair < int,int > > > dp;
// vector <vector pair< <int,int> > > dp;
int line_width;
int raise_pow_three(int a){
return a*a*a;
}
void print_ans(){
// a function to print the answer
// now we know solution always starts from 0,1
// that is the 0th index is in the first line
// cout<<0<<space<<1<<nextline;
pair <int , int > curr=make_pair(0,1);
pair <int , int > next_coor=dp[curr.first][curr.second];
int p=0;
while(curr.first<n){
cout<<curr.first+1<<space<<next_coor.first<<space;
curr=next_coor;
next_coor=dp[curr.first][curr.second];
}
cout<<nextline;
}
int recur(int k,int p){
// recursive function that returns the min cost for filling line p with words
// starting from index k inclusive
// base case
if(k>=n)return 0;
// recursive case
int overall_cost=IINF;
int curr_cost;
int sum_char=-1; // to account for the first space
int words_opt=0;
for(int i=0;i+k<n;i++){
sum_char+=arr[i+k];
sum_char++; // adding the space for current word
// terminating case
if(sum_char>line_width)break;
// calculate the cost and try to minimize the overall cost
curr_cost=raise_pow_three(line_width-sum_char)+recur(i+k+1,p+1);
if(curr_cost<overall_cost){
// update the current cost and the number of words in the current line
overall_cost=curr_cost;
dp[k][p]=make_pair(i+k+1,p+1);
// whenever we get the better cost we store the words_opt
// that is the number of words in current line for optimality
words_opt=i+1;
}
}
// cout<<k<<space<<p<<nextline;
// cout<<"values computed are : "<<space;
// cout<<overall_cost<<space<<words_opt<<nextline;
return overall_cost;
}
void solve(){
cin>>n;
arr.resize(n,0);
// dp.resize(n+1,vector <int>(n+1,make_pair(-1,-1)) );
dp.resize(n+1,vector <pair <int,int> >(n+1,make_pair(-1,-1)) );
// next element to reach after current one
loop(0,n)cin>>arr[i];
cin>>line_width;
int cost=recur(0,1);
// cout<<"overall optimal cost is : "<<cost<<nextline;
// for(auto x:dp){
// for(auto y:x){
// cout<<y.first<<space<<y.second<<tab<<tab;
// }
// cout<<nextline;
// }
// calling the print function to print the words in line for the optimal solution
print_ans();
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
test{
solve();
}
return 0;
} | [
"shikhar21121999@gmail.com"
] | shikhar21121999@gmail.com |
f5e235391eb1d3b9cbd1d5a8db3be9a0e0a8f768 | ff62c19bdd8d6a31cbdbdf3b4c980e82caab1aeb | /shell.h | 94e9235a33ce8333086b7d256e8ec426afe31ae5 | [] | no_license | zfymoon/AppTools | 9702d8fd2ac8999f466652b6b19ff8b7144bf7d0 | 39c07728448ea624b743daf037d034ade2603762 | refs/heads/master | 2020-07-27T11:42:33.853612 | 2019-09-17T14:37:27 | 2019-09-17T14:37:27 | 209,078,690 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,048 | h | //
// Created by Curie on 2019/9/17.
//
#ifndef APPTOOLS_SHELL_H
#define APPTOOLS_SHELL_H
#include <cstdlib>
#include <string>
#include <cstdio>
#include "log.h"
namespace Shell{
const char * TAG = "Shell";
const unsigned RESULT_OK = 0;
bool exec(const char * script){
return system(script) == RESULT_OK;
}
char * execWith(const char * script){
if(script == nullptr){
Log::e(TAG,"script is null");
return nullptr;
}
string result;
FILE * file;
const int max_buffer_size = 256*2;
char buffer[max_buffer_size];
file = popen(script,"r");
if(file){
while(!feof(file)){
if(fgets(buffer,max_buffer_size,file) != nullptr){
result.append(buffer);
}
}
pclose(file);
return const_cast<char *>(result.c_str());
} else{
Log::e(TAG,"can not exec script");
}
return nullptr;
}
}
#endif //APPTOOLS_SHELL_H
| [
"zfymoon@outlook.com"
] | zfymoon@outlook.com |
98bea0814f137d5cc2cb2d0f1fa452ba71060a90 | 02b57dd027cc552197c544f4995436ee57964d18 | /antennaControllerEmbedded/incl/realMotor.hpp | b2543df471c3593d723cdb6c1fdff1bc165ccb8e | [] | no_license | mwdink/antennaControllerProject | 215154d069b3ab6bbe67dc4bd5830c672e9edbb3 | 20a202f223691d1f4329647805fe1dc29f9b779f | refs/heads/master | 2016-09-05T23:30:51.113049 | 2012-10-22T20:49:47 | 2012-10-22T20:49:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,269 | hpp | /*****************************************************************************/
/** \file
realMotor.hpp
!PURPOSE:
!SUBSYSTEM:
!DEPENDENCIES, LIMITATIONS & DESIGN NOTES:
!REVISION:
\verbatim
$File: $
$Change: $
$Revision: $
$DateTime: $
$Author: $
\endverbatim
<em> </em>
*//***************************************************************************/
#ifndef REALMOTOR_HPP_
#define REALMOTOR_HPP_
/*----------------------------- Nested includes -----------------------------*/
#include "motorInterface.hpp"
/*----------------- Symbolic Constants and Macros (defines) -----------------*/
/*-------------------------- Typedefs and structs ---------------------------*/
/*----------------------- Declarations (externs only) -----------------------*/
/*------------------------------ Declarations -------------------------------*/
/*------------------------------- Prototypes --------------------------------*/
class RealMotor: public MotorInterface
{
public:
RealMotor();
virtual ~RealMotor(){;}
void initializeMotorHardware(void);
void runMotorUp(void);
void runMotorDown(void);
void setMotorIdle(void);
protected:
uint8_t motorUp;
uint8_t motorDown;
private:
};
#endif /* REALMOTOR_HPP_ */
| [
"mwdink@yahoo.com"
] | mwdink@yahoo.com |
fdaea8573535f4eec5e2f9e4c0ec78de83fc6466 | 7e979c633c939fba18a9c7a69087db3221d61904 | /tests/experiments/make_unique.cpp | 3568da52126871e5d75c1b39720095a007477891 | [
"Unlicense"
] | permissive | timmyjose-study/cpp_learning | a6c2e47a2a7c878b437dd06c4716718af6182c36 | ce0a72c12778e50e0450ec386a88c461f36ad4c1 | refs/heads/master | 2023-06-19T05:06:36.411136 | 2021-07-13T08:54:28 | 2021-07-13T08:54:28 | 371,962,517 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 461 | cpp | #include <iostream>
#include <memory>
class Foo {
public:
Foo(std::string name, double size) : name(name), size(size) {}
const std::string &get_name() const { return name; }
double get_size() const { return size; }
private:
std::string name;
double size;
};
int main() {
std::unique_ptr<Foo> foo =
std::make_unique<Foo>(std::string("hello"), 1.23455);
std::cout << foo->get_name() << ", " << foo->get_size() << std::endl;
return 0;
}
| [
"zoltan.jose@gmail.com"
] | zoltan.jose@gmail.com |
c5ed4ee3d2ccd4361bd632d5f69602838281967d | 4ae847e1f6eb00cbb4487fd5049f48d2d204a2db | /RTN.cpp | c30209c7489095391579fd32e4a6ea0f06d3de78 | [] | no_license | sucof/Python_Pin | 35e811c5a2b4796402a95f201c81a09547de0aa0 | 4f3ef7aa66c636b07319ea1867a503b39fd6219a | refs/heads/master | 2020-12-14T18:38:46.995123 | 2015-01-18T11:18:43 | 2015-01-18T11:18:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,563 | cpp | #include </usr/include/python2.7/Python.h>
#include "pin.H"
#include "RTN.h"
PyObject* get_pointer(PyObject* self, PyObject* args) {
PyObject* target;
PyArg_ParseTuple(args, "L", &target);
return PyInt_FromLong(*(ADDRINT*)target);
}
PyObject* set_pointer(PyObject* self, PyObject* args) {
PyObject* target;
PyObject* value;
PyArg_ParseTuple(args, "O|O", &target, &value);
ADDRINT* p_target = (ADDRINT*) PyInt_AsLong(target);
ADDRINT p_value = (ADDRINT) PyInt_AsLong(value);
//printf("*%p = %lx\n", p_target, p_value);
*p_target = p_value;
return Py_True;
}
void RTN_IPOINT_AFTER(
char* name, PyObject* callback, long int return_value,
ADDRINT* reg_gax, ADDRINT* reg_gbx, ADDRINT* reg_gcx, ADDRINT* reg_gdx,
ADDRINT* reg_gbp, ADDRINT* reg_gsp, ADDRINT* reg_gdi, ADDRINT* reg_gsi
) {
PyObject* arguments = PyTuple_New(1);
PyObject* everything = PyDict_New();
PyDict_SetItemString(everything, "function", PyString_FromString(name));
PyDict_SetItemString(everything, "return", PyInt_FromLong(return_value));
PyDict_SetItemString(everything, "reg_gax", Py_BuildValue("L", reg_gax));
PyDict_SetItemString(everything, "reg_gbx", Py_BuildValue("L", reg_gbx));
PyDict_SetItemString(everything, "reg_gcx", Py_BuildValue("L", reg_gcx));
PyDict_SetItemString(everything, "reg_gdx", Py_BuildValue("L", reg_gdx));
PyDict_SetItemString(everything, "reg_gbp", Py_BuildValue("L", reg_gbp));
PyDict_SetItemString(everything, "reg_gsp", Py_BuildValue("L", reg_gsp));
PyDict_SetItemString(everything, "reg_gdi", Py_BuildValue("L", reg_gdi));
PyDict_SetItemString(everything, "reg_gsi", Py_BuildValue("L", reg_gsi));
PyTuple_SetItem(arguments, 0, everything);
PyObject_CallObject(callback, arguments);
}
void RTN_IPOINT_BEFORE(
char* name, int num_args, PyObject* callback,
long int arg0, long int arg1, long int arg2, long int arg3, long int arg4,
long int arg5, long int arg6, long int arg7, long int arg8, long int arg9, long int arg10,
ADDRINT* ref_arg0, ADDRINT* ref_arg1, ADDRINT* ref_arg2, ADDRINT* ref_arg3, ADDRINT* ref_arg4,
ADDRINT* ref_arg5, ADDRINT* ref_arg6, ADDRINT* ref_arg7, ADDRINT* ref_arg8, ADDRINT* ref_arg9, ADDRINT* ref_arg10,
ADDRINT* reg_gax, ADDRINT* reg_gbx, ADDRINT* reg_gcx, ADDRINT* reg_gdx,
ADDRINT* reg_gbp, ADDRINT* reg_gsp, ADDRINT* reg_gdi, ADDRINT* reg_gsi
) {
PyObject* arguments = PyTuple_New(1);
PyObject* everything = PyDict_New();
PyDict_SetItemString(everything, "function", PyString_FromString(name));
PyDict_SetItemString(everything, "arg_0", PyInt_FromLong(arg0));
PyDict_SetItemString(everything, "arg_1", PyInt_FromLong(arg1));
PyDict_SetItemString(everything, "arg_2", PyInt_FromLong(arg2));
PyDict_SetItemString(everything, "arg_3", PyInt_FromLong(arg3));
PyDict_SetItemString(everything, "arg_4", PyInt_FromLong(arg4));
PyDict_SetItemString(everything, "arg_5", PyInt_FromLong(arg5));
PyDict_SetItemString(everything, "arg_6", PyInt_FromLong(arg6));
PyDict_SetItemString(everything, "arg_7", PyInt_FromLong(arg7));
PyDict_SetItemString(everything, "arg_8", PyInt_FromLong(arg8));
PyDict_SetItemString(everything, "arg_9", PyInt_FromLong(arg9));
PyDict_SetItemString(everything, "arg_10", PyInt_FromLong(arg10));
PyDict_SetItemString(everything, "ref_arg_0", PyInt_FromLong((long int) ref_arg0));
PyDict_SetItemString(everything, "ref_arg_1", PyInt_FromLong((long int) ref_arg1));
PyDict_SetItemString(everything, "ref_arg_2", PyInt_FromLong((long int) ref_arg2));
PyDict_SetItemString(everything, "ref_arg_3", PyInt_FromLong((long int) ref_arg3));
PyDict_SetItemString(everything, "ref_arg_4", PyInt_FromLong((long int) ref_arg4));
PyDict_SetItemString(everything, "ref_arg_5", PyInt_FromLong((long int) ref_arg5));
PyDict_SetItemString(everything, "ref_arg_6", PyInt_FromLong((long int) ref_arg6));
PyDict_SetItemString(everything, "ref_arg_7", PyInt_FromLong((long int) ref_arg7));
PyDict_SetItemString(everything, "ref_arg_8", PyInt_FromLong((long int) ref_arg8));
PyDict_SetItemString(everything, "ref_arg_9", PyInt_FromLong((long int) ref_arg9));
PyDict_SetItemString(everything, "ref_arg_10", PyInt_FromLong((long int) ref_arg10));
PyDict_SetItemString(everything, "reg_gax", Py_BuildValue("L", reg_gax));
PyDict_SetItemString(everything, "reg_gbx", Py_BuildValue("L", reg_gbx));
PyDict_SetItemString(everything, "reg_gcx", Py_BuildValue("L", reg_gcx));
PyDict_SetItemString(everything, "reg_gdx", Py_BuildValue("L", reg_gdx));
PyDict_SetItemString(everything, "reg_gbp", Py_BuildValue("L", reg_gbp));
PyDict_SetItemString(everything, "reg_gsp", Py_BuildValue("L", reg_gsp));
PyDict_SetItemString(everything, "reg_gdi", Py_BuildValue("L", reg_gdi));
PyDict_SetItemString(everything, "reg_gsi", Py_BuildValue("L", reg_gsi));
PyTuple_SetItem(arguments, 0, everything);
if (PyObject_CallObject(callback, arguments)) {
} else {
printf("no\n");
PyErr_Print();
}
}
PyObject* Python_RTN_InsertCall(PyObject* self, PyObject* args) {
PyObject* num_args;
PyObject* function_name;
PyObject* rtn;
PyObject* callable;
PyObject* ipoint;
PyArg_ParseTuple(args, "L|O|L|L|O", &ipoint, &function_name, &rtn, &num_args, &callable);
if (!PyCallable_Check(callable) || (long int) num_args > 10 || (long int) num_args < 0) {
return Py_BuildValue("O", Py_False);
}
//cout << "function_name: " << PyString_AsString(function_name) << endl;
RTN rtn_object = *(RTN*) rtn;
if ((long int) ipoint == IPOINT_AFTER) {
RTN_InsertCall(rtn_object, IPOINT_AFTER, (AFUNPTR) RTN_IPOINT_AFTER,
IARG_ADDRINT, PyString_AsString(function_name),
IARG_PTR, callable,
IARG_FUNCRET_EXITPOINT_VALUE,
IARG_REG_REFERENCE, REG_GAX,
IARG_REG_REFERENCE, REG_GBX,
IARG_REG_REFERENCE, REG_GCX,
IARG_REG_REFERENCE, REG_GDX,
IARG_REG_REFERENCE, REG_GBP,
IARG_REG_REFERENCE, REG_STACK_PTR,
IARG_REG_REFERENCE, REG_GDI,
IARG_REG_REFERENCE, REG_GSI,
IARG_END);
} else if ((long int) ipoint == IPOINT_BEFORE) {
RTN_InsertCall(rtn_object, IPOINT_BEFORE, (AFUNPTR) RTN_IPOINT_BEFORE,
IARG_ADDRINT, PyString_AsString(function_name),
IARG_ADDRINT, num_args,
IARG_PTR, callable,
IARG_FUNCARG_ENTRYPOINT_VALUE, 0,
IARG_FUNCARG_ENTRYPOINT_VALUE, 1,
IARG_FUNCARG_ENTRYPOINT_VALUE, 2,
IARG_FUNCARG_ENTRYPOINT_VALUE, 3,
IARG_FUNCARG_ENTRYPOINT_VALUE, 4,
IARG_FUNCARG_ENTRYPOINT_VALUE, 5,
IARG_FUNCARG_ENTRYPOINT_VALUE, 6,
IARG_FUNCARG_ENTRYPOINT_VALUE, 7,
IARG_FUNCARG_ENTRYPOINT_VALUE, 8,
IARG_FUNCARG_ENTRYPOINT_VALUE, 9,
IARG_FUNCARG_ENTRYPOINT_VALUE, 10,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 0,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 1,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 2,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 3,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 4,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 5,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 6,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 7,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 8,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 9,
IARG_FUNCARG_ENTRYPOINT_REFERENCE, 10,
IARG_REG_REFERENCE, REG_GAX,
IARG_REG_REFERENCE, REG_GBX,
IARG_REG_REFERENCE, REG_GCX,
IARG_REG_REFERENCE, REG_GDX,
IARG_REG_REFERENCE, REG_GBP,
IARG_REG_REFERENCE, REG_STACK_PTR,
IARG_REG_REFERENCE, REG_GDI,
IARG_REG_REFERENCE, REG_GSI,
IARG_END);
} else {
return Py_BuildValue("O", Py_False);
}
return Py_BuildValue("O", Py_True);
/*
for (int i=0; i < PyTuple_Size(args); i++) {
cur = PyTuple_GetItem(args, i);
if (PyString_Check(cur)) {
printf("[str] %s\n", PyString_AsString(cur));
} else if (PyInt_Check(cur)) {
printf("[int] %ld\n", PyInt_AsLong(cur));
}
}
return Py_BuildValue("O", Py_False);*/
}
PyObject* Python_RTN_Next(PyObject* self, PyObject* args) {
PyObject* x;
PyArg_ParseTuple(args, "L", &x);
RTN x_object = *(RTN*) x;
RTN* rtn_return = (RTN*) malloc(sizeof(RTN));
*rtn_return = RTN_Next(x_object);
return Py_BuildValue("L", rtn_return);
}
PyObject* Python_RTN_Prev(PyObject* self, PyObject* args) {
PyObject* x;
PyArg_ParseTuple(args, "L", &x);
RTN x_object = *(RTN*) x;
RTN* rtn_return = (RTN*) malloc(sizeof(RTN));
*rtn_return = RTN_Prev(x_object);
return Py_BuildValue("L", rtn_return);
}
PyObject* Python_RTN_Invalid(PyObject* self, PyObject* args) {
RTN* rtn_return = (RTN*) malloc(sizeof(RTN));
*rtn_return = RTN_Invalid();
return Py_BuildValue("L", rtn_return);
}
PyObject* Python_RTN_Valid(PyObject* self, PyObject* args) {
PyObject* x;
PyArg_ParseTuple(args, "L", &x);
RTN x_object = *(RTN*) x;
if (RTN_Valid(x_object)) {
return Py_BuildValue("O", Py_True);
} else {
return Py_BuildValue("O", Py_False);
}
}
PyObject* Python_RTN_Name(PyObject* self, PyObject* args) {
PyObject* x;
PyArg_ParseTuple(args, "L", &x);
RTN x_object = *(RTN*) x;
return Py_BuildValue("s", RTN_Name(x_object).c_str());
}
PyObject* Python_RTN_Sym(PyObject* self, PyObject* args) {
PyObject* x;
PyArg_ParseTuple(args, "L", &x);
RTN x_object = *(RTN*) x;
SYM* sym_return = (SYM*) malloc(sizeof(SYM));
*sym_return = RTN_Sym(x_object);
return Py_BuildValue("L", sym_return);
}
PyObject* Python_RTN_Id(PyObject* self, PyObject* args) {
PyObject* x;
PyArg_ParseTuple(args, "L", &x);
RTN x_object = *(RTN*) x;
return Py_BuildValue("L", RTN_Id(x_object));
}
PyObject* Python_RTN_Range(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
return Py_BuildValue("L", RTN_Range(rtn_object));
}
PyObject* Python_RTN_Size(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
return Py_BuildValue("L", RTN_Size(rtn_object));
}
PyObject* Python_RTN_FindNameByAddress(PyObject* self, PyObject* args) {
PyObject* address;
PyArg_ParseTuple(args, "L", &address);
ADDRINT address_object = (ADDRINT) address;
return Py_BuildValue("s", RTN_FindNameByAddress(address_object).c_str());
}
PyObject* Python_RTN_FindByAddress(PyObject* self, PyObject* args) {
PyObject* address;
PyArg_ParseTuple(args, "L", &address);
ADDRINT address_object = (ADDRINT) address;
RTN* rtn_return = (RTN*) malloc(sizeof(RTN));
*rtn_return = RTN_FindByAddress(address_object);
return Py_BuildValue("L", rtn_return);
}
PyObject* Python_RTN_FindByName(PyObject* self, PyObject* args) {
PyObject* img;
PyObject* name;
PyArg_ParseTuple(args, "L|O", &img, &name);
IMG img_object = *(IMG*) img;
char* name_object = PyString_AsString(name);
RTN* rtn_return = (RTN*) malloc(sizeof(RTN));
*rtn_return = RTN_FindByName(img_object, name_object);
return Py_BuildValue("L", rtn_return);
}
PyObject* Python_RTN_Open(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
RTN_Open(rtn_object);
return Py_BuildValue("O", Py_True);
}
PyObject* Python_RTN_Close(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
RTN_Close(rtn_object);
return Py_BuildValue("O", Py_True);
}
PyObject* Python_RTN_InsHead(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
INS* ins_return = (INS*) malloc(sizeof(INS));
*ins_return = RTN_InsHead(rtn_object);
return Py_BuildValue("L", ins_return);
}
PyObject* Python_RTN_InsHeadOnly(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
INS* ins_return = (INS*) malloc(sizeof(INS));
*ins_return = RTN_InsHeadOnly(rtn_object);
return Py_BuildValue("L", ins_return);
}
PyObject* Python_RTN_InsTail(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
INS* ins_return = (INS*) malloc(sizeof(INS));
*ins_return = RTN_InsTail(rtn_object);
return Py_BuildValue("L", ins_return);
}
PyObject* Python_RTN_NumIns(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
return Py_BuildValue("L", RTN_NumIns(rtn_object));
}
PyObject* Python_RTN_Address(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
return Py_BuildValue("L", RTN_Address(rtn_object));
}
PyObject* Python_RTN_CreateAt(PyObject* self, PyObject* args) {
PyObject* address;
PyObject* name;
PyArg_ParseTuple(args, "L|s", &address, &name);
ADDRINT address_object = (ADDRINT) address;
char* name_object = PyString_AsString(name);
RTN* rtn_return = (RTN*) malloc(sizeof(RTN));
*rtn_return = RTN_CreateAt(address_object, name_object);
return Py_BuildValue("L", rtn_return);
}
PyObject* Python_RTN_IsDynamic(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
if (RTN_IsDynamic(rtn_object)) {
return Py_BuildValue("O", Py_True);
} else {
return Py_BuildValue("O", Py_False);
}
}
PyObject* Python_RTN_IsSafeForProbedInsertion(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
if (RTN_IsSafeForProbedInsertion(rtn_object)) {
return Py_BuildValue("O", Py_True);
} else {
return Py_BuildValue("O", Py_False);
}
}
PyObject* Python_RTN_IsSafeForProbedInsertionEx(PyObject* self, PyObject* args) {
PyObject* rtn;
PyObject* mode;
PyArg_ParseTuple(args, "L|L", &rtn, &mode);
RTN rtn_object = *(RTN*) rtn;
PROBE_MODE mode_object = *(PROBE_MODE*) mode;
if (RTN_IsSafeForProbedInsertionEx(rtn_object, mode_object)) {
return Py_BuildValue("O", Py_True);
} else {
return Py_BuildValue("O", Py_False);
}
}
PyObject* Python_RTN_IsSafeForProbedReplacement(PyObject* self, PyObject* args) {
PyObject* rtn;
PyArg_ParseTuple(args, "L", &rtn);
RTN rtn_object = *(RTN*) rtn;
if (RTN_IsSafeForProbedReplacement(rtn_object)) {
return Py_BuildValue("O", Py_True);
} else {
return Py_BuildValue("O", Py_False);
}
}
PyObject* Python_RTN_IsSafeForProbedReplacementEx(PyObject* self, PyObject* args) {
PyObject* rtn;
PyObject* mode;
PyArg_ParseTuple(args, "L|L", &rtn, &mode);
RTN rtn_object = *(RTN*) rtn;
PROBE_MODE mode_object = *(PROBE_MODE*) mode;
if (RTN_IsSafeForProbedReplacementEx(rtn_object, mode_object)) {
return Py_BuildValue("O", Py_True);
} else {
return Py_BuildValue("O", Py_False);
}
} | [
"1blankwall1@gmail.com"
] | 1blankwall1@gmail.com |
0e3bb9954361d011656d719eb658bb223efbeede | e18aa9fa74df0eb36651e4147cdbc074ab2cf356 | /include/malformed_request_handler.h | 7dabde6e2a6e8804a6915d2701849695346c0976 | [] | no_license | pr33ch/big-bear | 255aa5903342a142eb0537b4c1d3208ceb01fdeb | 6089f4ffee445ae1d2bba20cf9b120e483e46955 | refs/heads/master | 2020-09-01T03:21:03.722669 | 2019-10-31T21:57:25 | 2019-10-31T21:57:25 | 218,868,035 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 344 | h | #include "request_handler.h"
#include "config_parser.h"
#include "http_response.h"
class MalformedRequestHandler : public RequestHandler
{
public:
static std::unique_ptr<RequestHandler> create(const NginxConfig& config, const std::string& root_path);
std::unique_ptr<HttpResponse> HandleRequest(const HttpRequest &request) override;
}; | [
"joris@cs130.org"
] | joris@cs130.org |
70efdaef1419f37c740968860241942942b1825c | 31f671e589e58f7a34ddf383d6701bc04f74bfd4 | /ps/week20/task2/Voskresenskaya/test.h | 11d19b17a6ed9d425132ff75012c6ca2f24a5c58 | [] | no_license | Boklazhenko/itstephomework | 450fbdd43c56fadb9f53573573197f2c880e832a | 368f951936620332ca68d14eb444084db9bb33a4 | refs/heads/master | 2020-09-08T16:54:19.988831 | 2020-08-08T13:22:35 | 2020-08-08T13:22:35 | 221,188,173 | 5 | 10 | null | 2020-08-15T07:00:35 | 2019-11-12T10:13:14 | C++ | UTF-8 | C++ | false | false | 184 | h | #include "Pointr.h"
using namespace std;
#pragma once
class Test
{
public:
explicit Test(int Value);
~Test() {};
int Value();
void setValue(int Value);
private:
int _Value;
}; | [
"vmm459@gmail.com"
] | vmm459@gmail.com |
60aa19431b1a885e7130b047b4914e0f4e72f5e0 | c70cecac66ad0241feae0f8ed8a77000dcbdc5cf | /LeetCode/495_Teemo Attacking.cpp | 42a45b6e6dc5dfa3056831bd2621f0c3e79286c1 | [] | no_license | vogage/CODE_for_learn | c38d6304bcae0a6746cc7afe921b186ff3d55954 | 6b4edf56ab70f55d857272de51b0440effdef0cd | refs/heads/master | 2023-08-31T00:49:59.734124 | 2023-08-18T13:06:14 | 2023-08-18T13:06:14 | 207,241,871 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 994 | cpp | //
// 495_Teemo Attacking.cpp
// leetcode
//
// Created by 钱德厚 on 2023/6/6.
//
#include <stdio.h>
#include <vector>
using namespace std;
class Solution {
public:
int findPoisonedDuration(vector<int>& timeSeries, int duration) {
if(timeSeries.size()==0)return 0;
if(timeSeries.size()==1)return duration;
int PoisonEnd=timeSeries[0]+duration;
int res=0;
for(int i=1;i<timeSeries.size();i++){
if(timeSeries[i]<PoisonEnd){
//reset time
res+=timeSeries[i]-timeSeries[i-1];
}else{
//renew time
res+=duration;
}
PoisonEnd=timeSeries[i]+duration;
}
return res+=duration;
}
};
int main(){
Solution mysolu;
vector<int> timeSeries={1,2};
vector<int> timeSeries1={1,4};
int duration=2;
int res=mysolu.findPoisonedDuration(timeSeries1, duration);
return 0;
}
| [
"1309416226@qq.com"
] | 1309416226@qq.com |
36a7bc2544c70cf719a9f25cda7025849f1ad4bc | cc3dc6ab7eebd53b33141beddb65dfca87b20861 | /UnnamedEngine/src/Main.cpp | d6f4070d81d0dcde6d21413d7d2a7b2537189786 | [] | no_license | 2851999/UnnamedEngine | d9e745164dfd3be542792d15735228cd4e4e0d7f | feb3d1efe0406fff2d711a2ad2c2202bf141535a | refs/heads/master | 2021-01-13T00:37:16.945925 | 2015-12-03T16:28:32 | 2015-12-03T16:28:32 | 47,343,771 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,178 | cpp | /*****************************************************************************
*
* Copyright 2015 Joel Davies
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*****************************************************************************/
#define TEST_LIGHTING
#ifdef TEST_LIGHTING
#include "LightingTest.h"
int main() {
LightingTest game;
game.create();
return 0;
}
#endif
#ifdef TEST_GUI
#include "GUITest.h"
int main() {
GUITest game;
game.create();
return 0;
}
#endif
#ifdef TEST_WINDOW
#include "WindowTest.h"
int main() {
WindowTest game;
game.create();
return 0;
}
#endif
| [
"Joel@TheBeast"
] | Joel@TheBeast |
6f240adcbf3794a77b7aa8199f21b3bdd0312d93 | 973996e18022fc176ec68876bbceb5ae54aa9cac | /ICPC_Mirrors/Nitc_13.0/problems/problems/ideal/solutions/ideal_iz_wa.cpp | a17cb60ea62d4e262adc677c7e41d4b17a258158 | [
"MIT"
] | permissive | Shahraaz/CP_P_S5 | 80bda6a39f197428bbe6952c6735fe9a17c01cb8 | b068ad02d34338337e549d92a14e3b3d9e8df712 | refs/heads/master | 2021-08-16T11:09:59.341001 | 2021-06-22T05:14:10 | 2021-06-22T05:14:10 | 197,088,137 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 623 | cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
int main() {
int n;
cin >> n;
vector<int> x(n), y(n), h(n);
for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> h[i];
int min_x = INF, max_x = -INF, min_y = INF, max_y = -INF;
for (int i = 0; i < n; i++) {
min_x = min(min_x, x[i] - h[i]);
max_x = max(max_x, x[i] + h[i]);
min_y = min(min_y, y[i] - h[i]);
max_y = max(max_y, y[i] + h[i]);
}
int rx = (min_x + max_x) / 2, ry = (min_y + max_y) / 2;
int rh = (max(max_x - min_x, max_y - min_y) + 1) / 2;
cout << rx << " " << ry << " " << rh << endl;
}
| [
"shahraazhussain@gmail.com"
] | shahraazhussain@gmail.com |
6b365af9deb6fe1f42287a9636f1d038a07fb014 | 33d6ebd78a5dbcc6c6b12e818c99a0705d3a082a | /C++/C++ primer练习/第一部分 C++基础/P110 1比较两个string对象以及比较两个C风格字符串的内容.cpp | f0f51b978b75705e2ec9cf2c9a7f48db8dc23347 | [] | no_license | haon16/cpp-learning | 00ab7aefaf0c0c2e249a16494d6a1a7600c78f90 | c779d1de78afff500fca91b577d5be86bf38fef0 | refs/heads/master | 2023-02-10T10:23:32.748327 | 2021-01-12T15:45:55 | 2021-01-12T15:45:55 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,175 | cpp | //时间:2019年5月15日12:39:37
//比较两个string对象和比较两个C风格字符串
#include <iostream>
#include <string>
#include <cstring>
int main()
{
std::string str1, str2;
std::cout << "请输入两个字符串:" << std::endl;
std::cin >> str1 >> str2;
if (str1 > str2)
std::cout << "第一个字符串大于第二个字符串" << std::endl;
else if (str1 < str2)
std::cout << "第一个字符串小于第二个字符串" << std::endl;
else
std::cout << "两个字符串相等" << std::endl;
char str3[80], str4[80];
std::cout << "请输入两个字符串:" << std::endl;
std::cin >> str3 >> str4;
auto result = strcmp(str3, str4);
switch (result)
{
case 1:
std::cout << "第三个字符串大于第四个字符串" << std::endl;
break;
case 0:
std::cout << "第三个字符串等于第四个字符串" << std::endl;
break;
case -1:
std::cout << "第三个字符串小于第四个字符串" << std::endl;
break;
default:
std::cout << "未定义的结果" << std::endl;
break;
}
return 0;
}
| [
"1020090076@qq.com"
] | 1020090076@qq.com |
503f86fb075e88aeb79a54f5b81d039f582bff59 | 1a7216dc2f093bde5ec050b0873c2011d1087a9d | /laços2.cpp | 1e3139408038a7c0e776ba9df8d97a974e6cfaa9 | [] | no_license | LuisWitts/Exercicios-C-plus-plus- | f0cea1811b7fc2f1328905b8e450ab6780b69e0a | 0899852aca2c99fdb59e45d9f3236a09ef99c21f | refs/heads/master | 2020-12-27T19:21:24.621089 | 2020-02-03T17:20:25 | 2020-02-03T17:20:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 220 | cpp | #include<stdio.h>
#include<stdlib.h>
#include<windows.h>
int main (){
int i, x=3;
for(i=1;i<=10;i++){
for(x=1;x<=10;x++){
printf("\n%i x %i = %i\n",i,x,i*x);
}
printf("\n******\n");
}
system ("pause");
}
| [
"luis.witts@outlook.com"
] | luis.witts@outlook.com |
6a46b27ef9dee9f749f66aa0b2978eefe26016ce | 8c8820fb84dea70d31c1e31dd57d295bd08dd644 | /MeshUtilitiesCommon/Private/OverlappingCorners.cpp | d9a835b89b5f9fc8d8cbc0543a710050b9966d6f | [] | no_license | redisread/UE-Runtime | e1a56df95a4591e12c0fd0e884ac6e54f69d0a57 | 48b9e72b1ad04458039c6ddeb7578e4fc68a7bac | refs/heads/master | 2022-11-15T08:30:24.570998 | 2020-06-20T06:37:55 | 2020-06-20T06:37:55 | 274,085,558 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,745 | cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "OverlappingCorners.h"
#include "MeshUtilitiesCommon.h"
FOverlappingCorners::FOverlappingCorners(const TArray<FVector>& InVertices, const TArray<uint32>& InIndices, float ComparisonThreshold)
{
const int32 NumWedges = InIndices.Num();
// Create a list of vertex Z/index pairs
TArray<FIndexAndZ> VertIndexAndZ;
VertIndexAndZ.Reserve(NumWedges);
for (int32 WedgeIndex = 0; WedgeIndex < NumWedges; WedgeIndex++)
{
new(VertIndexAndZ)FIndexAndZ(WedgeIndex, InVertices[InIndices[WedgeIndex]]);
}
// Sort the vertices by z value
VertIndexAndZ.Sort(FCompareIndexAndZ());
Init(NumWedges);
// Search for duplicates, quickly!
for (int32 i = 0; i < VertIndexAndZ.Num(); i++)
{
// only need to search forward, since we add pairs both ways
for (int32 j = i + 1; j < VertIndexAndZ.Num(); j++)
{
if (FMath::Abs(VertIndexAndZ[j].Z - VertIndexAndZ[i].Z) > ComparisonThreshold)
break; // can't be any more dups
const FVector& PositionA = InVertices[InIndices[VertIndexAndZ[i].Index]];
const FVector& PositionB = InVertices[InIndices[VertIndexAndZ[j].Index]];
if (PointsEqual(PositionA, PositionB, ComparisonThreshold))
{
Add(VertIndexAndZ[i].Index, VertIndexAndZ[j].Index);
}
}
}
FinishAdding();
}
void FOverlappingCorners::Init(int32 NumIndices)
{
Arrays.Reset();
Sets.Reset();
bFinishedAdding = false;
IndexBelongsTo.Reset(NumIndices);
IndexBelongsTo.AddUninitialized(NumIndices);
FMemory::Memset(IndexBelongsTo.GetData(), 0xFF, NumIndices * sizeof(int32));
}
void FOverlappingCorners::Add(int32 Key, int32 Value)
{
check(Key != Value);
check(bFinishedAdding == false);
int32 ContainerIndex = IndexBelongsTo[Key];
if (ContainerIndex == INDEX_NONE)
{
ContainerIndex = Arrays.Num();
TArray<int32>& Container = Arrays.AddDefaulted_GetRef();
Container.Reserve(6);
Container.Add(Key);
Container.Add(Value);
IndexBelongsTo[Key] = ContainerIndex;
IndexBelongsTo[Value] = ContainerIndex;
}
else
{
IndexBelongsTo[Value] = ContainerIndex;
TArray<int32>& ArrayContainer = Arrays[ContainerIndex];
if (ArrayContainer.Num() == 1)
{
// Container is a set
Sets[ArrayContainer.Last()].Add(Value);
}
else
{
// Container is an array
ArrayContainer.AddUnique(Value);
// Change container into set when one vertex is shared by large number of triangles
if (ArrayContainer.Num() > 12)
{
int32 SetIndex = Sets.Num();
TSet<int32>& Set = Sets.AddDefaulted_GetRef();
Set.Append(ArrayContainer);
// Having one element means we are using a set
// An array will never have just 1 element normally because we add them as pairs
ArrayContainer.Reset(1);
ArrayContainer.Add(SetIndex);
}
}
}
}
void FOverlappingCorners::FinishAdding()
{
check(bFinishedAdding == false);
for (TArray<int32>& Array : Arrays)
{
// Turn sets back into arrays for easier iteration code
// Also reduces peak memory later in the import process
if (Array.Num() == 1)
{
TSet<int32>& Set = Sets[Array.Last()];
Array.Reset(Set.Num());
for (int32 i : Set)
{
Array.Add(i);
}
}
// Sort arrays now to avoid sort multiple times
Array.Sort();
}
Sets.Empty();
bFinishedAdding = true;
}
uint32 FOverlappingCorners::GetAllocatedSize(void) const
{
uint32 BaseMemoryAllocated = IndexBelongsTo.GetAllocatedSize() + Arrays.GetAllocatedSize() + Sets.GetAllocatedSize();
uint32 ArraysMemory = 0;
for (const TArray<int32>& ArrayIt : Arrays)
{
ArraysMemory += ArrayIt.GetAllocatedSize();
}
uint32 SetsMemory = 0;
for (const TSet<int32>& SetsIt : Sets)
{
SetsMemory += SetsIt.GetAllocatedSize();
}
return BaseMemoryAllocated + ArraysMemory + SetsMemory;
}
| [
"wujiahong19981022@outlook.com"
] | wujiahong19981022@outlook.com |
81935cbf021966f363895ae3aa95b1ad238aaffc | ea54021e59910ae07c171a556f487f3403f79f6c | /Programe/VC/NET/Iocp/Iocp/ListenSock.h | b21593e0808c0e7f283904a8f2ed7b837a476f9b | [] | no_license | 15831944/pre2006 | e56441c0e511a5b4695d970d8a9a14b343ccc675 | 7d38b738fb74fa8987fa49bf2598be74645ebbd0 | refs/heads/master | 2023-02-24T19:57:40.843660 | 2021-01-19T13:01:19 | 2021-01-19T13:01:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 363 | h | #pragma once
#include "sock.h"
class CListenSocket : public CSocket
{
public:
CListenSocket(int fd);
virtual ~CListenSocket(void);
// accept() returns a new Socket object if there is a connection
// attempt in progress AND if the connection passes the filter
// if one is installed. Otherwise, returns 0.
virtual CSocket * Accept() = 0;
};
| [
"kl222@126.com"
] | kl222@126.com |
78fad9ed12d1e9220a069f65f6cb6c4af8a9c4ed | 0574237636f4d9ee0099f77c79adf182ce69419d | /Catalysts Coding Contest/Cat coder/Correct_Eq.cpp | 3003f7864b838c7268c7b2c2141af02ff6da0581 | [] | no_license | andreicoman11/code | 77359bccd7cc451d6db5edbfea9b2bf81f44250f | c0e318e7c7e192f1d90e82e2468344b6a27a310f | refs/heads/master | 2020-05-27T05:08:22.332100 | 2014-12-19T01:39:41 | 2014-12-19T01:39:41 | 28,082,193 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,630 | cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;
#define PB push_back
#define SZ size()
#define SORT(x) sort(ALL(x))
#define REP(x, hi) for (int x=0; x<(hi); x++)
#define REPD(x, hi) for (int x=((hi)-1); x>=0; x--)
#define FOR(x, lo, hi) for (int x=(lo); x<(hi); x++)
#define FORD(x, lo, hi) for (int x=((hi)-1); x>=(lo); x--)
#define FORALL(it,x) for (typeof(x.begin()) it=x.begin(); it!=x.end(); it++)
#define INFILE ".in"
#define OUTFILE ".out"
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef vector<double> VD;
typedef vector<VD> VVD;
typedef vector<string> VS;
ifstream fin (INFILE);
ofstream fout (OUTFILE);
bool eval(string s)
{
int r = 0;
int op = 1;
int eq = 1;
REP(i, s.SZ)
{
if( isdigit(s[i]) )
{
int n = 0;
while( isdigit(s[i]) )
{
n = n*10 + (int)s[i] - int('0');
i++;
}
i--;
r += op * n;
}
else if( s[i]=='-' ) op = -1 * eq;
else if( s[i]=='+' ) op = 1 * eq;
else if( s[i]=='=' ) {eq = -1;op=-1;}
}
cout << s << " " << r << endl;//system("pause");
if( r && eq==-1 ) return 0;
return 1;
}
int main()
{
VVI m(10);
VVI p(10);
m[6].PB(5);
m[7].PB(1);
m[8].PB(0);
m[8].PB(6);
m[8].PB(9);
m[9].PB(3);
m[9].PB(5);
p[0].PB(8);
p[1].PB(7);
p[3].PB(9);
p[5].PB(6);
p[5].PB(9);
p[6].PB(8);
p[9].PB(8);
string eq;
while( fin >> eq )
{
bool found = 0;
REP(i, eq.SZ)
{
if( isdigit( eq[i]) && m[int(eq[i]) - int('0')].SZ>0 )
{
int nr = int(eq[i]) - int('0');
char last = eq[i];
REP(j, m[nr].SZ)
{
eq[i] = char(int('0') + m[nr][j]);
REP(k, eq.SZ)
if( isdigit(eq[k]) && p[int(eq[k]) - int('0')].SZ>0 )
{
int nr2 = int(eq[k]) - int('0');
char last2 = eq[k];
REP(l, p[nr2].SZ)
{
eq[k] = char( int('0') + p[nr2][l]);
if( eval(eq) )
{
fout << eq << endl;
found = 1;
break;
}
}
eq[k] = last2;
if( found ) break;
}
else if( eq[k]=='-' )
{
eq[k] = '+';
if( eval(eq) )
{
fout << eq << endl;
found = 1;
break;
}
eq[k] = '-';
}
if( found ) break;
}
eq[i] = last;
}
if( eq[i]=='+' )
{
char last = eq[i];
eq[i] = '-';
REP(k, eq.SZ)
if( isdigit(eq[k]) && p[int(eq[k]) - int('0')].SZ>0 )
{
int nr2 = int(eq[k]) - int('0');
char last2 = eq[k];
REP(l, p[nr2].SZ)
{
eq[k] = char( int('0') + p[nr2][l]);
if( eval(eq) )
{
fout << eq << endl;
found = 1;
break;
}
}
eq[k] = last2;
if( found ) break;
}
else if( eq[k]=='-' )
{
eq[k] = '+';
if( eval(eq) )
{
fout << eq << endl;
found = 1;
break;
}
eq[k] = '-';
}
eq[i] = last;
}
if( found ) break;
}
if( !found )
REP(i, eq.SZ)
FOR(j, i+1, eq.SZ)
if( eq[i]=='-' && eq[j]=='=' )
{
eq[i] = '=';
eq[j] = '-';
if( eval(eq) )
{
fout << eq << endl;
found = 1;
break;
}
eq[i] = '-';
eq[j] = '=';
} else if( eq[i]=='=' && eq[j]=='-' )
{
eq[i] = '-';
eq[j] = '=';
if( eval(eq) )
{
fout << eq << endl;
found = 1;
break;
}
eq[i] = '=';
eq[j] = '-';
}
if( !found ) fout << "not found for " << eq << endl;
}
return 0;
} | [
"andreicoman11@gmail.com"
] | andreicoman11@gmail.com |
098c7b11a4be0187fe7a4dc2d35ca8f801376a1f | c776476e9d06b3779d744641e758ac3a2c15cddc | /examples/litmus/c/run-scripts/tmp_1/MP+dmb.sy+addr-rfi-pos-addr-[fr-rf].c.cbmc_out.cpp | 96551a471b77508ba44d2ea3030f25c55c629008 | [] | 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 | 63,158 | cpp | // 0:vars:3
// 5:atom_1_X6_1:1
// 3:atom_1_X0_1:1
// 4:atom_1_X5_1:1
// 6:atom_1_X8_0:1
// 7:atom_1_X10_1:1
// 8:thr0:1
// 9:thr1:1
// 10:thr2:1
#define ADDRSIZE 11
#define NPROC 4
#define NCONTEXT 1
#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 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_[NPROC*ADDRSIZE];
#define buff(x,k) buff_[(x)*ADDRSIZE+k]
int pw_[NPROC*ADDRSIZE];
#define pw(x,k) pw_[(x)*ADDRSIZE+k]
// declare arrays for context stamps
char cr_[NPROC*ADDRSIZE];
#define cr(x,k) cr_[(x)*ADDRSIZE+k]
char iw_[NPROC*ADDRSIZE];
#define iw(x,k) iw_[(x)*ADDRSIZE+k]
char cw_[NPROC*ADDRSIZE];
#define cw(x,k) cw_[(x)*ADDRSIZE+k]
char cx_[NPROC*ADDRSIZE];
#define cx(x,k) cx_[(x)*ADDRSIZE+k]
char is_[NPROC*ADDRSIZE];
#define is(x,k) is_[(x)*ADDRSIZE+k]
char cs_[NPROC*ADDRSIZE];
#define cs(x,k) cs_[(x)*ADDRSIZE+k]
char crmax_[NPROC*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[NPROC];
int cdy[NPROC];
int cds[NPROC];
int cdl[NPROC];
int cisb[NPROC];
int caddr[NPROC];
int cctrl[NPROC];
int cstart[NPROC];
int creturn[NPROC];
// declare arrays for contexts activity
int active[NCONTEXT];
int ctx_used[NCONTEXT];
int r0= 0;
char creg_r0;
int r1= 0;
char creg_r1;
int r2= 0;
char creg_r2;
int r3= 0;
char creg_r3;
int r4= 0;
char creg_r4;
int r5= 0;
char creg_r5;
int r6= 0;
char creg_r6;
int r7= 0;
char creg_r7;
int r8= 0;
char creg_r8;
int r9= 0;
char creg_r9;
int r10= 0;
char creg_r10;
int r11= 0;
char creg_r11;
int r12= 0;
char creg_r12;
int r13= 0;
char creg_r13;
int r14= 0;
char creg_r14;
int r15= 0;
char creg_r15;
int r16= 0;
char creg_r16;
int r17= 0;
char creg_r17;
int r18= 0;
char creg_r18;
int r19= 0;
char creg_r19;
int r20= 0;
char creg_r20;
int r21= 0;
char creg_r21;
int r22= 0;
char creg_r22;
int r23= 0;
char creg_r23;
int r24= 0;
char creg_r24;
int r25= 0;
char creg_r25;
int r26= 0;
char creg_r26;
int r27= 0;
char creg_r27;
int r28= 0;
char creg_r28;
int r29= 0;
char creg_r29;
int r30= 0;
char creg_r30;
char old_cctrl= 0;
char old_cr= 0;
char old_cdy= 0;
char old_cw= 0;
char new_creg= 0;
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;
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;
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;
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;
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);
// Dumping initializations
mem(0+0,0) = 0;
mem(0+1,0) = 0;
mem(0+2,0) = 0;
mem(5+0,0) = 0;
mem(3+0,0) = 0;
mem(4+0,0) = 0;
mem(6+0,0) = 0;
mem(7+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;
co(1,0) = 0;
delta(1,0) = -1;
co(2,0) = 0;
delta(2,0) = -1;
co(3,0) = 0;
delta(3,0) = -1;
co(4,0) = 0;
delta(4,0) = -1;
co(5,0) = 0;
delta(5,0) = -1;
co(6,0) = 0;
delta(6,0) = -1;
co(7,0) = 0;
delta(7,0) = -1;
co(8,0) = 0;
delta(8,0) = -1;
co(9,0) = 0;
delta(9,0) = -1;
co(10,0) = 0;
delta(10,0) = -1;
// 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 !41, metadata !DIExpression()), !dbg !50
// br label %label_1, !dbg !51
goto T1BLOCK1;
T1BLOCK1:
// call void @llvm.dbg.label(metadata !49), !dbg !52
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !42, metadata !DIExpression()), !dbg !53
// call void @llvm.dbg.value(metadata i64 2, metadata !45, metadata !DIExpression()), !dbg !53
// store atomic i64 2, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !54
// ST: Guess
iw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW
old_cw = cw(1,0);
cw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM
// 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]);
// Update
caddr[1] = max(caddr[1],0);
buff(1,0) = 2;
mem(0,cw(1,0)) = 2;
co(0,cw(1,0))+=1;
delta(0,cw(1,0)) = -1;
ASSUME(creturn[1] >= cw(1,0));
// call void (...) @dmbsy(), !dbg !55
// dumbsy: Guess
old_cdy = cdy[1];
cdy[1] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[1] >= old_cdy);
ASSUME(cdy[1] >= cisb[1]);
ASSUME(cdy[1] >= cdl[1]);
ASSUME(cdy[1] >= cds[1]);
ASSUME(cdy[1] >= cctrl[1]);
ASSUME(cdy[1] >= cw(1,0+0));
ASSUME(cdy[1] >= cw(1,0+1));
ASSUME(cdy[1] >= cw(1,0+2));
ASSUME(cdy[1] >= cw(1,5+0));
ASSUME(cdy[1] >= cw(1,3+0));
ASSUME(cdy[1] >= cw(1,4+0));
ASSUME(cdy[1] >= cw(1,6+0));
ASSUME(cdy[1] >= cw(1,7+0));
ASSUME(cdy[1] >= cw(1,8+0));
ASSUME(cdy[1] >= cw(1,9+0));
ASSUME(cdy[1] >= cw(1,10+0));
ASSUME(cdy[1] >= cr(1,0+0));
ASSUME(cdy[1] >= cr(1,0+1));
ASSUME(cdy[1] >= cr(1,0+2));
ASSUME(cdy[1] >= cr(1,5+0));
ASSUME(cdy[1] >= cr(1,3+0));
ASSUME(cdy[1] >= cr(1,4+0));
ASSUME(cdy[1] >= cr(1,6+0));
ASSUME(cdy[1] >= cr(1,7+0));
ASSUME(cdy[1] >= cr(1,8+0));
ASSUME(cdy[1] >= cr(1,9+0));
ASSUME(cdy[1] >= cr(1,10+0));
ASSUME(creturn[1] >= cdy[1]);
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !46, metadata !DIExpression()), !dbg !56
// call void @llvm.dbg.value(metadata i64 1, metadata !48, metadata !DIExpression()), !dbg !56
// store atomic i64 1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !57
// ST: Guess
iw(1,0+1*1) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW
old_cw = cw(1,0+1*1);
cw(1,0+1*1) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM
// Check
ASSUME(active[iw(1,0+1*1)] == 1);
ASSUME(active[cw(1,0+1*1)] == 1);
ASSUME(sforbid(0+1*1,cw(1,0+1*1))== 0);
ASSUME(iw(1,0+1*1) >= 0);
ASSUME(iw(1,0+1*1) >= 0);
ASSUME(cw(1,0+1*1) >= iw(1,0+1*1));
ASSUME(cw(1,0+1*1) >= old_cw);
ASSUME(cw(1,0+1*1) >= cr(1,0+1*1));
ASSUME(cw(1,0+1*1) >= cl[1]);
ASSUME(cw(1,0+1*1) >= cisb[1]);
ASSUME(cw(1,0+1*1) >= cdy[1]);
ASSUME(cw(1,0+1*1) >= cdl[1]);
ASSUME(cw(1,0+1*1) >= cds[1]);
ASSUME(cw(1,0+1*1) >= cctrl[1]);
ASSUME(cw(1,0+1*1) >= caddr[1]);
// Update
caddr[1] = max(caddr[1],0);
buff(1,0+1*1) = 1;
mem(0+1*1,cw(1,0+1*1)) = 1;
co(0+1*1,cw(1,0+1*1))+=1;
delta(0+1*1,cw(1,0+1*1)) = -1;
ASSUME(creturn[1] >= cw(1,0+1*1));
// ret i8* null, !dbg !58
ret_thread_1 = (- 1);
// 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 !61, metadata !DIExpression()), !dbg !109
// br label %label_2, !dbg !91
goto T2BLOCK1;
T2BLOCK1:
// call void @llvm.dbg.label(metadata !108), !dbg !111
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !64, metadata !DIExpression()), !dbg !112
// %0 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !94
// LD: Guess
old_cr = cr(2,0+1*1);
cr(2,0+1*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM
// Check
ASSUME(active[cr(2,0+1*1)] == 2);
ASSUME(cr(2,0+1*1) >= iw(2,0+1*1));
ASSUME(cr(2,0+1*1) >= 0);
ASSUME(cr(2,0+1*1) >= cdy[2]);
ASSUME(cr(2,0+1*1) >= cisb[2]);
ASSUME(cr(2,0+1*1) >= cdl[2]);
ASSUME(cr(2,0+1*1) >= cl[2]);
// Update
creg_r0 = cr(2,0+1*1);
crmax(2,0+1*1) = max(crmax(2,0+1*1),cr(2,0+1*1));
caddr[2] = max(caddr[2],0);
if(cr(2,0+1*1) < cw(2,0+1*1)) {
r0 = buff(2,0+1*1);
} else {
if(pw(2,0+1*1) != co(0+1*1,cr(2,0+1*1))) {
ASSUME(cr(2,0+1*1) >= old_cr);
}
pw(2,0+1*1) = co(0+1*1,cr(2,0+1*1));
r0 = mem(0+1*1,cr(2,0+1*1));
}
ASSUME(creturn[2] >= cr(2,0+1*1));
// call void @llvm.dbg.value(metadata i64 %0, metadata !66, metadata !DIExpression()), !dbg !112
// %conv = trunc i64 %0 to i32, !dbg !95
// call void @llvm.dbg.value(metadata i32 %conv, metadata !62, metadata !DIExpression()), !dbg !109
// %xor = xor i32 %conv, %conv, !dbg !96
creg_r1 = max(creg_r0,creg_r0);
ASSUME(active[creg_r1] == 2);
r1 = r0 ^ r0;
// call void @llvm.dbg.value(metadata i32 %xor, metadata !67, metadata !DIExpression()), !dbg !109
// %add = add nsw i32 2, %xor, !dbg !97
creg_r2 = max(0,creg_r1);
ASSUME(active[creg_r2] == 2);
r2 = 2 + r1;
// %idxprom = sext i32 %add to i64, !dbg !97
// %arrayidx = getelementptr inbounds [3 x i64], [3 x i64]* @vars, i64 0, i64 %idxprom, !dbg !97
r3 = 0+r2*1;
ASSUME(creg_r3 >= 0);
ASSUME(creg_r3 >= creg_r2);
ASSUME(active[creg_r3] == 2);
// call void @llvm.dbg.value(metadata i64* %arrayidx, metadata !68, metadata !DIExpression()), !dbg !117
// call void @llvm.dbg.value(metadata i64 1, metadata !70, metadata !DIExpression()), !dbg !117
// store atomic i64 1, i64* %arrayidx monotonic, align 8, !dbg !97
// ST: Guess
iw(2,r3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,r3);
cw(2,r3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,r3)] == 2);
ASSUME(active[cw(2,r3)] == 2);
ASSUME(sforbid(r3,cw(2,r3))== 0);
ASSUME(iw(2,r3) >= 0);
ASSUME(iw(2,r3) >= creg_r3);
ASSUME(cw(2,r3) >= iw(2,r3));
ASSUME(cw(2,r3) >= old_cw);
ASSUME(cw(2,r3) >= cr(2,r3));
ASSUME(cw(2,r3) >= cl[2]);
ASSUME(cw(2,r3) >= cisb[2]);
ASSUME(cw(2,r3) >= cdy[2]);
ASSUME(cw(2,r3) >= cdl[2]);
ASSUME(cw(2,r3) >= cds[2]);
ASSUME(cw(2,r3) >= cctrl[2]);
ASSUME(cw(2,r3) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],creg_r3);
buff(2,r3) = 1;
mem(r3,cw(2,r3)) = 1;
co(r3,cw(2,r3))+=1;
delta(r3,cw(2,r3)) = -1;
ASSUME(creturn[2] >= cw(2,r3));
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2), metadata !72, metadata !DIExpression()), !dbg !118
// %1 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !100
// LD: Guess
old_cr = cr(2,0+2*1);
cr(2,0+2*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM
// Check
ASSUME(active[cr(2,0+2*1)] == 2);
ASSUME(cr(2,0+2*1) >= iw(2,0+2*1));
ASSUME(cr(2,0+2*1) >= 0);
ASSUME(cr(2,0+2*1) >= cdy[2]);
ASSUME(cr(2,0+2*1) >= cisb[2]);
ASSUME(cr(2,0+2*1) >= cdl[2]);
ASSUME(cr(2,0+2*1) >= cl[2]);
// Update
creg_r4 = cr(2,0+2*1);
crmax(2,0+2*1) = max(crmax(2,0+2*1),cr(2,0+2*1));
caddr[2] = max(caddr[2],0);
if(cr(2,0+2*1) < cw(2,0+2*1)) {
r4 = buff(2,0+2*1);
} else {
if(pw(2,0+2*1) != co(0+2*1,cr(2,0+2*1))) {
ASSUME(cr(2,0+2*1) >= old_cr);
}
pw(2,0+2*1) = co(0+2*1,cr(2,0+2*1));
r4 = mem(0+2*1,cr(2,0+2*1));
}
ASSUME(creturn[2] >= cr(2,0+2*1));
// call void @llvm.dbg.value(metadata i64 %1, metadata !74, metadata !DIExpression()), !dbg !118
// %conv4 = trunc i64 %1 to i32, !dbg !101
// call void @llvm.dbg.value(metadata i32 %conv4, metadata !71, metadata !DIExpression()), !dbg !109
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2), metadata !76, metadata !DIExpression()), !dbg !121
// %2 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !103
// LD: Guess
old_cr = cr(2,0+2*1);
cr(2,0+2*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM
// Check
ASSUME(active[cr(2,0+2*1)] == 2);
ASSUME(cr(2,0+2*1) >= iw(2,0+2*1));
ASSUME(cr(2,0+2*1) >= 0);
ASSUME(cr(2,0+2*1) >= cdy[2]);
ASSUME(cr(2,0+2*1) >= cisb[2]);
ASSUME(cr(2,0+2*1) >= cdl[2]);
ASSUME(cr(2,0+2*1) >= cl[2]);
// Update
creg_r5 = cr(2,0+2*1);
crmax(2,0+2*1) = max(crmax(2,0+2*1),cr(2,0+2*1));
caddr[2] = max(caddr[2],0);
if(cr(2,0+2*1) < cw(2,0+2*1)) {
r5 = buff(2,0+2*1);
} else {
if(pw(2,0+2*1) != co(0+2*1,cr(2,0+2*1))) {
ASSUME(cr(2,0+2*1) >= old_cr);
}
pw(2,0+2*1) = co(0+2*1,cr(2,0+2*1));
r5 = mem(0+2*1,cr(2,0+2*1));
}
ASSUME(creturn[2] >= cr(2,0+2*1));
// call void @llvm.dbg.value(metadata i64 %2, metadata !78, metadata !DIExpression()), !dbg !121
// %conv8 = trunc i64 %2 to i32, !dbg !104
// call void @llvm.dbg.value(metadata i32 %conv8, metadata !75, metadata !DIExpression()), !dbg !109
// %xor9 = xor i32 %conv8, %conv8, !dbg !105
creg_r6 = max(creg_r5,creg_r5);
ASSUME(active[creg_r6] == 2);
r6 = r5 ^ r5;
// call void @llvm.dbg.value(metadata i32 %xor9, metadata !79, metadata !DIExpression()), !dbg !109
// %add11 = add nsw i32 0, %xor9, !dbg !106
creg_r7 = max(0,creg_r6);
ASSUME(active[creg_r7] == 2);
r7 = 0 + r6;
// %idxprom12 = sext i32 %add11 to i64, !dbg !106
// %arrayidx13 = getelementptr inbounds [3 x i64], [3 x i64]* @vars, i64 0, i64 %idxprom12, !dbg !106
r8 = 0+r7*1;
ASSUME(creg_r8 >= 0);
ASSUME(creg_r8 >= creg_r7);
ASSUME(active[creg_r8] == 2);
// call void @llvm.dbg.value(metadata i64* %arrayidx13, metadata !81, metadata !DIExpression()), !dbg !126
// %3 = load atomic i64, i64* %arrayidx13 monotonic, align 8, !dbg !106
// LD: Guess
old_cr = cr(2,r8);
cr(2,r8) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM
// Check
ASSUME(active[cr(2,r8)] == 2);
ASSUME(cr(2,r8) >= iw(2,r8));
ASSUME(cr(2,r8) >= creg_r8);
ASSUME(cr(2,r8) >= cdy[2]);
ASSUME(cr(2,r8) >= cisb[2]);
ASSUME(cr(2,r8) >= cdl[2]);
ASSUME(cr(2,r8) >= cl[2]);
// Update
creg_r9 = cr(2,r8);
crmax(2,r8) = max(crmax(2,r8),cr(2,r8));
caddr[2] = max(caddr[2],creg_r8);
if(cr(2,r8) < cw(2,r8)) {
r9 = buff(2,r8);
} else {
if(pw(2,r8) != co(r8,cr(2,r8))) {
ASSUME(cr(2,r8) >= old_cr);
}
pw(2,r8) = co(r8,cr(2,r8));
r9 = mem(r8,cr(2,r8));
}
ASSUME(creturn[2] >= cr(2,r8));
// call void @llvm.dbg.value(metadata i64 %3, metadata !83, metadata !DIExpression()), !dbg !126
// %conv16 = trunc i64 %3 to i32, !dbg !108
// call void @llvm.dbg.value(metadata i32 %conv16, metadata !80, metadata !DIExpression()), !dbg !109
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !85, metadata !DIExpression()), !dbg !128
// %4 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !110
// LD: Guess
old_cr = cr(2,0);
cr(2,0) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM
// 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]);
// Update
creg_r10 = 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)) {
r10 = buff(2,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));
r10 = mem(0,cr(2,0));
}
ASSUME(creturn[2] >= cr(2,0));
// call void @llvm.dbg.value(metadata i64 %4, metadata !87, metadata !DIExpression()), !dbg !128
// %conv20 = trunc i64 %4 to i32, !dbg !111
// call void @llvm.dbg.value(metadata i32 %conv20, metadata !84, metadata !DIExpression()), !dbg !109
// %cmp = icmp eq i32 %conv, 1, !dbg !112
// %conv21 = zext i1 %cmp to i32, !dbg !112
// call void @llvm.dbg.value(metadata i32 %conv21, metadata !88, metadata !DIExpression()), !dbg !109
// call void @llvm.dbg.value(metadata i64* @atom_1_X0_1, metadata !89, metadata !DIExpression()), !dbg !132
// %5 = zext i32 %conv21 to i64
// call void @llvm.dbg.value(metadata i64 %5, metadata !91, metadata !DIExpression()), !dbg !132
// store atomic i64 %5, i64* @atom_1_X0_1 seq_cst, align 8, !dbg !114
// ST: Guess
iw(2,3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,3);
cw(2,3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,3)] == 2);
ASSUME(active[cw(2,3)] == 2);
ASSUME(sforbid(3,cw(2,3))== 0);
ASSUME(iw(2,3) >= max(creg_r0,0));
ASSUME(iw(2,3) >= 0);
ASSUME(cw(2,3) >= iw(2,3));
ASSUME(cw(2,3) >= old_cw);
ASSUME(cw(2,3) >= cr(2,3));
ASSUME(cw(2,3) >= cl[2]);
ASSUME(cw(2,3) >= cisb[2]);
ASSUME(cw(2,3) >= cdy[2]);
ASSUME(cw(2,3) >= cdl[2]);
ASSUME(cw(2,3) >= cds[2]);
ASSUME(cw(2,3) >= cctrl[2]);
ASSUME(cw(2,3) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,3) = (r0==1);
mem(3,cw(2,3)) = (r0==1);
co(3,cw(2,3))+=1;
delta(3,cw(2,3)) = -1;
ASSUME(creturn[2] >= cw(2,3));
// %cmp25 = icmp eq i32 %conv4, 1, !dbg !115
// %conv26 = zext i1 %cmp25 to i32, !dbg !115
// call void @llvm.dbg.value(metadata i32 %conv26, metadata !92, metadata !DIExpression()), !dbg !109
// call void @llvm.dbg.value(metadata i64* @atom_1_X5_1, metadata !93, metadata !DIExpression()), !dbg !135
// %6 = zext i32 %conv26 to i64
// call void @llvm.dbg.value(metadata i64 %6, metadata !95, metadata !DIExpression()), !dbg !135
// store atomic i64 %6, i64* @atom_1_X5_1 seq_cst, align 8, !dbg !117
// ST: Guess
iw(2,4) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,4);
cw(2,4) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,4)] == 2);
ASSUME(active[cw(2,4)] == 2);
ASSUME(sforbid(4,cw(2,4))== 0);
ASSUME(iw(2,4) >= max(creg_r4,0));
ASSUME(iw(2,4) >= 0);
ASSUME(cw(2,4) >= iw(2,4));
ASSUME(cw(2,4) >= old_cw);
ASSUME(cw(2,4) >= cr(2,4));
ASSUME(cw(2,4) >= cl[2]);
ASSUME(cw(2,4) >= cisb[2]);
ASSUME(cw(2,4) >= cdy[2]);
ASSUME(cw(2,4) >= cdl[2]);
ASSUME(cw(2,4) >= cds[2]);
ASSUME(cw(2,4) >= cctrl[2]);
ASSUME(cw(2,4) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,4) = (r4==1);
mem(4,cw(2,4)) = (r4==1);
co(4,cw(2,4))+=1;
delta(4,cw(2,4)) = -1;
ASSUME(creturn[2] >= cw(2,4));
// %cmp30 = icmp eq i32 %conv8, 1, !dbg !118
// %conv31 = zext i1 %cmp30 to i32, !dbg !118
// call void @llvm.dbg.value(metadata i32 %conv31, metadata !96, metadata !DIExpression()), !dbg !109
// call void @llvm.dbg.value(metadata i64* @atom_1_X6_1, metadata !97, metadata !DIExpression()), !dbg !138
// %7 = zext i32 %conv31 to i64
// call void @llvm.dbg.value(metadata i64 %7, metadata !99, metadata !DIExpression()), !dbg !138
// store atomic i64 %7, i64* @atom_1_X6_1 seq_cst, align 8, !dbg !120
// ST: Guess
iw(2,5) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,5);
cw(2,5) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,5)] == 2);
ASSUME(active[cw(2,5)] == 2);
ASSUME(sforbid(5,cw(2,5))== 0);
ASSUME(iw(2,5) >= max(creg_r5,0));
ASSUME(iw(2,5) >= 0);
ASSUME(cw(2,5) >= iw(2,5));
ASSUME(cw(2,5) >= old_cw);
ASSUME(cw(2,5) >= cr(2,5));
ASSUME(cw(2,5) >= cl[2]);
ASSUME(cw(2,5) >= cisb[2]);
ASSUME(cw(2,5) >= cdy[2]);
ASSUME(cw(2,5) >= cdl[2]);
ASSUME(cw(2,5) >= cds[2]);
ASSUME(cw(2,5) >= cctrl[2]);
ASSUME(cw(2,5) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,5) = (r5==1);
mem(5,cw(2,5)) = (r5==1);
co(5,cw(2,5))+=1;
delta(5,cw(2,5)) = -1;
ASSUME(creturn[2] >= cw(2,5));
// %cmp35 = icmp eq i32 %conv16, 0, !dbg !121
// %conv36 = zext i1 %cmp35 to i32, !dbg !121
// call void @llvm.dbg.value(metadata i32 %conv36, metadata !100, metadata !DIExpression()), !dbg !109
// call void @llvm.dbg.value(metadata i64* @atom_1_X8_0, metadata !101, metadata !DIExpression()), !dbg !141
// %8 = zext i32 %conv36 to i64
// call void @llvm.dbg.value(metadata i64 %8, metadata !103, metadata !DIExpression()), !dbg !141
// store atomic i64 %8, i64* @atom_1_X8_0 seq_cst, align 8, !dbg !123
// ST: Guess
iw(2,6) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,6);
cw(2,6) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,6)] == 2);
ASSUME(active[cw(2,6)] == 2);
ASSUME(sforbid(6,cw(2,6))== 0);
ASSUME(iw(2,6) >= max(creg_r9,0));
ASSUME(iw(2,6) >= 0);
ASSUME(cw(2,6) >= iw(2,6));
ASSUME(cw(2,6) >= old_cw);
ASSUME(cw(2,6) >= cr(2,6));
ASSUME(cw(2,6) >= cl[2]);
ASSUME(cw(2,6) >= cisb[2]);
ASSUME(cw(2,6) >= cdy[2]);
ASSUME(cw(2,6) >= cdl[2]);
ASSUME(cw(2,6) >= cds[2]);
ASSUME(cw(2,6) >= cctrl[2]);
ASSUME(cw(2,6) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,6) = (r9==0);
mem(6,cw(2,6)) = (r9==0);
co(6,cw(2,6))+=1;
delta(6,cw(2,6)) = -1;
ASSUME(creturn[2] >= cw(2,6));
// %cmp40 = icmp eq i32 %conv20, 1, !dbg !124
// %conv41 = zext i1 %cmp40 to i32, !dbg !124
// call void @llvm.dbg.value(metadata i32 %conv41, metadata !104, metadata !DIExpression()), !dbg !109
// call void @llvm.dbg.value(metadata i64* @atom_1_X10_1, metadata !105, metadata !DIExpression()), !dbg !144
// %9 = zext i32 %conv41 to i64
// call void @llvm.dbg.value(metadata i64 %9, metadata !107, metadata !DIExpression()), !dbg !144
// store atomic i64 %9, i64* @atom_1_X10_1 seq_cst, align 8, !dbg !126
// ST: Guess
iw(2,7) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,7);
cw(2,7) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,7)] == 2);
ASSUME(active[cw(2,7)] == 2);
ASSUME(sforbid(7,cw(2,7))== 0);
ASSUME(iw(2,7) >= max(creg_r10,0));
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) = (r10==1);
mem(7,cw(2,7)) = (r10==1);
co(7,cw(2,7))+=1;
delta(7,cw(2,7)) = -1;
ASSUME(creturn[2] >= cw(2,7));
// ret i8* null, !dbg !127
ret_thread_2 = (- 1);
// 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 !149, metadata !DIExpression()), !dbg !154
// br label %label_3, !dbg !48
goto T3BLOCK1;
T3BLOCK1:
// call void @llvm.dbg.label(metadata !153), !dbg !156
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !150, metadata !DIExpression()), !dbg !157
// call void @llvm.dbg.value(metadata i64 1, metadata !152, metadata !DIExpression()), !dbg !157
// store atomic i64 1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !51
// ST: Guess
iw(3,0) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STIW
old_cw = cw(3,0);
cw(3,0) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STCOM
// Check
ASSUME(active[iw(3,0)] == 3);
ASSUME(active[cw(3,0)] == 3);
ASSUME(sforbid(0,cw(3,0))== 0);
ASSUME(iw(3,0) >= 0);
ASSUME(iw(3,0) >= 0);
ASSUME(cw(3,0) >= iw(3,0));
ASSUME(cw(3,0) >= old_cw);
ASSUME(cw(3,0) >= cr(3,0));
ASSUME(cw(3,0) >= cl[3]);
ASSUME(cw(3,0) >= cisb[3]);
ASSUME(cw(3,0) >= cdy[3]);
ASSUME(cw(3,0) >= cdl[3]);
ASSUME(cw(3,0) >= cds[3]);
ASSUME(cw(3,0) >= cctrl[3]);
ASSUME(cw(3,0) >= caddr[3]);
// Update
caddr[3] = max(caddr[3],0);
buff(3,0) = 1;
mem(0,cw(3,0)) = 1;
co(0,cw(3,0))+=1;
delta(0,cw(3,0)) = -1;
ASSUME(creturn[3] >= cw(3,0));
// ret i8* null, !dbg !52
ret_thread_3 = (- 1);
// 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
// call void @llvm.dbg.value(metadata i32 %argc, metadata !167, metadata !DIExpression()), !dbg !241
// call void @llvm.dbg.value(metadata i8** %argv, metadata !168, metadata !DIExpression()), !dbg !241
// %0 = bitcast i64* %thr0 to i8*, !dbg !121
// call void @llvm.lifetime.start.p0i8(i64 8, i8* %0) #7, !dbg !121
// call void @llvm.dbg.declare(metadata i64* %thr0, metadata !169, metadata !DIExpression()), !dbg !243
// %1 = bitcast i64* %thr1 to i8*, !dbg !123
// call void @llvm.lifetime.start.p0i8(i64 8, i8* %1) #7, !dbg !123
// call void @llvm.dbg.declare(metadata i64* %thr1, metadata !173, metadata !DIExpression()), !dbg !245
// %2 = bitcast i64* %thr2 to i8*, !dbg !125
// call void @llvm.lifetime.start.p0i8(i64 8, i8* %2) #7, !dbg !125
// call void @llvm.dbg.declare(metadata i64* %thr2, metadata !174, metadata !DIExpression()), !dbg !247
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2), metadata !175, metadata !DIExpression()), !dbg !248
// call void @llvm.dbg.value(metadata i64 0, metadata !177, metadata !DIExpression()), !dbg !248
// store atomic i64 0, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2) monotonic, align 8, !dbg !128
// ST: Guess
iw(0,0+2*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,0+2*1);
cw(0,0+2*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// 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 ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !178, metadata !DIExpression()), !dbg !250
// call void @llvm.dbg.value(metadata i64 0, metadata !180, metadata !DIExpression()), !dbg !250
// store atomic i64 0, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !130
// ST: Guess
iw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,0+1*1);
cw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// 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 ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !181, metadata !DIExpression()), !dbg !252
// call void @llvm.dbg.value(metadata i64 0, metadata !183, metadata !DIExpression()), !dbg !252
// store atomic i64 0, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !132
// ST: Guess
iw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,0);
cw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// 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));
// call void @llvm.dbg.value(metadata i64* @atom_1_X0_1, metadata !184, metadata !DIExpression()), !dbg !254
// call void @llvm.dbg.value(metadata i64 0, metadata !186, metadata !DIExpression()), !dbg !254
// store atomic i64 0, i64* @atom_1_X0_1 monotonic, align 8, !dbg !134
// ST: Guess
iw(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,3);
cw(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// Check
ASSUME(active[iw(0,3)] == 0);
ASSUME(active[cw(0,3)] == 0);
ASSUME(sforbid(3,cw(0,3))== 0);
ASSUME(iw(0,3) >= 0);
ASSUME(iw(0,3) >= 0);
ASSUME(cw(0,3) >= iw(0,3));
ASSUME(cw(0,3) >= old_cw);
ASSUME(cw(0,3) >= cr(0,3));
ASSUME(cw(0,3) >= cl[0]);
ASSUME(cw(0,3) >= cisb[0]);
ASSUME(cw(0,3) >= cdy[0]);
ASSUME(cw(0,3) >= cdl[0]);
ASSUME(cw(0,3) >= cds[0]);
ASSUME(cw(0,3) >= cctrl[0]);
ASSUME(cw(0,3) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,3) = 0;
mem(3,cw(0,3)) = 0;
co(3,cw(0,3))+=1;
delta(3,cw(0,3)) = -1;
ASSUME(creturn[0] >= cw(0,3));
// call void @llvm.dbg.value(metadata i64* @atom_1_X5_1, metadata !187, metadata !DIExpression()), !dbg !256
// call void @llvm.dbg.value(metadata i64 0, metadata !189, metadata !DIExpression()), !dbg !256
// store atomic i64 0, i64* @atom_1_X5_1 monotonic, align 8, !dbg !136
// ST: Guess
iw(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,4);
cw(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// Check
ASSUME(active[iw(0,4)] == 0);
ASSUME(active[cw(0,4)] == 0);
ASSUME(sforbid(4,cw(0,4))== 0);
ASSUME(iw(0,4) >= 0);
ASSUME(iw(0,4) >= 0);
ASSUME(cw(0,4) >= iw(0,4));
ASSUME(cw(0,4) >= old_cw);
ASSUME(cw(0,4) >= cr(0,4));
ASSUME(cw(0,4) >= cl[0]);
ASSUME(cw(0,4) >= cisb[0]);
ASSUME(cw(0,4) >= cdy[0]);
ASSUME(cw(0,4) >= cdl[0]);
ASSUME(cw(0,4) >= cds[0]);
ASSUME(cw(0,4) >= cctrl[0]);
ASSUME(cw(0,4) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,4) = 0;
mem(4,cw(0,4)) = 0;
co(4,cw(0,4))+=1;
delta(4,cw(0,4)) = -1;
ASSUME(creturn[0] >= cw(0,4));
// call void @llvm.dbg.value(metadata i64* @atom_1_X6_1, metadata !190, metadata !DIExpression()), !dbg !258
// call void @llvm.dbg.value(metadata i64 0, metadata !192, metadata !DIExpression()), !dbg !258
// store atomic i64 0, i64* @atom_1_X6_1 monotonic, align 8, !dbg !138
// ST: Guess
iw(0,5) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,5);
cw(0,5) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// Check
ASSUME(active[iw(0,5)] == 0);
ASSUME(active[cw(0,5)] == 0);
ASSUME(sforbid(5,cw(0,5))== 0);
ASSUME(iw(0,5) >= 0);
ASSUME(iw(0,5) >= 0);
ASSUME(cw(0,5) >= iw(0,5));
ASSUME(cw(0,5) >= old_cw);
ASSUME(cw(0,5) >= cr(0,5));
ASSUME(cw(0,5) >= cl[0]);
ASSUME(cw(0,5) >= cisb[0]);
ASSUME(cw(0,5) >= cdy[0]);
ASSUME(cw(0,5) >= cdl[0]);
ASSUME(cw(0,5) >= cds[0]);
ASSUME(cw(0,5) >= cctrl[0]);
ASSUME(cw(0,5) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,5) = 0;
mem(5,cw(0,5)) = 0;
co(5,cw(0,5))+=1;
delta(5,cw(0,5)) = -1;
ASSUME(creturn[0] >= cw(0,5));
// call void @llvm.dbg.value(metadata i64* @atom_1_X8_0, metadata !193, metadata !DIExpression()), !dbg !260
// call void @llvm.dbg.value(metadata i64 0, metadata !195, metadata !DIExpression()), !dbg !260
// store atomic i64 0, i64* @atom_1_X8_0 monotonic, align 8, !dbg !140
// ST: Guess
iw(0,6) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,6);
cw(0,6) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// 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));
// call void @llvm.dbg.value(metadata i64* @atom_1_X10_1, metadata !196, metadata !DIExpression()), !dbg !262
// call void @llvm.dbg.value(metadata i64 0, metadata !198, metadata !DIExpression()), !dbg !262
// store atomic i64 0, i64* @atom_1_X10_1 monotonic, align 8, !dbg !142
// ST: Guess
iw(0,7) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,7);
cw(0,7) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// 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));
// %call = call i32 @pthread_create(i64* noundef %thr0, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t0, i8* noundef null) #7, !dbg !143
// 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,5+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,7+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,5+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,7+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]);
// %call15 = call i32 @pthread_create(i64* noundef %thr1, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t1, i8* noundef null) #7, !dbg !144
// 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,5+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,7+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,5+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,7+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]);
// %call16 = call i32 @pthread_create(i64* noundef %thr2, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t2, i8* noundef null) #7, !dbg !145
// 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,5+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,7+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,5+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,7+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]);
// %3 = load i64, i64* %thr0, align 8, !dbg !146, !tbaa !147
// LD: Guess
old_cr = cr(0,8);
cr(0,8) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// 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_r12 = 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)) {
r12 = buff(0,8);
} else {
if(pw(0,8) != co(8,cr(0,8))) {
ASSUME(cr(0,8) >= old_cr);
}
pw(0,8) = co(8,cr(0,8));
r12 = mem(8,cr(0,8));
}
ASSUME(creturn[0] >= cr(0,8));
// %call17 = call i32 @pthread_join(i64 noundef %3, i8** noundef null), !dbg !151
// 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,5+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,7+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,5+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,7+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]);
// %4 = load i64, i64* %thr1, align 8, !dbg !152, !tbaa !147
// LD: Guess
old_cr = cr(0,9);
cr(0,9) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// 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_r13 = 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)) {
r13 = buff(0,9);
} else {
if(pw(0,9) != co(9,cr(0,9))) {
ASSUME(cr(0,9) >= old_cr);
}
pw(0,9) = co(9,cr(0,9));
r13 = mem(9,cr(0,9));
}
ASSUME(creturn[0] >= cr(0,9));
// %call18 = call i32 @pthread_join(i64 noundef %4, i8** noundef null), !dbg !153
// 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,5+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,7+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,5+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,7+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]);
// %5 = load i64, i64* %thr2, align 8, !dbg !154, !tbaa !147
// LD: Guess
old_cr = cr(0,10);
cr(0,10) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// 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_r14 = 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)) {
r14 = buff(0,10);
} else {
if(pw(0,10) != co(10,cr(0,10))) {
ASSUME(cr(0,10) >= old_cr);
}
pw(0,10) = co(10,cr(0,10));
r14 = mem(10,cr(0,10));
}
ASSUME(creturn[0] >= cr(0,10));
// %call19 = call i32 @pthread_join(i64 noundef %5, i8** noundef null), !dbg !155
// 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,5+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,7+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,5+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,7+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]);
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0), metadata !200, metadata !DIExpression()), !dbg !277
// %6 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 0) seq_cst, align 8, !dbg !157
// LD: Guess
old_cr = cr(0,0);
cr(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,0)] == 0);
ASSUME(cr(0,0) >= iw(0,0));
ASSUME(cr(0,0) >= 0);
ASSUME(cr(0,0) >= cdy[0]);
ASSUME(cr(0,0) >= cisb[0]);
ASSUME(cr(0,0) >= cdl[0]);
ASSUME(cr(0,0) >= cl[0]);
// Update
creg_r15 = cr(0,0);
crmax(0,0) = max(crmax(0,0),cr(0,0));
caddr[0] = max(caddr[0],0);
if(cr(0,0) < cw(0,0)) {
r15 = buff(0,0);
} else {
if(pw(0,0) != co(0,cr(0,0))) {
ASSUME(cr(0,0) >= old_cr);
}
pw(0,0) = co(0,cr(0,0));
r15 = mem(0,cr(0,0));
}
ASSUME(creturn[0] >= cr(0,0));
// call void @llvm.dbg.value(metadata i64 %6, metadata !202, metadata !DIExpression()), !dbg !277
// %conv = trunc i64 %6 to i32, !dbg !158
// call void @llvm.dbg.value(metadata i32 %conv, metadata !199, metadata !DIExpression()), !dbg !241
// %cmp = icmp eq i32 %conv, 2, !dbg !159
// %conv20 = zext i1 %cmp to i32, !dbg !159
// call void @llvm.dbg.value(metadata i32 %conv20, metadata !203, metadata !DIExpression()), !dbg !241
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1), metadata !205, metadata !DIExpression()), !dbg !281
// %7 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 1) seq_cst, align 8, !dbg !161
// LD: Guess
old_cr = cr(0,0+1*1);
cr(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,0+1*1)] == 0);
ASSUME(cr(0,0+1*1) >= iw(0,0+1*1));
ASSUME(cr(0,0+1*1) >= 0);
ASSUME(cr(0,0+1*1) >= cdy[0]);
ASSUME(cr(0,0+1*1) >= cisb[0]);
ASSUME(cr(0,0+1*1) >= cdl[0]);
ASSUME(cr(0,0+1*1) >= cl[0]);
// Update
creg_r16 = cr(0,0+1*1);
crmax(0,0+1*1) = max(crmax(0,0+1*1),cr(0,0+1*1));
caddr[0] = max(caddr[0],0);
if(cr(0,0+1*1) < cw(0,0+1*1)) {
r16 = buff(0,0+1*1);
} else {
if(pw(0,0+1*1) != co(0+1*1,cr(0,0+1*1))) {
ASSUME(cr(0,0+1*1) >= old_cr);
}
pw(0,0+1*1) = co(0+1*1,cr(0,0+1*1));
r16 = mem(0+1*1,cr(0,0+1*1));
}
ASSUME(creturn[0] >= cr(0,0+1*1));
// call void @llvm.dbg.value(metadata i64 %7, metadata !207, metadata !DIExpression()), !dbg !281
// %conv24 = trunc i64 %7 to i32, !dbg !162
// call void @llvm.dbg.value(metadata i32 %conv24, metadata !204, metadata !DIExpression()), !dbg !241
// %cmp25 = icmp eq i32 %conv24, 1, !dbg !163
// %conv26 = zext i1 %cmp25 to i32, !dbg !163
// call void @llvm.dbg.value(metadata i32 %conv26, metadata !208, metadata !DIExpression()), !dbg !241
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2), metadata !210, metadata !DIExpression()), !dbg !285
// %8 = load atomic i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @vars, i64 0, i64 2) seq_cst, align 8, !dbg !165
// LD: Guess
old_cr = cr(0,0+2*1);
cr(0,0+2*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,0+2*1)] == 0);
ASSUME(cr(0,0+2*1) >= iw(0,0+2*1));
ASSUME(cr(0,0+2*1) >= 0);
ASSUME(cr(0,0+2*1) >= cdy[0]);
ASSUME(cr(0,0+2*1) >= cisb[0]);
ASSUME(cr(0,0+2*1) >= cdl[0]);
ASSUME(cr(0,0+2*1) >= cl[0]);
// Update
creg_r17 = cr(0,0+2*1);
crmax(0,0+2*1) = max(crmax(0,0+2*1),cr(0,0+2*1));
caddr[0] = max(caddr[0],0);
if(cr(0,0+2*1) < cw(0,0+2*1)) {
r17 = buff(0,0+2*1);
} else {
if(pw(0,0+2*1) != co(0+2*1,cr(0,0+2*1))) {
ASSUME(cr(0,0+2*1) >= old_cr);
}
pw(0,0+2*1) = co(0+2*1,cr(0,0+2*1));
r17 = mem(0+2*1,cr(0,0+2*1));
}
ASSUME(creturn[0] >= cr(0,0+2*1));
// call void @llvm.dbg.value(metadata i64 %8, metadata !212, metadata !DIExpression()), !dbg !285
// %conv30 = trunc i64 %8 to i32, !dbg !166
// call void @llvm.dbg.value(metadata i32 %conv30, metadata !209, metadata !DIExpression()), !dbg !241
// %cmp31 = icmp eq i32 %conv30, 1, !dbg !167
// %conv32 = zext i1 %cmp31 to i32, !dbg !167
// call void @llvm.dbg.value(metadata i32 %conv32, metadata !213, metadata !DIExpression()), !dbg !241
// call void @llvm.dbg.value(metadata i64* @atom_1_X0_1, metadata !215, metadata !DIExpression()), !dbg !289
// %9 = load atomic i64, i64* @atom_1_X0_1 seq_cst, align 8, !dbg !169
// LD: Guess
old_cr = cr(0,3);
cr(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,3)] == 0);
ASSUME(cr(0,3) >= iw(0,3));
ASSUME(cr(0,3) >= 0);
ASSUME(cr(0,3) >= cdy[0]);
ASSUME(cr(0,3) >= cisb[0]);
ASSUME(cr(0,3) >= cdl[0]);
ASSUME(cr(0,3) >= cl[0]);
// Update
creg_r18 = cr(0,3);
crmax(0,3) = max(crmax(0,3),cr(0,3));
caddr[0] = max(caddr[0],0);
if(cr(0,3) < cw(0,3)) {
r18 = buff(0,3);
} else {
if(pw(0,3) != co(3,cr(0,3))) {
ASSUME(cr(0,3) >= old_cr);
}
pw(0,3) = co(3,cr(0,3));
r18 = mem(3,cr(0,3));
}
ASSUME(creturn[0] >= cr(0,3));
// call void @llvm.dbg.value(metadata i64 %9, metadata !217, metadata !DIExpression()), !dbg !289
// %conv36 = trunc i64 %9 to i32, !dbg !170
// call void @llvm.dbg.value(metadata i32 %conv36, metadata !214, metadata !DIExpression()), !dbg !241
// call void @llvm.dbg.value(metadata i64* @atom_1_X5_1, metadata !219, metadata !DIExpression()), !dbg !292
// %10 = load atomic i64, i64* @atom_1_X5_1 seq_cst, align 8, !dbg !172
// LD: Guess
old_cr = cr(0,4);
cr(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,4)] == 0);
ASSUME(cr(0,4) >= iw(0,4));
ASSUME(cr(0,4) >= 0);
ASSUME(cr(0,4) >= cdy[0]);
ASSUME(cr(0,4) >= cisb[0]);
ASSUME(cr(0,4) >= cdl[0]);
ASSUME(cr(0,4) >= cl[0]);
// Update
creg_r19 = cr(0,4);
crmax(0,4) = max(crmax(0,4),cr(0,4));
caddr[0] = max(caddr[0],0);
if(cr(0,4) < cw(0,4)) {
r19 = buff(0,4);
} else {
if(pw(0,4) != co(4,cr(0,4))) {
ASSUME(cr(0,4) >= old_cr);
}
pw(0,4) = co(4,cr(0,4));
r19 = mem(4,cr(0,4));
}
ASSUME(creturn[0] >= cr(0,4));
// call void @llvm.dbg.value(metadata i64 %10, metadata !221, metadata !DIExpression()), !dbg !292
// %conv40 = trunc i64 %10 to i32, !dbg !173
// call void @llvm.dbg.value(metadata i32 %conv40, metadata !218, metadata !DIExpression()), !dbg !241
// call void @llvm.dbg.value(metadata i64* @atom_1_X6_1, metadata !223, metadata !DIExpression()), !dbg !295
// %11 = load atomic i64, i64* @atom_1_X6_1 seq_cst, align 8, !dbg !175
// LD: Guess
old_cr = cr(0,5);
cr(0,5) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,5)] == 0);
ASSUME(cr(0,5) >= iw(0,5));
ASSUME(cr(0,5) >= 0);
ASSUME(cr(0,5) >= cdy[0]);
ASSUME(cr(0,5) >= cisb[0]);
ASSUME(cr(0,5) >= cdl[0]);
ASSUME(cr(0,5) >= cl[0]);
// Update
creg_r20 = cr(0,5);
crmax(0,5) = max(crmax(0,5),cr(0,5));
caddr[0] = max(caddr[0],0);
if(cr(0,5) < cw(0,5)) {
r20 = buff(0,5);
} else {
if(pw(0,5) != co(5,cr(0,5))) {
ASSUME(cr(0,5) >= old_cr);
}
pw(0,5) = co(5,cr(0,5));
r20 = mem(5,cr(0,5));
}
ASSUME(creturn[0] >= cr(0,5));
// call void @llvm.dbg.value(metadata i64 %11, metadata !225, metadata !DIExpression()), !dbg !295
// %conv44 = trunc i64 %11 to i32, !dbg !176
// call void @llvm.dbg.value(metadata i32 %conv44, metadata !222, metadata !DIExpression()), !dbg !241
// call void @llvm.dbg.value(metadata i64* @atom_1_X8_0, metadata !227, metadata !DIExpression()), !dbg !298
// %12 = load atomic i64, i64* @atom_1_X8_0 seq_cst, align 8, !dbg !178
// LD: Guess
old_cr = cr(0,6);
cr(0,6) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// 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_r21 = 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)) {
r21 = buff(0,6);
} else {
if(pw(0,6) != co(6,cr(0,6))) {
ASSUME(cr(0,6) >= old_cr);
}
pw(0,6) = co(6,cr(0,6));
r21 = mem(6,cr(0,6));
}
ASSUME(creturn[0] >= cr(0,6));
// call void @llvm.dbg.value(metadata i64 %12, metadata !229, metadata !DIExpression()), !dbg !298
// %conv48 = trunc i64 %12 to i32, !dbg !179
// call void @llvm.dbg.value(metadata i32 %conv48, metadata !226, metadata !DIExpression()), !dbg !241
// call void @llvm.dbg.value(metadata i64* @atom_1_X10_1, metadata !231, metadata !DIExpression()), !dbg !301
// %13 = load atomic i64, i64* @atom_1_X10_1 seq_cst, align 8, !dbg !181
// LD: Guess
old_cr = cr(0,7);
cr(0,7) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// 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_r22 = 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)) {
r22 = buff(0,7);
} else {
if(pw(0,7) != co(7,cr(0,7))) {
ASSUME(cr(0,7) >= old_cr);
}
pw(0,7) = co(7,cr(0,7));
r22 = mem(7,cr(0,7));
}
ASSUME(creturn[0] >= cr(0,7));
// call void @llvm.dbg.value(metadata i64 %13, metadata !233, metadata !DIExpression()), !dbg !301
// %conv52 = trunc i64 %13 to i32, !dbg !182
// call void @llvm.dbg.value(metadata i32 %conv52, metadata !230, metadata !DIExpression()), !dbg !241
// %and = and i32 %conv48, %conv52, !dbg !183
creg_r23 = max(creg_r21,creg_r22);
ASSUME(active[creg_r23] == 0);
r23 = r21 & r22;
// call void @llvm.dbg.value(metadata i32 %and, metadata !234, metadata !DIExpression()), !dbg !241
// %and53 = and i32 %conv44, %and, !dbg !184
creg_r24 = max(creg_r20,creg_r23);
ASSUME(active[creg_r24] == 0);
r24 = r20 & r23;
// call void @llvm.dbg.value(metadata i32 %and53, metadata !235, metadata !DIExpression()), !dbg !241
// %and54 = and i32 %conv40, %and53, !dbg !185
creg_r25 = max(creg_r19,creg_r24);
ASSUME(active[creg_r25] == 0);
r25 = r19 & r24;
// call void @llvm.dbg.value(metadata i32 %and54, metadata !236, metadata !DIExpression()), !dbg !241
// %and55 = and i32 %conv36, %and54, !dbg !186
creg_r26 = max(creg_r18,creg_r25);
ASSUME(active[creg_r26] == 0);
r26 = r18 & r25;
// call void @llvm.dbg.value(metadata i32 %and55, metadata !237, metadata !DIExpression()), !dbg !241
// %and56 = and i32 %conv32, %and55, !dbg !187
creg_r27 = max(max(creg_r17,0),creg_r26);
ASSUME(active[creg_r27] == 0);
r27 = (r17==1) & r26;
// call void @llvm.dbg.value(metadata i32 %and56, metadata !238, metadata !DIExpression()), !dbg !241
// %and57 = and i32 %conv26, %and56, !dbg !188
creg_r28 = max(max(creg_r16,0),creg_r27);
ASSUME(active[creg_r28] == 0);
r28 = (r16==1) & r27;
// call void @llvm.dbg.value(metadata i32 %and57, metadata !239, metadata !DIExpression()), !dbg !241
// %and58 = and i32 %conv20, %and57, !dbg !189
creg_r29 = max(max(creg_r15,0),creg_r28);
ASSUME(active[creg_r29] == 0);
r29 = (r15==2) & r28;
// call void @llvm.dbg.value(metadata i32 %and58, metadata !240, metadata !DIExpression()), !dbg !241
// %cmp59 = icmp eq i32 %and58, 1, !dbg !190
// br i1 %cmp59, label %if.then, label %if.end, !dbg !192
old_cctrl = cctrl[0];
cctrl[0] = get_rng(0,NCONTEXT-1);
ASSUME(cctrl[0] >= old_cctrl);
ASSUME(cctrl[0] >= creg_r29);
ASSUME(cctrl[0] >= 0);
if((r29==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 ([120 x i8], [120 x i8]* @.str.1, i64 0, i64 0), i32 noundef 98, i8* noundef getelementptr inbounds ([23 x i8], [23 x i8]* @__PRETTY_FUNCTION__.main, i64 0, i64 0)) #8, !dbg !193
// unreachable, !dbg !193
r30 = 1;
T0BLOCK2:
// %14 = bitcast i64* %thr2 to i8*, !dbg !196
// call void @llvm.lifetime.end.p0i8(i64 8, i8* %14) #7, !dbg !196
// %15 = bitcast i64* %thr1 to i8*, !dbg !196
// call void @llvm.lifetime.end.p0i8(i64 8, i8* %15) #7, !dbg !196
// %16 = bitcast i64* %thr0 to i8*, !dbg !196
// call void @llvm.lifetime.end.p0i8(i64 8, i8* %16) #7, !dbg !196
// ret i32 0, !dbg !197
ret_thread_0 = 0;
ASSERT(r30== 0);
}
| [
"tuan-phong.ngo@it.uu.se"
] | tuan-phong.ngo@it.uu.se |
994116cfc4d757435d5a0e26b70d093ca67d2e2f | a3d6556180e74af7b555f8d47d3fea55b94bcbda | /ui/accessibility/platform/fuchsia/semantic_provider_unittest.cc | ba85f513d2ca7724976803c2c0f1f3b5a247af44 | [
"BSD-3-Clause"
] | permissive | chromium/chromium | aaa9eda10115b50b0616d2f1aed5ef35d1d779d6 | a401d6cf4f7bf0e2d2e964c512ebb923c3d8832c | refs/heads/main | 2023-08-24T00:35:12.585945 | 2023-08-23T22:01:11 | 2023-08-23T22:01:11 | 120,360,765 | 17,408 | 7,102 | BSD-3-Clause | 2023-09-10T23:44:27 | 2018-02-05T20:55:32 | null | UTF-8 | C++ | false | false | 20,997 | cc | // Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "semantic_provider_impl.h"
#include <fidl/fuchsia.accessibility.semantics/cpp/fidl.h>
#include <fidl/fuchsia.ui.views/cpp/hlcpp_conversion.h>
#include <lib/async/default.h>
#include <lib/ui/scenic/cpp/view_ref_pair.h>
#include <algorithm>
#include <memory>
#include "base/fuchsia/fidl_event_handler.h"
#include "base/fuchsia/scoped_service_binding.h"
#include "base/fuchsia/test_component_context_for_process.h"
#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace ui {
namespace {
using fuchsia_accessibility_semantics::Node;
class AXFuchsiaSemanticProviderDelegate
: public AXFuchsiaSemanticProvider::Delegate {
public:
AXFuchsiaSemanticProviderDelegate() = default;
~AXFuchsiaSemanticProviderDelegate() override = default;
bool OnSemanticsManagerConnectionClosed(zx_status_t status) override {
on_semantics_manager_connection_closed_called_ = true;
return true;
}
bool OnAccessibilityAction(
uint32_t node_id,
fuchsia_accessibility_semantics::Action action) override {
on_accessibility_action_called_ = true;
on_accessibility_action_node_id_ = node_id;
on_accessibility_action_action_ = std::move(action);
return true;
}
void OnHitTest(fuchsia_math::PointF point,
HitTestCallback callback) override {
on_hit_test_called_ = true;
on_hit_test_point_ = std::move(point);
std::move(callback).Run({});
}
void OnSemanticsEnabled(bool enabled) override {
on_semantics_enabled_called_ = true;
}
bool on_semantics_manager_connection_closed_called_;
bool on_accessibility_action_called_;
uint32_t on_accessibility_action_node_id_ = 10000000;
fuchsia_accessibility_semantics::Action on_accessibility_action_action_;
bool on_hit_test_called_;
fuchsia_math::PointF on_hit_test_point_;
bool on_semantics_enabled_called_;
};
// Returns a semantic tree of the form:
// (0 (1 2 (3 4 (5))))
std::vector<Node> TreeNodes() {
Node node_0;
node_0.node_id(0u);
node_0.child_ids({{1u, 2u}});
Node node_1;
node_1.node_id(1u);
Node node_2;
node_2.node_id(2u);
node_2.child_ids({{3u, 4u}});
Node node_3;
node_3.node_id(3u);
Node node_4;
node_4.node_id(4u);
node_4.child_ids({{5u}});
Node node_5;
node_5.node_id(5u);
std::vector<Node> update;
update.push_back(std::move(node_0));
update.push_back(std::move(node_1));
update.push_back(std::move(node_2));
update.push_back(std::move(node_3));
update.push_back(std::move(node_4));
update.push_back(std::move(node_5));
return update;
}
class AXFuchsiaSemanticProviderTest
: public ::testing::Test,
public fidl::Server<fuchsia_accessibility_semantics::SemanticsManager>,
public fidl::Server<fuchsia_accessibility_semantics::SemanticTree> {
public:
AXFuchsiaSemanticProviderTest()
: semantics_manager_bindings_(test_context_.additional_services(), this),
semantic_listener_error_handler_(
base::BindRepeating([](fidl::UnbindInfo info) { ADD_FAILURE(); })) {
}
~AXFuchsiaSemanticProviderTest() override = default;
AXFuchsiaSemanticProviderTest(const AXFuchsiaSemanticProviderTest&) = delete;
AXFuchsiaSemanticProviderTest& operator=(
const AXFuchsiaSemanticProviderTest&) = delete;
void SetUp() override {
auto view_ref_pair = scenic::ViewRefPair::New();
delegate_ = std::make_unique<AXFuchsiaSemanticProviderDelegate>();
semantic_provider_ = std::make_unique<ui::AXFuchsiaSemanticProviderImpl>(
fidl::HLCPPToNatural(std::move(view_ref_pair.view_ref)),
delegate_.get());
// Spin the loop to allow registration with the SemanticsManager to be
// processed.
base::RunLoop().RunUntilIdle();
}
protected:
// fuchsia_accessibility_semantics::SemanticsManager implementation.
void RegisterViewForSemantics(
AXFuchsiaSemanticProviderTest::RegisterViewForSemanticsRequest& request,
AXFuchsiaSemanticProviderTest::RegisterViewForSemanticsCompleter::Sync&
completer) final {
semantic_listener_.Bind(std::move(request.listener()),
async_get_default_dispatcher(),
&semantic_listener_error_handler_);
semantic_tree_binding_.emplace(async_get_default_dispatcher(),
std::move(request.semantic_tree_request()),
this, fidl::kIgnoreBindingClosure);
semantic_listener_->OnSemanticsModeChanged({{.updates_enabled = true}})
.Then(
[](fidl::Result<fuchsia_accessibility_semantics::SemanticListener::
OnSemanticsModeChanged>& result) {
ASSERT_TRUE(result.is_ok());
});
}
// fuchsia_accessibility_semantics::SemanticTree implementation.
void UpdateSemanticNodes(
AXFuchsiaSemanticProviderTest::UpdateSemanticNodesRequest& request,
AXFuchsiaSemanticProviderTest::UpdateSemanticNodesCompleter::Sync&
ignored_completer) final {
num_update_semantic_nodes_called_++;
node_updates_.push_back(std::move(request.nodes()));
}
void DeleteSemanticNodes(
AXFuchsiaSemanticProviderTest::DeleteSemanticNodesRequest& request,
AXFuchsiaSemanticProviderTest::DeleteSemanticNodesCompleter::Sync&
ignored_completer) final {
num_delete_semantic_nodes_called_++;
}
void CommitUpdates(
AXFuchsiaSemanticProviderTest::CommitUpdatesCompleter::Sync& completer)
final {
completer.Reply();
}
void SendSemanticEvent(
AXFuchsiaSemanticProviderTest::SendSemanticEventRequest& request,
AXFuchsiaSemanticProviderTest::SendSemanticEventCompleter::Sync&
completer) override {
completer.Reply();
}
const std::vector<std::vector<fuchsia_accessibility_semantics::Node>>&
node_updates() {
return node_updates_;
}
// Required because of |test_context_|.
base::test::SingleThreadTaskEnvironment task_environment_{
base::test::SingleThreadTaskEnvironment::MainThreadType::IO};
base::TestComponentContextForProcess test_context_;
// Binding to fake Semantics Manager Fuchsia service, implemented by this test
// class.
base::ScopedNaturalServiceBinding<
fuchsia_accessibility_semantics::SemanticsManager>
semantics_manager_bindings_;
uint32_t num_update_semantic_nodes_called_ = 0;
uint32_t num_delete_semantic_nodes_called_ = 0;
base::RepeatingClosure on_commit_;
fidl::Client<fuchsia_accessibility_semantics::SemanticListener>
semantic_listener_;
base::FidlErrorEventHandler<fuchsia_accessibility_semantics::SemanticListener>
semantic_listener_error_handler_;
absl::optional<
fidl::ServerBinding<fuchsia_accessibility_semantics::SemanticTree>>
semantic_tree_binding_;
std::unique_ptr<AXFuchsiaSemanticProviderDelegate> delegate_;
std::unique_ptr<ui::AXFuchsiaSemanticProviderImpl> semantic_provider_;
// Node updates batched per API call to UpdateSemanticNodes().
std::vector<std::vector<fuchsia_accessibility_semantics::Node>> node_updates_;
};
TEST_F(AXFuchsiaSemanticProviderTest, HandlesOnSemanticsConnectionClosed) {
ASSERT_TRUE(semantic_tree_binding_.has_value());
semantic_tree_binding_->Close(ZX_ERR_PEER_CLOSED);
// Spin the loop to allow the channel-close to be handled.
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(delegate_->on_semantics_manager_connection_closed_called_);
}
TEST_F(AXFuchsiaSemanticProviderTest, HandlesOnAccessibilityAction) {
bool action_handled = false;
semantic_listener_
->OnAccessibilityActionRequested({{
.node_id = 1u,
.action = fuchsia_accessibility_semantics::Action::kDefault,
}})
.Then([&action_handled](
fidl::Result<fuchsia_accessibility_semantics::SemanticListener::
OnAccessibilityActionRequested>& result) {
ASSERT_TRUE(result.is_ok());
action_handled = result->handled();
});
// Spin the loop to handle the request, and receive the response.
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(action_handled);
EXPECT_TRUE(delegate_->on_accessibility_action_called_);
EXPECT_EQ(delegate_->on_accessibility_action_node_id_, 1u);
EXPECT_EQ(delegate_->on_accessibility_action_action_,
fuchsia_accessibility_semantics::Action::kDefault);
}
TEST_F(AXFuchsiaSemanticProviderTest, HandlesOnHitTest) {
semantic_provider_->SetPixelScale(2.f);
// Note that the point is sent here and will be converted according to the
// device scale used. Only then it gets sent to the handler, which receives
// the value already with the proper scaling.
semantic_listener_
->HitTest({{
.local_point = {{.x = 4, .y = 6}},
}})
.Then([](fidl::Result<
fuchsia_accessibility_semantics::SemanticListener::HitTest>&
result) { ASSERT_TRUE(result.is_ok()); });
// Spin the loop to allow the call to be processed.
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(delegate_->on_hit_test_called_);
EXPECT_EQ(delegate_->on_hit_test_point_.x(), 8.0);
EXPECT_EQ(delegate_->on_hit_test_point_.y(), 12.0);
}
// Verify that the AXFuchsiaSemanticProviderImpl constructor triggered the call
// chain RegisterViewForSemantics -> OnSemanticsModeChanged ->
// OnSemanticsEnabled.
TEST_F(AXFuchsiaSemanticProviderTest, HandlesOnSemanticsEnabled) {
EXPECT_TRUE(delegate_->on_semantics_enabled_called_);
}
TEST_F(AXFuchsiaSemanticProviderTest, SendsRootOnly) {
Node root;
root.node_id(0u);
EXPECT_TRUE(semantic_provider_->Update(std::move(root)));
// Spin the loop to process the update call.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest, SendsNodesFromRootToLeaves) {
auto tree_nodes = TreeNodes();
for (auto& node : tree_nodes) {
EXPECT_TRUE(semantic_provider_->Update(std::move(node)));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest, SendsNodesFromLeavesToRoot) {
auto nodes = TreeNodes();
std::reverse(nodes.begin(), nodes.end());
for (auto& node : nodes) {
EXPECT_TRUE(semantic_provider_->Update(std::move(node)));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest,
SendsNodesOnlyAfterParentNoLongerPointsToDeletedChild) {
auto tree_nodes = TreeNodes();
for (auto& node : tree_nodes) {
EXPECT_TRUE(semantic_provider_->Update(std::move(node)));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
// Deletes node 5, which is a child of 4.
EXPECT_TRUE(semantic_provider_->Delete(5u));
// Spin the loop to process the deletion call.
base::RunLoop().RunUntilIdle();
// Commit is pending, because the parent still points to the child.
EXPECT_TRUE(semantic_provider_->HasPendingUpdates());
Node node_4;
node_4.node_id(4u);
node_4.child_ids({});
EXPECT_TRUE(semantic_provider_->Update(std::move(node_4)));
// Spin the loop to process the node update.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 2u);
EXPECT_EQ(num_delete_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest,
SendsNodesOnlyAfterDanglingChildIsDeleted) {
auto tree_nodes = TreeNodes();
for (auto& node : tree_nodes) {
EXPECT_TRUE(semantic_provider_->Update(std::move(node)));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
Node node_4;
node_4.node_id(4u);
node_4.child_ids({}); // This removes child 5.
EXPECT_TRUE(semantic_provider_->Update(std::move(node_4)));
// Spin the loop to process the update call.
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(semantic_provider_->HasPendingUpdates());
EXPECT_TRUE(semantic_provider_->Delete(5u));
// Spin the loop to process the deletion.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 2u);
EXPECT_EQ(num_delete_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest, ReparentsNodeWithADeletion) {
auto tree_nodes = TreeNodes();
for (auto& node : tree_nodes) {
EXPECT_TRUE(semantic_provider_->Update(std::move(node)));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
// Deletes node 4 to reparent its child (5).
EXPECT_TRUE(semantic_provider_->Delete(4u));
// Spin the loop to process the deletion.
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(semantic_provider_->HasPendingUpdates());
// Add child 5 to another node.
Node node_1;
node_1.node_id(1u);
node_1.child_ids({{5u}});
EXPECT_TRUE(semantic_provider_->Update(std::move(node_1)));
// Spin the loop to process the update.
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(semantic_provider_->HasPendingUpdates());
Node node_4;
node_4.node_id(4u);
node_4.child_ids({});
EXPECT_TRUE(semantic_provider_->Update(std::move(node_4)));
// Spin the loop to process the update.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 2u);
EXPECT_EQ(num_delete_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest, ReparentsNodeWithAnUpdate) {
auto tree_nodes = TreeNodes();
for (auto& node : tree_nodes) {
EXPECT_TRUE(semantic_provider_->Update(std::move(node)));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
// Add child 5 to another node. Note that 5 will have two parents, and the
// commit must be held until it has only one.
Node node_1;
node_1.node_id(1u);
node_1.child_ids({{5u}});
EXPECT_TRUE(semantic_provider_->Update(std::move(node_1)));
// Spin the loop to process the update.
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(semantic_provider_->HasPendingUpdates());
// Updates node 4 to no longer point to 5.
Node node_4;
node_4.node_id(4u);
node_4.child_ids({});
EXPECT_TRUE(semantic_provider_->Update(std::move(node_4)));
// Spin the loop to process the update.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 2u);
EXPECT_EQ(num_delete_semantic_nodes_called_, 0u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest, ChangesRoot) {
auto tree_nodes = TreeNodes();
for (auto& node : tree_nodes) {
EXPECT_TRUE(semantic_provider_->Update(std::move(node)));
}
// Spin the loop to process the queued updated calls.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
Node new_root;
new_root.node_id(0u);
new_root.child_ids({{1u, 2u}});
EXPECT_TRUE(semantic_provider_->Update(std::move(new_root)));
// Spin the loop to process the update.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 2u);
EXPECT_EQ(num_delete_semantic_nodes_called_, 0u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest, BatchesUpdates) {
std::vector<Node> updates;
for (uint32_t i = 0; i < 30; ++i) {
Node node;
node.node_id(i);
node.child_ids({{i + 1}});
updates.push_back(std::move(node));
}
updates.back().child_ids()->clear();
for (auto& node : updates) {
EXPECT_TRUE(semantic_provider_->Update(std::move(node)));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
// 30 nodes in batches of 16 (default value of maximum nodes per update call),
// should result in two update calls to the semantics API.
EXPECT_EQ(num_update_semantic_nodes_called_, 2u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest, ClearsTree) {
auto tree_nodes = TreeNodes();
for (auto& node : tree_nodes) {
EXPECT_TRUE(semantic_provider_->Update(std::move(node)));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
semantic_provider_->Clear();
// Spin the loop to process the clear-tree call.
base::RunLoop().RunUntilIdle();
EXPECT_EQ(num_update_semantic_nodes_called_, 1u);
EXPECT_EQ(num_delete_semantic_nodes_called_, 1u);
EXPECT_FALSE(semantic_provider_->HasPendingUpdates());
}
TEST_F(AXFuchsiaSemanticProviderTest, UpdateScaleFactor) {
// Send an initial root node update. At this point, the pixel scale is 1, the
// root node's transform will be the identity matrix. Thus, the resulting
// update sent to fuchsia should not contain a transform.
{
Node node;
node.node_id(0u);
// Set child_ids to make sure they're not overwritten later.
node.child_ids({{1u}});
semantic_provider_->Update(std::move(node));
Node child;
child.node_id(1u);
semantic_provider_->Update(std::move(child));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
// Check that the first update sent to fuchsia reflects a pixel scale of 1.
{
ASSERT_EQ(node_updates().size(), 1u);
const auto& first_update_batch = node_updates()[0];
ASSERT_EQ(first_update_batch.size(), 2u);
EXPECT_EQ(first_update_batch[0].node_id(), 0u);
const fuchsia_accessibility_semantics::Node& node = first_update_batch[0];
ASSERT_TRUE(node.node_to_container_transform().has_value());
const auto& transform = node.node_to_container_transform()->matrix();
EXPECT_EQ(transform[0], 1.f);
EXPECT_EQ(transform[5], 1.f);
ASSERT_EQ(node.child_ids()->size(), 1u);
EXPECT_EQ(node.child_ids().value()[0], 1u);
}
// Now, set a new pixel scale != 1. This step should force an update to
// fuchsia.
const auto kPixelScale = 0.5f;
semantic_provider_->SetPixelScale(kPixelScale);
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
// Check that the root node's node_to_conatiner_transform field was set when
// the pixel scale was updated.
{
ASSERT_EQ(node_updates().size(), 2u);
const auto& second_update_batch = node_updates()[1];
ASSERT_EQ(second_update_batch.size(), 1u);
const fuchsia_accessibility_semantics::Node& node = second_update_batch[0];
EXPECT_EQ(node.node_id(), 0u);
ASSERT_TRUE(node.node_to_container_transform().has_value());
const auto& transform = node.node_to_container_transform()->matrix();
EXPECT_EQ(transform[0], 1.f / kPixelScale);
EXPECT_EQ(transform[5], 1.f / kPixelScale);
ASSERT_EQ(node.child_ids()->size(), 1u);
EXPECT_EQ(node.child_ids().value()[0], 1u);
}
// Finally, send one more update, and verify that the semantic provider
// accounted for the new pixel scale in the root node's transform.
{
Node node;
node.node_id(0u);
node.child_ids({{1u}});
semantic_provider_->Update(std::move(node));
}
// Spin the loop to process the queued update calls.
base::RunLoop().RunUntilIdle();
// Check that the root node's node_to_conatiner_transform field was set using
// the new pixel scale.
{
ASSERT_EQ(node_updates().size(), 3u);
const auto& third_update_batch = node_updates()[2];
ASSERT_EQ(third_update_batch.size(), 1u);
const fuchsia_accessibility_semantics::Node& node = third_update_batch[0];
EXPECT_EQ(node.node_id(), 0u);
ASSERT_TRUE(node.node_to_container_transform().has_value());
const auto& transform = node.node_to_container_transform()->matrix();
EXPECT_EQ(transform[0], 1.f / kPixelScale);
EXPECT_EQ(transform[5], 1.f / kPixelScale);
ASSERT_EQ(node.child_ids()->size(), 1u);
EXPECT_EQ(node.child_ids().value()[0], 1u);
}
}
} // namespace
} // namespace ui
| [
"chromium-scoped@luci-project-accounts.iam.gserviceaccount.com"
] | chromium-scoped@luci-project-accounts.iam.gserviceaccount.com |
61cf3c6e708b1cae3e4f510afeef09c52925c3af | 5330918e825f8d373d3907962ba28215182389c3 | /CondTools/Geometry/plugins/PGeometricDetExtraBuilder.cc | 2e2c1c4235147522adfb297e6f4b29220a51e172 | [] | 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 | 2,874 | cc | #include "PGeometricDetExtraBuilder.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Event.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "CondFormats/GeometryObjects/interface/PGeometricDetExtra.h"
#include "Geometry/Records/interface/PGeometricDetExtraRcd.h"
#include "Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h"
#include <DetectorDescription/Core/interface/DDCompactView.h>
#include <DetectorDescription/Core/interface/DDExpandedView.h>
#include "DetectorDescription/Core/interface/DDExpandedNode.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
#include "Geometry/TrackerGeometryBuilder/interface/GeomDetTypeIdToEnum.h"
#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <iostream>
#include <string>
#include <vector>
PGeometricDetExtraBuilder::PGeometricDetExtraBuilder(const edm::ParameterSet& iConfig)
{
}
PGeometricDetExtraBuilder::~PGeometricDetExtraBuilder()
{
}
void
PGeometricDetExtraBuilder::beginRun( const edm::Run&, edm::EventSetup const& es)
{
PGeometricDetExtra* pgde = new PGeometricDetExtra;
edm::Service<cond::service::PoolDBOutputService> mydbservice;
if( !mydbservice.isAvailable() ){
edm::LogError("PGeometricDetExtraBuilder")<<"PoolDBOutputService unavailable";
return;
}
edm::ESTransientHandle<DDCompactView> cpvH;
edm::ESHandle<std::vector<GeometricDetExtra> > gdeH;
es.get<IdealGeometryRecord>().get( cpvH );
es.get<IdealGeometryRecord>().get( gdeH );
const std::vector<GeometricDetExtra>& gdes = (*gdeH);
std::vector<GeometricDetExtra>::const_iterator git = gdes.begin();
std::vector<GeometricDetExtra>::const_iterator egit = gdes.end();
for (; git!= egit; ++git) { // one level below "tracker"
putOne(*git, pgde);
}
if ( mydbservice->isNewTagRequest("PGeometricDetExtraRcd") ) {
mydbservice->createNewIOV<PGeometricDetExtra>( pgde,mydbservice->beginOfTime(),mydbservice->endOfTime(),"PGeometricDetExtraRcd");
} else {
edm::LogError("PGeometricDetExtraBuilder")<<"PGeometricDetExtra and PGeometricDetExtraRcd Tag already present";
}
}
void PGeometricDetExtraBuilder::putOne ( const GeometricDetExtra& gde, PGeometricDetExtra* pgde ) {
PGeometricDetExtra::Item item;
item._geographicalId = gde.geographicalId();
item._volume = gde.volume();
item._density = gde.density();
item._weight = gde.weight();
item._copy = gde.copyno();
item._material = gde.material();
pgde->pgdes_.push_back ( item );
}
| [
"sha1-1d692184473970509f0e165e4d62c8c025ba163f@cern.ch"
] | sha1-1d692184473970509f0e165e4d62c8c025ba163f@cern.ch |
959482fd19b6f11a2dd522a937735a75b631d623 | ce64c59e1e2b6ae779f125c982e94f6de93d62f8 | /dialogs/kconfigdialog.h | 2ac0edaedfb64f187215d3def2a0eed5179d11f1 | [] | no_license | The-Oracle/kdeui | f3e2d7cc7335bdffce9d6a02de38ab196e5cf02d | 87414d061d2f7156901212a19ea01bdf85d6e53d | refs/heads/master | 2021-01-20T00:51:25.654205 | 2017-04-24T05:14:13 | 2017-04-24T05:14:13 | 89,200,851 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,924 | h | /*
* This file is part of the KDE libraries
* Copyright (C) 2003 Benjamin C Meyer (ben+kdelibs at meyerhome dot net)
* Copyright (C) 2003 Waldo Bastian <bastian@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KCONFIGDIALOG_H
#define KCONFIGDIALOG_H
#include <kpagedialog.h>
class KConfig;
class KConfigSkeleton;
class KConfigDialogManager;
/**
* \short Standard %KDE configuration dialog class
*
* The KConfigDialog class provides an easy and uniform means of displaying
* a settings dialog using KPageDialog, KConfigDialogManager and a
* KConfigSkeleton derived settings class.
*
* KConfigDialog handles the enabling and disabling of buttons, creation
* of the dialog, and deletion of the widgets. Because of
* KConfigDialogManager, this class also manages: restoring
* the settings, reseting them to the default values, and saving them. This
* requires that the names of the widgets corresponding to configuration entries
* have to have the same name plus an additional "kcfg_" prefix. For example the
* widget named "kcfg_MyOption" would be associated with the configuration entry
* "MyOption".
*
* Here is an example usage of KConfigDialog:
*
* \code
* void KCoolApp::showSettings(){
* if(KConfigDialog::showDialog("settings"))
* return;
* KConfigDialog *dialog = new KConfigDialog(this, "settings", MySettings::self());
* dialog->setFaceType(KPageDialog::List);
* dialog->addPage(new General(0, "General"), i18n("General") );
* dialog->addPage(new Appearance(0, "Style"), i18n("Appearance") );
* connect(dialog, SIGNAL(settingsChanged(const QString&)), mainWidget, SLOT(loadSettings()));
* connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(loadSettings()));
* dialog->show();
* }
* \endcode
*
* Other than the above code, each class that has settings in the dialog should
* have a loadSettings() type slot to read settings and perform any
* necessary changes.
*
* For dialog appearance options (like buttons, default button, ...) please see
* @see KPageDialog
*
* @see KConfigSkeleton
* @author Waldo Bastian <bastian@kde.org>
*/
class KDEUI_EXPORT KConfigDialog : public KPageDialog {
Q_OBJECT
Q_SIGNALS:
/**
* A widget in the dialog was modified.
*/
void widgetModified();
/**
* One or more of the settings have been permanently changed such as if
* the user clicked on the Apply or Ok button.
* @param dialogName the name of the dialog.
*/
void settingsChanged(const QString& dialogName);
public:
/**
* @param parent - The parent of this object. Even though the class
* deletes itself the parent should be set so the dialog can be centered
* with the application on the screen.
*
* @param name - The name of this object. The name is used in determining if
* there can be more than one dialog at a time. Use names such as:
* "Font Settings" or "Color Settings" and not just "Settings" in
* applications where there is more than one dialog.
*
* @param config - Config object containing settings.
*/
KConfigDialog( QWidget *parent, const QString& name,
KConfigSkeleton *config );
/**
* Deconstructor, removes name from the list of open dialogs.
* Deletes private class.
* @see exists()
*/
~KConfigDialog();
/**
* Adds page to the dialog and to KConfigDialogManager. When an
* application is done adding pages show() should be called to
* display the dialog.
* @param page - Pointer to the page that is to be added to the dialog.
* This object is reparented.
* @param itemName - Name of the page.
* @param pixmapName - Name of the icon that should be used, if needed, when
* displaying the page. The string may either be the name of a themed
* icon (e.g. "document-save"), which the internal icon loader will be
* used to retrieve, or an absolute path to the pixmap on disk.
* @param header - Header text use in the list modes. Ignored in Tabbed
* mode. If empty, the itemName text is used when needed.
* @param manage - Whether KConfigDialogManager should manage the page or not.
* @returns The KPageWidgetItem associated with the page.
*/
KPageWidgetItem* addPage( QWidget *page, const QString &itemName,
const QString &pixmapName=QString(),
const QString &header=QString(),
bool manage=true );
/**
* Adds page to the dialog that is managed by a custom KConfigDialogManager.
* This is useful for dialogs that contain settings spread over more than
* one configuration file and thus have/need more than one KConfigSkeleton.
* When an application is done adding pages show() should be called to
* display the dialog.
* @param page - Pointer to the page that is to be added to the dialog.
* This object is reparented.
* @param config - Config object containing corresponding settings.
* @param itemName - Name of the page.
* @param pixmapName - Name of the icon that should be used, if needed, when
* displaying the page. The string may either be the name of a themed
* icon (e.g. "document-save"), which the internal icon loader will be
* used to retrieve, or an absolute path to the pixmap on disk.
* @param header - Header text use in the list modes. Ignored in Tabbed
* mode. If empty, the itemName text is used when needed.
* @returns The KPageWidgetItem associated with the page.
*/
KPageWidgetItem* addPage( QWidget *page, KConfigSkeleton *config,
const QString &itemName,
const QString &pixmapName=QString(),
const QString &header=QString() );
/**
* See if a dialog with the name 'name' already exists.
* @see showDialog()
* @param name - Dialog name to look for.
* @return Pointer to widget or NULL if it does not exist.
*/
static KConfigDialog* exists( const QString& name );
/**
* Attempts to show the dialog with the name 'name'.
* @see exists()
* @param name - The name of the dialog to show.
* @return True if the dialog 'name' exists and was shown.
*/
static bool showDialog( const QString& name );
protected Q_SLOTS:
/**
* Update the settings from the dialog.
* Virtual function for custom additions.
*
* Example use: User clicks Ok or Apply button in a configure dialog.
*/
virtual void updateSettings();
/**
* Update the dialog based on the settings.
* Virtual function for custom additions.
*
* Example use: Initialisation of dialog.
* Example use: User clicks Reset button in a configure dialog.
*/
virtual void updateWidgets();
/**
* Update the dialog based on the default settings.
* Virtual function for custom additions.
*
* Example use: User clicks Defaults button in a configure dialog.
*/
virtual void updateWidgetsDefault();
/**
* Updates the Apply and Default buttons.
* Connect to this slot if you implement you own hasChanged()
* or isDefault() methods for widgets not managed by KConfig.
* @since 4.3
*/
void updateButtons();
/**
* Some setting was changed. Emit the signal with the dialogs name.
* Connect to this slot if there are widgets not managed by KConfig.
* @since 4.3
*/
void settingsChangedSlot();
protected:
/**
* Returns whether the current state of the dialog is
* different from the current configuration.
* Virtual function for custom additions.
*/
virtual bool hasChanged();
/**
* Returns whether the current state of the dialog is
* the same as the default configuration.
*/
virtual bool isDefault();
/**
* @internal
*/
virtual void showEvent(QShowEvent *e);
private Q_SLOTS:
/**
* Slot which cleans up the KConfigDialogManager of the page.
* */
void onPageRemoved(KPageWidgetItem* item);
private:
class KConfigDialogPrivate;
friend class KConfigDialogPrivate;
KConfigDialogPrivate *const d;
Q_PRIVATE_SLOT( d, void _k_updateButtons() )
Q_PRIVATE_SLOT( d, void _k_settingsChangedSlot() )
Q_DISABLE_COPY(KConfigDialog)
};
#endif //KCONFIGDIALOG_H
| [
"Jeremy@jbdynamics.net"
] | Jeremy@jbdynamics.net |
848d8cceaf998a4148bb32975156d8933e27d88b | f68c1a09ade5d969f3973246747466e4a540ff74 | /src/prod/src/data/txnreplicator/statemanager/StateManager.CheckpointPerfTest.cpp | 1b0996380e9d34b75cccac736c8bc408693201e5 | [
"MIT"
] | permissive | GitTorre/service-fabric | ab38752d4cc7c8f2ee03553372c0f3e05911ff67 | 88da19dc5ea8edfe1c9abebe25a5c5079995db63 | refs/heads/master | 2021-04-09T10:57:45.678751 | 2018-08-20T19:17:28 | 2018-08-20T19:17:28 | 125,401,516 | 0 | 0 | MIT | 2018-03-15T17:13:53 | 2018-03-15T17:13:52 | null | UTF-8 | C++ | false | false | 13,814 | cpp | // ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
#include <stdlib.h>
#include <boost/test/unit_test.hpp>
#include "Common/boost-taef.h"
using namespace Common;
using namespace ktl;
using namespace TxnReplicator;
using namespace Data::StateManager;
using namespace Data::Utilities;
namespace StateManagerTests
{
class StateManagerCheckpointPerfTest : public StateManagerTestBase
{
// load the config object as its needed for the tracing to work
CommonConfig config;
public:
StateManagerCheckpointPerfTest()
{
}
~StateManagerCheckpointPerfTest()
{
}
public:
// Checkpoint Performance Test
Awaitable<void> Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync(
__in ULONG itemsCount) noexcept;
Awaitable<void> Test_Checkpoint_Performance_Test(
__in ULONG itemsCount) noexcept;
private:
KUriView expectedNameView = L"fabric:/sps/sp";
const LONG64 expectedParentId = 16;
const LONG64 expectedCreateLSN = 19;
const LONG64 expectedDeleteLSN = 87;
const MetadataMode::Enum expectedMetadataMode = MetadataMode::Enum::Active;
};
//
// Goal: Checkpoint Performance Test, This test will focus on CreateAsync And OpenAsync
// The time interval for CreateAsync And OpenAsync will be printed out
//
// Algorithm:
// 1. Populate the Serializable MetadataArray list
// 2. Create checkpoint file call CreateAsync, and print out the time interval
// 3. Open the checkpoint file call OpenAsync, and print out the time interval
// 4. Verify the checkpoint file is the same as we wrote
// 5. Clean up
//
Awaitable<void> StateManagerCheckpointPerfTest::Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync(
__in ULONG itemsCount) noexcept
{
NTSTATUS status = STATUS_UNSUCCESSFUL;
KWString fileName = TestHelper::CreateFileName(L"Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync.txt", GetAllocator());
KGuid expectedPartitionId;
expectedPartitionId.CreateNew();
ULONG64 expectedReplicId = 8;
FABRIC_SEQUENCE_NUMBER expectedPrepareCheckpointLSN = 64;
PartitionedReplicaId::SPtr partitionedReplicaIdCSPtr = PartitionedReplicaId::Create(expectedPartitionId, expectedReplicId, GetAllocator());
// verifier used to verify the state provider ids are the same
LONG64 verifier = 0;
KSharedArray<SerializableMetadata::CSPtr>::SPtr SerializableMetadataArray = TestHelper::CreateSerializableMetadataArray(GetAllocator());
for (ULONG i = 0; i < itemsCount; i++)
{
LONG64 stateProviderId = KDateTime::Now();
verifier = verifier ^ stateProviderId;
SerializableMetadata::CSPtr serializablemetadataSPtr = TestHelper::CreateSerializableMetadata(
stateProviderId,
expectedNameView,
expectedParentId,
expectedCreateLSN,
expectedDeleteLSN, GetAllocator());
status = SerializableMetadataArray->Append(serializablemetadataSPtr);
VERIFY_IS_TRUE(NT_SUCCESS(status));
}
Common::Stopwatch stopwatch;
stopwatch.Start();
CheckpointFile::SPtr checkpointFileSPtr = nullptr;
status = CheckpointFile::Create(
*partitionedReplicaIdCSPtr,
fileName,
GetAllocator(),
checkpointFileSPtr);
VERIFY_IS_TRUE(NT_SUCCESS(status));
co_await checkpointFileSPtr->WriteAsync(*SerializableMetadataArray, SerializationMode::Enum::Native, expectedPrepareCheckpointLSN, CancellationToken::None);
stopwatch.Stop();
Trace.WriteInfo(
BoostTestTrace,
"Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync with {0} items, Checkpoint Performance Test WriteAsync call completed in {1} ms",
itemsCount,
stopwatch.ElapsedMilliseconds);
stopwatch.Restart();
// Open the checkpoint file call OpenAsync, and print out the time interval
// The OpenAsync should iterate through the enumerator
co_await checkpointFileSPtr->ReadAsync(CancellationToken::None);
CheckpointFileAsyncEnumerator::SPtr enumerator = checkpointFileSPtr->GetAsyncEnumerator();
while (co_await enumerator->MoveNextAsync(CancellationToken::None))
{
// We don't need to do anything with the returned serilizable metadata, so ignore it.
enumerator->GetCurrent();
}
// Close the file stream and file
co_await enumerator->CloseAsync();
stopwatch.Stop();
Trace.WriteInfo(
BoostTestTrace,
"Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync with {0} items, Checkpoint Performance Test ReadAsync call completed in {1} ms",
itemsCount,
stopwatch.ElapsedMilliseconds);
// Verify the checkpoint file is the same as we wrote
CheckpointFileAsyncEnumerator::SPtr enumeratorVerify = checkpointFileSPtr->GetAsyncEnumerator();
ULONG i = 0;
while (co_await enumeratorVerify->MoveNextAsync(CancellationToken::None))
{
SerializableMetadata::CSPtr serializableMetadata = enumeratorVerify->GetCurrent();
verifier = verifier ^ serializableMetadata->StateProviderId;
VERIFY_IS_TRUE(serializableMetadata->Name->Get(KUriView::eRaw).Compare(expectedNameView) == 0);
VERIFY_IS_TRUE(serializableMetadata->ParentStateProviderId == expectedParentId);
VERIFY_IS_TRUE(serializableMetadata->CreateLSN == expectedCreateLSN);
VERIFY_IS_TRUE(serializableMetadata->DeleteLSN == expectedDeleteLSN);
VERIFY_IS_TRUE(serializableMetadata->MetadataMode == expectedMetadataMode);
++i;
}
co_await enumeratorVerify->CloseAsync();
VERIFY_IS_TRUE(verifier == 0);
VERIFY_IS_TRUE(i == itemsCount);
// Clean up
KString::CSPtr filePath = TestHelper::CreateFileString(GetAllocator(), L"Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync.txt");
Common::File::Delete(static_cast<LPCWSTR>(*filePath), true);
}
//
// Goal: Checkpoint Performance Test, This test will focus on CheckpointAsync
// The time interval for CheckpointAsync will be printed out
//
// Algorithm:
// 1. Populate the state providers name list
// 2. Bring up the primary replica
// 3. Populate state providers and take checkpoint, print out the time interval for CheckpointAsync call
// 4. Verify the checkpoint file is as expected
// 5. Clean up and shut down
//
Awaitable<void> StateManagerCheckpointPerfTest::Test_Checkpoint_Performance_Test(
__in ULONG itemsCount) noexcept
{
NTSTATUS status = STATUS_UNSUCCESSFUL;
Common::Stopwatch stopwatch;
// Setup: Populate the state providers name list
KArray<KUri::CSPtr> nameList(GetAllocator(), itemsCount);
for (ULONG index = 0; index < itemsCount; index++)
{
status = nameList.Append(GetStateProviderName(NameType::Random));
VERIFY_IS_TRUE(NT_SUCCESS(status));
}
// Setup: Bring up the primary replica
{
co_await testTransactionalReplicatorSPtr_->OpenAsync(CancellationToken::None);
co_await testTransactionalReplicatorSPtr_->ChangeRoleAsync(FABRIC_REPLICA_ROLE_PRIMARY, CancellationToken::None);
co_await this->PopulateAsync(nameList);
VerifyExist(nameList, true);
// #10485130: Disable the Test StateProvider WriteFile.
this->DisableStateProviderCheckpointing(nameList);
stopwatch.Start();
co_await testTransactionalReplicatorSPtr_->PrepareCheckpointAsync();
stopwatch.Stop();
Trace.WriteInfo(
BoostTestTrace,
"Test_Checkpoint_Performance_Test with {0} items, PrepareCheckpoint completed in {1} ms",
itemsCount,
stopwatch.ElapsedMilliseconds);
stopwatch.Restart();
co_await testTransactionalReplicatorSPtr_->PerformCheckpointAsync(CancellationToken::None);
stopwatch.Stop();
Trace.WriteInfo(
BoostTestTrace,
"Test_Checkpoint_Performance_Test with {0} items, PerformCheckpointAsync completed in {1} ms",
itemsCount,
stopwatch.ElapsedMilliseconds);
stopwatch.Restart();
co_await testTransactionalReplicatorSPtr_->CompleteCheckpointAsync(CancellationToken::None);
stopwatch.Stop();
Trace.WriteInfo(
BoostTestTrace,
"Test_Checkpoint_Performance_Test with {0} items, CompleteCheckpointAsync completed in {1} ms",
itemsCount,
stopwatch.ElapsedMilliseconds);
co_await testTransactionalReplicatorSPtr_->CloseAsync(CancellationToken::None);
testTransactionalReplicatorSPtr_.Reset();
}
// Verify the checkpoint file is as expected
{
testTransactionalReplicatorSPtr_ = CreateReplica(
*partitionedReplicaIdCSPtr_,
*runtimeFolders_,
*partitionSPtr_);
co_await testTransactionalReplicatorSPtr_->OpenAsync(CancellationToken::None);
co_await testTransactionalReplicatorSPtr_->ChangeRoleAsync(FABRIC_REPLICA_ROLE_PRIMARY, CancellationToken::None);
VerifyExist(nameList, true);
// Clean up and shut down
co_await testTransactionalReplicatorSPtr_->ChangeRoleAsync(FABRIC_REPLICA_ROLE_NONE, CancellationToken::None);
co_await testTransactionalReplicatorSPtr_->CloseAsync(CancellationToken::None);
}
}
BOOST_FIXTURE_TEST_SUITE(StateManagerCheckpointPerfTestSuite, StateManagerCheckpointPerfTest)
//
// Scenario: Checkpoint Performance Test, test mainly focus on CreateAsync and OpenAsync
// Expected Result: The time interval for CreateAsync and OpenAsync will be printed out
//
BOOST_AUTO_TEST_CASE(Checkpoint_Performance_Test_CreateAsyncAndOpenAsync_ZeroItems)
{
ULONG itemsCount = 0;
SyncAwait(this->Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync(itemsCount));
}
//
// Scenario: Checkpoint Performance Test, test mainly focus on CreateAsync and OpenAsync
// Expected Result: The time interval for CreateAsync and OpenAsync will be printed out
//
BOOST_AUTO_TEST_CASE(Checkpoint_Performance_Test_CreateAsyncAndOpenAsync_ThousandItems)
{
const ULONG itemsCount = 1000;
SyncAwait(this->Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync(itemsCount));
}
//
// Scenario: Checkpoint Performance Test, test mainly focus on CreateAsync and OpenAsync
// Expected Result: The time interval for CreateAsync and OpenAsync will be printed out
//
BOOST_AUTO_TEST_CASE(Checkpoint_Performance_Test_CreateAsyncAndOpenAsync_TenThousandItems)
{
const ULONG itemsCount = 10000;
SyncAwait(this->Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync(itemsCount));
}
//
// Scenario: Checkpoint Performance Test, test mainly focus on CreateAsync and OpenAsync
// Expected Result: The time interval for CreateAsync and OpenAsync will be printed out
//
BOOST_AUTO_TEST_CASE(Checkpoint_Performance_Test_CreateAsyncAndOpenAsync_FiftyThousandItems)
{
const ULONG itemsCount = 50000;
SyncAwait(this->Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync(itemsCount));
}
//
// Scenario: Checkpoint Performance Test, test mainly focus on CreateAsync and OpenAsync
// Expected Result: The time interval for CreateAsync and OpenAsync will be printed out
//
BOOST_AUTO_TEST_CASE(Checkpoint_Performance_Test_CreateAsyncAndOpenAsync_HundredThousandItems)
{
const ULONG itemsCount = 100000;
SyncAwait(this->Test_Checkpoint_Performance_Test_CreateAsyncAndOpenAsync(itemsCount));
}
//
// Scenario: Checkpoint Performance Test, test mainly focus on CheckpointAsync function
// Expected Result: The time interval for CheckpointAsync will be printed out
//
BOOST_AUTO_TEST_CASE(Checkpoint_Performance_Test_ZeroItem)
{
const ULONG itemsCount = 0;
SyncAwait(this->Test_Checkpoint_Performance_Test(itemsCount));
}
//
// Scenario: Checkpoint Performance Test, test mainly focus on CheckpointAsync function
// Expected Result: The time interval for CheckpointAsync will be printed out
//
BOOST_AUTO_TEST_CASE(Checkpoint_Performance_Test_ThousandItems)
{
const ULONG itemsCount = 1000;
SyncAwait(this->Test_Checkpoint_Performance_Test(itemsCount));
}
//
// Scenario: Checkpoint Performance Test, test mainly focus on CheckpointAsync function
// Expected Result: The time interval for CheckpointAsync will be printed out
//
BOOST_AUTO_TEST_CASE(Checkpoint_Performance_Test_TenThousandItems)
{
const ULONG itemsCount = 10000;
SyncAwait(this->Test_Checkpoint_Performance_Test(itemsCount));
}
BOOST_AUTO_TEST_SUITE_END()
}
| [
"noreply-sfteam@microsoft.com"
] | noreply-sfteam@microsoft.com |
ed0be709ccab210c232ef2a7306ca549087a5c8c | 2850bb3451b264d9ab9e2d289355f59baa538c1f | /midiinoutcv4pot2.ino | 3a1b9d970b639909d8696b52f5df0a4e2b08c71d | [] | no_license | sl4g/midiclockCv | 3fe6a844e4c7feee776cd31da2bdfb88a079b2ff | e4c5183924ca59e3717289dcf7b95e7c33848e90 | refs/heads/main | 2023-01-20T12:53:26.633184 | 2020-12-02T14:14:49 | 2020-12-02T14:14:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,854 | ino |
/*
* MidiSequencerGate v1
*
*
* Este sketch esta realizado a partir de las siguientes fuentes:
* https://little-scale.blogspot.com/2008/05/how-to-deal-with-midi-clock-signals-in.html
* chemiker1981.blogspot.com/2010/10/1-reading-midi-clock-to-read-midi-clock.html
* y algunos ejeplos basicos de arduinos
*
* ¿Que hace? a partir del optocoplador fijado en D0 (RX) arduino es capaz de leer señales MIDI externas
* la señal relacionada con la continuidad del reloj es aislada y utilizada como medida para sincronizar aparatos a traves
* de una muy sucia salida de "gate" (la que esta en formato de output) en este sketch. Externamente se utiliza esta señal como clock para
* dos 4017 que constituyen el secuenciador. Posee además un "clock" interno al que se puede cambiar con un switch SPDT conectado a D3
* = )
*/
// Declaration of Varialbes
//funciona con cuatro salidas, dos van a secuenciadores y dos son clock puro
byte midi_start = 0xfa;
byte midi_stop = 0xfc;
byte midi_clock = 0xf8;
byte midi_continue = 0xfb;
int play_flag = 0;
byte data;
int clock_step;
const int switchPin = 8;
const int potPin = 2;
int statusLed0 = 9;
int statusLed1 = 10;
int statusLed2 = 11;
int statusLed3 = 12;
int statusLed4 = 13;
int val = 0;
int switchVal;
// Initialization
void setup() {
pinMode(statusLed0, OUTPUT);
pinMode(statusLed1, OUTPUT);
pinMode(statusLed2, OUTPUT);
pinMode(statusLed3, OUTPUT);
pinMode(statusLed4, OUTPUT);
pinMode(switchPin, INPUT);
pinMode(potPin, INPUT);
Serial.begin(31250);
clock_step = 0;
}
// Main Programm
void loop() {
switchVal = digitalRead(switchPin);
if (switchVal == HIGH) {
if (Serial.available() > 0) {
data = Serial.read();
if (data == midi_start) {
play_flag = 1;
clock_step = 0;
}
else if (data == midi_continue) {
play_flag = 1;
}
else if (data == midi_stop) {
play_flag = 0;
clock_step = 0;
}
else if ((data == midi_clock) && (play_flag == 1)) {
Sync();
}
}
}
else {
val = analogRead(potPin); // read the voltage on the pot
digitalWrite(statusLed0, HIGH); // set the LED on
digitalWrite(statusLed1, HIGH); // set the LED on
digitalWrite(statusLed2, HIGH); // set the LED on
digitalWrite(statusLed3, HIGH); // set the LED on
digitalWrite(statusLed4, HIGH); // set the LED on
delay(val); // blink rate set by pot value (in milliseconds)
digitalWrite(statusLed0, LOW); // set the LED off
digitalWrite(statusLed1, LOW); // set the LED off
digitalWrite(statusLed2, LOW); // set the LED off
digitalWrite(statusLed3, LOW); // set the LED off
digitalWrite(statusLed4, LOW); // set the LED off
delay(val); // turn led off for same periodigitalWrite(ledPin, LOW); // turn the ledPin offd as it was turned on
}
}
// Function
void Sync() { // 1st half of a bar: LED=on, seconds half of a bar: LED=off
clock_step = clock_step + 1;
if (clock_step == 1) {
digitalWrite(statusLed0, HIGH); // set the LED on
digitalWrite(statusLed1, HIGH); // set the LED on
digitalWrite(statusLed2, HIGH); // set the LED on
digitalWrite(statusLed3, HIGH); // set the LED on
digitalWrite(statusLed4, HIGH); // set the LED on
}
else if (clock_step == 24 / 2) {
digitalWrite(statusLed0, LOW); // set the LED off
digitalWrite(statusLed1, LOW); // set the LED off
digitalWrite(statusLed2, LOW); // set the LED off
digitalWrite(statusLed3, LOW); // set the LED off
digitalWrite(statusLed4, LOW); // set the LED off
}
else if (clock_step == 24) {
clock_step = 0;
}
}
/* un codigo para controlar un timmer interno y permitir un timer externo
void readPots ()
{
tempo = (analogRead (AnalogInTempo) * 1.9);
duration = (analogRead (AnalogInDuration));
}
/
*/
| [
"noreply@github.com"
] | noreply@github.com |
e7dbded17692e2526ee8e4c2956951f20fda46b4 | 887f3a72757ff8f691c1481618944b727d4d9ff5 | /third_party/gecko_1.9.2/osx/gecko_sdk/include/nsIDOMCSSPageRule.h | 345b69fbddcffaad4f2ff3fb97d95d2d14224ea8 | [] | no_license | zied-ellouze/gears | 329f754f7f9e9baa3afbbd652e7893a82b5013d1 | d3da1ed772ed5ae9b82f46f9ecafeb67070d6899 | refs/heads/master | 2020-04-05T08:27:05.806590 | 2015-09-03T13:07:39 | 2015-09-03T13:07:39 | 41,813,794 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,775 | h | /*
* DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/mozilla-1.9.2-macosx-xulrunner/build/dom/interfaces/css/nsIDOMCSSPageRule.idl
*/
#ifndef __gen_nsIDOMCSSPageRule_h__
#define __gen_nsIDOMCSSPageRule_h__
#ifndef __gen_nsIDOMCSSRule_h__
#include "nsIDOMCSSRule.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIDOMCSSPageRule */
#define NS_IDOMCSSPAGERULE_IID_STR "a6cf90bd-15b3-11d2-932e-00805f8add32"
#define NS_IDOMCSSPAGERULE_IID \
{0xa6cf90bd, 0x15b3, 0x11d2, \
{ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMCSSPageRule : public nsIDOMCSSRule {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMCSSPAGERULE_IID)
/* attribute DOMString selectorText; */
NS_SCRIPTABLE NS_IMETHOD GetSelectorText(nsAString & aSelectorText) = 0;
NS_SCRIPTABLE NS_IMETHOD SetSelectorText(const nsAString & aSelectorText) = 0;
/* readonly attribute nsIDOMCSSStyleDeclaration style; */
NS_SCRIPTABLE NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMCSSPageRule, NS_IDOMCSSPAGERULE_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMCSSPAGERULE \
NS_SCRIPTABLE NS_IMETHOD GetSelectorText(nsAString & aSelectorText); \
NS_SCRIPTABLE NS_IMETHOD SetSelectorText(const nsAString & aSelectorText); \
NS_SCRIPTABLE NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMCSSPAGERULE(_to) \
NS_SCRIPTABLE NS_IMETHOD GetSelectorText(nsAString & aSelectorText) { return _to GetSelectorText(aSelectorText); } \
NS_SCRIPTABLE NS_IMETHOD SetSelectorText(const nsAString & aSelectorText) { return _to SetSelectorText(aSelectorText); } \
NS_SCRIPTABLE NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) { return _to GetStyle(aStyle); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMCSSPAGERULE(_to) \
NS_SCRIPTABLE NS_IMETHOD GetSelectorText(nsAString & aSelectorText) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectorText(aSelectorText); } \
NS_SCRIPTABLE NS_IMETHOD SetSelectorText(const nsAString & aSelectorText) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSelectorText(aSelectorText); } \
NS_SCRIPTABLE NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStyle(aStyle); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsDOMCSSPageRule : public nsIDOMCSSPageRule
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMCSSPAGERULE
nsDOMCSSPageRule();
private:
~nsDOMCSSPageRule();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsDOMCSSPageRule, nsIDOMCSSPageRule)
nsDOMCSSPageRule::nsDOMCSSPageRule()
{
/* member initializers and constructor code */
}
nsDOMCSSPageRule::~nsDOMCSSPageRule()
{
/* destructor code */
}
/* attribute DOMString selectorText; */
NS_IMETHODIMP nsDOMCSSPageRule::GetSelectorText(nsAString & aSelectorText)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMCSSPageRule::SetSelectorText(const nsAString & aSelectorText)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute nsIDOMCSSStyleDeclaration style; */
NS_IMETHODIMP nsDOMCSSPageRule::GetStyle(nsIDOMCSSStyleDeclaration * *aStyle)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIDOMCSSPageRule_h__ */
| [
"gears.daemon@fe895e04-df30-0410-9975-d76d301b4276"
] | gears.daemon@fe895e04-df30-0410-9975-d76d301b4276 |
ea5cf5e61b5490139d8161b0b8c775b4209b8248 | 1bb09b8df7468c4e2e87892751413d6cd34c79b6 | /dune/porsol/common/ReservoirPropertyCapillary_impl.hpp | 040f0d73bf9b7e25f8c90d369e7477393503a9fc | [] | no_license | kristinf/opm-porsol | 158557772f31b770605842502c89b8791e26ca7a | b02f46ce5ee2cb647a8b2f073c8468c4bcd7c6e5 | refs/heads/master | 2021-01-15T16:37:26.958418 | 2012-10-03T17:55:51 | 2012-10-03T17:55:51 | null | 0 | 0 | null | null | null | null | ISO-8859-15 | C++ | false | false | 9,787 | hpp | //===========================================================================
//
// File: ReservoirPropertyCapillary_impl.hpp
//
// Created: Thu Oct 22 20:16:15 2009
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// Bård Skaflestad <bard.skaflestad@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 Statoil ASA.
This file is part of The Open Reservoir Simulator Project (OpenRS).
OpenRS 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.
OpenRS 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENRS_RESERVOIRPROPERTYCAPILLARY_IMPL_HEADER
#define OPENRS_RESERVOIRPROPERTYCAPILLARY_IMPL_HEADER
namespace Dune
{
template <int dim>
double ReservoirPropertyCapillary<dim>::mobilityFirstPhase(int cell_index, double saturation) const
{
return relPermFirstPhase(cell_index, saturation) / Super::viscosity1_;
}
template <int dim>
double ReservoirPropertyCapillary<dim>::mobilitySecondPhase(int cell_index, double saturation) const
{
return relPermSecondPhase(cell_index, saturation) / Super::viscosity2_;
}
template <int dim>
void ReservoirPropertyCapillary<dim>::phaseMobility(int phase_index,
int cell_index,
double saturation,
double& phase_mob) const
{
if (phase_index == 0) {
phase_mob = mobilityFirstPhase(cell_index, saturation);
} else {
ASSERT(phase_index == 1);
phase_mob = mobilitySecondPhase(cell_index, saturation);
}
}
template <int dim>
double ReservoirPropertyCapillary<dim>::totalMobility(int cell_index, double saturation) const
{
double l1 = mobilityFirstPhase(cell_index, saturation);
double l2 = mobilitySecondPhase(cell_index, saturation);
return l1 + l2;
}
template <int dim>
double ReservoirPropertyCapillary<dim>::fractionalFlow(int cell_index, double saturation) const
{
double l1 = mobilityFirstPhase(cell_index, saturation);
double l2 = mobilitySecondPhase(cell_index, saturation);
return l1/(l1 + l2);
}
template <int dim>
template<class Vector>
void ReservoirPropertyCapillary<dim>::phaseMobilities(int cell_index, double saturation, Vector& mobility) const
{
//ASSERT (mobility.size() >= Super::NumberOfPhases);
mobility[0] = mobilityFirstPhase(cell_index, saturation);
mobility[1] = mobilitySecondPhase(cell_index, saturation);
}
template <int dim>
template <class Vector>
void
ReservoirPropertyCapillary<dim>::phaseMobilitiesDeriv(int c, double s,
Vector& dmob) const {
dmob[0] = relPermFirstPhaseDeriv (c, s) / Super::viscosity1_;
dmob[3] = - relPermSecondPhaseDeriv(c, s) / Super::viscosity2_;
dmob[1] = dmob[2] = 0;
}
// ------ Private methods ------
template <int dim>
double ReservoirPropertyCapillary<dim>::relPermFirstPhase(int cell_index, double saturation) const
{
if (Super::rock_.size() > 0) {
const int region = Super::cell_to_rock_[cell_index];
ASSERT (region < int(Super::rock_.size()));
double res;
Super::rock_[region].krw(saturation, res);
return res;
} else {
// HACK ALERT!
// Use quadratic rel-perm if no known rock table exists.
return saturation * saturation;
}
}
template <int dim>
double
ReservoirPropertyCapillary<dim>::
relPermFirstPhaseDeriv(int cell_index, double saturation) const
{
if (Super::rock_.size() > 0) {
const int region = Super::cell_to_rock_[cell_index];
ASSERT (region < int(Super::rock_.size()));
double res;
Super::rock_[region].dkrw(saturation, res);
return res;
} else {
// HACK ALERT!
// Use quadratic rel-perm if no known rock table exists.
return 2 * saturation;
}
}
template <int dim>
double ReservoirPropertyCapillary<dim>::relPermSecondPhase(int cell_index, double saturation) const
{
if (Super::rock_.size() > 0) {
const int region = Super::cell_to_rock_[cell_index];
ASSERT (region < int(Super::rock_.size()));
double res;
Super::rock_[region].kro(saturation, res);
return res;
} else {
// HACK ALERT!
// Use quadratic rel-perm if no known rock table exists.
return (1 - saturation) * (1 - saturation);
}
}
template <int dim>
double
ReservoirPropertyCapillary<dim>::
relPermSecondPhaseDeriv(int cell_index, double saturation) const
{
if (Super::rock_.size() > 0) {
const int region = Super::cell_to_rock_[cell_index];
ASSERT (region < int(Super::rock_.size()));
double res;
Super::rock_[region].dkro(saturation, res);
return res;
} else {
// HACK ALERT!
// Use quadratic rel-perm if no known rock table exists.
return - 2 * (1 - saturation);
}
}
template <int dim>
void ReservoirPropertyCapillary<dim>::cflFracFlows(int rock, double s, double& ff_first, double& ff_gravity) const
{
if (rock == -1) {
// No rock dependency, we might just as well use the first cell.
const int cell_index = 0;
double l1 = mobilityFirstPhase(cell_index, s);
double l2 = mobilitySecondPhase(cell_index, s);
ff_first = l1/(l1 + l2);
ff_gravity = l1*l2/(l1 + l2);
} else {
double krw, kro;
Super::rock_[rock].krw(s, krw);
Super::rock_[rock].kro(s, kro);
double l1 = krw/Super::viscosity1_;
double l2 = kro/Super::viscosity2_;
ff_first = l1/(l1 + l2);
ff_gravity = l1*l2/(l1 + l2);
}
}
template <int dim>
array<double, 3> ReservoirPropertyCapillary<dim>::computeSingleRockCflFactors(int rock, double min_perm, double max_poro) const
{
// Make min_perm matrix.
OwnCMatrix min_perm_matrix(dim, dim, (double*)0);
eye(min_perm_matrix);
min_perm_matrix *= min_perm;
// Sample values at many saturation points.
const int N = 257;
double delta = 1.0/double(N - 1);
double last_ff1, last_ffg;
double max_der1 = -1e100;
double max_derg = -1e100;
cflFracFlows(rock, 0.0, last_ff1, last_ffg);
double max_ffg = last_ffg;
double max_derpc = rock == -1 ? 0.0 :
std::fabs(Super::rock_[rock].capPressDeriv(min_perm_matrix, max_poro, 0.0));
for (int i = 1; i < N; ++i) {
double s = double(i)*delta;
double ff1, ffg;
cflFracFlows(rock, s, ff1, ffg);
double est_deriv_ff1 = std::fabs(ff1 - last_ff1)/delta;
double est_deriv_ffg = std::fabs(ffg - last_ffg)/delta;
max_der1 = std::max(max_der1, est_deriv_ff1);
max_derg = std::max(max_derg, est_deriv_ffg);
max_ffg = std::max(max_ffg, ffg);
max_derpc = rock == -1 ? 0.0 :
std::max(max_derpc, std::fabs(Super::rock_[rock].capPressDeriv(min_perm_matrix, max_poro, s)));
last_ff1 = ff1;
last_ffg = ffg;
}
array<double, 3> retval = {{ 1.0/max_der1, 1.0/max_derg, max_ffg*max_derpc }};
return retval;
}
template <int dim>
void ReservoirPropertyCapillary<dim>::computeCflFactors()
{
if (Super::rock_.empty()) {
array<double, 3> fac = computeSingleRockCflFactors(-1, 0.0, 0.0);
Super::cfl_factor_ = fac[0];
Super::cfl_factor_gravity_ = fac[1];
Super::cfl_factor_capillary_ = fac[2];
} else {
// Compute min perm and max poro per rock (for J-scaling cap pressure funcs).
std::vector<double> min_perm(Super::rock_.size(), 1e100);
std::vector<double> max_poro(Super::rock_.size(), 0.0);
int num_cells = Super::porosity_.size();
for (int c = 0; c < num_cells; ++c) {
int r = Super::cell_to_rock_[c];
min_perm[r] = std::min(min_perm[r], trace(Super::permeability(c))/double(dim));
max_poro[r] = std::max(max_poro[r], Super::porosity(c));
}
Super::cfl_factor_ = 1e100;
Super::cfl_factor_gravity_ = 1e100;
Super::cfl_factor_capillary_ = 0.0;
for (int r = 0; r < int(Super::rock_.size()); ++r) {
array<double, 3> fac = computeSingleRockCflFactors(r, min_perm[r], max_poro[r]);
Super::cfl_factor_ = std::min(Super::cfl_factor_, fac[0]);
Super::cfl_factor_gravity_ = std::min(Super::cfl_factor_gravity_, fac[1]);
Super::cfl_factor_capillary_ = std::max(Super::cfl_factor_capillary_, fac[2]);
}
}
}
} // namespace Dune
#endif // OPENRS_RESERVOIRPROPERTYCAPILLARY_IMPL_HEADER
| [
"Bard.Skaflestad@sintef.no"
] | Bard.Skaflestad@sintef.no |
600ee0e0915c32e20d2eb0bf3fb492b440471b29 | 8ee17f972d788231ea9f3ac40f1596e22834726a | /3rd/boost_1_66_0/boost/asio/ts/timer.hpp | f45c0bca8b0b2bd7de3ab35804e775d9f731c6b7 | [
"BSL-1.0"
] | permissive | tulingwangbo/cefMultiBrowser | 585a04ee2903aad5ade8b32decf4e28391b1b1f1 | 459a459021da080d39a518bfe4417f69b689342f | refs/heads/master | 2020-04-04T16:36:51.262515 | 2018-11-04T14:38:06 | 2018-11-04T14:38:06 | 156,085,167 | 5 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 764 | hpp | //
// ts/timer.hpp
// ~~~~~~~~~~~~
//
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_TS_TIMER_HPP
#define BOOST_ASIO_TS_TIMER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/chrono.hpp>
#include <boost/asio/wait_traits.hpp>
#include <boost/asio/basic_waitable_timer.hpp>
#include <boost/asio/system_timer.hpp>
#include <boost/asio/steady_timer.hpp>
#include <boost/asio/high_resolution_timer.hpp>
#endif // BOOST_ASIO_TS_TIMER_HPP
| [
"tulingwangbo@163.com"
] | tulingwangbo@163.com |
57e27c75259e95a5d30d29c23e4e95aff6414487 | c8fb249a960a3790cb2b74f62c1e02f39adf8e02 | /tests/01-real.cpp | dca3d76b77ce3c1238ecefb28d8f852b3f51c7b8 | [] | no_license | Signalsmith-Audio/fft | f36506b2013b44119b821c96476afb4acc83d711 | 957f5c27257742f44d74a7208aa6621f2ba9fcb5 | refs/heads/main | 2023-02-02T22:18:19.509848 | 2020-12-20T22:52:34 | 2020-12-20T22:52:34 | 323,150,323 | 23 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,038 | cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <complex>
#include "tests-common.h"
#define LOG_VALUE(expr) \
(std::cout << #expr << " = " << (expr) << "\n")
#define FAIL_VALUE_PAIR(expr1, expr2) \
( \
LOG_VALUE(expr1), LOG_VALUE(expr2), \
test.fail(#expr1 " and " #expr2) \
)
template<bool modified=false>
void test_real(Test &test) {
using signalsmith::FFT;
using signalsmith::RealFFT;
using signalsmith::ModifiedRealFFT;
using std::vector;
using std::complex;
for (int size = 2; size < 100; size += 2) {
vector<complex<double>> complexInput(size);
vector<complex<double>> complexMid(size);
vector<complex<double>> complexOutput(size);
vector<double> realInput(size);
vector<complex<double>> realMid(size); // Only need half, but check it's undisturbed
vector<double> realOutput(size);
FFT<double> fft(size);
typename std::conditional<modified, ModifiedRealFFT<double>, RealFFT<double>>::type realFft(size);
// Random inputs
for (int i = 0; i < size; ++i) {
double v = rand()/(double)RAND_MAX - 0.5;
complexInput[i] = v;
realInput[i] = v;
}
if (modified) {
for (int i = 0; i < size; ++i) {
double rotPhase = -M_PI*i/size;
complex<double> rot = {cos(rotPhase), sin(rotPhase)};
complexInput[i] *= rot;
}
}
for (int i = size/2; i < size; ++i) {
// Should be undisturbed - fill with known value
realMid[i] = complex<double>{52, 21};
}
fft.fft(complexInput, complexMid);
realFft.fft(realInput, realMid);
// Check complex spectrum matches
if (!modified) {
if (complexMid[0].imag() > 1e-6) return test.fail("complexMid[0].imag()");
if (abs(complexMid[0].real() - realMid[0].real()) > 1e-6) return FAIL_VALUE_PAIR(complexMid[0].real(), realMid[0].real());
if (abs(complexMid[size/2].real() - realMid[0].imag()) > 1e-6) return FAIL_VALUE_PAIR(complexMid[size/2].real(), realMid[0].imag());
}
for (int i = modified ? 0 : 1; i < size/2; ++i) {
complex<double> diff = complexMid[i] - realMid[i];
if (abs(diff) > size*1e-6) {
LOG_VALUE(i);
return FAIL_VALUE_PAIR(complexMid[i], realMid[i]);
}
}
for (int i = size/2; i < size; ++i) {
// It should have left the second half of realMid completely alone
if (realMid[i] != complex<double>{52, 21}) return test.fail("realMid second half");
}
fft.ifft(complexMid, complexOutput);
realFft.ifft(realMid, realOutput);
if (modified) {
for (int i = 0; i < size; ++i) {
double rotPhase = M_PI*i/size;
complex<double> rot = {cos(rotPhase), sin(rotPhase)};
complexOutput[i] *= rot;
}
}
for (int i = 0; i < size; ++i) {
if (complexOutput[i].imag() > size*1e-6) return test.fail("complexOutput[i].imag");
if (abs(complexOutput[i].real() - realOutput[i]) > size*1e-6) {
LOG_VALUE(size);
LOG_VALUE(i);
return FAIL_VALUE_PAIR(complexOutput[i], realOutput[i]);
}
}
}
}
TEST("Random real", random_real) {
test_real<false>(test);
}
TEST("Modified real", random_modified_real) {
test_real<true>(test);
}
| [
"luffgd@gmail.com"
] | luffgd@gmail.com |
44bcfbfe66af4344471da43265ab93870595a260 | 5ad0b998aa94aa49ccc08219f535457d6c8277af | /heaterPID.h | a4f975def2ebcee79831b14e3467b5015f1b5999 | [] | no_license | daPhoosa/Kynetic | 52d6ac191893bf196c26e229554829f31506506f | f5ae3b1014eccc8208530226b56729321612baca | refs/heads/master | 2020-12-31T00:54:20.486111 | 2019-04-19T20:24:58 | 2019-04-19T20:24:58 | 80,589,110 | 11 | 3 | null | 2018-09-24T15:10:34 | 2017-02-01T04:21:43 | C++ | UTF-8 | C++ | false | false | 3,748 | h | /*
Kynetic CNC Control Software
Copyright (C) 2017 Phillip Schmidt
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 3 of the License, 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 this program. If not, see <http://www.gnu.org/licenses/>
*/
class heaterPID
{
public:
heaterPID( int Hz, float p, float i, float d, float f );
void setGain( float p, float i, float d, float f );
void setAmbTemp( float t );
int in( float setTemp, float probeTemp );
int out();
int getSaturationTime();
void display();
private:
float setTemp, probeTemp, ambTemp;
float pGain, iGain, dGain, fwdGain;
float p_Out, i_Out, d_Out, fwd_Out;
float sampleRateHz;
float lastError, setPointTemp;
const float OUTPUT_MAX = 255.0f;
const float INV_OUTPUT_MAX = 1.0f / OUTPUT_MAX;
int output;
bool outputSaturated;
uint32_t saturationStartTime;
};
heaterPID::heaterPID( int Hz, float p, float i, float d, float f )
{
sampleRateHz = Hz;
setGain( p, i, d, f );
setAmbTemp( 22.0f );
}
void heaterPID::setGain( float p, float i, float d, float f )
{
pGain = p;
iGain = i / sampleRateHz;
dGain = d * sampleRateHz;
fwdGain = f;
}
void heaterPID::setAmbTemp( float t )
{
ambTemp = t;
}
int heaterPID::in( float set, float probe )
{
setTemp = set;
probeTemp = probe;
fwd_Out = fwdGain * ( setTemp - ambTemp );
float error = setTemp - probeTemp;
float errorDelta = (error - lastError) * 0.25f; // smooth error change
p_Out = constrain( pGain * error, -OUTPUT_MAX, OUTPUT_MAX ); // proportional component
if( abs(p_Out) < OUTPUT_MAX ) // only add I+D when P is not saturated
{
float scaleFactor = (OUTPUT_MAX - abs(p_Out)) * INV_OUTPUT_MAX; // soften I+D effect at extreme error
i_Out += iGain * error * scaleFactor; // integral component
i_Out = constrain( i_Out, -OUTPUT_MAX, OUTPUT_MAX );
d_Out = dGain * errorDelta * scaleFactor; // derivative component
d_Out = constrain( d_Out, -OUTPUT_MAX, OUTPUT_MAX );
}
else
{
i_Out = d_Out = 0.0f;
}
lastError += errorDelta;
output = int( p_Out + i_Out + d_Out + fwd_Out );
if( output >= int(OUTPUT_MAX) )
{
outputSaturated = true;
if( !saturationStartTime ) saturationStartTime = millis(); // set start time the first time saturation is observed
}
else
{
outputSaturated = false;
saturationStartTime = 0;
}
return output;
}
int heaterPID::out()
{
return output;
}
int heaterPID::getSaturationTime()
{
if( outputSaturated )
{
return ( millis() - saturationStartTime ) / 1000; // return time in seconds
}
return 0;
}
void heaterPID::display()
{
if(SERIAL_PORT)
{
String msg = String( setTemp ) + " " +
String( probeTemp ) + " " +
String( p_Out ) + " " +
String( i_Out ) + " " +
String( d_Out ) + " " +
String( fwd_Out ) + " " +
String( output ) + '\n';
SERIAL_PORT.print(msg);
}
}
| [
"pjs.schmidt@gmail.com"
] | pjs.schmidt@gmail.com |
28a92bf083b05d0e665e0830bf37f7e9ebcee63c | c27df8ce4903389256023f71fc8004c6caf41d21 | /examples/common/80_math_stat/main.cpp | f35b643e4cb6b5076e26963a769d1e7a6f9645fd | [] | no_license | atu-guda/stm32oxc | be8f584e6978fa40482bbd5df4a23bd6b41329eb | 591b43246b8928329642b06bad8b9de6802e62ed | refs/heads/master | 2023-09-03T08:42:36.058233 | 2023-09-02T19:15:15 | 2023-09-02T19:15:15 | 34,165,176 | 5 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,943 | cpp | #include <cstring>
#include <iterator>
#include <algorithm>
#include <oxc_auto.h>
#include <oxc_statdata.h>
#include <oxc_namedints.h>
#include <oxc_namedfloats.h>
using namespace std;
using namespace SMLRL;
USE_DIE4LED_ERROR_HANDLER;
BOARD_DEFINE_LEDS;
BOARD_CONSOLE_DEFINES;
const char* common_help_string = "Appication to test misc math" NL;
// --- local commands;
int cmd_test0( int argc, const char * const * argv );
CmdInfo CMDINFO_TEST0 { "test0", 'T', cmd_test0, " - test statistics" };
int cmd_testout( int argc, const char * const * argv );
CmdInfo CMDINFO_TESTOUT { "testout", 'O', cmd_testout, " - test output" };
int cmd_testsplit( int argc, const char * const * argv );
CmdInfo CMDINFO_TESTSPLIT { "testspit", 'X', cmd_testsplit, " expr - test var split" };
const CmdInfo* global_cmds[] = {
DEBUG_CMDS,
&CMDINFO_TEST0,
&CMDINFO_TESTOUT,
&CMDINFO_TESTSPLIT,
nullptr
};
void idle_main_task()
{
leds.toggle( 1 );
}
// ---------------------- ints + floats iface ---------------------------
float W_max = 100.0f;
float V_max = 8.0f;
float X_c = 1.34f;
float pmin = 5.0f;
float va[4] = { 0.1f, -0.2f, 0.3f, -0.5f };
float get_pmin( int /*idx*/ )
{
return pmin;
}
bool set_pmin( float v, int /* idx */ )
{
pmin = clamp( v, 2.0f, 90.0f );
return true;
}
int iv = 42;
int iva[] = { -7, 8, 9, -10, 15 };
int ivf = 17;
int get_ivf( int /*idx*/ )
{
return ivf;
}
bool set_ivf( int v, int /* idx */ )
{
ivf = clamp( v, -20, 20 ) & (~1u);
return true;
}
constexpr NamedFloat fl0_W_max { "W_max", &W_max };
constexpr NamedFloat fl0_V_max { "V_max", &V_max };
constexpr const NamedObj *const fl01_objs[] = {
& fl0_W_max,
& fl0_V_max,
nullptr
};
const NamedObjs fl01( fl01_objs );
constexpr NamedSubObj fl0_sub { "sub", &fl01 };
constexpr NamedFloat fl0_X_c { "X_c", &X_c, 1, NamedFloat::Flags::ro };
constexpr NamedFloat fl0_pwm_min { "pwm_min", get_pmin, set_pmin };
constexpr NamedFloat fl0_va { "va", va, size(va) };
constexpr NamedInt fl0_iv { "iv", &iv };
constexpr NamedInt fl0_iva { "iva", iva, size(iva) };
constexpr NamedInt fl0_ivf { "ivf", get_ivf, set_ivf };
constexpr const NamedObj *const fl0_objs[] = {
& fl0_sub,
& fl0_X_c,
& fl0_pwm_min,
& fl0_va,
& fl0_iv,
& fl0_iva,
& fl0_ivf,
nullptr
};
const NamedObjs fl0( fl0_objs );
bool print_var_fl( const char *nm, int fmt )
{
return fl0.print( nm, fmt );
}
bool set_var_fl( const char *nm, const char *s )
{
auto ok = fl0.set( nm, s );
print_var_fl( nm, 0 );
return ok;
}
const char* get_var_name_fl( unsigned i )
{
return fl0.getName( i );
}
// ---------------------------------------------------------
int main(void)
{
BOARD_PROLOG;
UVAR('a') = 2;
UVAR('b') = 10;
UVAR('t') = 100;
UVAR('n') = 1000000;
print_var_hook = print_var_fl;
set_var_hook = set_var_fl;
BOARD_POST_INIT_BLINK;
std_out << NL "##################### " PROJ_NAME NL;
// std_out << "# fl0.size = " << fl0.size() << " name= \"" << fl0.getName( 1 ) << "\"" NL;
// std_out << "# &fl0_W_max = " << HexInt( (void*)&fl0_W_max ) << " fl0_objs= " << HexInt( (void*)fl0_objs )
// << " fl0.begin()= " << HexInt( (void*)( fl0.begin() ) ) << NL;
//
// auto f = fl0.begin();
// std_out << "# f.getName()= \"" << f->getName() << "\"" NL;
srl.re_ps();
oxc_add_aux_tick_fun( led_task_nortos );
leds.reset( 0xFF );
std_main_loop_nortos( &srl, idle_main_task );
return 0;
}
int cmd_test0( int argc, const char * const * argv )
{
unsigned n_ch = 2;
uint32_t n = arg2long_d( 1, argc, argv, UVAR('n'), 1, 100000000 ); // number of series
std_out << "# Test: sizeof(sreal)= " << sizeof(sreal) << " sizeof(xfloat)= " << sizeof(xfloat) << NL;
StatData sdat( n_ch );
break_flag = 0;
for( decltype(n) i=0; i<n && !break_flag; ++i ) {
// uint32_t tcc = HAL_GetTick();
// if( i == 0 ) {
// tm0 = tcc; tm00 = tm0;
// }
sreal v[n_ch];
v[0] = 1.0f * UVAR('a') + ( ( i & 1 ) ? UVAR('b') : (-UVAR('b') ) );
v[1] = 5.1f * UVAR('a') - 12.3f * ( ( i & 1 ) ? UVAR('b') : (-UVAR('b') ) );
sdat.add( v );
// delay_ms_until_brk( &tm0, t_step );
}
sdat.calc();
std_out << sdat << NL;
return 0;
}
int cmd_testout( int argc, const char * const * argv )
{
if( argc > 1 ) {
float f = arg2float_d( 1, argc, argv, 1.234f, -FLT_MAX, FLT_MAX );
std_out << FltFmt( f )
<< ' ' << FltFmt( f, cvtff_exp )
<< ' ' << FltFmt( f, cvtff_fix )
<< NL;
#ifdef OXC_HAVE_DOUBLE
double d = arg2double_d( 1, argc, argv, 1.23456789123456, -DBL_MAX, DBL_MAX );
std_out << DblFmt( d )
<< ' ' << DblFmt( d, cvtff_exp )
<< ' ' << DblFmt( d, cvtff_fix )
<< NL;
#endif
return 0;
}
for( float f = 7.23456789e-12f; f < 1e14f; f *= -10 ) {
std_out << FltFmt( f )
<< ' ' << FltFmt( f, cvtff_exp )
<< ' ' << FltFmt( f, cvtff_fix )
<< NL;
}
#ifdef OXC_HAVE_DOUBLE
std_out << "# double values test " NL;
for( double f = 7.2345678912345678e-20; f < 0.1 * DBL_MAX; f *= -10 ) {
std_out << DblFmt( f )
<< ' ' << DblFmt( f, cvtff_exp )
<< ' ' << DblFmt( f, cvtff_fix )
<< NL;
}
#endif
return 0;
}
int cmd_testsplit( int argc, const char * const * argv )
{
if( argc < 2 ) {
std_out << "# Error: expresssion required! " NL;
return 1;
}
int idx;
char nm0[maxSimpleNameLength];
char nm1[maxExprNameLength];
const char *eptr;
bool ok = splitNameWithIdx( argv[1], nm0, nm1, idx, &eptr );
std_out << "ok= " << ok << " nm=\"" << nm0 << "\" nm1=\"" << nm1
<< "\" idx= " << idx << " *eptr='" << (*eptr) << '\'' << NL;
fl0.print( argv[1] );
return 0;
}
// vim: path=.,/usr/share/stm32cube/inc/,/usr/arm-none-eabi/include,/usr/share/stm32oxc/inc
| [
"atu@nmetau.edu.ua"
] | atu@nmetau.edu.ua |
214ae992d8f708a1a9d1b2494cf38314c9d29c28 | 6bc6c394edf98d0a37fd3ba3b1e209cc38ed4208 | /include/ecst/tag.hpp | 54861a20b41dd0415434ed5fc30665206f5fcfc0 | [
"AFL-3.0",
"AFL-2.1",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Qznec/ecst | 1e0ac2fed6914b133af2769dc586419fc0522013 | c068a7b932fc99ebc73ee2f0dce1eceef577bd7b | refs/heads/master | 2023-01-06T06:29:09.878561 | 2021-12-15T13:24:23 | 2021-12-15T13:24:23 | 126,379,793 | 0 | 0 | null | 2018-03-22T18:38:11 | 2018-03-22T18:38:10 | null | UTF-8 | C++ | false | false | 283 | hpp | // Copyright (c) 2015-2016 Vittorio Romeo
// License: Academic Free License ("AFL") v. 3.0
// AFL License page: http://opensource.org/licenses/AFL-3.0
// http://vittorioromeo.info | vittorio.romeo@outlook.com
#pragma once
#include "./tag/component.hpp"
#include "./tag/system.hpp"
| [
"vittorio.romeo@outlook.com"
] | vittorio.romeo@outlook.com |
a7d8c8387c9ed11dd1f1cdde61dfb5aa1d5590e5 | fc9ec32670150cce44432b6b43dca6ae7e9a56bc | /uva/10963.cc | 593530e7e468e4faabec0a6d5d6581fadb9e2c99 | [] | no_license | ArthurEmidio/programming-problems | e3efc16ad826a6f4b43277b72ef90189aec868c7 | 16a8c3883649efaf1ab0475036f017638bfe343f | refs/heads/master | 2020-12-04T12:37:06.643514 | 2017-06-27T07:49:10 | 2017-06-27T07:49:10 | 65,958,563 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 807 | cc | #include <iostream>
#include <limits>
#include <cmath>
#include <vector>
using namespace std;
#define ll long long
int main()
{
int n;
cin >> n;
vector<bool> answers(n, false);
for (int i = 0; i < n; i++) {
int w;
cin >> w;
bool isValid = true;
int y1, y2;
cin >> y1 >> y2;
int value = abs(y1 - y2);
for (int j = 1; j < w; j++) {
cin >> y1 >> y2;
if (abs(y1 - y2) != value) {
isValid = false;
}
}
if (isValid) {
answers[i] = true;
}
}
int i = 0;
for (bool b : answers) {
printf("%s\n", b ? "yes" : "no");
i++;
if (i != n) printf("\n");
}
return 0;
}
| [
"arthur.500@gmail.com"
] | arthur.500@gmail.com |
769fda9184976837fcc904872309aa67a98f5e8e | 09b36c8ab18fdc7ec4034ed9fdad088a18c191be | /CourseBuild/MyFarmingGame_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/lumpedcpp/Lump_libil2cpp_utils.cpp | a4eb6ecc50981f9205540430ecae89c51eea861b | [] | no_license | zackrcarson/MyFarmingGame | 782005ac51b1d90a376397a7c5196258649af3e2 | 0e0a867fe2023e9ac650169f6cf85bef8548a677 | refs/heads/master | 2023-01-27T14:34:02.572891 | 2020-12-10T03:11:09 | 2020-12-10T03:11:09 | 288,341,793 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,657 | cpp | #include "il2cpp-config.h"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\DirectoryUtils.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\Environment.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\Exception.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\Il2CppHStringReference.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\Logging.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\MarshalingUtils.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\Memory.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\MemoryMappedFile.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\MemoryPool.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\Output.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\PathUtils.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\RegisterRuntimeInitializeAndCleanup.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\Runtime.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\StringUtils.cpp"
#include "C:\Program Files\Unity\Hub\Editor\2019.3.7f1\Editor\Data\il2cpp\libil2cpp\utils\mono-structs.cpp"
| [
"zackrcarson@gmail.com"
] | zackrcarson@gmail.com |
c1a6a69bc129094739df9bcacbb14eb179676f15 | 722154ad6170ca33c29d32b299eadbdbbae98c44 | /UVa1615/Uva1615.cpp | c7bb23fa69b35963d1f10ffcd06d33e52c6b6aae | [
"MIT"
] | permissive | Demi871023/UVa-Problem | 43d695e007421c4ec9dd728b6eb0074592d1f06b | a87a85fb2ad0a5540969ed39f79c48465b669f35 | refs/heads/master | 2021-07-19T13:05:52.790153 | 2020-05-31T13:43:58 | 2020-05-31T13:43:58 | 173,319,816 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,416 | cpp | //UVa 1615 Highway
/*
想法:
概念上很像 UVa 10382 Watering Grass的覆蓋問題。
利用畢氏定理,求出圓半徑和圓中心距離L線的所構成的第三條邊(即dis)
在圓心X值往左的dis(-dis)和往右的dis(+dis),即為高速公路必定存在的範圍。
直接掃一遍,在不符合上述規則的情況時,count++。
最後掃完之後的ans即為答案
*/
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
struct Villages
{
double left;
double right;
bool operator < (const Villages &rhs)const
{
return right < rhs.right;
}
};
vector <Villages> v;
int main()
{
//freopen("1615.in", "r", stdin);
//freopen("ttt.out", "w", stdout);
int L, D, N;
while(~scanf("%d%d%d", &L, &D, &N))
{
v.clear();
for(int i = 0 ; i < N ; i++)
{
int x, y;
scanf("%d%d", &x, &y);
double dis = sqrt(D*D - y*y);
double templeft = (double)x - dis;
double tempright = (double)x + dis;
v.push_back((Villages){templeft, tempright});
}
sort(v.begin(), v.end());
double build = v[0].right;
int ans = 1;
for(int i = 1 ; i < N ; i++)
{
double leftmost = v[i].left;
if(leftmost <= build)
{
continue;
}
else
{
ans++;
build = v[i].right;
}
}
printf("%d\n", ans);
}
} | [
"noreply@github.com"
] | noreply@github.com |
c5360d7dfc45667fbe7871fe4b811fa9f7e34153 | 1854667e41610358399e95fc326e0d308f79f9df | /GameClient/include/GameClient/Unity/Yield/AsyncOperation.h | 4ba9769248d8cd6c9a27b192c3cb09ef8ebec05e | [] | no_license | 1aam2am1/RTS_GAME | c84e8a102635bdccbd91bc3b23b6b5663b162151 | d8df7df5949738f248d948ff49dd9703b726d9fd | refs/heads/master | 2023-03-24T06:38:55.735177 | 2021-03-26T13:59:07 | 2021-03-26T13:59:07 | 296,715,523 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,782 | h | //
// Created by Michal_Marszalek on 14.09.2020.
//
#ifndef RTS_GAME_ASYNCOPERATION_H
#define RTS_GAME_ASYNCOPERATION_H
#include <Yield/YieldInstruction.h>
#include <GameApi/Signal.h>
/// Asynchronous operation coroutine.
/// \note You can yield until asynchronous operation continues, or manually check whether it's done (isDone) or progress (progress).
class AsyncOperation : public YieldInstruction {
public:
/// Has the operation finished? (Read Only)
/// \note Flipping to true can be delayed.
/// \see allowSceneActivation
const bool &isDone = m_isDone;
///What's the operation's progress. (Read Only)
/// \note Return an operation's progress. (Read Only) This returns how close the operation is to finishing.
/// The operation is finished when the progress float reaches 1.0 and isDone is called.
/// If you set allowSceneActivation to false, progress is halted at 0.9 until it is set to true. This is extremely useful for creating loading bars.
const float &progress = m_progress;
/// Priority lets you tweak in which order async operation calls will be performed.
/// \note When multiple asynchronous operations are queued up, the operation with the higher priority will be executed first.
/// Once an operation has been started on the background thread, changing the priority will have no effect anymore.
int priority;
/// Allow Scenes to be activated as soon as it is ready.
/// \details When used in combination with LoadLevelAsync & LoadLevelAdditiveAsync it allows you to delay the actual activation of the Scene.
/// (And unloading of the previous Scene).
/// \note When allowSceneActivation is set to false then progress is stopped at 0.9. The isDone is then maintained at false.
/// When allowSceneActivation is set to true isDone can complete. While isDone is false, the AsyncOperation queue is stalled.
/// For example, if a LoadSceneAsync.allowSceneActivation is set to false, and another AsyncOperation (e.g. SceneManager.UnloadSceneAsync )
/// is initialized, the last operation will not be called before the first allowSceneActivation is set to true.
bool allowSceneActivation;
/// Event that is invoked upon operation completion. An event handler that is registered in the same frame as the call
/// that creates it will be invoked next frame, even if the operation is able to complete synchronously.
/// If a handler is registered after the operation has completed and has already invoked the complete event,
/// the handler will be called synchronously.
sigslot::signal<AsyncOperation> completed;
protected:
bool m_isDone = false;
float m_progress = 0.f;
YieldReturn operator()() override;
};
#endif //RTS_GAME_ASYNCOPERATION_H
| [
"1aam2am1@gmail.com"
] | 1aam2am1@gmail.com |
82149e2371b674e0e356610547948aa1effe359f | 18c9f462701dd6cd3c8cea41ce44b4ecdd24ec17 | /programmers/정수 삼각형.cpp | fadc4b520939cc45d12bf9101a7390e19000ea88 | [] | no_license | Jiyoung-h/algorithm | 9ad35ca6c1fd0b9f6516e51b3b9ff56b5d39eebd | a5423647ee61e889156aeb00c6473c65d5532aa8 | refs/heads/main | 2023-04-19T23:38:37.412730 | 2021-05-02T08:59:26 | 2021-05-02T08:59:26 | 324,719,207 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 353 | cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<vector<int>> triangle) {
for(int i=triangle.size()-2; i>=0; i--){
for(int j=0; j<triangle[i].size(); j++){
triangle[i][j] = max(triangle[i+1][j], triangle[i+1][j+1]) + triangle[i][j];
}
}
return triangle[0][0];
}
| [
"noreply@github.com"
] | noreply@github.com |
b8e3d126f116370e0ca6567f2accbad49836aac1 | 7ff817baf68174a89546d7c7e48886d831ef7e46 | /build/jsb-link/frameworks/runtime-src/cocos2d-x-jsb/Agora/Streaming/CocosAgoraManager.cpp | f8e3a9d307537918bbaac8d02baf560d88b2960a | [] | no_license | Tommywangh/Agora-iOS-Cocos | 2d985e3cb96897178b204a8290317153baddbdb1 | 6bd1c32abd33a424de9f4321e448625645c92531 | refs/heads/master | 2020-12-06T12:50:39.691982 | 2019-10-09T15:01:59 | 2019-10-09T15:01:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,506 | cpp | //
// CocosAgoraManager.cpp
// Agora-iOS-Cocos
//
// Created by Agora on 20/12/2017.
//
#include <string>
#include "CocosAgoraManager.h"
#include "cocos2d.h"
using namespace std;
NS_AGORA_BEGIN
static CocosAgoraManager *s_SharedCocosAgoraManager = nullptr;
CocosAgoraManager* CocosAgoraManager::getInstance()
{
if (!s_SharedCocosAgoraManager)
{
s_SharedCocosAgoraManager = new (std::nothrow) CocosAgoraManager;
}
return s_SharedCocosAgoraManager;
}
CocosAgoraManager::CocosAgoraManager() {
_chatRoom = NULL;
}
void CocosAgoraManager::setChatRoom(HomeAgora *chatRoom)
{
_chatRoom = chatRoom;
}
void CocosAgoraManager::localJoinCallback(string res)
{
if (_chatRoom != NULL) {
_chatRoom->localJoinCallback(res);
}
}
void CocosAgoraManager::localLeaveCallback(string res)
{
if (_chatRoom != NULL) {
_chatRoom->localLeaveCallback(res);
}
}
void CocosAgoraManager::muteLocalAudioCallback(string res) {
if (_chatRoom != NULL) {
_chatRoom->muteLocalAudioCallback(res);
}
}
void CocosAgoraManager::unmuteLocalAudioCallback(string res) {
if (_chatRoom != NULL) {
_chatRoom->unmuteLocalAudioCallback(res);
}
}
void CocosAgoraManager::muteLocalVideoCallback(string res)
{
if (_chatRoom != NULL) {
_chatRoom->muteLocalVideoCallback(res);
}
}
void CocosAgoraManager::unmuteLocalVideoCallback(string res)
{
if (_chatRoom != NULL) {
_chatRoom->unmuteLocalVideoCallback(res);
}
}
void CocosAgoraManager::muteRemoteVideoCallback(string res)
{
if (_chatRoom != NULL) {
_chatRoom->muteRemoteVideoCallback(res);
}
}
void CocosAgoraManager::unmuteRemoteVideoCallback(string res)
{
if (_chatRoom != NULL) {
_chatRoom->unmuteRemoteVideoCallback(res);
}
}
void CocosAgoraManager::muteRemoteAudioCallback(string res)
{
if (_chatRoom != NULL) {
_chatRoom->muteRemoteAudioCallback(res);
}
}
void CocosAgoraManager::unmuteRemoteAudioCallback(string res)
{
if (_chatRoom != NULL) {
_chatRoom->unmuteRemoteAudioCallback(res);
}
}
void CocosAgoraManager::remoteLeaveCallback(unsigned int uid)
{
if (_chatRoom != NULL) {
_chatRoom->remoteLeaveCallback(uid);
}
}
void CocosAgoraManager::remoteJoinCallback(unsigned int uid)
{
if (_chatRoom != NULL) {
_chatRoom->remoteJoinCallback(uid);
}
}
void CocosAgoraManager::updateFrame(unsigned int uid, void *rgbaBuffer, int rgbsStride, ssize_t dataLen, int width, int height, int rotation)
{
if (_chatRoom != NULL) {
_chatRoom->updateFrame(uid, rgbaBuffer, dataLen, width, height);
}
}
cocos2d::Size CocosAgoraManager::getTextureSize(unsigned int uid)
{
if (_chatRoom != NULL) {
return _chatRoom->getTextureSize(uid);
}
return cocos2d::Size(0, 0);
}
void CocosAgoraManager::updateAudioLevel(unsigned int uid, unsigned int audioLevel)
{
if (_chatRoom != NULL) {
return _chatRoom->updateAudioLevel(uid, audioLevel);
}
}
void CocosAgoraManager::updateRtcStats(unsigned int duration,
unsigned int txBytes,
unsigned int rxBytes,
unsigned int txAudioKBitrate,
unsigned int rxAudioKBitrate,
unsigned int txVideoKBitrate,
unsigned int rxVideoKBitrate,
unsigned int userCount,
double cpuAppUsage,
double cpuTotalUsage)
{
if (_chatRoom != NULL) {
_chatRoom->updateRtcStats(duration,
txBytes,
rxBytes,
txAudioKBitrate,
rxAudioKBitrate,
txVideoKBitrate,
rxVideoKBitrate,
userCount,
cpuAppUsage,
cpuTotalUsage);
}
}
void CocosAgoraManager::updateLocalVideoStats(unsigned int sentBitrate,
unsigned int sentFrameRate) {
if (_chatRoom != NULL) {
_chatRoom->updateLocalVideoStats(sentBitrate,
sentFrameRate);
}
}
void CocosAgoraManager::updateClientStats(unsigned int uid,
unsigned int width,
unsigned int height,
unsigned int receivedBitrate,
unsigned int receivedFrameRate) {
if (_chatRoom != NULL) {
_chatRoom->updateClientStats(uid,
width,
height,
receivedBitrate,
receivedFrameRate);
}
}
void CocosAgoraManager::updateNetworkQuality(unsigned int uid,
unsigned int txquality,
unsigned int rxquality) {
if (_chatRoom != NULL) {
_chatRoom->updateNetworkQuality(uid,
txquality,
rxquality);
}
}
NS_AGORA_END
| [
"lijunjie@huohua.cn"
] | lijunjie@huohua.cn |
0c934016d97906976ce0c1f7e796a4b05b838343 | a398c5d782f7dc59d7fc43a67bfefdd1872f13c6 | /ScriptExtender/GameDefinitions/PropertyMaps/Item.inl | 1aa003b6eea06e39633be4e874a2ec96810a341a | [
"MIT"
] | permissive | Norbyte/ositools | b11f82221000f0a8be6dc85bfe6c40645746524e | e2d351a5503f8660c5c40fc4a68570373befc7d9 | refs/heads/master | 2023-08-14T16:31:00.481306 | 2023-07-28T16:11:30 | 2023-07-28T16:11:30 | 120,127,571 | 351 | 41 | MIT | 2023-08-30T10:32:44 | 2018-02-03T20:37:56 | C++ | UTF-8 | C++ | false | false | 6,150 | inl | BEGIN_CLS(eoc::ItemDefinition)
P_RO(Version)
P_RO(NetID)
P_RO(ItemNetId)
P_RO(UUID)
P(RootTemplate)
P_RO(RootTemplateType)
P(OriginalRootTemplate)
P_RO(OriginalRootTemplateType)
P(WorldRot)
P(Scale_M)
P_RO(InventoryNetID)
P_RO(InventorySubContainerNetID)
P(Slot)
P(Amount)
P(GoldValueOverwrite)
P(WeightValueOverwrite)
P(DamageTypeOverwrite)
P(HP)
P(ItemType)
P(CustomDisplayName)
P(CustomDescription)
P(CustomBookContent)
P(GenerationStatsId)
P(GenerationItemType)
P(GenerationRandom)
P(GenerationLevel)
P_REF(GenerationBoostSet)
P_RO(LevelGroupIndex)
P_RO(RootGroupIndex)
P_RO(NameIndex)
P_RO(NameCool)
P(StatsLevel)
P(Key)
P(LockLevel)
P(StatsEntryName)
P(EquipmentStatsType)
P(HasModifiedSkills)
P(Skills)
P_REF(Tags)
P_REF(RuneBoostSet)
P_REF(DeltaModSet)
P_REF(PinnedContainerTags)
P(IsGlobal)
P(Active)
P(HasGeneratedStats)
P(CanBeUsed)
P(IsPinnedContainer)
P(CanBeMoved)
P(CanBePickedUp)
P(Invisible)
P(CustomRequirements)
P(Known)
P(IsIdentified)
P(GMFolding)
P(Floating)
P(CanUseRemotely)
P_FUN(ResetProgression, ResetProgression)
#if defined(GENERATING_PROPMAP)
pm.AddRawProperty("GenerationBoosts",
&(GenericGetOffsetProperty<decltype(PM::ObjectType::GenerationBoostSet)>),
&(GenericSetOffsetProperty<decltype(PM::ObjectType::GenerationBoostSet)>),
offsetof(PM::ObjectType, GenerationBoostSet)
);
pm.AddRawProperty("RuneBoosts",
&(GenericGetOffsetProperty<decltype(PM::ObjectType::RuneBoostSet)>),
&(GenericSetOffsetProperty<decltype(PM::ObjectType::RuneBoostSet)>),
offsetof(PM::ObjectType, RuneBoostSet)
);
pm.AddRawProperty("DeltaMods",
&(GenericGetOffsetProperty<decltype(PM::ObjectType::DeltaModSet)>),
&(GenericSetOffsetProperty<decltype(PM::ObjectType::DeltaModSet)>),
offsetof(PM::ObjectType, DeltaModSet)
);
#endif
END_CLS()
BEGIN_CLS(esv::ItemGeneration)
P(Base)
P(ItemType)
P(Random)
P(Level)
P(Boosts)
END_CLS()
BEGIN_CLS(esv::Item)
INHERIT(IEoCServerObject)
P_RO(WorldPos)
P_GETTER_SETTER(Flags, LuaGetFlags, LuaSetFlags)
P_BITMASK_GETTER_SETTER(Flags, LuaHasFlag, LuaSetFlag)
P(Flags2)
P_BITMASK(Flags2)
/*
// Make dangerous flags read-only
propertyMap.Flags[GFS.strActivated].Flags &= ~kPropWrite;
propertyMap.Flags[GFS.strOffStage].Flags &= ~kPropWrite;
propertyMap.Flags[GFS.strDestroyed].Flags &= ~kPropWrite;
propertyMap.Flags[GFS.strGlobal].Flags &= ~kPropWrite;
*/
P_RO(CurrentLevel)
// Available via IGameObject
// P_RO(Scale)
P_REF(AI)
P_REF(CurrentTemplate)
P(OriginalTemplateType)
P(CustomDisplayName)
P(CustomDescription)
P(CustomBookContent)
P(StatsId)
P_REF(Stats)
P_REF(StatsFromName)
P_REF(Generation)
P_RO(InventoryHandle)
P_RO(ParentInventoryHandle)
P_RO(Slot)
P(Amount)
P(Vitality)
P(Armor)
P_RO(InUseByCharacterHandle)
P(UserId)
P(Key)
P(LockLevel)
P_REF(StatusMachine)
P_RO(VisualResourceID)
P_RO(OwnerHandle)
PN_RO(OwnerCharacterHandle, OwnerHandle)
P_RO(OriginalOwnerCharacter)
// FIXME - Sockets?
P(ComputedVitality)
P(Rarity)
P(GoldValueOverwrite)
P(WeightValueOverwrite)
P_REF(Tags)
P_RO(TeleportTargetOverride)
P(TreasureLevel)
P_RO(LevelOverride)
P_RO(ForceSynch)
P_RO(TeleportUseCount)
P_RO(PreviousLevel)
// v55 compatibility
PN_REF(RootTemplate, CurrentTemplate)
P_FUN(GetInventoryItems, GetInventoryItemGuids)
P_FUN(GetNearbyCharacters, GetNearbyCharacters)
P_FUN(GetDeltaMods, GetDeltaMods)
P_FUN(SetDeltaMods, LuaSetDeltaMods)
P_FUN(GetGeneratedBoosts, GetGeneratedBoosts)
P_FUN(SetGeneratedBoosts, LuaSetGeneratedBoosts)
P_GETTER(UserVars, LuaGetUserVariables)
P_FALLBACK(&esv::Item::LuaFallbackGet, &esv::Item::LuaFallbackSet)
END_CLS()
BEGIN_CLS(esv::Inventory)
P_RO(GUID)
P_RO(NetID)
P_RO(Handle)
P_RO(EquipmentSlots)
P_RO(ParentHandle)
P_RO(CachedGoldAmount)
P_RO(CachedWeight)
P_RO(IsGlobal)
P_REF(ItemsBySlot)
P_REF(Views)
P_REF(UpdateViews)
P_REF(BuyBackAmounts)
P_REF(TimeItemAddedToInventory)
P_REF(PinnedContainers)
END_CLS()
BEGIN_CLS(esv::InventoryView)
P_RO(NetID)
P_RO(Handle)
P_RO(Owner)
P_RO(ParentType)
P_REF(Parents)
P_RO(ViewId)
P_REF(Items)
P_REF(ItemIndices)
P_REF(PinnedContainerTags)
END_CLS()
BEGIN_CLS(esv::ItemMover)
P_REF(Movements)
END_CLS()
BEGIN_CLS(esv::ItemMovement::InventoryAddParams)
P(OwnerCharacterHandle)
P(Flags)
P(InventoryNetId)
P(Slot)
END_CLS()
BEGIN_CLS(esv::ItemMovement)
P_RO(ItemHandle)
P_RO(MoverHandle)
P(Moving)
P(MovingToInventory)
P(MovingInWorld)
P(HeightForced)
P(AiBounds)
P(WakePhysics)
P(DoHitTest)
P_REF(InventoryAdd)
P(MoveEventName)
END_CLS()
BEGIN_CLS(ecl::Item)
INHERIT(IEoCClientReplicatedObject)
P_RO(WorldPos)
P_GETTER_SETTER(Flags, LuaGetFlags, LuaSetFlags)
P_BITMASK_GETTER_SETTER(Flags, LuaHasFlag, LuaSetFlag)
P_RO(PhysicsFlags)
P_BITMASK(PhysicsFlags)
P_RO(GravityTimer)
P_RO(UnknownTimer)
P_RO(FallTimer)
P_RO(WakePosition)
P_RO(AIBoundSize)
P_RO(CurrentLevel)
// Available via IGameObject
// P_RO(Scale)
P_REF(Physics)
P_REF(AI)
P_REF(CurrentTemplate)
P_REF(Stats)
P_RO(StatsId)
P_REF(StatsFromName)
P_RO(InventoryHandle)
P_RO(InventoryParentHandle)
PN_RO(ParentInventoryHandle, InventoryParentHandle)
P_RO(CurrentSlot)
PN_RO(Slot, CurrentSlot)
P(Amount)
P(Vitality)
P_REF(StatusMachine)
P_RO(InUseByCharacterHandle)
P_RO(InUseByUserId)
P(KeyName)
P(LockLevel)
P_RO(OwnerCharacterHandle)
P_RO(CachedItemDescription)
P_REF(Tags)
P(Flags2)
P_BITMASK(Flags2)
P(Level)
P(ItemType)
P(GoldValueOverride)
P(BaseWeightOverwrite)
P(ItemColorOverride)
P_REF(CustomDisplayName)
P_REF(CustomDescription)
P_REF(CustomBookContent)
#if defined(OSI_EOCAPP)
P(Icon)
#endif
// v55 compatibility
PN_REF(RootTemplate, CurrentTemplate)
P_FUN(GetInventoryItems, GetInventoryItemGuids)
P_FUN(GetOwnerCharacter, GetOwnerCharacter)
P_FUN(GetDeltaMods, GetDeltaMods)
P_GETTER(UserVars, LuaGetUserVariables)
P_FALLBACK(&ecl::Item::LuaFallbackGet, &ecl::Item::LuaFallbackSet)
END_CLS()
BEGIN_CLS(ecl::Inventory)
P_RO(GUID)
P_RO(NetID)
P_RO(OwnerCharacterHandleUI)
P_RO(EquipmentSlots)
P_RO(ParentHandle)
P_RO(Flags)
P_REF(ItemsBySlot)
// P_REF(Views)
P_REF(UpdateViews)
// P_REF(OfferedAmounts)
// P_REF(BuyBackAmounts)
P_REF(PinnedContainers)
END_CLS()
BEGIN_CLS(ecl::InventoryView)
P_RO(NetID)
P_RO(Handle)
P_RO(ParentNetId_M)
P_REF(ParentInventories)
P_REF(ItemHandles)
P_REF(ItemNetIdToIndex)
END_CLS()
| [
"infernorb@gmail.com"
] | infernorb@gmail.com |
a90afe3986b489a1c0e0ce3ef8a32b5ff2adda01 | 482c0df0db19446f3f3c68705b366777c9795bb4 | /nntrainer/compiler/input_realizer.h | 530a7e6f716b521e01256b2dbf6d75ac899e8d50 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | priyankmohanverma/nntrainer | dc5efa1aabe3fddbec4485b56059a495550f6787 | 0c82b2f21d2587dce0a18afa35fbc8d59c23adcd | refs/heads/main | 2023-08-29T04:14:56.297226 | 2021-10-14T17:07:03 | 2021-10-18T04:28:55 | 408,322,547 | 0 | 0 | Apache-2.0 | 2021-09-23T12:14:42 | 2021-09-20T05:35:59 | C++ | UTF-8 | C++ | false | false | 1,999 | h | // SPDX-License-Identifier: Apache-2.0
/**
* Copyright (C) 2021 Jihoon Lee <jhoon.it.lee@samsung.com>
*
* @file inputremap_realizer.h
* @date 14 October 2021
* @brief NNTrainer graph realizer which remaps input to the external graph
* @see https://github.com/nnstreamer/nntrainer
* @author Jihoon Lee <jhoon.it.lee@samsung.com>
* @bug No known bugs except for NYI items
*/
#ifndef __INPUTREMAP_REALIZER_H__
#define __INPUTREMAP_REALIZER_H__
#include <memory>
#include <string>
#include <vector>
#include <realizer.h>
namespace nntrainer {
/**
* @brief Graph realizer class which remaps input from start -> input layers
* @note This class find orphaned identifer in order from start_layers and
* change the identifier to input_layers. If start_layers does not have any
* input layers, push single input identifier, if start_layers have
* input_layers, check if the given input layer exists starting from the first
* input layers, if not exist, change to the given input layer in order. In case
* of start_layer contains n input_layers to be replaced.
*
*/
class InputRealizer final : public GraphRealizer {
public:
/**
* @brief Construct a new Input Realizer object
*
* @param start_layers start layers
* @param input_layers input layers
*/
InputRealizer(const std::vector<std::string> &start_layers,
const std::vector<std::string> &input_layers);
/**
* @brief Destroy the Graph Realizer object
*
*/
~InputRealizer();
/**
* @brief graph realizer creates a shallow copied graph based on the reference
* @note input realizer resets input_layers of start_layers so that it can be
* connected to the external network
* @throw std::invalid_argument if graph is ill formed
*
*/
GraphRepresentation realize(const GraphRepresentation &reference) override;
private:
std::vector<std::string> start_layers;
std::vector<std::string> input_layers;
};
} // namespace nntrainer
#endif // __INPUTREMAP_REALIZER_H__
| [
"jijoong.moon@samsung.com"
] | jijoong.moon@samsung.com |
0851d06e16079158b76aba0aafee58fb32111946 | 855a2f819b5f4d352c6a9f0d0ef9c7f891a71fff | /codeforce/1228A/1228A.cpp | 7a17cbb8236e4f58a9bc48a04a94dd32cb1564d2 | [] | no_license | DoNothing627/C- | 3cd75cd5366dc0a142b21fb574cd9c53b7e35d8f | c5fee56f58a56f1a71c90ff85f50f84ba3e249b3 | refs/heads/main | 2023-07-21T13:52:43.361327 | 2023-07-12T05:44:50 | 2023-07-12T05:44:50 | 350,928,017 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 810 | cpp | //--------DO NOTHING---------
#include <bits/stdc++.h>
#include <bitset>
//#define x first
//#define y second
#define mn
#define pb push_back
#define oo 1000000007
//#define int long long
#define DoNothing "1228A"
#define ii pair< int, int>
#define memset(f, a) memset(f, a, sizeof(f))
#define forr(i, a, b) for(int i= a; i<= b; i++)
using namespace std;
int l, r;
bool d[20];
bool chek(int x)
{
memset(d, 0);
while(x){
if(d[x% 10]) return 0;
d[x% 10]= 1;
x/= 10;
}
return 1;
}
main()
{
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
freopen(DoNothing".inp", "r", stdin);
//freopen(DoNothing".out", "w", stdout);
cin>> l>> r;
forr(i, l, r)
if(chek(i)){
cout<< i;
return 0;
}
cout<< -1;
return 0;
}
| [
"andxh58chn@gmail.com"
] | andxh58chn@gmail.com |
c03fabeee19cc6fe0fef70163f19e18240452a18 | c8e6dfe5d2d4511f6ba1413b278932a2ab10a9c1 | /src/prcm/reg_cm_rtc.hpp | d8da02d6dc84fcbde301b0be7f00f0d573143478 | [
"MIT"
] | permissive | brandonbraun653/Apollo | 61d4a81871ac10b2a2c74c238be817daeee40bb6 | a1ece2cc3f1d3dae48fdf8fe94f0bbb59d405fce | refs/heads/main | 2023-04-08T19:13:45.705310 | 2021-04-17T22:02:02 | 2021-04-17T22:02:02 | 319,139,363 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,141 | hpp | /********************************************************************************
* File Name:
* reg_cm_rtc.hpp
*
* Description:
* RTC clock module register definitions
*
* 2021 | Brandon Braun | brandonbraun653@gmail.com
*******************************************************************************/
#pragma once
#ifndef APOLLO_REG_DEF_CM_RTC_HPP
#define APOLLO_REG_DEF_CM_RTC_HPP
/* STL Includes */
#include <cstdint>
/* Apollo Includes */
#include <Apollo/src/mem/mem_map.hpp>
/* Chimera Includes */
#include <Chimera/common>
#include <Chimera/utility>
namespace Apollo::REG
{
/*-------------------------------------------------------------------------------
RTC Registers
-------------------------------------------------------------------------------*/
static constexpr Chimera::Gen::RegAccess<uint32_t, MEM::L4_CM_RTC.StartAddress + 0x00, 0xFFFFFFFF, 0x00000000, 0>
CM_RTC_RTC_CLKCTRL;
static constexpr Chimera::Gen::RegAccess<uint32_t, MEM::L4_CM_RTC.StartAddress + 0x04, 0xFFFFFFFF, 0x00000000, 0>
CM_RTC_CLKSTCTRL;
} // namespace Apollo::REG
#endif /* !APOLLO_REG_DEF_CM_RTC_HPP */
| [
"brandonbraun653@gmail.com"
] | brandonbraun653@gmail.com |
3f5fa6b34cd3118e6347187a27d0eadba1b9bc39 | d0fb46aecc3b69983e7f6244331a81dff42d9595 | /ccc/src/model/AddUsersToSkillGroupRequest.cc | 3c9a96f332edc3f1080b6995d3ab687d150fb4cc | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-cpp-sdk | 3d8d051d44ad00753a429817dd03957614c0c66a | e862bd03c844bcb7ccaa90571bceaa2802c7f135 | refs/heads/master | 2023-08-29T11:54:00.525102 | 2023-08-29T03:32:48 | 2023-08-29T03:32:48 | 115,379,460 | 104 | 82 | NOASSERTION | 2023-09-14T06:13:33 | 2017-12-26T02:53:27 | C++ | UTF-8 | C++ | false | false | 1,880 | cc | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/ccc/model/AddUsersToSkillGroupRequest.h>
using AlibabaCloud::CCC::Model::AddUsersToSkillGroupRequest;
AddUsersToSkillGroupRequest::AddUsersToSkillGroupRequest()
: RpcServiceRequest("ccc", "2020-07-01", "AddUsersToSkillGroup") {
setMethod(HttpRequest::Method::Post);
}
AddUsersToSkillGroupRequest::~AddUsersToSkillGroupRequest() {}
std::string AddUsersToSkillGroupRequest::getInstanceId() const {
return instanceId_;
}
void AddUsersToSkillGroupRequest::setInstanceId(const std::string &instanceId) {
instanceId_ = instanceId;
setParameter(std::string("InstanceId"), instanceId);
}
std::string AddUsersToSkillGroupRequest::getUserSkillLevelList() const {
return userSkillLevelList_;
}
void AddUsersToSkillGroupRequest::setUserSkillLevelList(const std::string &userSkillLevelList) {
userSkillLevelList_ = userSkillLevelList;
setParameter(std::string("UserSkillLevelList"), userSkillLevelList);
}
std::string AddUsersToSkillGroupRequest::getSkillGroupId() const {
return skillGroupId_;
}
void AddUsersToSkillGroupRequest::setSkillGroupId(const std::string &skillGroupId) {
skillGroupId_ = skillGroupId;
setParameter(std::string("SkillGroupId"), skillGroupId);
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
5076a55a4848a1c003f89b185997259ffda02e20 | fe0559eaa11c60145797571bf0ab051bed71ae91 | /ast/XQFunctionConversion.cpp | 371a6c3f449be2182ad4c9985b11f135334f328f | [] | no_license | ren19890419/xqilla | 23e64a012f825ff58371907284d15872c9286f7b | ba6e4d58c777bede091856c0edee68c58a5fa364 | refs/heads/master | 2021-05-26T12:09:50.022580 | 2012-04-11T13:41:47 | 2012-04-11T13:41:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,919 | cpp | /*
* Copyright (c) 2001, 2008,
* DecisionSoft Limited. All rights reserved.
* Copyright (c) 2004, 2011,
* Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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 "../config/xqilla_config.h"
#include <assert.h>
#include <sstream>
#include <xqilla/ast/XQFunctionConversion.hpp>
#include <xqilla/schema/SequenceType.hpp>
#include <xqilla/context/DynamicContext.hpp>
#if defined(XERCES_HAS_CPP_NAMESPACE)
XERCES_CPP_NAMESPACE_USE
#endif
XQFunctionConversion::XQFunctionConversion(ASTNode* expr, SequenceType* seqType, XPath2MemoryManager* memMgr)
: ASTNodeImpl(FUNCTION_CONVERSION, memMgr),
expr_(expr),
seqType_(seqType)
{
}
ASTNode* XQFunctionConversion::staticResolution(StaticContext *context)
{
seqType_->staticResolution(context);
return seqType_->convertFunctionArg(expr_, context, /*numericfunction*/false, seqType_)
->staticResolution(context);
}
ASTNode *XQFunctionConversion::staticTypingImpl(StaticContext *context)
{
// Never happens
return this;
}
Result XQFunctionConversion::createResult(DynamicContext* context, int flags) const
{
// Never happens
return 0;
}
ASTNode *XQFunctionConversion::getExpression() const {
return expr_;
}
SequenceType *XQFunctionConversion::getSequenceType() const {
return seqType_;
}
void XQFunctionConversion::setExpression(ASTNode *item) {
expr_ = item;
}
| [
"yayanyang@gmail.com"
] | yayanyang@gmail.com |
f587712f9a039c3422d04c8c1fbf32647699df0a | 955feb7b64478dec79eccab0d52a8de02d6d7bc7 | /main.cpp | 032c9a639b96d6daa2f37699e7cd0dd26299b4ea | [] | no_license | AdityaPatil00/2DGame | ca070829de8f5b7d89d8824e75ec3f7e134b2307 | 97d97feced705d47bfdf8799b5db79e9d0f66338 | refs/heads/master | 2021-01-13T00:45:03.772598 | 2016-03-31T15:58:23 | 2016-03-31T15:58:23 | 54,003,885 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 306 | cpp | //Game
#include "manager.h"
#include <iostream>
#include <vector>
int main(int,char*[]) { //
try {
Manager manager;
manager.play();
}
catch (const string& msg) { std::cout << msg << std::endl; }
catch (...) {
std::cout << "Oops, someone threw an exception!" << std::endl;
}
return 0;
}
| [
"aaddiipp243@gmail.com"
] | aaddiipp243@gmail.com |
fa38dc1c74d08a64d936017f3a0e969664ef3ace | 4c6f485f6f3d7ec836ebd11a242381dbd906e064 | /addons/cirkit-addon-reversible/src/reversible/cli/commands/cbs.cpp | 2fd6232566f31f519e10505dcb5fae35745c1a41 | [] | no_license | chastell/cirkit | d4b079c41d6084da3e9a59bfda1e7f7aca78217a | f239edec904a013c134c14197e12f35d0271e9cf | refs/heads/master | 2020-12-31T02:32:32.562881 | 2016-07-08T09:41:17 | 2016-07-08T09:41:17 | 62,955,618 | 0 | 0 | null | 2016-07-09T15:23:39 | 2016-07-09T15:23:39 | null | UTF-8 | C++ | false | false | 4,335 | cpp | /* CirKit: A circuit toolkit
* Copyright (C) 2009-2015 University of Bremen
* Copyright (C) 2015-2016 EPFL
*
* 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 3 of the License, 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "cbs.hpp"
#include <boost/format.hpp>
#include <alice/rules.hpp>
#include <core/cli/stores.hpp>
#include <core/utils/program_options.hpp>
#include <classical/cli/stores.hpp>
#include <reversible/cli/stores.hpp>
#include <reversible/synthesis/cut_based_synthesis.hpp>
namespace cirkit
{
/******************************************************************************
* Types *
******************************************************************************/
/******************************************************************************
* Private functions *
******************************************************************************/
/******************************************************************************
* Public functions *
******************************************************************************/
cbs_command::cbs_command( const environment::ptr& env )
: cirkit_command( env, "Circuit based synthesis", "[M. Soeken, A. Chattopadhyay: Unlocking Efficiency and Scalability of Reversible Logic Synthesis using Conventional Logic Synthesis, in: DAC 53 (2016)]" )
{
opts.add_options()
( "threshold,t", value_with_default( &threshold ), "threshold for size of FFRs" )
( "embedding", value_with_default( &embedding ), "0u: BDD-based, 1u: PLA-based" )
( "synthesis", value_with_default( &synthesis ), "0u: TBS (BDD), 1u: TBS (SAT), 2u: DBS" )
( "store_intermediate", "stores all intermediate results (BDDs, RCBDDs, and circuits) in store\n"
"should only be used for debugging purposes on small functions" )
;
add_new_option();
be_verbose();
}
command::rules_t cbs_command::validity_rules() const
{
return { has_store_element<aig_graph>( env ) };
}
bool cbs_command::execute()
{
const auto& aigs = env->store<aig_graph>();
auto& circuits = env->store<circuit>();
auto settings = make_settings();
settings->set( "var_threshold", threshold );
settings->set( "embedding", embedding );
settings->set( "synthesis", synthesis );
settings->set( "store_intermediate", is_set( "store_intermediate" ) );
circuit circ;
cut_based_synthesis( circ, aigs.current(), settings, statistics );
extend_if_new( circuits );
circuits.current() = circ;
print_runtime();
if ( is_set( "store_intermediate" ) )
{
auto& bdds = env->store<bdd_function_t>();
auto& rcbdds = env->store<rcbdd>();
for ( const auto& bdd : statistics->get<std::vector<bdd_function_t>>( "bdds" ) )
{
bdds.extend();
bdds.current() = bdd;
}
for ( const auto& cf : statistics->get<std::vector<rcbdd>>( "rcbdds" ) )
{
rcbdds.extend();
rcbdds.current() = cf;
}
for ( const auto& circ : statistics->get<std::vector<circuit>>( "circuits" ) )
{
circuits.extend();
circuits.current() = circ;
}
}
return true;
}
command::log_opt_t cbs_command::log() const
{
return log_opt_t({
{"runtime", statistics->get<double>( "runtime" )},
{"threshold", static_cast<int>(threshold)},
{"embedding", static_cast<int>(embedding)},
{"synthesis", static_cast<int>(synthesis)}
});
}
}
// Local Variables:
// c-basic-offset: 2
// eval: (c-set-offset 'substatement-open 0)
// eval: (c-set-offset 'innamespace 0)
// End:
| [
"mathias.soeken@gmail.com"
] | mathias.soeken@gmail.com |
b9e039f2c6fbb757cb4300a9ae7c9f703a11c1c0 | 8c46543db2ac0645fe3a90e69b9e8e13c3e9d68d | /src/bench/verify_script.cpp | 6d859fc657c315df8bdcebe7b430bb71bf98dab8 | [
"MIT"
] | permissive | LISY-Network/LISY-Network | 4552cc21e201238969633b4d3552cea4a645c189 | ba0a8ebc8ab79437aca9372a192a687398da5314 | refs/heads/master | 2023-01-14T14:12:21.328616 | 2020-10-10T04:33:15 | 2020-10-10T04:33:15 | 302,812,964 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,062 | cpp | // Copyright (c) 2016 The Bitcoin Core developers
// Copyright (c) 2017 The LISYNetwork Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bench.h"
#include "key.h"
#if defined(HAVE_CONSENSUS_LIB)
#include "script/lisynetworkconsensus.h"
#endif
#include "script/script.h"
#include "script/sign.h"
#include "streams.h"
#include <array>
// FIXME: Dedup with BuildCreditingTransaction in test/script_tests.cpp.
static CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey)
{
CMutableTransaction txCredit;
txCredit.nVersion = 1;
txCredit.nLockTime = 0;
txCredit.vin.resize(1);
txCredit.vout.resize(1);
txCredit.vin[0].prevout.SetNull();
txCredit.vin[0].scriptSig = CScript() << CScriptNum(0) << CScriptNum(0);
txCredit.vin[0].nSequence = CTxIn::SEQUENCE_FINAL;
txCredit.vout[0].scriptPubKey = scriptPubKey;
txCredit.vout[0].nValue = 1;
return txCredit;
}
// FIXME: Dedup with BuildSpendingTransaction in test/script_tests.cpp.
static CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit)
{
CMutableTransaction txSpend;
txSpend.nVersion = 1;
txSpend.nLockTime = 0;
txSpend.vin.resize(1);
txSpend.vout.resize(1);
txSpend.vin[0].prevout.hash = txCredit.GetHash();
txSpend.vin[0].prevout.n = 0;
txSpend.vin[0].scriptSig = scriptSig;
txSpend.vin[0].nSequence = CTxIn::SEQUENCE_FINAL;
txSpend.vout[0].scriptPubKey = CScript();
txSpend.vout[0].nValue = txCredit.vout[0].nValue;
return txSpend;
}
// Microbenchmark for verification of a basic P2WPKH script. Can be easily
// modified to measure performance of other types of scripts.
static void VerifyScriptBench(benchmark::State& state)
{
const int flags = SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH;
const int witnessversion = 0;
// Keypair.
CKey key;
static const std::array<unsigned char, 32> vchKey = {
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
}
};
key.Set(vchKey.begin(), vchKey.end(), false);
CPubKey pubkey = key.GetPubKey();
uint160 pubkeyHash;
CHash160().Write(pubkey.begin(), pubkey.size()).Finalize(pubkeyHash.begin());
// Script.
CScript scriptPubKey = CScript() << witnessversion << ToByteVector(pubkeyHash);
CScript scriptSig;
CScript witScriptPubkey = CScript() << OP_DUP << OP_HASH160 << ToByteVector(pubkeyHash) << OP_EQUALVERIFY << OP_CHECKSIG;
CTransaction txCredit = BuildCreditingTransaction(scriptPubKey);
CMutableTransaction txSpend = BuildSpendingTransaction(scriptSig, txCredit);
CScriptWitness& witness = txSpend.vin[0].scriptWitness;
witness.stack.emplace_back();
key.Sign(SignatureHash(witScriptPubkey, txSpend, 0, SIGHASH_ALL, txCredit.vout[0].nValue, SIGVERSION_WITNESS_V0), witness.stack.back(), 0);
witness.stack.back().push_back(static_cast<unsigned char>(SIGHASH_ALL));
witness.stack.push_back(ToByteVector(pubkey));
// Benchmark.
while (state.KeepRunning()) {
ScriptError err;
bool success = VerifyScript(
txSpend.vin[0].scriptSig,
txCredit.vout[0].scriptPubKey,
&txSpend.vin[0].scriptWitness,
flags,
MutableTransactionSignatureChecker(&txSpend, 0, txCredit.vout[0].nValue),
&err);
assert(err == SCRIPT_ERR_OK);
assert(success);
#if defined(HAVE_CONSENSUS_LIB)
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
stream << txSpend;
int csuccess = lisynetworkconsensus_verify_script_with_amount(
txCredit.vout[0].scriptPubKey.data(),
txCredit.vout[0].scriptPubKey.size(),
txCredit.vout[0].nValue,
(const unsigned char*)stream.data(), stream.size(), 0, flags, nullptr);
assert(csuccess == 1);
#endif
}
}
BENCHMARK(VerifyScriptBench);
| [
"lisy_network@163.com"
] | lisy_network@163.com |
800a7fdeb39c45bd6e20a362dec7af63d03084bc | 92cbbee1dae8d2889db3125201db09ab6de7e9b0 | /GreedyAlgorithms/JobSequencing.cpp | 9855617267cea79867f51511677a388c63112cad | [] | no_license | sanyamsinghal/Data_Structures_And_Algorithms | bb2121da766420e3fdfb9517c5ad7013daa029c2 | 8c5277d6a904da946830a3657a4181a9ff86826a | refs/heads/master | 2021-05-25T22:19:11.131151 | 2020-08-29T17:42:15 | 2020-08-29T17:42:15 | 253,944,134 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,888 | cpp | // /*
// User:- sanyam
// */
// #include<bits/stdc++.h>
// using namespace std;
// #define pb push_back
// #define mp make_pair
// #define ll long long int
// #define mod 1000000007
// #define w(t) int t; cin>>t while(t--)
// #define triplet pair<int,pair<int,int>>
// #define vi vector<int>
// #define vll vector<ll>
// #define pi pair<int,int>
// #define pll pair<ll,ll>
// #define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// #define loop(i, k, n) for(ll i=k; i<n; i+=1)
// #define loop2(i, k, n) for(ll i=k; i>=n; i--)
// const ll inf = 1e18;
// void take_fileIO(){
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
// return;
// }
// /* ---------------------From here main coding part starts-------------------- */
// bool comp(pi a, pi b){
// if(a.first==b.first)
// return a.second > b.second;
// return a.first > b.first;
// }
// void solve(){
// int n; cin>>n;
// vector<pair<int,int>>v;
// for(int i=1; i<=n; i++){
// int id, deadline, profit;
// cin>>id>>deadline>>profit;
// v.push_back(mp(profit, deadline));
// // cout<<id<<deadline<<profit<<endl;
// }
// bool vis[505] = {false};
// sort(v.begin(), v.end(), comp);
// // for(int i=0; i<n; i++){
// // cout<<v[i].first<<" "<<v[i].second<<endl;
// // }
// // cout<<"---\n";
// int total_profit = 0;
// int cnt=0;
// for(int i=0; i<n; i++){
// int dead = v[i].second;
// while(dead>0){
// if(vis[dead]==false && dead<=n){
// total_profit += v[i].first;
// vis[dead]=true;
// cnt++;
// break;
// // cout<<dead<<" "<<v[i].first<<endl;
// }
// dead--;
// }
// }
// cout<<cnt<<" "<<total_profit<<endl;
// }
// int main(){
// fastIO;
// take_fileIO();
// int t; cin>>t;
// while(t--){
// solve();
// }
// return 0;
// }
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long int
#define mod 1000000007
#define w(t) int t; cin>>t while(t--)
#define triplet pair<int,pair<int,int>>
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int,int>
#define pll pair<ll,ll>
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define loop(i, k, n) for(ll i=k; i<n; i+=1)
#define loop2(i, k, n) for(ll i=k; i>=n; i--)
const ll inf = 1e18;
void take_fileIO(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
return;
}
/* ---------------------From here main coding part starts-------------------- */
bool comp(pi a, pi b){
if(a.first==b.first)
return a.second > b.second;
return a.first > b.first;
}
void solve(){
int n; cin>>n;
vector<pair<int,int>>v;
for(int i=1; i<=n; i++){
int id, deadline, profit;
cin>>id>>deadline>>profit;
v.push_back(mp(profit, deadline));
// cout<<id<<deadline<<profit<<endl;
}
bool vis[500] = {false};
int available[501];
for(int i=0; i<=500; i++)
available[i]=i;
sort(v.begin(), v.end(), comp);
// for(int i=0; i<n; i++){
// cout<<v[i].first<<" "<<v[i].second<<endl;
// }
// cout<<"---\n";
int total_profit = 0;
int cnt=0;
for(int i=0; i<n; i++){
int dead = v[i].second;
int available_slot = available[dead];
if(available_slot > 0){
if(1){
total_profit += v[i].first;
vis[dead]=true;
available[dead] =dead-1;
cnt++;
break;
}
}
}
cout<<cnt<<" "<<total_profit<<endl;
}
int main(){
fastIO;
take_fileIO();
int t; cin>>t;
while(t--){
solve();
}
return 0;
} | [
"noreply@github.com"
] | noreply@github.com |
43773817e45ea60fb13126f8e03696963959167d | 3f4450af978da5dd4460113bc00bb7972e8dda35 | /Undergraduate_SecondYear/Others/main.cpp | 70903bcfd74a91280f201badce39d04a686d8413 | [] | no_license | dantlz/VERY_OLD_Academic_Projects | 070824a20f79f463dc5606c81d6449cea707147b | 15b3464fa8d4896e7b7cf066ccdff541c3361812 | refs/heads/master | 2021-05-01T18:37:07.751308 | 2016-08-26T23:25:40 | 2016-08-26T23:25:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 81 | cpp |
int main(int argc, char* argv[]){
return 0;
}
//g++ -g -Wall main.cpp -o main
| [
"tianlinz@usc.edu"
] | tianlinz@usc.edu |
73ca89961b4db88b8c565e5d2ce4524e4cb08062 | b5c591be63b6b4d9ed6e477777e8464bd887aad6 | /led-controller.ino | 5f2ead4e4db4399e548387e1d3e0c6f1a301532b | [] | no_license | seco/ESP8266-WS28xx-Blynk | aa8501275a79ceaf03c0af43a4ddca27b68d3597 | 8d1f918e55ab3fdfee4f37018199a1663868c62d | refs/heads/master | 2021-01-04T14:06:44.170244 | 2017-01-09T01:14:59 | 2017-01-09T01:14:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,902 | ino | /*
Virtual Ports:
V0 = Hue (Slider 0-255)
V1 = Saturation (Slider 0-255)
V2 = Brightness (Slider 0-255)
V3 = Cycle Pre-set (Momentary Button)
V4 = Colour: Blue (Momentary Button)
V5 = Updates Per Sec (Slider 10-500)
V6 = Colour: Red (Momentary Button)
V7 = Colour: Green (Momentary Button)
V8 = Colour: White (Momentary Button)
V9 = Terminal Widget
V10 = Manual Mode (Switch Button)
V11 = Sync gHUE (Momentary Button)
V12 = Colour: Yellow (Momentary Button)
V13 = Alert Mode (Momentary Button)
V14 = OFF (Momentary Button)
V15 = Colour: Light Blue (Momentary Button)
V16 = Zone1 Up Time (Value Widget)
V17 = Zone1 Wifi Signal (Value Widget)
V18 = Zone2 Up Time (Value Widget)
V19 = Zone2 Wifi Signal (Value Widget)
V20 = Zone3 Up Time (Value Widget)
V21 = Zone3 Wifi Signal (Value Widget)
V25 = Memory1 (Momentary Button)
V26 = Memory2 (Momentary Button)
V29 = Night Mode
*/
/****************************************************************************/
//#define BLYNK_PRINT Serial
#include <ArduinoOTA.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <FastLED.h>
#include <SimpleTimer.h>
#include <elapsedMillis.h>
/****************************************************************************/
#define BLYNK_MSG_LIMIT 200
#define DATA_PIN 12
/************************ CHANGE SETTINGS HERE ONLY *************************/
#define NUM_LEDS 100
char nickname[] = "xxxxxxxx";
int HardwareZone = 2;
char auth[] = "xxxxxxxx";
char ssid[] = "xxxxxxxx";
char pass[] = "xxxxxxxx";
/****************************************************************************/
int varManualMode, varHue, varSaturation, varBrightness, varHuePrev, varHueNew;
int varNextColour, varNextColourPrev, varBlendingMode, varUpdatesPerSec;
int varAlertMode, varZone, varRainbowSpeed;
long HexRGB;
int varNight, curMode, curSaturation, curBrightness, curHue;
int varMemSave, varMem1, varMem1_Brightness, varMem1_Saturation, varMem1_Hue, varMem1_ManualMode;
int varMem2, varMem2_Brightness, varMem2_Saturation, varMem2_Hue, varMem2_ManualMode;
/****************************************************************************/
WidgetTerminal terminal(V9);
SimpleTimer timer;
CRGB leds[NUM_LEDS];
/****************************************************************************/
void sendUptime() {
Blynk.virtualWrite(V16, millis() / 1000);
Blynk.virtualWrite(V17, map(WiFi.RSSI(), -105, -40, 0, 100) );
}
/****************************************************************************/
void setup()
{
WiFi.mode(WIFI_STA);
// CHOOSE CLOUD OR LOCAL SERVER CONFIG
Blynk.begin(auth, ssid, pass);
// Blynk.begin(auth, ssid, pass, IPAddress(192, 168, 1, 2));
while (Blynk.connect() == false) {}
/*********** OTA *************/
ArduinoOTA.setHostname("LED-Controller-1");
ArduinoOTA.begin();
/******** BOOT VARS **********/
varHue = 190; // Start on a Blue Hue
varSaturation = 255; // Start Full Colour
varBrightness = 255; // Start Full Brightness
varManualMode = 0; // Start in preset mode
varNextColour = 0; //
varNextColourPrev = 0; // Set Button State
varBlendingMode = 1; // Start LINEARBLEND
varUpdatesPerSec = 100; // Start on 100 fps
varAlertMode = 0; // Start Alert Mode OFF
varZone = 1;
varRainbowSpeed = 0; // Start stationary
/******** FASTLED ************/
FastLED.addLeds<WS2811, DATA_PIN, GRB>(leds, NUM_LEDS);
/******** READY **************/
terminal.print(F("# Blynk v" BLYNK_VERSION ": "));
terminal.print(nickname);
terminal.println(F(" Device started"));
terminal.flush();
timer.setInterval(1000L, sendUptime);
}
/****************************************************************************/
// List of patterns to cycle through. Each is defined as a separate function below.
typedef void (*SimplePatternList[])();
SimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, sinelon, juggle, whitescan };
uint8_t gCurrentPatternNumber = 0; // Index number of which pattern is current
uint8_t gHue = 0; // rotating "base color" used by many of the patterns
/****************************************************************************/
BLYNK_WRITE(V0) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varHue = param.asInt();
//HexRGB = ((long)leds[0].r << 16) | ((long)leds[0].g << 8 ) | (long)leds[0].b;
//Blynk.setProperty(V0, "color", "#" + String(HexRGB, HEX));
}
}
BLYNK_WRITE(V1) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varSaturation = param.asInt();
}
}
BLYNK_WRITE(V2) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varBrightness = param.asInt();
}
}
BLYNK_WRITE(V3) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varNextColour = param.asInt();
if (varNextColour == 1 && varNextColourPrev == 0) {
nextPattern();
delay(10);
}
varNextColourPrev = varNextColour;
}
}
BLYNK_WRITE(V4) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varManualMode = 1;
varBrightness = (int)255;
varSaturation = (int)255;
varHue = (int)152;
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V2, 255);
Blynk.virtualWrite(V1, 255);
Blynk.virtualWrite(V0, 152);
delay(10);
}
}
BLYNK_WRITE(V5) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varUpdatesPerSec = param.asInt();
}
}
BLYNK_WRITE(V6) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varManualMode = 1;
varBrightness = (int)255;
varSaturation = (int)255;
varHue = (int)0;
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V2, 255);
Blynk.virtualWrite(V1, 255);
Blynk.virtualWrite(V0, 0);
delay(10);
}
}
BLYNK_WRITE(V7) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varManualMode = 1;
varBrightness = (int)255;
varSaturation = (int)255;
varHue = (int)80;
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V2, 255);
Blynk.virtualWrite(V1, 255);
Blynk.virtualWrite(V0, 80);
delay(10);
}
}
BLYNK_WRITE(V8) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varManualMode = 1;
varBrightness = (int)255;
varSaturation = (int)0;
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V2, 255);
Blynk.virtualWrite(V1, 0);
delay(10);
}
}
BLYNK_WRITE(V10) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varManualMode = param.asInt();
}
}
BLYNK_WRITE(V11) {
gHue = 0;
terminal.print(nickname);
terminal.println(" | Sync'd gHUE ");
terminal.flush();
}
BLYNK_WRITE(V15) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varManualMode = 1;
Blynk.virtualWrite(V10, varManualMode);
varBrightness = (int)255;
varSaturation = (int)255;
varHue = (int)27;
Blynk.virtualWrite(V2, 255);
Blynk.virtualWrite(V1, 255);
Blynk.virtualWrite(V0, 27);
delay(10);
}
}
BLYNK_WRITE(V12) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varManualMode = 1;
varBrightness = (int)255;
varSaturation = (int)255;
varHue = (int)64;
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V2, 255);
Blynk.virtualWrite(V1, 255);
Blynk.virtualWrite(V0, 64);
delay(10);
}
}
BLYNK_WRITE(V13) {
varAlertMode = param.asInt();
terminal.print(nickname);
terminal.println(" | ALERT!");
terminal.flush();
}
BLYNK_WRITE(V14) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varManualMode = 1;
varBrightness = (int)0;
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V2, 0);
delay(10);
}
}
BLYNK_WRITE(V22) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varRainbowSpeed = param.asInt();
Blynk.virtualWrite(V22, varRainbowSpeed);
}
}
BLYNK_WRITE(V23) {
varZone = param.asInt();
if (varZone == HardwareZone) {
terminal.print(nickname);
terminal.println(" | Zone Selected!");
terminal.flush();
Blynk.virtualWrite(V0, varHue);
Blynk.virtualWrite(V1, varSaturation);
Blynk.virtualWrite(V2, varBrightness);
Blynk.virtualWrite(V5, varUpdatesPerSec);
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V22, varRainbowSpeed);
}
}
BLYNK_WRITE(V25) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varMem1 = param.asInt();
if (varMemSave && varMem1) {
varMem1_ManualMode = varManualMode;
varMem1_Hue = varHue;
varMem1_Saturation = varSaturation;
varMem1_Brightness = varBrightness;
} else if (!varMemSave && varMem1) {
varManualMode = varMem1_ManualMode;
varBrightness = varMem1_Brightness;
varSaturation = varMem1_Saturation;
varHue = varMem1_Hue;
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V2, varBrightness);
Blynk.virtualWrite(V1, varSaturation);
Blynk.virtualWrite(V0, varHue);
}
}
delay(10);
}
BLYNK_WRITE(V26) {
if ( (varZone == HardwareZone) || (varZone == 1)) {
varMem2 = param.asInt();
if (varMemSave && varMem2) {
varMem2_ManualMode = varManualMode;
varMem2_Hue = varHue;
varMem2_Saturation = varSaturation;
varMem2_Brightness = varBrightness;
} else if (!varMemSave && varMem2) {
varManualMode = varMem2_ManualMode;
varBrightness = varMem2_Brightness;
varSaturation = varMem2_Saturation;
varHue = varMem2_Hue;
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V2, varBrightness);
Blynk.virtualWrite(V1, varSaturation);
Blynk.virtualWrite(V0, varHue);
}
}
delay(10);
}
BLYNK_WRITE(V27) {
varMemSave = param.asInt();
}
BLYNK_WRITE(V29) {
varNight = param.asInt();
if (varNight) {
curMode = varManualMode;
curSaturation = varSaturation;
curBrightness = varBrightness;
curHue = varHue;
varManualMode = 1;
varBrightness = (int)100;
varSaturation = (int)255;
varHue = (int)152;
Blynk.virtualWrite(V10, varManualMode);
Blynk.virtualWrite(V2, 100);
Blynk.virtualWrite(V1, 255);
Blynk.virtualWrite(V0, 152);
delay(10);
} else if (!varNight) {
varManualMode = curMode;
varBrightness = curBrightness;
varSaturation = curSaturation;
varHue = curHue;
Blynk.virtualWrite(V10, curMode);
Blynk.virtualWrite(V2, curBrightness);
Blynk.virtualWrite(V1, curSaturation);
Blynk.virtualWrite(V0, curHue);
delay(10);
}
}
/****************************************************************************/
void loop()
{
Blynk.run();
ArduinoOTA.handle();
timer.run(); // Initiates SimpleTimer
if (varAlertMode == 1) {
for (int i = 0; i < 20; i++) {
fill_solid(leds, NUM_LEDS, CRGB::White);
FastLED.show();
FastLED.delay(50);
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
FastLED.delay(50);
}
varAlertMode = 0;
}
if (varManualMode == 1) { // Manual Control
fill_solid(leds, NUM_LEDS, CHSV(varHue, varSaturation, varBrightness));
}
if (varManualMode == 0) { // Pallette Mode
gPatterns[gCurrentPatternNumber]();
FastLED.show();
FastLED.delay(1000 / varUpdatesPerSec);
EVERY_N_MILLISECONDS( 20 ) {
gHue++; // slowly cycle the "base color" through the rainbow
}
}
FastLED.show();
}
/****************************************************************************/
#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))
void nextPattern() {
// add one to the current pattern number, and wrap around at the end
gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);
}
void rainbow() {
// FastLED's built-in rainbow generator
fill_rainbow( leds, NUM_LEDS, gHue, varRainbowSpeed);
}
void rainbowWithGlitter() {
// built-in FastLED rainbow, plus some random sparkly glitter
rainbow();
addGlitter(80);
}
void addGlitter( fract8 chanceOfGlitter) {
if ( random8() < chanceOfGlitter) {
leds[ random16(NUM_LEDS) ] += CRGB::White;
}
}
void confetti() {
// random colored speckles that blink in and fade smoothly
fadeToBlackBy( leds, NUM_LEDS, 10);
int pos = random16(NUM_LEDS);
leds[pos] += CHSV( gHue + random8(64), 200, 255);
}
void sinelon() {
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy( leds, NUM_LEDS, 20);
int pos = beatsin16(13, 0, NUM_LEDS);
leds[pos] += CHSV( gHue, 255, 192);
}
void juggle() {
// eight colored dots, weaving in and out of sync with each other
fadeToBlackBy( leds, NUM_LEDS, 20);
byte dothue = 0;
for ( int i = 0; i < 8; i++) {
leds[beatsin16(i + 7, 0, NUM_LEDS)] |= CHSV(dothue, 200, 255);
dothue += 32;
}
}
void whitescan() {
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::White;
FastLED.show();
FastLED.delay(1000 / varUpdatesPerSec);
leds[i] = CRGB::Black;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
259faf54228b73238475606e1528b915911a3347 | e8b5f5d76996de5f4833f118bc20931ae4666088 | /mbed/Story-Fit-Mbed/src/Scenes/Title.Scene.cpp | 37d10074cf79e2aa8f6c5393dc6238861f6f3f6c | [
"MIT"
] | permissive | rads560/storyfit | 9543da70e096db8e3b065f6a156d111105c4481b | 5dce0b669e92e2d0e42260b415f469ca1ffd2b6d | refs/heads/main | 2023-04-21T08:09:42.529631 | 2021-05-11T23:01:48 | 2021-05-11T23:01:48 | 343,874,835 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,806 | cpp | /*
* StoryFit
* EE459 Spring 2021
* Team 13
* Radhika Agrawal and Justin Wilford
*/
#include "Title.Scene.h"
#include "storyfit.h"
#include "textbox.h"
#include "rectangle.h"
#include "sensors.h"
#include "MainMenu.Scene.h"
TitleScene::TitleScene(Game* game, Scene* parent)
: Scene(game, parent) {
}
TitleScene::~TitleScene() {
Unload();
}
void TitleScene::Load() {
// Serial.begin(9600);
// Serial.println("StoryFit Title Screen");
//Title screen Big text
tbTitle = new TextBox(this, 1, "Title", 30, 80, "StoryFit", 0, 0, 0x4E59, 0x4970, 3);
// Title screen prompt
tbPrompt = new TextBox(this, 0, "Prompt", 70, 190, "Press Start", 0, 0, 0xFFFF, 0x4970, 1);
// Title screen background
Rectangle* bg = new Rectangle(this, 15, "Background", 0, 0, 240, 240);
bg->SetColor(0x4970);
// Setup flashing
mTimer = PROMPT_FLASH_PERIOD;
mPromptHighlight = false;
// Serial.println("Finished Initializing");
}
void TitleScene::Unload() {
if (tbTitle != nullptr) {
delete tbTitle;
tbTitle = nullptr;
}
if (tbPrompt != nullptr) {
delete tbPrompt;
tbPrompt = nullptr;
}
}
void TitleScene::ProcessInput() {
mStartPressed = Sensors::GetButtonCenter();
}
void TitleScene::Update(float deltaTime) {
mTimer -= deltaTime;
if (mTimer <= 0.0f) {
if (mPromptHighlight) {
tbPrompt->SetColor(0xFFFF);
}
else {
tbPrompt->SetColor(0xF72B);
}
mPromptHighlight = !mPromptHighlight;
mTimer = PROMPT_FLASH_PERIOD;
}
// If the start button was pressed, move to the Main Menu scene
if (mStartPressed) {
// Load Scene automatically unloads the current scene
mGame->LoadScene(new MainMenu(mGame));
}
} | [
"jwilford@usc.edu"
] | jwilford@usc.edu |
1f7a612e47d70a7d2c768c21cccde24e99fb8823 | 24f26275ffcd9324998d7570ea9fda82578eeb9e | /chromeos/services/assistant/platform/audio_stream_handler.cc | 6b1f4f85bb8f8bb9eee677f8d9b339df42b11796 | [
"BSD-3-Clause"
] | permissive | Vizionnation/chromenohistory | 70a51193c8538d7b995000a1b2a654e70603040f | 146feeb85985a6835f4b8826ad67be9195455402 | refs/heads/master | 2022-12-15T07:02:54.461083 | 2019-10-25T15:07:06 | 2019-10-25T15:07:06 | 217,557,501 | 2 | 1 | BSD-3-Clause | 2022-11-19T06:53:07 | 2019-10-25T14:58:54 | null | UTF-8 | C++ | false | false | 6,071 | cc | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/services/assistant/platform/audio_stream_handler.h"
#include "base/bind.h"
#include "chromeos/services/assistant/platform/audio_media_data_source.h"
namespace chromeos {
namespace assistant {
AudioStreamHandler::AudioStreamHandler(
scoped_refptr<base::SequencedTaskRunner> task_runner)
: task_runner_(task_runner), client_binding_(this), weak_factory_(this) {}
AudioStreamHandler::~AudioStreamHandler() = default;
void AudioStreamHandler::StartAudioDecoder(
mojom::AssistantAudioDecoderFactory* audio_decoder_factory,
assistant_client::AudioOutput::Delegate* delegate,
InitCB on_inited) {
mojom::AssistantAudioDecoderClientPtr client;
client_binding_.Bind(mojo::MakeRequest(&client));
mojom::AssistantMediaDataSourcePtr data_source;
media_data_source_ =
std::make_unique<AudioMediaDataSource>(&data_source, task_runner_);
audio_decoder_factory->CreateAssistantAudioDecoder(
mojo::MakeRequest(&audio_decoder_), std::move(client),
std::move(data_source));
delegate_ = delegate;
media_data_source_->set_delegate(delegate_);
start_device_owner_on_main_thread_ = std::move(on_inited);
audio_decoder_->OpenDecoder(base::BindOnce(
&AudioStreamHandler::OnDecoderInitialized, weak_factory_.GetWeakPtr()));
}
void AudioStreamHandler::OnNewBuffers(
const std::vector<std::vector<uint8_t>>& buffers) {
if (buffers.size() == 0)
no_more_data_ = true;
for (const auto& buffer : buffers)
decoded_data_.emplace_back(buffer);
is_decoding_ = false;
FillDecodedBuffer(buffer_to_copy_, size_to_copy_);
}
// TODO(wutao): Needs to pass |playback_timestamp| to LibAssistant.
void AudioStreamHandler::FillBuffer(
void* buffer,
int buffer_size,
int64_t playback_timestamp,
assistant_client::Callback1<int> on_filled) {
DCHECK(!on_filled_);
on_filled_ = std::move(on_filled);
buffer_to_copy_ = buffer;
size_to_copy_ = buffer_size;
FillDecodedBuffer(buffer, buffer_size);
}
void AudioStreamHandler::OnEndOfStream() {
if (delegate_)
delegate_->OnEndOfStream();
}
void AudioStreamHandler::OnError(assistant_client::AudioOutput::Error error) {
if (delegate_)
delegate_->OnError(error);
}
void AudioStreamHandler::OnStopped() {
stopped_ = true;
// Do not provide more source data.
media_data_source_->set_delegate(nullptr);
// Call |delegate_->OnStopped()| will delete |this|. Call |CloseDecoder| to
// clean up first.
audio_decoder_->CloseDecoder(base::BindOnce(&AudioStreamHandler::StopDelegate,
weak_factory_.GetWeakPtr()));
}
void AudioStreamHandler::OnDecoderInitialized(bool success,
uint32_t bytes_per_sample,
uint32_t samples_per_second,
uint32_t channels) {
task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&AudioStreamHandler::OnDecoderInitializedOnThread,
weak_factory_.GetWeakPtr(), success, bytes_per_sample,
samples_per_second, channels));
}
void AudioStreamHandler::OnDecoderInitializedOnThread(
bool success,
uint32_t bytes_per_sample,
uint32_t samples_per_second,
uint32_t channels) {
if (!success) {
// In the case that both |OpenDecoder()| and |CloseDecoder()| were called,
// there is no need to call |OnError()|, since we are going to call
// |OnStopped()| soon.
if (!stopped_)
OnError(assistant_client::AudioOutput::Error::FATAL_ERROR);
start_device_owner_on_main_thread_.Reset();
return;
}
DCHECK(bytes_per_sample == 2 || bytes_per_sample == 4);
const assistant_client::OutputStreamFormat format = {
bytes_per_sample == 2
? assistant_client::OutputStreamEncoding::STREAM_PCM_S16
: assistant_client::OutputStreamEncoding::STREAM_PCM_S32,
/*pcm_sample_rate=*/samples_per_second,
/*pcm_num_channels=*/channels};
if (start_device_owner_on_main_thread_) {
DCHECK(!on_filled_);
std::move(start_device_owner_on_main_thread_).Run(format);
}
}
void AudioStreamHandler::StopDelegate() {
delegate_->OnStopped();
delegate_ = nullptr;
}
void AudioStreamHandler::FillDecodedBuffer(void* buffer, int buffer_size) {
if (on_filled_ && (decoded_data_.size() > 0 || no_more_data_)) {
int size_copied = 0;
// Fill buffer with data not more than requested.
while (!decoded_data_.empty() && size_copied < buffer_size) {
std::vector<uint8_t>& data = decoded_data_.front();
int audio_buffer_size = static_cast<int>(data.size());
if (size_copied + audio_buffer_size > buffer_size)
audio_buffer_size = buffer_size - size_copied;
memcpy(reinterpret_cast<uint8_t*>(buffer) + size_copied, data.data(),
audio_buffer_size);
size_copied += audio_buffer_size;
if (audio_buffer_size < static_cast<int>(data.size()))
data.erase(data.begin(), data.begin() + audio_buffer_size);
else
decoded_data_.pop_front();
}
task_runner_->PostTask(
FROM_HERE, base::BindOnce(&AudioStreamHandler::OnFillBufferOnThread,
weak_factory_.GetWeakPtr(),
std::move(on_filled_), size_copied));
}
if (decoded_data_.empty() && !no_more_data_) {
task_runner_->PostTask(FROM_HERE,
base::BindOnce(&AudioStreamHandler::DecodeOnThread,
weak_factory_.GetWeakPtr()));
}
}
void AudioStreamHandler::OnFillBufferOnThread(
assistant_client::Callback1<int> on_filled,
int num_bytes) {
on_filled(num_bytes);
}
void AudioStreamHandler::DecodeOnThread() {
if (is_decoding_)
return;
is_decoding_ = true;
audio_decoder_->Decode();
}
} // namespace assistant
} // namespace chromeos
| [
"rjkroege@chromium.org"
] | rjkroege@chromium.org |
a9a704a404c0343b162be0c411392f05c7c50f78 | 7d7301514d34006d19b2775ae4f967a299299ed6 | /leetcode/list/25.reverseKGroup.list_6.cpp | cf30c53b120c76cf93a1f451895c4def774d34e7 | [] | no_license | xmlb88/algorithm | ae83ff0e478ea01f37bc686de14f7d009d45731b | cf02d9099569e2638e60029b89fd7b384f3c1a68 | refs/heads/master | 2023-06-16T00:21:27.922428 | 2021-07-17T03:46:50 | 2021-07-17T03:46:50 | 293,984,271 | 1 | 0 | null | 2020-12-02T09:08:28 | 2020-09-09T02:44:20 | C++ | GB18030 | C++ | false | false | 3,164 | cpp | #include <iostream>
#include "listNode.h"
using namespace std;
// think
// 反转以a为头结点的链表
ListNode* reverse(ListNode* a) {
ListNode* pre = NULL;
ListNode* cur = a;
while (cur != NULL) {
ListNode* node = cur -> next;
cur -> next = pre;
pre = cur;
cur = node;
}
return pre;
}
// 反转区间[a, b)之间的元素,左闭右开(a为头结点)
ListNode* reverseAB(ListNode* a, ListNode* b) {
ListNode* pre = NULL;
ListNode* cur = a;
while (cur != b) {
ListNode* nxt = cur -> next;
cur -> next = pre;
pre = cur;
cur = nxt;
}
// 返回反转后的头结点
return pre;
}
// now?
ListNode* reverseKGroup(ListNode* head, int k) {
if (head == NULL) return NULL;
// 区间[a, b)包含k个待反转元素
ListNode* a = head;
ListNode* b = head;
for (int i = 0; i < k; i++) {
// base case;
if (b == null) return head;
b = b -> next;
}
// 反转前k个元素
ListNode newHead = reverseAB(a, b);
// !!递归反转后续链表 并且需要连接起来
a.next = reverseKGroup(b, k);
return newHead;
}
// review
ListNode* reverse(ListNode* a, ListNode* b) {
ListNode* pre = NULL;
ListNode* cur = a;
while (cur != b) {
ListNode* nxt = cur -> next;
cur -> next = pre;
pre = cur;
cur = nxt;
}
return pre;
}
ListNode* reverseKGroup(ListNode* head, int k) {
ListNode* a = head;
ListNode* b = head;
for (int i = 0; i < k; i++) {
if (b == NULL) return head;
b = b -> next;
}
ListNode* newHead = reverse(a, b);
a -> next = reverseKGroup(b, k);
return newHead;
}
// review 2021年5月20日11:22:26
ListNode* reverseBetween(ListNode* a, ListNode* b) {
ListNode* pre = nullptr;
ListNode* cur = a;
while (cur != b) {
ListNode* node = cur -> next;
cur -> next = pre;
pre = cur;
cur = node;
}
return pre;
}
ListNode* reverseKGroup(ListNode* head, int k) {
ListNode *a = head, *b = head;
for (int i = 0; i < k; ++i) {
if (!b) return head;
b = b -> next;
}
ListNode* newHead = reverseBetween(a, b);
a -> next = reverseKGroup(b, k);
return newHead;
}
//
void reverse(ListNode* a, ListNode* b) {
ListNode* pre = nullptr;
ListNode* cur = a;
while (pre != b) {
ListNode* nxt = cur -> next;
cur -> next = pre;
pre = cur;
cur = nxt;
}
}
ListNode* reverseKGroup(ListNode* head, int k) {
ListNode* dummy = new ListNode(0);
dummy -> next = head;
ListNode* pre = dummy;
while (head) {
ListNode* tail = pre;
for (int i = 0; i < k; ++i) {
tail = tail -> next;
if (!tail) return dummy -> next;
}
ListNode* nxt = tail -> next;
reverse(head, tail);
pre -> next = tail;
head -> next = nxt;
pre = head;
head = head -> next;
}
return dummy -> next;
}
// ag
ListNode* reverse(ListNode* a, ListNode* b) {
ListNode* pre = nullptr;
} | [
"xmlb@gmail.com"
] | xmlb@gmail.com |
759debcffa184d68b6d95e4f3fbec99c52d37444 | 01310f3f4d3dfb427108c7582ee5288c30ca7da8 | /src/others/test.cpp | 825a68ac66121e5243e3e4bfe7bf7f3df6ed2f3c | [] | no_license | biswesh/planogram-integrity | 2517a335ff27478f8c7b132f63616da3252ce80f | d8add0c7d48ea7ea0eb0f6e4cf14fd32186e719c | refs/heads/master | 2021-01-19T23:24:55.644988 | 2017-04-18T15:46:34 | 2017-04-18T15:46:34 | 88,976,054 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,091 | cpp | #include <stdio.h>
#include <iostream>
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/calib3d.hpp"
#include "opencv2/xfeatures2d.hpp"
#include <opencv2/imgcodecs.hpp>
#include "opencv2/ml.hpp"
#include <cmath>
#include "opencv2/core/types.hpp"
using namespace cv;
using namespace std;
int main(){
Mat img_1 = imread("/home/ubuntu/imgMatchData/test_1.jpg",IMREAD_GRAYSCALE);
Mat img_2= imread("/home/ubuntu/imgMatchData/test_2.jpg",IMREAD_GRAYSCALE);
Rect rect1;
rect1.x = 100;
rect1.y = 100;
rect1.width = 100;
rect1.height = 100;
Mat img_3 = img_1;
cout << "img_3 : "<< img_1.isContinuous() << endl;
//cout << "img3 rows : " << img_3.rows << "img3 cols : " << img_3.cols << endl;
img_3 = img_1(rect1);
cout << "img_3 : "<< img_3.isContinuous() << endl;
for(int i = 0; i < img_3.rows; i++){
for(int j = 0; j < img_3.cols; j++){
img_3.at<double>(i,j) = 122;
}
}
namedWindow( "image", WINDOW_NORMAL);
imshow("image",img_1);
waitKey(0);
//cout << "img1 rows : " << img_1.rows << "img1 cols : " << img_1.cols << endl;
//cout << "img3 rows : " << img_3.rows << "img3 cols : " << img_3.cols << endl;
//Mat a = [1 2 3;4 5 6;7 8 9];
//Mat b = a;
//Ptr<MSER> ms = MSER::create(21, (int)(0.00002*img_1.cols*img_1.rows), (int)(0.05*img_1.cols*img_1.rows), 1, 0.7);
//vector<vector<Point> > regions;
//vector<cv::Rect> mser_bbox;
//ms->detectRegions(img_1, regions, mser_bbox);
//for (int i = 0; i < regions.size(); i++){
// cout << "x : " << regions[i][4].x <<" y : " << regions[i][4].y << endl;
//}
//cout << "vector size : " << regions.size() << endl;
//cout << "vector element size : " << regions[2].size() << endl;
//for (int i = 0; i < regions.size(); i++)
//{
// rectangle(img_1, mser_bbox[i], CV_RGB(0, 255, 0));
//}
//imshow("mser", img_1);
//waitKey(0);
return 0;
} | [
"sankit@sankit.com"
] | sankit@sankit.com |
530ae0fe780f818375e5185df98a2fe35c93855d | d60d795b96f0e026b10275c21dc186ae95314e50 | /test/DrawDelphesMGvsPH.cpp | e769b7a2fd0e1aecccee74fdd76d35d64272c089 | [] | no_license | denizpoyraz/FlatNtStudy | 1c716031fb679442ce50c85420f72396086fcfdc | a570eb92c0ca59ef538bae7456c5fa9202d0c664 | refs/heads/master | 2021-01-15T17:51:30.347067 | 2015-02-26T11:02:31 | 2015-02-26T11:02:31 | 31,064,665 | 0 | 0 | null | 2015-02-20T12:49:15 | 2015-02-20T12:49:15 | null | UTF-8 | C++ | false | false | 52,143 | cpp | //////////////////////////////////////////////////
// compare or just make LHE level distributions //
//////////////////////////////////////////////////
#include <iostream>
#include <map>
#include "TChain.h"
#include "TLorentzVector.h"
#include "TSystem.h"
#include "TLatex.h"
#include "TPad.h"
#include "plotter.h"
#include "ConfigParser.h"
#include "readTree.h"
#include "utils.h"
using namespace std ;
float matchingCone ;
float minLeptonCleaningPt;
float minLeptonCutPt;
float minJetCutPt;
float leptonIsoCut_mu;
float leptonIsoCut_el;
float leptonIsoCutLoose;
bool usePuppiAsDefault;
string finalStateString;
// no cuts are possible, all the variable to be plotted are given from an external file.
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
int main (int argc, char ** argv) {
// check number of inpt parameters
if(argc < 2){
cerr<<"how to use it : ./bin/DrawLHEPlots <cfg file> "<<endl;
return -1;
}
// Set Root style from global enviroment path
string ROOTStyle;
if(getenv ("ROOTStyle")!=NULL){
ROOTStyle = getenv ("ROOTStyle");
gROOT->ProcessLine((".x "+ROOTStyle+"/setTDRStyle.C").c_str());
}
gStyle->SetOptStat(0);
gStyle->SetPadTopMargin(0.09);
gStyle->SetPadLeftMargin(0.13);
gStyle->SetErrorX(0.5);
// parse config file parameter
if (gConfigParser) return 1 ;
gConfigParser = new ConfigParser();
TString config ;
config.Form("%s",argv[1]);
if(!(gConfigParser->init(config))){
cout << ">>> parseConfigFile::Could not open configuration file " << config << endl;
return -1;
}
// import base directory where samples are located and txt file with the directory name + other info
string InputBaseDirectoryMG = gConfigParser -> readStringOption("Input::InputBaseDirectoryMG");
string InputBaseDirectoryPH = gConfigParser -> readStringOption("Input::InputBaseDirectoryPH");
// treeName
string treeName = gConfigParser -> readStringOption("Input::TreeName");
// import from cfg file the cross section value for this sample
float CrossSectionMG = gConfigParser -> readFloatOption("Input::CrossSectionMG");
// import from cfg file the cross section value for this sample
float CrossSectionPH = gConfigParser -> readFloatOption("Input::CrossSectionPH");
// take the cut list
string InputCutList = gConfigParser -> readStringOption("Input::InputCutList");
// Read the cut file
vector <cutContainer> CutList;
if(ReadInputCutFile(InputCutList,CutList) <= 0){
cerr<<" Empty Cut List File or not Exisisting --> Exit "<<endl; return -1;}
// take the variable list to be plotted
string InputVariableList = gConfigParser -> readStringOption("Input::InputVariableList");
vector<variableContainer> variableList;
if(ReadInputVariableFile(InputVariableList,variableList) <= 0 ){
cerr<<" Empty Variable List File or not Exisisting --> Exit "<<endl; return -1;}
// take lumi and other parameters
float lumi = gConfigParser -> readFloatOption("Option::Lumi"); // fb^(-1)
lumi *= 1000. ; // transform into pb^(-1)
// select lepton flavour final state
finalStateString = gConfigParser -> readStringOption("Option::finalStateString");
matchingCone = gConfigParser -> readFloatOption("Option::matchingCone");
minLeptonCleaningPt = gConfigParser -> readFloatOption("Option::minLeptonCleaningPt");
minLeptonCutPt = gConfigParser -> readFloatOption("Option::minLeptonCutPt");
minJetCutPt = gConfigParser -> readFloatOption("Option::minJetCutPt");
usePuppiAsDefault = gConfigParser -> readBoolOption("Option::usePuppiAsDefault");
leptonIsoCut_mu = gConfigParser -> readFloatOption("Option::leptonIsoCutMu");
leptonIsoCut_el = gConfigParser -> readFloatOption("Option::leptonIsoCutEl");
leptonIsoCutLoose = gConfigParser -> readFloatOption("Option::leptonIsoCutLoose");
// output directory
string outputPlotDirectory = gConfigParser -> readStringOption("Output::outputPlotDirectory");
system(("mkdir -p output/"+outputPlotDirectory).c_str());
system(("rm -r output/"+outputPlotDirectory+"/*").c_str());
///// Start the analysis
map<string,TH1F*> histoCutEffMG ;
map<string,TH1F*> histoCutEffPH ;
TChain* chainMG = new TChain (treeName.c_str()) ;
chainMG->Add ((InputBaseDirectoryMG+"/*.root").c_str()) ;
int totEventMG = chainMG->GetEntries();
readTree* readerMG = new readTree((TTree*)(chainMG));
cout<<"Lumi (fb-1) "<<lumi/1000<<" entries before "<<totEventMG<<" cross section "<<CrossSectionMG<<" Nevents before selections "<<lumi*CrossSectionMG<<" weight "<<lumi*CrossSectionMG/float(totEventMG)<<endl;
float weightMG = 1.0*lumi*CrossSectionMG/float(totEventMG) ;
TChain* chainPH = new TChain (treeName.c_str()) ;
chainPH->Add ((InputBaseDirectoryPH+"/*.root").c_str()) ;
int totEventPH = chainPH->GetEntries();
readTree* readerPH = new readTree((TTree*)(chainPH));
cout<<"Lumi (fb-1) "<<lumi/1000<<" entries before "<<totEventPH<<" cross section "<<CrossSectionPH<<" Nevents before selections "<<lumi*CrossSectionPH<<" weight "<<lumi*CrossSectionPH/float(totEventPH)<<endl;
float weightPH = 1.0*lumi*CrossSectionPH/float(totEventPH) ;
// make the plot container
vector<histoContainer> plotVectorMG;
for(size_t iCut = 0; iCut < CutList.size(); iCut++){
for(size_t iVar = 0; iVar < variableList.size(); iVar++){
plotVectorMG.push_back(histoContainer("MG_"+CutList.at(iCut).cutLayerName,variableList.at(iVar)));
}
}
vector<histoContainer> plotVectorPH;
for(size_t iCut = 0; iCut < CutList.size(); iCut++){
for(size_t iVar = 0; iVar < variableList.size(); iVar++){
plotVectorPH.push_back(histoContainer("PH_"+CutList.at(iCut).cutLayerName,variableList.at(iVar)));
}
}
int passingLHEFilterMG = 0 ;
int passingLHEFilterPH = 0 ;
int passingLHEFilterMG_Pt = 0 ;
int passingLHEFilterPH_Pt = 0 ;
int passingLHEFilterMG_Deta = 0 ;
int passingLHEFilterPH_Deta = 0 ;
// Loop on the events
for(int iEventMG = 0; iEventMG < chainMG->GetEntries(); iEventMG++){
readerMG->fChain->GetEntry(iEventMG) ;
if (iEventMG % 100000 == 0) cout << "reading event MG: " << iEventMG << "\n" ;
// filter LHE level leptons
if(finalStateString == "UU"){
if(fabs(readerMG->leptonLHEpid1) != 13 or fabs(readerMG->leptonLHEpid2) != 13)
continue;
}
else if(finalStateString == "EE"){
if(fabs(readerMG->leptonLHEpid1) != 11 or fabs(readerMG->leptonLHEpid2) != 11) continue;
}
else if(finalStateString == "EU"){
if(fabs(readerMG->leptonLHEpid1) != 11 or fabs(readerMG->leptonLHEpid2) != 13) continue ;
}
else if(finalStateString == "UE"){
if(fabs(readerMG->leptonLHEpid1) != 13 or fabs(readerMG->leptonLHEpid2) != 11) continue ;
}
else {
cerr<<"problem with LHE level final state definition --> skip event"<<endl;
continue;
}
passingLHEFilterMG++;
// if an event pass the cut, fill the associated map
TLorentzVector L_lepton1, L_lepton2, L_parton1, L_parton2;
L_lepton1.SetPtEtaPhiM(readerMG->leptonLHEpt1,readerMG->leptonLHEeta1,readerMG->leptonLHEphi1,readerMG->leptonLHEm1);
L_lepton2.SetPtEtaPhiM(readerMG->leptonLHEpt2,readerMG->leptonLHEeta2,readerMG->leptonLHEphi2,readerMG->leptonLHEm2);
L_parton1.SetPtEtaPhiM(readerMG->jetLHEPartonpt1,readerMG->jetLHEPartoneta1,readerMG->jetLHEPartonphi1,0.);
L_parton2.SetPtEtaPhiM(readerMG->jetLHEPartonpt2,readerMG->jetLHEPartoneta2,readerMG->jetLHEPartonphi2,0.);
if(L_lepton1.Pt() < minLeptonCutPt or L_lepton2.Pt() < minLeptonCutPt) continue;
passingLHEFilterMG_Pt++;
if(L_parton1.Eta()*L_parton2.Eta() > 0) continue;
passingLHEFilterMG_Deta++;
// Loop on the cut list --> one cut for each polarization
for(size_t iCut = 0; iCut < CutList.size(); iCut++){
// cut the events
string name = "MG";
if(!passCutContainerSelection(readerMG,
CutList.at(iCut),
name,
0,
usePuppiAsDefault,
minLeptonCutPt,
minLeptonCleaningPt,
leptonIsoCut_mu,
leptonIsoCut_el,
leptonIsoCutLoose,
matchingCone,
minJetCutPt,
histoCutEffMG,
finalStateString)) continue;
// if an event pass the cut, fill the associated map
TLorentzVector L_dilepton, L_met, L_puppi_met;
TLorentzVector L_dijet, L_LLmet;
// dump all the lepton in the event
vector<leptonContainer> LeptonsAll;
fillRecoLeptonsArray (LeptonsAll, *readerMG);
// dump tight leptons
vector<leptonContainer> leptonsIsoTight ;
leptonsIsoTight = dumpLeptons (LeptonsAll, leptonIsoCut_mu, leptonIsoCut_el, minLeptonCutPt);
L_dilepton = leptonsIsoTight.at(0).lepton4V_ + leptonsIsoTight.at(1).lepton4V_ ;
L_met.SetPtEtaPhiM (readerMG->pfmet,0.,readerMG->pfmetphi, 0.) ;
L_LLmet = L_dilepton + L_met ;
L_puppi_met.SetPtEtaPhiM (readerMG->pfmet_puppi,0.,readerMG->pfmetphi_puppi, 0.) ;
float asimJ = 0, asimL = 0, Rvar = 0;
// take reco jets
vector<jetContainer> RecoJetsAll ;
if(not usePuppiAsDefault)
fillRecoJetArray (RecoJetsAll, *readerMG) ;
else
fillPuppiJetArray (RecoJetsAll, *readerMG) ;
// take jets
vector<jetContainer> RecoJets;
RecoJets = dumpJets (RecoJetsAll, leptonsIsoTight, minJetCutPt, 999., CutList.at(iCut).jetPUID, minLeptonCleaningPt, matchingCone);
asimL = (leptonsIsoTight.at(0).lepton4V_.Pt()-leptonsIsoTight.at(1).lepton4V_.Pt())/(leptonsIsoTight.at(0).lepton4V_.Pt()+leptonsIsoTight.at(1).lepton4V_.Pt()) ;
if(RecoJets.size() >= 2){
L_dijet = RecoJets.at(0).jet4V_ + RecoJets.at(1).jet4V_;
asimJ = (RecoJets.at(0).jet4V_.Pt()-RecoJets.at(1).jet4V_.Pt())/(RecoJets.at(0).jet4V_.Pt()+RecoJets.at(1).jet4V_.Pt()) ;
Rvar = (leptonsIsoTight.at(0).lepton4V_.Pt()*leptonsIsoTight.at(1).lepton4V_.Pt())/(RecoJets.at(0).jet4V_.Pt()*RecoJets.at(1).jet4V_.Pt()) ;
}
for(size_t iVar = 0; iVar < variableList.size(); iVar++){
histoContainer tmpPlot;
tmpPlot.cutName = "MG_"+CutList.at(iCut).cutLayerName;
tmpPlot.varName = variableList.at(iVar).variableName;
vector<histoContainer>::iterator itVec ;
itVec = find(plotVectorMG.begin(),plotVectorMG.end(),tmpPlot);
if(itVec == plotVectorMG.end()){
cerr<<"Problem -->plot not found for MG "<<" "<<variableList.at(iVar).variableName<<endl;
continue ;
}
if(variableList.at(iVar).variableName == "ptj1" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(0).jet4V_.Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptj2" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(1).jet4V_.Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "etaj1" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(0).jet4V_.Eta(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "etaj2" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(1).jet4V_.Eta(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "detajj" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(RecoJets.at(0).jet4V_.Eta()-RecoJets.at(1).jet4V_.Eta()),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptjj" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dijet.Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "mjj" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dijet.M(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dRjj" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(0).jet4V_.DeltaR(RecoJets.at(1).jet4V_),weightMG) ;
}
else if(variableList.at(iVar).variableName == "Asim_j" and RecoJets.size() >=2){
itVec->histogram->Fill(asimJ,weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJ" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(RecoJets.at(0).jet4V_.DeltaPhi(RecoJets.at(1).jet4V_)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "etaj1etaj2" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(0).jet4V_.Eta()*RecoJets.at(1).jet4V_.Eta(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptl1" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptl2" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "etal1" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.Eta(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "etal2" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.Eta(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "mll" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.M(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptll" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "etall" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.Eta(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "phill" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.Phi(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dRll" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.DeltaR(leptonsIsoTight.at(1).lepton4V_),weightMG) ;
}
else if(variableList.at(iVar).variableName == "etal1etal2" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.Eta()*leptonsIsoTight.at(1).lepton4V_.Eta(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(leptonsIsoTight.at(1).lepton4V_)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaEta_LL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.Eta()-leptonsIsoTight.at(1).lepton4V_.Eta()),weightMG) ;
}
else if(variableList.at(iVar).variableName == "Asim_l" and RecoJets.size() >=2){
itVec->histogram->Fill(asimL,weightMG) ;
}
else if(variableList.at(iVar).variableName == "met" and RecoJets.size() >=2){
itVec->histogram->Fill(L_met.Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "R" and RecoJets.size() >=2){
itVec->histogram->Fill(Rvar,weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(L_met)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptLMet" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(0).lepton4V_ + L_met).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TLMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(L_met)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptTLMet" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(1).lepton4V_ + L_met).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LLMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dilepton.DeltaPhi(L_met)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptLLMet" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dilepton + L_met).Pt(),weightMG) ;
}
///
else if(variableList.at(iVar).variableName == "DeltaPhi_LJL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(RecoJets.at(0).jet4V_)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptLJL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(0).lepton4V_+RecoJets.at(0).jet4V_).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_LJL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.DeltaR(RecoJets.at(0).jet4V_),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TJL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(RecoJets.at(1).jet4V_)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptTJL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(0).lepton4V_+RecoJets.at(1).jet4V_).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_TJL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.DeltaR(RecoJets.at(1).jet4V_),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(L_dijet)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptJJL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(0).lepton4V_+L_dijet).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_JJL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.DeltaR(L_dijet),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(1).lepton4V_.DeltaPhi(RecoJets.at(0).jet4V_)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(1).lepton4V_.DeltaPhi(RecoJets.at(1).jet4V_)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(1).lepton4V_.DeltaPhi(L_dijet)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_LJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.DeltaR(RecoJets.at(0).jet4V_),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_TJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.DeltaR(RecoJets.at(1).jet4V_),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_JJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.DeltaR(L_dijet),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptLJTL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(1).lepton4V_+RecoJets.at(0).jet4V_).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptTJTL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(1).lepton4V_+RecoJets.at(1).jet4V_).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptJJTL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(1).lepton4V_+L_dijet).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dilepton.DeltaPhi(RecoJets.at(0).jet4V_)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dilepton.DeltaPhi(RecoJets.at(1).jet4V_)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dilepton.DeltaPhi(L_dijet)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_LJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.DeltaR(RecoJets.at(0).jet4V_),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_TJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.DeltaR(RecoJets.at(1).jet4V_),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_JJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.DeltaR(L_dijet),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptLJLL" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dilepton+RecoJets.at(0).jet4V_).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dijet.DeltaPhi(L_met)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptJJMet" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dijet+L_met).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LJMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(RecoJets.at(0).jet4V_.DeltaPhi(L_met)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptLJMet" and RecoJets.size() >=2){
itVec->histogram->Fill((RecoJets.at(0).jet4V_+L_met).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TJMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(RecoJets.at(1).jet4V_.DeltaPhi(L_met)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "ptTJMet" and RecoJets.size() >=2){
itVec->histogram->Fill((RecoJets.at(1).jet4V_+L_met).Pt(),weightMG) ;
}
///
else if(variableList.at(iVar).variableName == "ptJJ_LLMet" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dijet+L_LLmet).Pt(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJ_LLMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dijet.DeltaPhi(L_LLmet)),weightMG) ;
}
else if(variableList.at(iVar).variableName == "dR_JJ_LLMet" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dijet.DeltaR(L_LLmet),weightMG) ;
}
else if(variableList.at(iVar).variableName == "mlljj" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dilepton+L_dijet).M(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "mlljjmet" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dilepton+L_dijet+L_met).M(),weightMG) ;
}
else if(variableList.at(iVar).variableName == "mTH" and RecoJets.size() >=2){
itVec->histogram->Fill(sqrt(2*L_dilepton.Pt()*L_met.Pt()*(1-TMath::Cos(L_dilepton.DeltaPhi(L_met)))),weightMG) ;
}
}
}
}
// Loop on the events
for(int iEventPH = 0; iEventPH < chainPH->GetEntries(); iEventPH++){
readerPH->fChain->GetEntry(iEventPH) ;
if (iEventPH % 100000 == 0) cout << "reading event PH: " << iEventPH << "\n" ;
// filter LHE level leptons
if(finalStateString == "UU"){
if(fabs(readerPH->leptonLHEpid1) != 13 or fabs(readerPH->leptonLHEpid2) != 13)
continue;
}
else if(finalStateString == "EE"){
if(fabs(readerPH->leptonLHEpid1) != 11 or fabs(readerPH->leptonLHEpid2) != 11) continue;
}
else if(finalStateString == "EU"){
if(fabs(readerPH->leptonLHEpid1) != 11 or fabs(readerPH->leptonLHEpid2) != 13) continue ;
}
else if(finalStateString == "UE"){
if(fabs(readerPH->leptonLHEpid1) != 13 or fabs(readerPH->leptonLHEpid2) != 11) continue ;
}
else {
cerr<<"problem with LHE level final state definition --> skip event"<<endl;
continue;
}
passingLHEFilterPH++;
// if an event pass the cut, fill the associated map
TLorentzVector L_lepton1, L_lepton2, L_parton1, L_parton2;
L_lepton1.SetPtEtaPhiM(readerPH->leptonLHEpt1,readerPH->leptonLHEeta1,readerPH->leptonLHEphi1,readerPH->leptonLHEm1);
L_lepton2.SetPtEtaPhiM(readerPH->leptonLHEpt2,readerPH->leptonLHEeta2,readerPH->leptonLHEphi2,readerPH->leptonLHEm2);
L_parton1.SetPtEtaPhiM(readerPH->jetLHEPartonpt1,readerPH->jetLHEPartoneta1,readerPH->jetLHEPartonphi1,0.);
L_parton2.SetPtEtaPhiM(readerPH->jetLHEPartonpt2,readerPH->jetLHEPartoneta2,readerPH->jetLHEPartonphi2,0.);
if(L_lepton1.Pt() < minLeptonCutPt or L_lepton2.Pt() < minLeptonCutPt) continue;
passingLHEFilterPH_Pt++;
if(L_parton1.Eta()*L_parton2.Eta() > 0) continue;
passingLHEFilterPH_Deta++;
// Loop on the cut list --> one cut for each polarization
for(size_t iCut = 0; iCut < CutList.size(); iCut++){
// cut the events
string name = "PH";
if(!passCutContainerSelection(readerPH,
CutList.at(iCut),
name,
0,
usePuppiAsDefault,
minLeptonCutPt,
minLeptonCleaningPt,
leptonIsoCut_mu,
leptonIsoCut_el,
leptonIsoCutLoose,
matchingCone,
minJetCutPt,
histoCutEffPH,
finalStateString)) continue;
// if an event pass the cut, fill the associated map
TLorentzVector L_dilepton, L_met, L_puppi_met;
TLorentzVector L_dijet, L_LLmet;
// dump all the lepton in the event
vector<leptonContainer> LeptonsAll;
fillRecoLeptonsArray (LeptonsAll, *readerPH);
// dump tight leptons
vector<leptonContainer> leptonsIsoTight ;
leptonsIsoTight = dumpLeptons (LeptonsAll, leptonIsoCut_mu, leptonIsoCut_el, minLeptonCutPt);
L_dilepton = leptonsIsoTight.at(0).lepton4V_ + leptonsIsoTight.at(1).lepton4V_ ;
L_met.SetPtEtaPhiM (readerPH->pfmet,0.,readerPH->pfmetphi, 0.) ;
L_LLmet = L_dilepton + L_met ;
L_puppi_met.SetPtEtaPhiM (readerPH->pfmet_puppi,0.,readerPH->pfmetphi_puppi, 0.) ;
float asimJ = 0, asimL = 0, Rvar = 0;
// take reco jets
vector<jetContainer> RecoJetsAll ;
if(not usePuppiAsDefault)
fillRecoJetArray (RecoJetsAll, *readerPH) ;
else
fillPuppiJetArray (RecoJetsAll, *readerPH) ;
// take jets
vector<jetContainer> RecoJets;
RecoJets = dumpJets (RecoJetsAll, leptonsIsoTight, minJetCutPt, 999., CutList.at(iCut).jetPUID, minLeptonCleaningPt, matchingCone);
asimL = (leptonsIsoTight.at(0).lepton4V_.Pt()-leptonsIsoTight.at(1).lepton4V_.Pt())/(leptonsIsoTight.at(0).lepton4V_.Pt()+leptonsIsoTight.at(1).lepton4V_.Pt()) ;
if(RecoJets.size() >= 2){
L_dijet = RecoJets.at(0).jet4V_ + RecoJets.at(1).jet4V_;
asimJ = (RecoJets.at(0).jet4V_.Pt()-RecoJets.at(1).jet4V_.Pt())/(RecoJets.at(0).jet4V_.Pt()+RecoJets.at(1).jet4V_.Pt()) ;
Rvar = (leptonsIsoTight.at(0).lepton4V_.Pt()*leptonsIsoTight.at(1).lepton4V_.Pt())/(RecoJets.at(0).jet4V_.Pt()*RecoJets.at(1).jet4V_.Pt()) ;
}
for(size_t iVar = 0; iVar < variableList.size(); iVar++){
histoContainer tmpPlot;
tmpPlot.cutName = "PH_"+CutList.at(iCut).cutLayerName;
tmpPlot.varName = variableList.at(iVar).variableName;
vector<histoContainer>::iterator itVec ;
itVec = find(plotVectorPH.begin(),plotVectorPH.end(),tmpPlot);
if(itVec == plotVectorPH.end()){
cerr<<"Problem -->plot not found for PH "<<" "<<variableList.at(iVar).variableName<<endl;
continue ;
}
if(variableList.at(iVar).variableName == "ptj1" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(0).jet4V_.Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptj2" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(1).jet4V_.Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "etaj1" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(0).jet4V_.Eta(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "etaj2" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(1).jet4V_.Eta(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "detajj" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(RecoJets.at(0).jet4V_.Eta()-RecoJets.at(1).jet4V_.Eta()),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptjj" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dijet.Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "mjj" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dijet.M(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dRjj" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(0).jet4V_.DeltaR(RecoJets.at(1).jet4V_),weightPH) ;
}
else if(variableList.at(iVar).variableName == "Asim_j" and RecoJets.size() >=2){
itVec->histogram->Fill(asimJ,weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJ" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(RecoJets.at(0).jet4V_.DeltaPhi(RecoJets.at(1).jet4V_)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "etaj1etaj2" and RecoJets.size() >=2){
itVec->histogram->Fill(RecoJets.at(0).jet4V_.Eta()*RecoJets.at(1).jet4V_.Eta(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptl1" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptl2" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "etal1" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.Eta(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "etal2" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.Eta(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "mll" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.M(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptll" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "etall" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.Eta(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "phill" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.Phi(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dRll" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.DeltaR(leptonsIsoTight.at(1).lepton4V_),weightPH) ;
}
else if(variableList.at(iVar).variableName == "etal1etal2" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.Eta()*leptonsIsoTight.at(1).lepton4V_.Eta(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(leptonsIsoTight.at(1).lepton4V_)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaEta_LL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.Eta()-leptonsIsoTight.at(1).lepton4V_.Eta()),weightPH) ;
}
else if(variableList.at(iVar).variableName == "Asim_l" and RecoJets.size() >=2){
itVec->histogram->Fill(asimL,weightPH) ;
}
else if(variableList.at(iVar).variableName == "met" and RecoJets.size() >=2){
itVec->histogram->Fill(L_met.Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "R" and RecoJets.size() >=2){
itVec->histogram->Fill(Rvar,weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(L_met)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptLMet" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(0).lepton4V_ + L_met).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TLMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(L_met)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptTLMet" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(1).lepton4V_ + L_met).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LLMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dilepton.DeltaPhi(L_met)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptLLMet" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dilepton + L_met).Pt(),weightPH) ;
}
///
else if(variableList.at(iVar).variableName == "DeltaPhi_LJL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(RecoJets.at(0).jet4V_)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptLJL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(0).lepton4V_+RecoJets.at(0).jet4V_).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_LJL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.DeltaR(RecoJets.at(0).jet4V_),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TJL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(RecoJets.at(1).jet4V_)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptTJL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(0).lepton4V_+RecoJets.at(1).jet4V_).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_TJL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.DeltaR(RecoJets.at(1).jet4V_),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(0).lepton4V_.DeltaPhi(L_dijet)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptJJL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(0).lepton4V_+L_dijet).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_JJL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(0).lepton4V_.DeltaR(L_dijet),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(1).lepton4V_.DeltaPhi(RecoJets.at(0).jet4V_)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(1).lepton4V_.DeltaPhi(RecoJets.at(1).jet4V_)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(leptonsIsoTight.at(1).lepton4V_.DeltaPhi(L_dijet)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_LJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.DeltaR(RecoJets.at(0).jet4V_),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_TJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.DeltaR(RecoJets.at(1).jet4V_),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_JJTL" and RecoJets.size() >=2){
itVec->histogram->Fill(leptonsIsoTight.at(1).lepton4V_.DeltaR(L_dijet),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptLJTL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(1).lepton4V_+RecoJets.at(0).jet4V_).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptTJTL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(1).lepton4V_+RecoJets.at(1).jet4V_).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptJJTL" and RecoJets.size() >=2){
itVec->histogram->Fill((leptonsIsoTight.at(1).lepton4V_+L_dijet).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dilepton.DeltaPhi(RecoJets.at(0).jet4V_)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dilepton.DeltaPhi(RecoJets.at(1).jet4V_)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dilepton.DeltaPhi(L_dijet)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_LJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.DeltaR(RecoJets.at(0).jet4V_),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_TJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.DeltaR(RecoJets.at(1).jet4V_),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_JJLL" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dilepton.DeltaR(L_dijet),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptLJLL" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dilepton+RecoJets.at(0).jet4V_).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dijet.DeltaPhi(L_met)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptJJMet" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dijet+L_met).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_LJMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(RecoJets.at(0).jet4V_.DeltaPhi(L_met)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptLJMet" and RecoJets.size() >=2){
itVec->histogram->Fill((RecoJets.at(0).jet4V_+L_met).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_TJMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(RecoJets.at(1).jet4V_.DeltaPhi(L_met)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "ptTJMet" and RecoJets.size() >=2){
itVec->histogram->Fill((RecoJets.at(1).jet4V_+L_met).Pt(),weightPH) ;
}
///
else if(variableList.at(iVar).variableName == "ptJJ_LLMet" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dijet+L_LLmet).Pt(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "DeltaPhi_JJ_LLMet" and RecoJets.size() >=2){
itVec->histogram->Fill(fabs(L_dijet.DeltaPhi(L_LLmet)),weightPH) ;
}
else if(variableList.at(iVar).variableName == "dR_JJ_LLMet" and RecoJets.size() >=2){
itVec->histogram->Fill(L_dijet.DeltaR(L_LLmet),weightPH) ;
}
else if(variableList.at(iVar).variableName == "mlljj" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dilepton+L_dijet).M(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "mlljjmet" and RecoJets.size() >=2){
itVec->histogram->Fill((L_dilepton+L_dijet+L_met).M(),weightPH) ;
}
else if(variableList.at(iVar).variableName == "mTH" and RecoJets.size() >=2){
itVec->histogram->Fill(sqrt(2*L_dilepton.Pt()*L_met.Pt()*(1-TMath::Cos(L_dilepton.DeltaPhi(L_met)))),weightPH) ;
}
}
}
}
// make the canvas and basic banners
TCanvas *cCanvas = new TCanvas("cCanvas","",1,52,550,550);
cCanvas->SetTicks();
cCanvas->SetFillColor(0);
cCanvas->SetBorderMode(0);
cCanvas->SetBorderSize(2);
cCanvas->SetTickx(1);
cCanvas->SetTicky(1);
cCanvas->SetRightMargin(0.05);
cCanvas->SetBottomMargin(0.12);
cCanvas->SetFrameBorderMode(0);
TLatex * tex = new TLatex(0.88,0.92," 14 TeV");
tex->SetNDC();
tex->SetTextAlign(31);
tex->SetTextFont(42);
tex->SetTextSize(0.045);
tex->SetLineWidth(2);
TLatex * tex2 = new TLatex(0.14,0.92,"Delphes");
tex2->SetNDC();
tex2->SetTextFont(61);
tex2->SetTextSize(0.045);
tex2->SetLineWidth(2);
TLatex * tex3 = new TLatex(0.286,0.92,"Simulation Preliminary");
tex3->SetNDC();
tex3->SetTextFont(52);
tex3->SetTextSize(0.04);
tex3->SetLineWidth(2);
TLegend* legend = new TLegend(0.55,0.75,0.85,0.89);
legend->SetBorderSize(0);
legend->SetFillColor(0);
legend->SetFillStyle(0);
legend->SetTextSize(0.04);
legend->SetTextFont(42);
for(size_t iCut = 0; iCut < CutList.size(); iCut++){
for(size_t iVar = 0; iVar < variableList.size(); iVar++){ // loop on var
histoContainer tmpPlotMG;
tmpPlotMG.cutName = "MG_"+CutList.at(iCut).cutLayerName;
tmpPlotMG.varName = variableList.at(iVar).variableName;
vector<histoContainer>::iterator itVecMG ;
itVecMG = find(plotVectorMG.begin(),plotVectorMG.end(),tmpPlotMG);
if(itVecMG == plotVectorMG.end()){
cerr<<"Problem -->plot not found for MG : "<<variableList.at(iVar).variableName<<endl;
}
itVecMG->histogram->GetXaxis()->SetTitleSize(0.04);
itVecMG->histogram->GetYaxis()->SetRangeUser(0.001,itVecMG->histogram->GetMaximum()*1.1);
itVecMG->histogram->GetYaxis()->SetTitleSize(0.05);
itVecMG->histogram->SetLineColor(kBlue);
itVecMG->histogram->SetLineStyle(1);
itVecMG->histogram->SetLineWidth(2);
itVecMG->histogram->GetYaxis()->SetTitle("#sigma x lumi");
itVecMG->histogram->Draw("hist");
legend->AddEntry(itVecMG->histogram,"Madgraph","l");
histoContainer tmpPlotPH;
tmpPlotPH.cutName = "PH_"+CutList.at(iCut).cutLayerName;
tmpPlotPH.varName = variableList.at(iVar).variableName;
vector<histoContainer>::iterator itVecPH ;
itVecPH = find(plotVectorPH.begin(),plotVectorPH.end(),tmpPlotPH);
if(itVecPH == plotVectorPH.end()){
cerr<<"Problem -->plot not found for PH : "<<variableList.at(iVar).variableName<<endl;
}
itVecPH->histogram->GetXaxis()->SetTitleSize(0.04);
itVecPH->histogram->GetYaxis()->SetRangeUser(0.001,itVecPH->histogram->GetMaximum()*1.1);
itVecPH->histogram->GetYaxis()->SetTitleSize(0.05);
itVecPH->histogram->SetLineColor(kRed);
itVecPH->histogram->SetLineStyle(7);
itVecPH->histogram->SetLineWidth(2);
itVecPH->histogram->GetYaxis()->SetTitle("#sigma x lumi");
itVecPH->histogram->Draw("hist same");
legend->AddEntry(itVecPH->histogram,"Phantom","l");
tex->Draw("same");
tex2->Draw("same");
tex3->Draw("same");
legend->Draw("same");
cCanvas->SaveAs(string("output/"+outputPlotDirectory+"/"+CutList.at(iCut).cutLayerName+"_"+variableList.at(iVar).variableName+".pdf").c_str(),"pdf");
cCanvas->SaveAs(string("output/"+outputPlotDirectory+"/"+CutList.at(iCut).cutLayerName+"_"+variableList.at(iVar).variableName+".png").c_str(),"png");
cCanvas->SaveAs(string("output/"+outputPlotDirectory+"/"+CutList.at(iCut).cutLayerName+"_"+variableList.at(iVar).variableName+".root").c_str(),"root");
cCanvas->SetLogy();
cCanvas->SaveAs(string("output/"+outputPlotDirectory+"/"+CutList.at(iCut).cutLayerName+"_"+variableList.at(iVar).variableName+"_log.pdf").c_str(),"pdf");
cCanvas->SaveAs(string("output/"+outputPlotDirectory+"/"+CutList.at(iCut).cutLayerName+"_"+variableList.at(iVar).variableName+"_log.png").c_str(),"png");
cCanvas->SaveAs(string("output/"+outputPlotDirectory+"/"+CutList.at(iCut).cutLayerName+"_"+variableList.at(iVar).variableName+"_log.root").c_str(),"root");
cCanvas->SetLogy(0);
gPad->Update();
legend->Clear();
}
}
cout<<"LHE filter efficiency MG : "<<passingLHEFilterMG<<" totEvent "<<totEventMG<<" efficiency "<<float(passingLHEFilterMG)/float(totEventMG)*100<<" % "<<endl;
cout<<"LHE filter efficiency PH : "<<passingLHEFilterPH<<" totEvent "<<totEventPH<<" efficiency "<<float(passingLHEFilterPH)/float(totEventPH)*100<<" % "<<endl;
cout<<"PT filter efficiency MG : "<<passingLHEFilterMG_Pt<<" LHE event "<<passingLHEFilterMG<<" efficiency "<<float(passingLHEFilterMG_Pt)/float(passingLHEFilterMG)*100<<" % "<<endl;
cout<<"PT filter efficiency PH : "<<passingLHEFilterPH_Pt<<" LHE event "<<passingLHEFilterPH<<" efficiency "<<float(passingLHEFilterPH_Pt)/float(passingLHEFilterPH)*100<<" % "<<endl;
cout<<"Deta filter efficiency MG : "<<passingLHEFilterMG_Deta<<" LHE event "<<passingLHEFilterMG_Pt<<" efficiency "<<float(passingLHEFilterMG_Deta)/float(passingLHEFilterMG_Pt)*100<<" % "<<endl;
cout<<"Deta filter efficiency PH : "<<passingLHEFilterPH_Deta<<" LHE event "<<passingLHEFilterPH_Pt<<" efficiency "<<float(passingLHEFilterPH_Deta)/float(passingLHEFilterPH_Pt)*100<<" % "<<endl;
TFile* outputEfficiency = new TFile(("output/"+outputPlotDirectory+"/outputEfficiency.root").c_str(),"RECREATE");
for(map<string,TH1F*>::const_iterator itMap = histoCutEffMG.begin(); itMap != histoCutEffMG.end(); itMap++){
itMap->second->Scale(1./itMap->second->GetBinContent(1));
itMap->second->Write();
}
for(map<string,TH1F*>::const_iterator itMap = histoCutEffPH.begin(); itMap != histoCutEffPH.end(); itMap++){
itMap->second->Scale(1./itMap->second->GetBinContent(1));
itMap->second->Write();
}
outputEfficiency->Close();
//Normalize histograms
for(size_t ihisto = 0; ihisto < plotVectorMG.size(); ihisto++){
if(plotVectorMG.at(ihisto).varName == "DeltaPhi_LL")
cout<<"Events Histo MG "<<plotVectorMG.at(ihisto).histogram->GetName()<<" unweighted "<<plotVectorMG.at(ihisto).histogram->GetEntries()<<" weighted "<<plotVectorMG.at(ihisto).histogram->Integral(0,plotVectorMG.at(ihisto).histogram->GetNbinsX()+1)<<endl;
}
for(size_t ihisto = 0; ihisto < plotVectorPH.size(); ihisto++){
if(plotVectorPH.at(ihisto).varName == "DeltaPhi_LL")
cout<<"Events Histo PH "<<plotVectorPH.at(ihisto).histogram->GetName()<<" unweighted "<<plotVectorPH.at(ihisto).histogram->GetEntries()<<" weighted "<<plotVectorPH.at(ihisto).histogram->Integral(0,plotVectorPH.at(ihisto).histogram->GetNbinsX()+1)<<endl;
}
return 0 ;
}
// LocalWords: iEventPH
| [
"raffaele.gerosa@cern.ch"
] | raffaele.gerosa@cern.ch |
79787c45323641bcc40414dc4c8fcf2356ded4b6 | 2b7b0a7be28e1fc3a59f81c5d42b3cb38de6dd44 | /cocktailPro/Beobachter.h | 527e770c0d7bde81fe1703a1dbf985034a0a98de | [] | no_license | klyonrad/cocktailPro | 1c12b6de8860dafbe951a573ae203b93700bac34 | 428a0a3954e8702762b010a5fda54985228947b8 | refs/heads/master | 2020-03-31T01:49:50.120682 | 2014-01-05T17:31:05 | 2014-01-05T17:31:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 140 | h | #ifndef BEOBACHTER_H_H
#define BEOBACHTER_H_H
using namespace std;
class Beobachter
{
public:
virtual void aktualisiere();
};
#endif
| [
"klukasocial+github@gmail.com"
] | klukasocial+github@gmail.com |
fe65c4b4d2568e366bcedc9f34b9fc9a65ade2f1 | 6bb3918b1bc9686105b7647bd5ca142e9fbfbe1c | /01_IDE/Class_Factory/ClassFactoryDllServerWithRegFile/ClassFactoryDllServerWithRegFile.cpp | 8daa3d9b29c31329cc0c2fb4ca61e064f08db180 | [] | no_license | shreyasBorle/WinRT_2019_Repository | af8818bf00c77cc881824b05b347161f8ac7cb10 | 49905c2fd5fcef111e2ab54901b3ea47790776f6 | refs/heads/master | 2022-02-24T20:30:55.059751 | 2019-10-21T14:25:26 | 2019-10-21T14:25:26 | 203,588,936 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,947 | cpp | #include<windows.h>
#include"ClassFactoryDllServerWithRegFile.h"
class CSumSubtract:public ISum, ISubtract
{
private:
LONG m_cRef = 1;
public:
//contructor method decleartion.
CSumSubtract(void);
//destructor method deleration
~CSumSubtract(void);
//IUnKnown specific method declration
HRESULT __stdcall QueryInterface(REFIID, void **);
ULONG __stdcall AddRef(void);
ULONG __stdcall Release(void);
//ISum sepecific method decelaration
HRESULT __stdcall SumOfTwoIntegers(int, int, int *);
//Isubtract specific method delcartaion
HRESULT __stdcall SubtractionOfTwoIntegers(int,int,int *);
};
class CSumSubtractClassFactory:public IClassFactory
{
private:
LONG m_cRef;
public :
//contructor methdo delration
CSumSubtractClassFactory(void);
//destrucot method decalration
~CSumSubtractClassFactory(void);
//IUnknwon secific method declration.
HRESULT __stdcall QueryInterface(REFIID,void **);
ULONG __stdcall AddRef(void);
ULONG __stdcall Release(void);
//IClassfatcory specific method decleration (inherited)
HRESULT __stdcall CreateInstance(IUnknown *, REFIID, void **);
HRESULT __stdcall LockServer(BOOL);
};
long glNumberOfActiveComponents = 0;
long glNumberOfServerLocks = 0;
//DLLMAIN
BOOL WINAPI DllMain(HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return(TRUE);
}
//Implementation of CSumSubtract's Constructor method
CSumSubtract::CSumSubtract(void)
{
m_cRef = 1;
InterlockedIncrement(&glNumberOfActiveComponents);
}
//implementaion destrcuot of teh CSumSUbtract method.
CSumSubtract::~CSumSubtract(void)
{
InterlockedDecrement(&glNumberOfActiveComponents);
}
//implemenation o fthe SSumSUbtract's IUnknown methods
HRESULT CSumSubtract::QueryInterface(REFIID riid, void **ppv)
{
if (riid == IID_IUnknown)
{
*ppv = static_cast<ISum *>(this);
}
else if (riid == IID_ISum) {
*ppv = static_cast<ISum *>(this);
}
else if (riid == IID_ISubtract)
{
*ppv = static_cast<ISubtract *>(this);
}
else {
*ppv = NULL;
return(E_NOINTERFACE);
}
reinterpret_cast<IUnknown *>(*ppv)->AddRef();
return(S_OK);
}
ULONG CSumSubtract::AddRef(void)
{
InterlockedIncrement(&m_cRef);
return(m_cRef);
}
ULONG CSumSubtract::Release(void)
{
InterlockedDecrement(&m_cRef);
if (m_cRef == 0)
{
delete(this);
return(0);
}
return(m_cRef);
}
/*implementaion of the ISum's method*/
HRESULT CSumSubtract::SumOfTwoIntegers(int num1, int num2, int *pSum)
{
*pSum = num1 + num2;
return(S_OK);
}
HRESULT CSumSubtract::SubtractionOfTwoIntegers(int num1, int num2, int *pSubtract)
{
*pSubtract = num1 - num2;
return(S_OK);
}
/*imlemntaion of CSumSubtractClassFactory's Cnstructor*/
CSumSubtractClassFactory::CSumSubtractClassFactory(void)
{
m_cRef = 1;
}
//implementation of the CSumSubtractClassFactory Destrcutor
CSumSubtractClassFactory::~CSumSubtractClassFactory(void)
{
//code
}
HRESULT CSumSubtractClassFactory::QueryInterface(REFIID riid,void **ppv)
{
if (riid == IID_IUnknown)
*ppv = static_cast<IClassFactory *>(this);
if (riid == IID_IClassFactory)
*ppv = static_cast<IClassFactory *>(this);
else
{
*ppv = NULL;
return(E_NOINTERFACE);
}
reinterpret_cast<IUnknown *>(*ppv)->AddRef();
return(S_OK);
}
ULONG CSumSubtractClassFactory::AddRef(void)
{
InterlockedIncrement(&m_cRef);
return(m_cRef);
}
ULONG CSumSubtractClassFactory::Release(void)
{
InterlockedDecrement(&m_cRef);
if (m_cRef == 0)
{
delete(this);
return(0);
}
return(m_cRef);
}
//imlementation of the CSumSubtractClassFactory IClassFactory methods
HRESULT CSumSubtractClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppv)
{
//variable decleration
CSumSubtract *pCSumSubtract = NULL;
HRESULT hr;
//code
if (pUnkOuter != NULL)
{
return(CLASS_E_NOAGGREGATION);
}
pCSumSubtract = new CSumSubtract;
if (pCSumSubtract == NULL)
{
return(E_OUTOFMEMORY);
}
hr = pCSumSubtract->QueryInterface(riid, ppv);
pCSumSubtract->Release();
return(hr);
}
HRESULT CSumSubtractClassFactory::LockServer(BOOL fLock)
{
if (fLock)
{
InterlockedIncrement(&glNumberOfServerLocks);
}
else
{
InterlockedDecrement(&glNumberOfServerLocks);
}
return(S_OK);
}
HRESULT __stdcall DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
{
//var decleration
CSumSubtractClassFactory *pCSumSubtractClassFactory = NULL;
HRESULT hr;
if (rclsid != CLSID_SumSubtract)
{
return(CLASS_E_CLASSNOTAVAILABLE);
}
pCSumSubtractClassFactory = new CSumSubtractClassFactory;
if (pCSumSubtractClassFactory == NULL)
{
return(E_OUTOFMEMORY);
}
hr = pCSumSubtractClassFactory->QueryInterface(riid, ppv);
pCSumSubtractClassFactory->Release();
return(hr);
}
HRESULT __stdcall DllCanUnloadNow(void)
{
if ((glNumberOfActiveComponents == 0) && (glNumberOfServerLocks == 0))
return(S_OK);
else
return(S_FALSE);
}
| [
"32008259+shreyasBorle@users.noreply.github.com"
] | 32008259+shreyasBorle@users.noreply.github.com |
a240275236d225a34d5501c69ffbdd7914e2042c | cb0201ded1bbbe05d9f98f6d9393c8d17e3c872b | /CppSprtPkg/Include/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp | 6b0633f2ec60d522386ff07a3978fd93fc47249b | [
"BSD-2-Clause",
"OpenSSL"
] | permissive | mikeniu/uefi-longson | 43999ccae33372f5875680eb43578fa103518cce | d6fba2f83e00125ff0362b4583461958d459fb4b | refs/heads/main | 2023-03-16T23:04:00.293750 | 2021-03-04T03:09:38 | 2021-03-04T03:09:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,883 | hpp | // -*- C++ -*-
// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software
// Foundation; either version 3, or (at your option) any later
// version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software
// is hereby granted without fee, provided that the above copyright
// notice appears in all copies, and that both that copyright notice
// and this permission notice appear in supporting documentation. None
// of the above authors, nor IBM Haifa Research Laboratories, make any
// representation about the suitability of this software for any
// purpose. It is provided "as is" without express or implied
// warranty.
/**
* @file insert_fn_imps.hpp
* Contains implementations of gp_ht_map_'s insert related functions.
*/
#include <ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp>
#include <ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp>
| [
"lvjianmin@loongson.cn"
] | lvjianmin@loongson.cn |
f5580cef7e9199b643161e3783f7f15e41f009a4 | 11044e91c8abd2180be242d16cd687ebcd02b2e3 | /src/Demos/Demo3/Demo3.cpp | 7a2b41ffd346ec2b1fb29df9ba658f2d4e2e2acd | [] | no_license | mshehabeldin85/CSC588-AudioEngine | 70ff06235822e7a26b99458d9f4cc7ffe7d314ba | 0cf51cb7f45641eeb541aca58400ce0e9fa1c249 | refs/heads/master | 2022-12-22T22:52:35.723465 | 2020-09-11T16:05:30 | 2020-09-11T16:05:30 | 291,942,891 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,616 | cpp | //----------------------------------------------------------------------------
// Copyright 2020, Ed Keenan, all rights reserved.
//----------------------------------------------------------------------------
#include "TimeEventMan.h"
#include "Demo3.h"
#include "Demo3_0.h"
#include "Demo3_1.h"
#include "Demo3_2.h"
#include "Demo3_3.h"
#include "Demo3_4.h"
#include "Demo3_5.h"
#include "Demo3_6.h"
#include "Demo3_7.h"
#include "Demo3_8.h"
#include "Demo3_9.h"
void Demo3()
{
Demo3_0 *p_0 = new Demo3_0();
assert(p_0);
TimeEventMan::Add(p_0, 0 * Time(Duration::TIME_ONE_SECOND));
Demo3_1 *p_1 = new Demo3_1();
assert(p_1);
TimeEventMan::Add(p_1, 1 * Time(Duration::TIME_ONE_SECOND));
Demo3_2 *p_2 = new Demo3_2();
assert(p_2);
TimeEventMan::Add(p_2, 2 * Time(Duration::TIME_ONE_SECOND));
Demo3_3 *p_3 = new Demo3_3();
assert(p_3);
TimeEventMan::Add(p_3, 3 * Time(Duration::TIME_ONE_SECOND));
Demo3_4 *p_4 = new Demo3_4();
assert(p_4);
TimeEventMan::Add(p_4, 4 * Time(Duration::TIME_ONE_SECOND));
Demo3_5* p_5 = new Demo3_5();
assert(p_5);
TimeEventMan::Add(p_5, 5 * Time(Duration::TIME_ONE_SECOND));
Demo3_6* p_6 = new Demo3_6();
assert(p_6);
TimeEventMan::Add(p_6, 6 * Time(Duration::TIME_ONE_SECOND));
Demo3_7* p_7 = new Demo3_7();
assert(p_7);
TimeEventMan::Add(p_7, 7 * Time(Duration::TIME_ONE_SECOND));
Demo3_8* p_8 = new Demo3_8();
assert(p_8);
TimeEventMan::Add(p_8, 8 * Time(Duration::TIME_ONE_SECOND));
Demo3_9* p_9 = new Demo3_9();
assert(p_9);
TimeEventMan::Add(p_9, 13 * Time(Duration::TIME_ONE_SECOND));
//TimeEventMan::Dump();
}
// --- End of File ---
| [
"mahmoud.salahsabet@gamil.com"
] | mahmoud.salahsabet@gamil.com |
f1e0a4a67f32b55c32c256d7747ad20a29182540 | 20b2af5e275469261d95d4441303d567b5c03bba | /src/tuhhsdk/Data/OdometryOffset.hpp | bc3bb9daf97108b189c0ff9ac745f2ebbcfdae5f | [
"BSD-2-Clause"
] | permissive | humanoid-robotics-htl-leonding/robo-ducks-core | efd513dedf58377dadc6a3094dd5c01f13c32eb1 | 1644b8180214b95ad9ce8fa97318a51748b5fe3f | refs/heads/master | 2022-04-26T17:19:00.073468 | 2020-04-23T07:05:25 | 2020-04-23T07:05:25 | 181,146,731 | 7 | 0 | NOASSERTION | 2022-04-08T13:25:14 | 2019-04-13T09:07:29 | C++ | UTF-8 | C++ | false | false | 737 | hpp | #pragma once
#include "Framework/DataType.hpp"
#include "Tools/Math/Pose.hpp"
/**
* @class OdometryOffset does not work trans module manager boundaries!!!!!!!!!!!!
*/
class OdometryOffset : public DataType<OdometryOffset>
{
public:
/// the name of this DataType
DataTypeName name = "OdometryOffset";
/// the odometry offset in this cycle
Pose odometryOffset;
/**
* @brief reset resets the offset to 0
*/
void reset()
{
odometryOffset = Pose();
}
virtual void toValue(Uni::Value& value) const
{
value = Uni::Value(Uni::ValueType::OBJECT);
value["odometryOffset"] << odometryOffset;
}
virtual void fromValue(const Uni::Value& value)
{
value["odometryOffset"] >> odometryOffset;
}
};
| [
"rene.kost.951@gmail.com"
] | rene.kost.951@gmail.com |
5cc9196f53d9182337926375a7dfff0f9feaef17 | c6a30dee782710a74f037d857a47d9ba79eb44d1 | /lexer.cpp | d85de324250ca5265d9e6a2b29b97b7deea2b0de | [] | no_license | BirdyDeveloper/parser | 76147ccd0874ade12d0a317d6029113d012c5bee | d933f5568bdd35ad28df16ad21b5185b7ba29a99 | refs/heads/master | 2020-04-22T06:10:41.419409 | 2019-02-11T18:51:07 | 2019-02-11T18:51:07 | 170,181,432 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,592 | cpp | #include "lexer.h"
Lexer::Lexer(std::string const& str) : iss(str + "$") {
tokens_trie.add_string("and", Token::And);
tokens_trie.add_string("or", Token::Or);
tokens_trie.add_string("xor", Token::Xor);
tokens_trie.add_string("not", Token::Not);
tokens_trie.add_string("(", Token::LB);
tokens_trie.add_string(")", Token::RB);
tokens_trie.add_string("$", Token::End);
tokens_trie.add_string("a", Token::Var);
tokens_trie.add_string("b", Token::Var);
tokens_trie.add_string("c", Token::Var);
}
Lexer::Lexer(std::string const& str, std::vector<std::string> const& v) : Lexer(str) {
for (auto const& s : v) {
tokens_trie.add_string(s, Token::Smth);
}
}
Token Lexer::next_token() {
char c;
std::string cur_string_token;
while (isspace(iss.peek())) {
iss.get();
}
tokens_trie.reset_state();
while (!iss.eof() && (c = static_cast<char>(iss.get()))) {
cur_string_token += c;
if (tokens_trie.move_state(c)) {
if (tokens_trie.has_key()
&& !tokens_trie.has_next(static_cast<char>(iss.peek()))) {
_current_string_token = cur_string_token;
return _current_token = tokens_trie.get_key();
}
} else {
_current_string_token = cur_string_token;
return _current_token = Token::None;
}
}
_current_string_token = cur_string_token;
return _current_token = Token::None;
}
Token Lexer::current_token() const {
return _current_token;
}
std::string const& Lexer::current_string_token() const {
return _current_string_token;
}
Lexer::trie::trie() {
t.emplace_back();
}
void Lexer::trie::add_string(std::string const& s, Token key) {
unsigned long cur = 0;
for (char c : s) {
if (!t[cur].to.count(c)) {
t[cur].to[c] = t.size();
t.emplace_back();
}
cur = t[cur].to[c];
}
t[cur].key = key;
}
bool Lexer::trie::move_state(char c) {
if (t[state].to.count(c)) {
state = t[state].to[c];
return true;
} else {
state = 0;
return false;
}
}
void Lexer::trie::reset_state() {
state = 0;
}
bool Lexer::trie::has_key() const {
return t[state].key != Token::None;
}
bool Lexer::trie::has_next(char c) const {
return t[state].to.count(c);
}
Token Lexer::trie::get_key() const {
return t[state].key;
}
Token Lexer::token_by_string(std::string const& s) {
for (char c : s) {
tokens_trie.move_state(c);
}
return tokens_trie.get_key();
}
| [
"Alex.PKZDL@yandex.ru"
] | Alex.PKZDL@yandex.ru |
8098982cd77c352a436e96a02ab7a60a883e90c5 | cc21ea29b28127d4e2a751c11c1108ad01114d29 | /2ºcuatrimestre/MP/sesion05/src/I_17_OrdenaConPunteros.cpp | c028a8efaff84697654273d71dd7ccbc46841851 | [] | no_license | AlbitaMoreno/Primero | 46ef749acdaacdb569500dff6108b5f793c12bae | 200d6fb5302e285974f0133a5c6706be409bf191 | refs/heads/master | 2021-01-19T00:44:14.742612 | 2016-11-12T12:20:05 | 2016-11-12T12:20:05 | 73,213,699 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,557 | cpp | //
// CURSO 2015-2016
// Alba Moreno Ontiveros
//
// Fichero: I_17_Ordena_Con_Punteros.cpp
//
//si no lse le pasan argumentos al main, ordena el indice entero
//si se le pasan derecha e izquierda ordena el subvector que queda comprendido
//entre ambos indices
/***************************************************************************/
#include <iostream>
//la uso para crear barrera, cadena de char que separa las soluciones
#include <cstring>
//para poder usar exit
#include <cstdlib>
#include "Random.h"
#include "Ordena.h"
using namespace std;
int main(int argc, char const *argv[])
{
MyRandom generador(0,50);
const int TOPE = 50;
//vector de datos
int vector[TOPE];
//indice de "vector"
int *ptr[TOPE];
//inicializo p apuntando a la primera posicion del vector
int *p = &vector[0];
char barrera[50];
memset(barrera, '*',49);
memset (&(barrera[49]),'\0',1);
cout <<"El vector es: " << endl;
//incializo el vector
for (int i = 0; i < TOPE; i++){
vector[i] = generador.Next();
cout << " " << vector[i];
}
cout << endl;
//le asigno a cada puntero de *ptr[] una casilla de vector independientemente de si esta ordenada.
for(int i = 0; i < TOPE; i++, p++){
ptr[i] = &vector[i];
}
cout << barrera << endl;
if(argc <= 3){
if(argc == 1){
cout << barrera << endl;
cout << "No ha introducido argumentos" << endl;
//tengo que ordenar todo el vector
cout << "Ordenando indices..." << endl;
Ordena(p,ptr,0,(TOPE-1));
cout << endl;
//muestro el indice ordenado
for(int i = 0; i < TOPE; i++){
cout << " " << *ptr[i];
}
cout << endl;
}
if(argc == 2){
cout << barrera << endl;
cout << "ERROR: argumentos invalidos" << endl;
cout << barrera << endl;
exit(EXIT_FAILURE);
}
if(argc == 3){
cout << barrera << endl;
cout << "Numero de argumentos adecuado: " << endl;
//transformo los parametros argv[1] y argv[2] que son tipo char a tipo int
int der = atoi(argv[2]);
int izq = atoi(argv[1]);
int utils = der - izq + 1;
cout << "Ordenando indices..." << endl;
Ordena(p,ptr,izq,der);
for(int i = 0; i < utils; i++,izq++){
cout << " " << *ptr[izq];
}
cout << endl;
}
}
else{
cout << barrera << endl;
cout << "ERROR: argumentos invalidos" << endl;
cout << barrera << endl;
exit(EXIT_FAILURE);
}
cout << barrera << endl;
cout << "El vector sigue desordenado..." << endl;
cout << barrera << endl;
//incializo el vector
for (int i = 0; i < TOPE; i++)
cout << " " << vector[i];
cout << endl;
return 0;
} | [
"albamoreno.ontiveros@gmail.com"
] | albamoreno.ontiveros@gmail.com |
d90c260b1f29f85a7754939a2a5b9825d2bef4e2 | 3f97b65830b7f3cea0fdfd7ab618cf4b302c0257 | /TRACKING/RT Object Tracking Without Color - webcam/Source.cpp | ea4423298733718232e25c546fc5a809c1087684 | [] | no_license | vefak/OpenCV_Practice | 81141a17acc26444bdb5bc5b3ed01d5d0fb881e9 | 36805adc7272fae6993615c50e9dbabb528d6a96 | refs/heads/master | 2023-02-16T16:45:12.421336 | 2020-10-04T13:16:13 | 2020-10-04T13:16:13 | 301,133,753 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,843 | cpp | //motionTracking.cpp
//Written by Kyle Hounslow, December 2013
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software")
//, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
//and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
//IN THE SOFTWARE.
#include <opencv\cv.h>
#include <opencv\highgui.h>
#include <opencv2\opencv.hpp>
#include <iostream>
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
using namespace std;
using namespace cv;
//our sensitivity value to be used in the absdiff() function
const static int SENSITIVITY_VALUE = 20;
//size of blur used to smooth the intensity image output from absdiff() function
const static int BLUR_SIZE = 10;
//we'll have just one object to search for
//and keep track of its position.
int theObject[2] = { 0,0 };
//bounding rectangle of the object, we will use the center of this as its position.
Rect objectBoundingRectangle = Rect(0, 0, 0, 0);
//int to string helper function
string intToString(int number) {
//this function has a number input and string output
std::stringstream ss;
ss << number;
return ss.str();
}
void searchForMovement(Mat thresholdImage, Mat &cameraFeed) {
//notice how we use the '&' operator for objectDetected and cameraFeed. This is because we wish
//to take the values passed into the function and manipulate them, rather than just working with a copy.
//eg. we draw to the cameraFeed to be displayed in the main() function.
bool objectDetected = false;
Mat temp;
thresholdImage.copyTo(temp);
//these two vectors needed for output of findContours
vector< vector<Point> > contours;
vector<Vec4i> hierarchy;
//find contours of filtered image using openCV findContours function
//findContours(temp,contours,hierarchy,CV_RETR_CCOMP,CV_CHAIN_APPROX_SIMPLE );// retrieves all contours
findContours(temp, contours, hierarchy, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);// retrieves external contours
//if contours vector is not empty, we have found some objects
if (contours.size()>0)objectDetected = true;
else objectDetected = false;
if (objectDetected) {
//the largest contour is found at the end of the contours vector
//we will simply assume that the biggest contour is the object we are looking for.
vector< vector<Point> > largestContourVec;
largestContourVec.push_back(contours.at(contours.size() - 1));
//make a bounding rectangle around the largest contour then find its centroid
//this will be the object's final estimated position.
objectBoundingRectangle = boundingRect(largestContourVec.at(0));
int xpos = objectBoundingRectangle.x + objectBoundingRectangle.width / 2;
int ypos = objectBoundingRectangle.y + objectBoundingRectangle.height / 2;
//update the objects positions by changing the 'theObject' array values
theObject[0] = xpos, theObject[1] = ypos;
}
//make some temp x and y variables so we dont have to type out so much
int x = theObject[0];
int y = theObject[1];
//draw some crosshairs around the object
circle(cameraFeed, Point(x, y), 20, Scalar(0, 255, 0), 2);
line(cameraFeed, Point(x, y), Point(x, y - 25), Scalar(0, 255, 0), 2);
line(cameraFeed, Point(x, y), Point(x, y + 25), Scalar(0, 255, 0), 2);
line(cameraFeed, Point(x, y), Point(x - 25, y), Scalar(0, 255, 0), 2);
line(cameraFeed, Point(x, y), Point(x + 25, y), Scalar(0, 255, 0), 2);
//write the position of the object to the screen
putText(cameraFeed, "Tracking object at (" + intToString(x) + "," + intToString(y) + ")", Point(x, y), 1, 1, Scalar(255, 0, 0), 2);
}
int main() {
//some boolean variables for added functionality
bool objectDetected = false;
//these two can be toggled by pressing 'd' or 't'
bool debugMode = false;
bool trackingEnabled = false;
//pause and resume code
bool pause = false;
//set up the matrices that we will need
//the two frames we will be comparing
Mat frame1, frame2;
//their grayscale images (needed for absdiff() function)
Mat grayImage1, grayImage2;
//resulting difference image
Mat differenceImage;
//thresholded difference image (for use in findContours() function)
Mat thresholdImage;
//video capture object.
VideoCapture capture;
while (1) {
//we can loop the video by re-opening the capture every time the video reaches its last frame
capture.open(0);
if (!capture.isOpened()) {
cout << "ERROR ACQUIRING VIDEO FEED\n";
getchar();
return -1;
}
//check if the video has reach its last frame.
//we add '-1' because we are reading two frames from the video at a time.
//if this is not included, we get a memory error!
//read first frame
capture.read(frame1);
//convert frame1 to gray scale for frame differencing
cv::cvtColor(frame1, grayImage1, COLOR_BGR2GRAY);
//copy second frame
capture.read(frame2);
//convert frame2 to gray scale for frame differencing
cv::cvtColor(frame2, grayImage2, COLOR_BGR2GRAY);
//perform frame differencing with the sequential images. This will output an "intensity image"
//do not confuse this with a threshold image, we will need to perform thresholding afterwards.
cv::absdiff(grayImage1, grayImage2, differenceImage);
//threshold intensity image at a given sensitivity value
cv::threshold(differenceImage, thresholdImage, SENSITIVITY_VALUE, 255, THRESH_BINARY);
if (debugMode == true) {
//show the difference image and threshold image
cv::imshow("Difference Image", differenceImage);
cv::imshow("Threshold Image", thresholdImage);
}
else {
//if not in debug mode, destroy the windows so we don't see them anymore
cv::destroyWindow("Difference Image");
cv::destroyWindow("Threshold Image");
}
//blur the image to get rid of the noise. This will output an intensity image
cv::blur(thresholdImage, thresholdImage, cv::Size(BLUR_SIZE, BLUR_SIZE));
//threshold again to obtain binary image from blur output
cv::threshold(thresholdImage, thresholdImage, SENSITIVITY_VALUE, 255, THRESH_BINARY);
if (debugMode == true) {
//show the threshold image after it's been "blurred"
imshow("Final Threshold Image", thresholdImage);
}
else {
//if not in debug mode, destroy the windows so we don't see them anymore
cv::destroyWindow("Final Threshold Image");
}
//if tracking enabled, search for contours in our thresholded image
if (trackingEnabled) {
searchForMovement(thresholdImage, frame1);
}
//show our captured frame
imshow("Frame1", frame1);
//check to see if a button has been pressed.
//this 10ms delay is necessary for proper operation of this program
//if removed, frames will not have enough time to referesh and a blank
//image will appear.
switch (waitKey(10)) {
case 27: //'esc' key has been pressed, exit program.
return 0;
case 116: //'t' has been pressed. this will toggle tracking
trackingEnabled = !trackingEnabled;
if (trackingEnabled == false) cout << "Tracking disabled." << endl;
else cout << "Tracking enabled." << endl;
break;
case 100: //'d' has been pressed. this will debug mode
debugMode = !debugMode;
if (debugMode == false) cout << "Debug mode disabled." << endl;
else cout << "Debug mode enabled." << endl;
break;
case 112: //'p' has been pressed. this will pause/resume the code.
pause = !pause;
if (pause == true) {
cout << "Code paused, press 'p' again to resume" << endl;
while (pause == true) {
//stay in this loop until
switch (waitKey()) {
//a switch statement inside a switch statement? Mind blown.
case 112:
//change pause back to false
pause = false;
cout << "Code Resumed" << endl;
break;
}
}
}
}
}
return 0;
} | [
"vmakman@gmail.com"
] | vmakman@gmail.com |
9728999e83a58c63b8972dfb332a5bbbd0f5fedd | 276bfe3829432430a3abb272e8d66341c04cc66c | /DQM/EcalBarrelMonitorDbModule/src/DBWriterWorkers.cc | 1b2ca9ab3a0f862ff456910e5fe644dac299ea42 | [] | no_license | igv4321/cmssw | 498ced2b349d4497a6cfa41e543a985830543274 | acb0d0a6a92769a333576863458249a7336ca064 | refs/heads/CMSSW_7_1_X | 2023-05-01T14:12:02.386868 | 2014-03-21T12:54:50 | 2014-03-21T12:54:50 | 18,013,692 | 0 | 3 | null | 2017-05-19T20:48:23 | 2014-03-22T16:11:12 | C++ | UTF-8 | C++ | false | false | 48,058 | cc | #include "../interface/DBWriterWorkers.h"
#include "../interface/LogicIDTranslation.h"
#include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"
#include "DQM/EcalCommon/interface/MESetMulti.h"
#include "DQM/EcalCommon/interface/MESetUtils.h"
#include "OnlineDB/EcalCondDB/interface/EcalLogicID.h"
#include "OnlineDB/EcalCondDB/interface/MonCrystalConsistencyDat.h"
#include "OnlineDB/EcalCondDB/interface/MonTTConsistencyDat.h"
#include "OnlineDB/EcalCondDB/interface/MonMemChConsistencyDat.h"
#include "OnlineDB/EcalCondDB/interface/MonMemTTConsistencyDat.h"
#include "OnlineDB/EcalCondDB/interface/MonLaserBlueDat.h"
#include "OnlineDB/EcalCondDB/interface/MonLaserGreenDat.h"
#include "OnlineDB/EcalCondDB/interface/MonLaserIRedDat.h"
#include "OnlineDB/EcalCondDB/interface/MonLaserRedDat.h"
#include "OnlineDB/EcalCondDB/interface/MonPNBlueDat.h"
#include "OnlineDB/EcalCondDB/interface/MonPNGreenDat.h"
#include "OnlineDB/EcalCondDB/interface/MonPNIRedDat.h"
#include "OnlineDB/EcalCondDB/interface/MonPNRedDat.h"
#include "OnlineDB/EcalCondDB/interface/MonTimingLaserBlueCrystalDat.h"
#include "OnlineDB/EcalCondDB/interface/MonTimingLaserGreenCrystalDat.h"
#include "OnlineDB/EcalCondDB/interface/MonTimingLaserIRedCrystalDat.h"
#include "OnlineDB/EcalCondDB/interface/MonTimingLaserRedCrystalDat.h"
#include "OnlineDB/EcalCondDB/interface/MonPedestalsDat.h"
#include "OnlineDB/EcalCondDB/interface/MonPNPedDat.h"
#include "OnlineDB/EcalCondDB/interface/MonPedestalsOnlineDat.h"
#include "OnlineDB/EcalCondDB/interface/MonTestPulseDat.h"
#include "OnlineDB/EcalCondDB/interface/MonPulseShapeDat.h"
#include "OnlineDB/EcalCondDB/interface/MonPNMGPADat.h"
#include "OnlineDB/EcalCondDB/interface/MonTimingCrystalDat.h"
#include "OnlineDB/EcalCondDB/interface/MonLed1Dat.h"
#include "OnlineDB/EcalCondDB/interface/MonLed2Dat.h"
// #include "OnlineDB/EcalCondDB/interface/MonPNLed1Dat.h"
// #include "OnlineDB/EcalCondDB/interface/MonPNLed2Dat.h"
#include "OnlineDB/EcalCondDB/interface/MonTimingLed1CrystalDat.h"
#include "OnlineDB/EcalCondDB/interface/MonTimingLed2CrystalDat.h"
#include "OnlineDB/EcalCondDB/interface/MonOccupancyDat.h"
#include "OnlineDB/EcalCondDB/interface/MonRunDat.h"
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
#include "DataFormats/EcalDetId/interface/EcalScDetId.h"
#include "DataFormats/EcalDetId/interface/EcalElectronicsId.h"
#include "DataFormats/EcalDetId/interface/EcalPnDiodeDetId.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
namespace ecaldqm {
enum Quality {
kBad = 0,
kGood = 1,
kUnknown = 2,
kMBad = 3,
kMGood = 4,
kMUnknown = 5
};
bool
qualityOK(int _quality)
{
return (_quality != kBad && _quality != kUnknown);
}
DBWriterWorker::DBWriterWorker(std::string const& _name, edm::ParameterSet const& _ps) :
name_(_name),
runTypes_(),
source_(),
active_(false)
{
edm::ParameterSet const& params(_ps.getUntrackedParameterSet(name_));
std::vector<std::string> runTypes(params.getUntrackedParameter<std::vector<std::string> >("runTypes"));
for(unsigned iT(0); iT < runTypes.size(); ++iT)
runTypes_.insert(runTypes[iT]);
if(!params.existsAs<edm::ParameterSet>("source", false)) return;
edm::ParameterSet const& sourceParams(params.getUntrackedParameterSet("source"));
std::vector<std::string> const& meNames(sourceParams.getParameterNames());
for(unsigned iP(0); iP < meNames.size(); ++iP){
std::string meName(meNames[iP]);
edm::ParameterSet const& meParam(sourceParams.getUntrackedParameterSet(meName));
source_.insert(meName, createMESet(meParam));
}
}
void
DBWriterWorker::retrieveSource(DQMStore const& _store)
{
std::string failedPath;
for(MESetCollection::iterator sItr(source_.begin()); sItr != source_.end(); ++sItr){
if(!sItr->second->retrieve(_store, &failedPath)){
edm::LogError("EcalDQM") << name_ << ": MESet " << sItr->first << "@" << failedPath << " not found";
active_ = false;
return;
}
}
active_ = true;
}
bool
IntegrityWriter::run(EcalCondDBInterface* _db, MonRunIOV& _iov)
{
/*
uses
OccupancyTask.Digi (h_)
PNDiodeTask.Occupancy (hmem_)
IntegrityTask.Gain (h01_)
IntegrityTask.ChId (h02_)
IntegrityTask.GainSwitch (h03_)
IntegrityTask.TowerId (h04_)
IntegrityTask.BlockSize (h05_)
RawDataTask.L1AFE
RawDataTask.BXFE
PNDiodeTask.MemChId (h06_)
PNDiodeTask.MemGain (h07_)
PNDiodeTask.MemTowerId (h08_)
PNDiodeTask.MomBlockSize (h09_)
IntegrityClient.Quality
PNIntegrityClient.QualitySummary
*/
bool result(true);
std::map<EcalLogicID, MonCrystalConsistencyDat> crystalConsistencies;
std::map<EcalLogicID, MonTTConsistencyDat> towerConsistencies;
std::map<EcalLogicID, MonMemChConsistencyDat> memChannelConsistencies;
std::map<EcalLogicID, MonMemTTConsistencyDat> memTowerConsistencies;
MESet const& digiME(source_.at("Digi"));
MESet const& gainME(source_.at("Gain"));
MESet const& chidME(source_.at("ChId"));
MESet const& gainswitchME(source_.at("GainSwitch"));
MESet const& qualityME(source_.at("Quality"));
MESet const& toweridME(source_.at("TowerId"));
MESet const& blocksizeME(source_.at("BlockSize"));
MESet const& l1aME(source_.at("L1AFE"));
MESet const& bxME(source_.at("BXFE"));
MESet const& memdigiME(source_.at("MEMDigi"));
MESet const& memchidME(source_.at("MEMChId"));
MESet const& memgainME(source_.at("MEMGain"));
MESet const& pnqualityME(source_.at("PNQuality"));
MESet const& memtoweridME(source_.at("MEMTowerId"));
MESet const& memblocksizeME(source_.at("MEMBlockSize"));
if(verbosity_ > 1) edm::LogInfo("EcalDQM") << " Looping over crystals";
MESet::const_iterator dEnd(digiME.end());
MESet::const_iterator qItr(qualityME);
for(MESet::const_iterator dItr(digiME.beginChannel()); dItr != dEnd; dItr.toNextChannel()){
DetId id(dItr->getId());
int nDigis(dItr->getBinContent());
int gain(gainME.getBinContent(id));
int chid(chidME.getBinContent(id));
int gainswitch(gainswitchME.getBinContent(id));
qItr = dItr;
if(gain > 0 || chid > 0 || gainswitch > 0){
MonCrystalConsistencyDat& data(crystalConsistencies[crystalID(id)]);
data.setProcessedEvents(nDigis);
data.setProblematicEvents(gain + chid + gainswitch);
data.setProblemsGainZero(gain);
data.setProblemsID(chid);
data.setProblemsGainSwitch(gainswitch);
int channelStatus(qItr->getBinContent());
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
data.setTaskStatus(channelBad);
result &= qualityOK(channelStatus);
}
}
if(verbosity_ > 1) edm::LogInfo("EcalDQM") << " Looping over towers";
for(unsigned iDCC(kEEmLow); iDCC <= kEBpHigh; ++iDCC){
for(unsigned iTower(1); iTower <= 68; ++iTower){
if(!ccuExists(iDCC + 1, iTower)) continue;
EcalElectronicsId eid(iDCC + 1, iTower, 1, 1);
std::vector<DetId> channels(getElectronicsMap()->dccTowerConstituents(iDCC + 1, iTower));
int nDigis(0);
bool towerBad(false);
for(unsigned iD(0); iD < channels.size(); ++iD){
int n(digiME.getBinContent(channels[iD]));
if(n > nDigis) nDigis = n;
int channelStatus(qualityME.getBinContent(channels[iD]));
if(channelStatus == kBad || channelStatus == kMBad) towerBad = true;
}
int towerid(toweridME.getBinContent(eid));
int blocksize(blocksizeME.getBinContent(eid));
int l1a(l1aME.getBinContent(iDCC + 1, iTower));
int bx(bxME.getBinContent(iDCC + 1, iTower));
if(towerid > 0 || blocksize > 0 || l1a > 0 || bx > 0){
MonTTConsistencyDat& data(towerConsistencies[towerID(eid)]);
data.setProcessedEvents(nDigis);
data.setProblematicEvents(towerid + blocksize + l1a + bx);
data.setProblemsID(towerid);
data.setProblemsSize(blocksize);
data.setProblemsLV1(l1a);
data.setProblemsBunchX(bx);
data.setTaskStatus(towerBad);
result &= !towerBad;
}
}
}
if(verbosity_ > 1) edm::LogInfo("EcalDQM") << " Looping over MEM channels and towers";
for(unsigned iMD(0); iMD < memDCC.size(); ++iMD){
unsigned iDCC(memDCC[iMD]);
int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel);
for(unsigned iPN(1); iPN <= 10; ++iPN){
EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN);
int nDigis(memdigiME.getBinContent(pnid));
int memchid(memchidME.getBinContent(pnid));
int memgain(memgainME.getBinContent(pnid));
if(memchid > 0 || memgain > 0){
MonMemChConsistencyDat& data(memChannelConsistencies[memChannelID(pnid)]);
data.setProcessedEvents(nDigis);
data.setProblematicEvents(memchid + memgain);
data.setProblemsID(memchid);
data.setProblemsGainZero(memgain);
int channelStatus(pnqualityME.getBinContent(pnid));
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
data.setTaskStatus(channelBad);
result &= qualityOK(channelStatus);
}
}
for(unsigned iTower(69); iTower <= 70; ++iTower){
EcalElectronicsId eid(iDCC + 1, iTower, 1, 1);
int nDigis(0);
bool towerBad(false);
for(unsigned iPN(1); iPN <= 10; ++iPN){
EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN);
int n(memdigiME.getBinContent(pnid));
if(n > nDigis) nDigis = n;
int channelStatus(pnqualityME.getBinContent(pnid));
if(channelStatus == kBad || channelStatus == kMBad) towerBad = true;
}
int towerid(memtoweridME.getBinContent(eid));
int blocksize(memblocksizeME.getBinContent(eid));
if(towerid > 0 || blocksize > 0){
MonMemTTConsistencyDat& data(memTowerConsistencies[memTowerID(eid)]);
data.setProcessedEvents(nDigis);
data.setProblematicEvents(towerid + blocksize);
data.setProblemsID(towerid);
data.setProblemsSize(blocksize);
data.setTaskStatus(towerBad);
result &= !towerBad;
}
}
}
if(verbosity_ > 1) edm::LogInfo("EcalDQM") << " Inserting data";
try{
if(crystalConsistencies.size() > 0){
if(verbosity_ > 2) edm::LogInfo("EcalDQM") << " crystalConsistencies";
_db->insertDataArraySet(&crystalConsistencies, &_iov);
}
if(towerConsistencies.size() > 0){
if(verbosity_ > 2) edm::LogInfo("EcalDQM") << " towerConsistencies";
_db->insertDataArraySet(&towerConsistencies, &_iov);
}
if(memChannelConsistencies.size() > 0){
if(verbosity_ > 2) edm::LogInfo("EcalDQM") << " memChannelConsistencies";
_db->insertDataArraySet(&memChannelConsistencies, &_iov);
}
if(memTowerConsistencies.size() > 0){
if(verbosity_ > 2) edm::LogInfo("EcalDQM") << " memTowerConsistencies";
_db->insertDataArraySet(&memTowerConsistencies, &_iov);
}
}
catch(std::runtime_error& e){
if(std::string(e.what()).find("unique constraint") != std::string::npos)
edm::LogWarning("EcalDQM") << e.what();
else
throw cms::Exception("DBError") << e.what();
}
return result;
}
LaserWriter::LaserWriter(edm::ParameterSet const& _ps) :
DBWriterWorker("Laser", _ps),
wlToME_()
{
std::vector<int> laserWavelengths(_ps.getUntrackedParameter<std::vector<int> >("laserWavelengths"));
// wavelengths are not necessarily ordered
// create a map wl -> MESet index
// using Amplitude here but any multi-wavelength plot is fine
MESet::PathReplacements repl;
MESetMulti const& amplitude(static_cast<MESetMulti const&>(source_.at("Amplitude")));
unsigned nWL(laserWavelengths.size());
for(unsigned iWL(0); iWL != nWL; ++iWL){
int wl(laserWavelengths[iWL]);
if(wl <= 0 || wl >= 5) throw cms::Exception("InvalidConfiguration") << "Laser Wavelength";
repl["wl"] = std::to_string(wl);
wlToME_[wl] = amplitude.getIndex(repl);
}
}
bool
LaserWriter::run(EcalCondDBInterface* _db, MonRunIOV& _iov)
{
/*
uses
LaserTask.Amplitude (h01, h03, h05, h07)
LaserTask.AOverP (h02, h04, h06, h08)
LaserTask.Timing (h09, h10, h11, h12)
LaserClient.Quality (meg01, meg02, meg03, meg04)
LaserTask.PNAmplitude (i09, i10, i11, i12)
LaserClient.PNQualitySummary (meg09, meg10, meg11, meg12)
PNDiodeTask.Pedestal (i13, i14, i15, i16)
*/
bool result(true);
std::map<EcalLogicID, MonLaserBlueDat> l1Amp;
std::map<EcalLogicID, MonTimingLaserBlueCrystalDat> l1Time;
std::map<EcalLogicID, MonPNBlueDat> l1PN;
std::map<EcalLogicID, MonLaserGreenDat> l2Amp;
std::map<EcalLogicID, MonTimingLaserGreenCrystalDat> l2Time;
std::map<EcalLogicID, MonPNGreenDat> l2PN;
std::map<EcalLogicID, MonLaserIRedDat> l3Amp;
std::map<EcalLogicID, MonTimingLaserIRedCrystalDat> l3Time;
std::map<EcalLogicID, MonPNIRedDat> l3PN;
std::map<EcalLogicID, MonLaserRedDat> l4Amp;
std::map<EcalLogicID, MonTimingLaserRedCrystalDat> l4Time;
std::map<EcalLogicID, MonPNRedDat> l4PN;
MESet const& ampME(source_.at("Amplitude"));
MESet const& aopME(source_.at("AOverP"));
MESet const& timeME(source_.at("Timing"));
MESet const& qualityME(source_.at("Quality"));
MESet const& pnME(source_.at("PNAmplitude"));
MESet const& pnQualityME(source_.at("PNQuality"));
MESet const& pnPedestalME(source_.at("PNPedestal"));
for(std::map<int, unsigned>::iterator wlItr(wlToME_.begin()); wlItr != wlToME_.end(); ++wlItr){
int wl(wlItr->first);
unsigned iM(wlItr->second);
static_cast<MESetMulti const&>(ampME).use(iM);
static_cast<MESetMulti const&>(aopME).use(iM);
static_cast<MESetMulti const&>(timeME).use(iM);
static_cast<MESetMulti const&>(qualityME).use(iM);
static_cast<MESetMulti const&>(pnME).use(iM);
static_cast<MESetMulti const&>(pnQualityME).use(iM);
MESet::const_iterator aEnd(ampME.end());
MESet::const_iterator qItr(qualityME);
MESet::const_iterator oItr(aopME);
MESet::const_iterator tItr(timeME);
for(MESet::const_iterator aItr(ampME.beginChannel()); aItr != aEnd; aItr.toNextChannel()){
float aEntries(aItr->getBinEntries());
if(aEntries < 1.) continue;
qItr = aItr;
oItr = aItr;
tItr = aItr;
DetId id(aItr->getId());
float ampMean(aItr->getBinContent());
float ampRms(aItr->getBinError() * std::sqrt(aEntries));
float aopEntries(oItr->getBinEntries());
float aopMean(oItr->getBinContent());
float aopRms(oItr->getBinError() * std::sqrt(aopEntries));
float timeEntries(tItr->getBinEntries());
float timeMean(tItr->getBinContent());
float timeRms(tItr->getBinError() * std::sqrt(timeEntries));
int channelStatus(qItr->getBinContent());
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
EcalLogicID logicID(crystalID(id));
switch(wl){
case 1:
{
MonLaserBlueDat& aData(l1Amp[logicID]);
aData.setAPDMean(ampMean);
aData.setAPDRMS(ampRms);
aData.setAPDOverPNMean(aopMean);
aData.setAPDOverPNRMS(aopRms);
aData.setTaskStatus(channelBad);
MonTimingLaserBlueCrystalDat& tData(l1Time[logicID]);
tData.setTimingMean(timeMean);
tData.setTimingRMS(timeRms);
tData.setTaskStatus(channelBad);
}
break;
case 2:
{
MonLaserGreenDat& aData(l2Amp[logicID]);
aData.setAPDMean(ampMean);
aData.setAPDRMS(ampRms);
aData.setAPDOverPNMean(aopMean);
aData.setAPDOverPNRMS(aopRms);
aData.setTaskStatus(channelBad);
MonTimingLaserGreenCrystalDat& tData(l2Time[logicID]);
tData.setTimingMean(timeMean);
tData.setTimingRMS(timeRms);
tData.setTaskStatus(channelBad);
}
break;
case 3:
{
MonLaserIRedDat& aData(l3Amp[logicID]);
aData.setAPDMean(ampMean);
aData.setAPDRMS(ampRms);
aData.setAPDOverPNMean(aopMean);
aData.setAPDOverPNRMS(aopRms);
aData.setTaskStatus(channelBad);
MonTimingLaserIRedCrystalDat& tData(l3Time[logicID]);
tData.setTimingMean(timeMean);
tData.setTimingRMS(timeRms);
tData.setTaskStatus(channelBad);
}
break;
case 4:
{
MonLaserRedDat& aData(l4Amp[logicID]);
aData.setAPDMean(ampMean);
aData.setAPDRMS(ampRms);
aData.setAPDOverPNMean(aopMean);
aData.setAPDOverPNRMS(aopRms);
aData.setTaskStatus(channelBad);
MonTimingLaserRedCrystalDat& tData(l4Time[logicID]);
tData.setTimingMean(timeMean);
tData.setTimingRMS(timeRms);
tData.setTaskStatus(channelBad);
}
break;
}
result &= qualityOK(channelStatus);
}
for(unsigned iMD(0); iMD < memDCC.size(); ++iMD){
unsigned iDCC(memDCC[iMD]);
int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel);
for(unsigned iPN(1); iPN <= 10; ++iPN){
EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN);
float entries(pnME.getBinEntries(pnid));
if(entries < 1.) continue;
float mean(pnME.getBinContent(pnid));
float rms(pnME.getBinError(pnid) * std::sqrt(entries));
float pedestalEntries(pnPedestalME.getBinEntries(pnid));
float pedestalMean(pnPedestalME.getBinContent(pnid));
float pedestalRms(pnPedestalME.getBinError(pnid) * std::sqrt(pedestalEntries));
int channelStatus(pnQualityME.getBinContent(pnid));
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
switch(wl){
case 1:
{
MonPNBlueDat& data(l1PN[lmPNID(pnid)]);
data.setADCMeanG1(-1.);
data.setADCRMSG1(-1.);
data.setPedMeanG1(-1.);
data.setPedRMSG1(-1.);
data.setADCMeanG16(mean);
data.setADCRMSG16(rms);
data.setPedMeanG16(pedestalMean);
data.setPedRMSG16(pedestalRms);
data.setTaskStatus(channelBad);
}
break;
case 2:
{
MonPNGreenDat& data(l2PN[lmPNID(pnid)]);
data.setADCMeanG1(-1.);
data.setADCRMSG1(-1.);
data.setPedMeanG1(-1.);
data.setPedRMSG1(-1.);
data.setADCMeanG16(mean);
data.setADCRMSG16(rms);
data.setPedMeanG16(pedestalMean);
data.setPedRMSG16(pedestalRms);
data.setTaskStatus(channelBad);
}
break;
case 3:
{
MonPNIRedDat& data(l3PN[lmPNID(pnid)]);
data.setADCMeanG1(-1.);
data.setADCRMSG1(-1.);
data.setPedMeanG1(-1.);
data.setPedRMSG1(-1.);
data.setADCMeanG16(mean);
data.setADCRMSG16(rms);
data.setPedMeanG16(pedestalMean);
data.setPedRMSG16(pedestalRms);
data.setTaskStatus(channelBad);
}
break;
case 4:
{
MonPNRedDat& data(l4PN[lmPNID(pnid)]);
data.setADCMeanG1(-1.);
data.setADCRMSG1(-1.);
data.setPedMeanG1(-1.);
data.setPedRMSG1(-1.);
data.setADCMeanG16(mean);
data.setADCRMSG16(rms);
data.setPedMeanG16(pedestalMean);
data.setPedRMSG16(pedestalRms);
data.setTaskStatus(channelBad);
}
break;
}
result &= qualityOK(channelStatus);
}
}
}
try{
if(l1Amp.size() > 0)
_db->insertDataArraySet(&l1Amp, &_iov);
if(l1Time.size() > 0)
_db->insertDataArraySet(&l1Time, &_iov);
if(l1PN.size() > 0)
_db->insertDataArraySet(&l1PN, &_iov);
if(l2Amp.size() > 0)
_db->insertDataArraySet(&l2Amp, &_iov);
if(l2Time.size() > 0)
_db->insertDataArraySet(&l2Time, &_iov);
if(l2PN.size() > 0)
_db->insertDataArraySet(&l2PN, &_iov);
if(l3Amp.size() > 0)
_db->insertDataArraySet(&l3Amp, &_iov);
if(l3Time.size() > 0)
_db->insertDataArraySet(&l3Time, &_iov);
if(l3PN.size() > 0)
_db->insertDataArraySet(&l3PN, &_iov);
if(l4Amp.size() > 0)
_db->insertDataArraySet(&l4Amp, &_iov);
if(l4Time.size() > 0)
_db->insertDataArraySet(&l4Time, &_iov);
if(l4PN.size() > 0)
_db->insertDataArraySet(&l4PN, &_iov);
}
catch(std::runtime_error& e){
if(std::string(e.what()).find("unique constraint") != std::string::npos)
edm::LogWarning("EcalDQM") << e.what();
else
throw cms::Exception("DBError") << e.what();
}
return result;
}
PedestalWriter::PedestalWriter(edm::ParameterSet const& _ps) :
DBWriterWorker("Pedestal", _ps),
gainToME_(),
pnGainToME_()
{
std::vector<int> MGPAGains(_ps.getUntrackedParameter<std::vector<int> >("MGPAGains"));
std::vector<int> MGPAGainsPN(_ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN"));
MESet::PathReplacements repl;
MESetMulti const& pedestal(static_cast<MESetMulti const&>(source_.at("Pedestal")));
unsigned nG(MGPAGains.size());
for(unsigned iG(0); iG != nG; ++iG){
int gain(MGPAGains[iG]);
if(gain != 1 && gain != 6 && gain != 12) throw cms::Exception("InvalidConfiguration") << "MGPA gain";
repl["gain"] = std::to_string(gain);
gainToME_[gain] = pedestal.getIndex(repl);
}
repl.clear();
MESetMulti const& pnPedestal(static_cast<MESetMulti const&>(source_.at("PNPedestal")));
unsigned nGPN(MGPAGainsPN.size());
for(unsigned iG(0); iG != nGPN; ++iG){
int gain(MGPAGainsPN[iG]);
if(gain != 1 && gain != 16) throw cms::Exception("InvalidConfiguration") << "PN MGPA gain";
repl["pngain"] = std::to_string(gain);
pnGainToME_[gain] = pnPedestal.getIndex(repl);
}
}
bool
PedestalWriter::run(EcalCondDBInterface* _db, MonRunIOV& _iov)
{
/*
uses
PedestalTask.Pedestal (h01, h02, h03)
PedestalTask.PNPedestal (i01, i02)
PedestalClient.Quality (meg01, meg02, meg03)
PedestalClient.PNQualitySummary (meg04, meg05)
*/
bool result(true);
std::map<EcalLogicID, MonPedestalsDat> pedestals;
std::map<EcalLogicID, MonPNPedDat> pnPedestals;
MESet const& pedestalME(source_.at("Pedestal"));
MESet const& qualityME(source_.at("Quality"));
MESet const& pnPedestalME(source_.at("PNPedestal"));
MESet const& pnQualityME(source_.at("PNQuality"));
for(std::map<int, unsigned>::iterator gainItr(gainToME_.begin()); gainItr != gainToME_.end(); ++gainItr){
int gain(gainItr->first);
int iM(gainItr->second);
static_cast<MESetMulti const&>(pedestalME).use(iM);
static_cast<MESetMulti const&>(qualityME).use(iM);
MESet::const_iterator pEnd(pedestalME.end());
MESet::const_iterator qItr(qualityME);
for(MESet::const_iterator pItr(pedestalME.beginChannel()); pItr != pEnd; pItr.toNextChannel()){
float entries(pItr->getBinEntries());
if(entries < 1.) continue;
qItr = pItr;
float mean(pItr->getBinContent());
float rms(pItr->getBinError() * std::sqrt(entries));
EcalLogicID logicID(crystalID(pItr->getId()));
if(pedestals.find(logicID) == pedestals.end()){
MonPedestalsDat& insertion(pedestals[logicID]);
insertion.setPedMeanG1(-1.);
insertion.setPedRMSG1(-1.);
insertion.setPedMeanG6(-1.);
insertion.setPedRMSG6(-1.);
insertion.setPedMeanG12(-1.);
insertion.setPedRMSG12(-1.);
insertion.setTaskStatus(false);
}
MonPedestalsDat& data(pedestals[logicID]);
switch(gain){
case 1:
data.setPedMeanG1(mean);
data.setPedRMSG1(rms);
break;
case 6:
data.setPedMeanG6(mean);
data.setPedRMSG6(rms);
break;
case 12:
data.setPedMeanG12(mean);
data.setPedRMSG12(rms);
break;
}
int channelStatus(qItr->getBinContent());
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
if(channelBad)
data.setTaskStatus(true);
result &= qualityOK(channelStatus);
}
}
for(std::map<int, unsigned>::iterator gainItr(pnGainToME_.begin()); gainItr != pnGainToME_.end(); ++gainItr){
int gain(gainItr->first);
int iM(gainItr->second);
static_cast<MESetMulti const&>(pnPedestalME).use(iM);
static_cast<MESetMulti const&>(pnQualityME).use(iM);
for(unsigned iMD(0); iMD < memDCC.size(); ++iMD){
unsigned iDCC(memDCC[iMD]);
int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel);
for(unsigned iPN(1); iPN <= 10; ++iPN){
EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN);
float entries(pnPedestalME.getBinEntries(pnid));
if(entries < 1.) continue;
float mean(pnPedestalME.getBinContent(pnid));
float rms(pnPedestalME.getBinError(pnid) * std::sqrt(entries));
EcalLogicID logicID(lmPNID(pnid));
if(pnPedestals.find(logicID) == pnPedestals.end()){
MonPNPedDat& insertion(pnPedestals[logicID]);
insertion.setPedMeanG1(-1.);
insertion.setPedRMSG1(-1.);
insertion.setPedMeanG16(-1.);
insertion.setPedRMSG16(-1.);
insertion.setTaskStatus(false);
}
MonPNPedDat& data(pnPedestals[lmPNID(pnid)]);
switch(gain){
case 1:
data.setPedMeanG1(mean);
data.setPedRMSG1(rms);
break;
case 16:
data.setPedMeanG16(mean);
data.setPedRMSG16(rms);
break;
}
int channelStatus(pnQualityME.getBinContent(pnid));
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
if(channelBad)
data.setTaskStatus(true);
result &= qualityOK(channelStatus);
}
}
}
try{
if(pedestals.size() > 0)
_db->insertDataArraySet(&pedestals, &_iov);
if(pnPedestals.size() > 0)
_db->insertDataArraySet(&pnPedestals, &_iov);
}
catch(std::runtime_error& e){
if(std::string(e.what()).find("unique constraint") != std::string::npos)
edm::LogWarning("EcalDQM") << e.what();
else
throw cms::Exception("DBError") << e.what();
}
return result;
}
bool
PresampleWriter::run(EcalCondDBInterface* _db, MonRunIOV& _iov)
{
/*
uses
PresampleTask.Pedestal (h03)
PresampleClient.Quality (meg03)
*/
bool result(true);
std::map<EcalLogicID, MonPedestalsOnlineDat> pedestals;
MESet const& pedestalME(source_.at("Pedestal"));
MESet const& qualityME(source_.at("Quality"));
MESet::const_iterator pEnd(pedestalME.end());
MESet::const_iterator qItr(qualityME);
for(MESet::const_iterator pItr(pedestalME.beginChannel()); pItr != pEnd; pItr.toNextChannel()){
float entries(pItr->getBinEntries());
if(entries < 1.) continue;
qItr = pItr;
float mean(pItr->getBinContent());
float rms(pItr->getBinError() * std::sqrt(entries));
MonPedestalsOnlineDat& data(pedestals[crystalID(pItr->getId())]);
data.setADCMeanG12(mean);
data.setADCRMSG12(rms);
int channelStatus(qItr->getBinContent());
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
data.setTaskStatus(channelBad);
result &= qualityOK(channelStatus);
}
try{
if(pedestals.size() > 0)
_db->insertDataArraySet(&pedestals, &_iov);
}
catch(std::runtime_error& e){
if(std::string(e.what()).find("unique constraint") != std::string::npos)
edm::LogWarning("EcalDQM") << e.what();
else
throw cms::Exception("DBError") << e.what();
}
return result;
}
TestPulseWriter::TestPulseWriter(edm::ParameterSet const& _ps) :
DBWriterWorker("TestPulse", _ps),
gainToME_(),
pnGainToME_()
{
std::vector<int> MGPAGains(_ps.getUntrackedParameter<std::vector<int> >("MGPAGains"));
std::vector<int> MGPAGainsPN(_ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN"));
MESet::PathReplacements repl;
MESetMulti const& amplitude(static_cast<MESetMulti const&>(source_.at("Amplitude")));
unsigned nG(MGPAGains.size());
for(unsigned iG(0); iG != nG; ++iG){
int gain(MGPAGains[iG]);
if(gain != 1 && gain != 6 && gain != 12) throw cms::Exception("InvalidConfiguration") << "MGPA gain";
repl["gain"] = std::to_string(gain);
gainToME_[gain] = amplitude.getIndex(repl);
}
repl.clear();
MESetMulti const& pnAmplitude(static_cast<MESetMulti const&>(source_.at("PNAmplitude")));
unsigned nGPN(MGPAGainsPN.size());
for(unsigned iG(0); iG != nGPN; ++iG){
int gain(MGPAGainsPN[iG]);
if(gain != 1 && gain != 16) throw cms::Exception("InvalidConfiguration") << "PN MGPA gain";
repl["pngain"] = std::to_string(gain);
pnGainToME_[gain] = pnAmplitude.getIndex(repl);
}
}
bool
TestPulseWriter::run(EcalCondDBInterface* _db, MonRunIOV& _iov)
{
/*
uses
TestPulseTask.Amplitude (ha01, ha02, ha03)
TestPulseTask.Shape (me_hs01, me_hs02, me_hs03)
TestPulseTask.PNAmplitude (i01, i02)
PNDiodeTask.Pedestal (i03, i04)
TestPulseClient.Quality (meg01, meg02, meg03)
TestPulseClient.PNQualitySummary (meg04, meg05)
*/
bool result(true);
std::map<EcalLogicID, MonTestPulseDat> amplitude;
std::map<EcalLogicID, MonPulseShapeDat> shape;
std::map<EcalLogicID, MonPNMGPADat> pnAmplitude;
MESet const& amplitudeME(source_.at("Amplitude"));
MESet const& shapeME(source_.at("Shape"));
MESet const& qualityME(source_.at("Quality"));
MESet const& pnAmplitudeME(source_.at("PNAmplitude"));
MESet const& pnPedestalME(source_.at("PNPedestal"));
MESet const& pnQualityME(source_.at("PNQuality"));
for(std::map<int, unsigned>::iterator gainItr(gainToME_.begin()); gainItr != gainToME_.end(); ++gainItr){
int gain(gainItr->first);
int iM(gainItr->second);
static_cast<MESetMulti const&>(amplitudeME).use(iM);
static_cast<MESetMulti const&>(shapeME).use(iM);
static_cast<MESetMulti const&>(qualityME).use(iM);
MESet::const_iterator aEnd(amplitudeME.end());
MESet::const_iterator qItr(qualityME);
for(MESet::const_iterator aItr(amplitudeME.beginChannel()); aItr != aEnd; aItr.toNextChannel()){
float entries(aItr->getBinEntries());
if(entries < 1.) continue;
qItr = aItr;
float mean(aItr->getBinContent());
float rms(aItr->getBinError() * std::sqrt(entries));
EcalLogicID logicID(crystalID(aItr->getId()));
if(amplitude.find(logicID) == amplitude.end()){
MonTestPulseDat& insertion(amplitude[logicID]);
insertion.setADCMeanG1(-1.);
insertion.setADCRMSG1(-1.);
insertion.setADCMeanG6(-1.);
insertion.setADCRMSG6(-1.);
insertion.setADCMeanG12(-1.);
insertion.setADCRMSG12(-1.);
insertion.setTaskStatus(false);
}
MonTestPulseDat& data(amplitude[logicID]);
switch(gain){
case 1:
data.setADCMeanG1(mean);
data.setADCRMSG1(rms);
break;
case 6:
data.setADCMeanG6(mean);
data.setADCRMSG6(rms);
break;
case 12:
data.setADCMeanG12(mean);
data.setADCRMSG12(rms);
break;
}
int channelStatus(qItr->getBinContent());
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
if(channelBad)
data.setTaskStatus(true);
result &= qualityOK(channelStatus);
}
for(unsigned iSM(0); iSM < 54; ++iSM){
std::vector<float> samples(10, 0.);
std::vector<DetId> ids(getElectronicsMap()->dccConstituents(iSM + 1));
unsigned nId(ids.size());
unsigned nChannels(0);
EcalLogicID logicID;
for(unsigned iD(0); iD < nId; ++iD){
DetId& id(ids[iD]);
if(iD == 0) logicID = crystalID(id);
if(shapeME.getBinEntries(id, 1) < 1.) continue;
++nChannels;
for(int i(0); i < 10; ++i)
samples[i] += shapeME.getBinContent(id, i + 1);
}
if(nChannels == 0) continue;
for(int i(0); i < 10; ++i)
samples[i] /= nChannels;
if(shape.find(logicID) == shape.end()){
MonPulseShapeDat& insertion(shape[logicID]);
std::vector<float> defval(10, -1.);
insertion.setSamples(defval, 1);
insertion.setSamples(defval, 6);
insertion.setSamples(defval, 12);
}
MonPulseShapeDat& data(shape[logicID]);
data.setSamples(samples, gain);
}
}
for(std::map<int, unsigned>::iterator gainItr(pnGainToME_.begin()); gainItr != pnGainToME_.end(); ++gainItr){
int gain(gainItr->first);
int iM(gainItr->second);
static_cast<MESetMulti const&>(pnAmplitudeME).use(iM);
static_cast<MESetMulti const&>(pnQualityME).use(iM);
for(unsigned iMD(0); iMD < memDCC.size(); ++iMD){
unsigned iDCC(memDCC[iMD]);
int subdet(iDCC <= kEEmHigh || iDCC >= kEEpLow ? EcalEndcap : EcalBarrel);
for(unsigned iPN(1); iPN <= 10; ++iPN){
EcalPnDiodeDetId pnid(subdet, iDCC + 1, iPN);
float entries(pnAmplitudeME.getBinEntries(pnid));
if(entries < 1.) continue;
float mean(pnAmplitudeME.getBinContent(pnid));
float rms(pnAmplitudeME.getBinError(pnid) * std::sqrt(entries));
float pedestalEntries(pnPedestalME.getBinEntries(pnid));
float pedestalMean(pnPedestalME.getBinContent(pnid));
float pedestalRms(pnPedestalME.getBinError(pnid) * std::sqrt(pedestalEntries));
EcalLogicID logicID(lmPNID(pnid));
if(pnAmplitude.find(logicID) == pnAmplitude.end()){
MonPNMGPADat& insertion(pnAmplitude[logicID]);
insertion.setADCMeanG1(-1.);
insertion.setADCRMSG1(-1.);
insertion.setPedMeanG1(-1.);
insertion.setPedRMSG1(-1.);
insertion.setADCMeanG16(-1.);
insertion.setADCRMSG16(-1.);
insertion.setPedMeanG16(-1.);
insertion.setPedRMSG16(-1.);
insertion.setTaskStatus(false);
}
MonPNMGPADat& data(pnAmplitude[lmPNID(pnid)]);
switch(gain){
case 1:
data.setADCMeanG1(mean);
data.setADCRMSG1(rms);
// dynamic pedestal not measured for G1
// data.setPedMeanG1(pedestalMean);
// data.setPedRMSG1(pedestalRms);
break;
case 16:
data.setADCMeanG16(mean);
data.setADCRMSG16(rms);
data.setPedMeanG16(pedestalMean);
data.setPedRMSG16(pedestalRms);
break;
}
int channelStatus(pnQualityME.getBinContent(pnid));
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
if(channelBad)
data.setTaskStatus(true);
result &= qualityOK(channelStatus);
}
}
}
try{
if(amplitude.size() > 0)
_db->insertDataArraySet(&litude, &_iov);
if(shape.size() > 0)
_db->insertDataSet(&shape, &_iov);
if(pnAmplitude.size() > 0)
_db->insertDataArraySet(&pnAmplitude, &_iov);
}
catch(std::runtime_error& e){
if(std::string(e.what()).find("unique constraint") != std::string::npos)
edm::LogWarning("EcalDQM") << e.what();
else
throw cms::Exception("DBError") << e.what();
}
return result;
}
bool
TimingWriter::run(EcalCondDBInterface* _db, MonRunIOV& _iov)
{
/*
uses
TimingTask.TimeMap (h01)
TimingClient.Quality (meg01)
*/
bool result(true);
std::map<EcalLogicID, MonTimingCrystalDat> timing;
MESet const& timingME(source_.at("Timing"));
MESet const& qualityME(source_.at("Quality"));
MESet::const_iterator tEnd(timingME.end());
MESet::const_iterator qItr(qualityME);
for(MESet::const_iterator tItr(timingME.beginChannel()); tItr != tEnd; tItr.toNextChannel()){
float entries(tItr->getBinEntries());
if(entries < 1.) continue;
qItr = tItr;
float mean(tItr->getBinContent());
float rms(tItr->getBinError() * std::sqrt(entries));
MonTimingCrystalDat& data(timing[crystalID(tItr->getId())]);
data.setTimingMean(mean);
data.setTimingRMS(rms);
int channelStatus(qItr->getBinContent());
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
data.setTaskStatus(channelBad);
result &= qualityOK(channelStatus);
}
try{
if(timing.size() > 0)
_db->insertDataArraySet(&timing, &_iov);
}
catch(std::runtime_error& e){
if(std::string(e.what()).find("unique constraint") != std::string::npos)
edm::LogWarning("EcalDQM") << e.what();
else
throw cms::Exception("DBError") << e.what();
}
return result;
}
LedWriter::LedWriter(edm::ParameterSet const& _ps) :
DBWriterWorker("Led", _ps),
wlToME_()
{
std::vector<int> ledWavelengths(_ps.getUntrackedParameter<std::vector<int> >("ledWavelengths"));
// wavelengths are not necessarily ordered
// create a map wl -> MESet index
// using Amplitude here but any multi-wavelength plot is fine
MESet::PathReplacements repl;
MESetMulti const& amplitude(static_cast<MESetMulti const&>(source_.at("Amplitude")));
unsigned nWL(ledWavelengths.size());
for(unsigned iWL(0); iWL != nWL; ++iWL){
int wl(ledWavelengths[iWL]);
if(wl != 1 && wl != 2) throw cms::Exception("InvalidConfiguration") << "Led Wavelength";
repl["wl"] = std::to_string(wl);
wlToME_[wl] = amplitude.getIndex(repl);
}
}
bool
LedWriter::run(EcalCondDBInterface* _db, MonRunIOV& _iov)
{
/*
uses
LedTask.Amplitude (h01, h03)
LedTask.AOverP (h02, h04)
LedTask.Timing (h09, h10)
LedClient.Quality (meg01, meg02)
LedTask.PNAmplitude (i09, i10)
x LedClient.PNQualitySummary (meg09, meg10)
x PNDiodeTask.Pedestal (i13, i14)
*/
bool result(true);
std::map<EcalLogicID, MonLed1Dat> l1Amp;
std::map<EcalLogicID, MonTimingLed1CrystalDat> l1Time;
// std::map<EcalLogicID, MonPNLed1Dat> l1PN;
std::map<EcalLogicID, MonLed2Dat> l2Amp;
std::map<EcalLogicID, MonTimingLed2CrystalDat> l2Time;
// std::map<EcalLogicID, MonPNLed2Dat> l2PN;
MESet const& ampME(source_.at("Amplitude"));
MESet const& aopME(source_.at("AOverP"));
MESet const& timeME(source_.at("Timing"));
MESet const& qualityME(source_.at("Quality"));
// MESet const& pnME(source_.at("PNAmplitude"));
// MESet const& pnQualityME(source_.at("PNQuality"));
// MESet const& pnPedestalME(source_.at("PNPedestal"));
for(std::map<int, unsigned>::iterator wlItr(wlToME_.begin()); wlItr != wlToME_.end(); ++wlItr){
int wl(wlItr->first);
unsigned iM(wlItr->second);
static_cast<MESetMulti const&>(ampME).use(iM);
static_cast<MESetMulti const&>(aopME).use(iM);
static_cast<MESetMulti const&>(timeME).use(iM);
static_cast<MESetMulti const&>(qualityME).use(iM);
// static_cast<MESetMulti const&>(pnME).use(iM);
// static_cast<MESetMulti const&>(pnQualityME).use(iM);
MESet::const_iterator aEnd(ampME.end());
MESet::const_iterator qItr(qualityME);
MESet::const_iterator oItr(aopME);
MESet::const_iterator tItr(timeME);
for(MESet::const_iterator aItr(ampME.beginChannel()); aItr != aEnd; aItr.toNextChannel()){
float aEntries(aItr->getBinEntries());
if(aEntries < 1.) continue;
qItr = aItr;
oItr = aItr;
tItr = aItr;
DetId id(aItr->getId());
float ampMean(aItr->getBinContent());
float ampRms(aItr->getBinError() * std::sqrt(aEntries));
float aopEntries(oItr->getBinEntries());
float aopMean(oItr->getBinContent());
float aopRms(oItr->getBinError() * std::sqrt(aopEntries));
float timeEntries(tItr->getBinEntries());
float timeMean(tItr->getBinContent());
float timeRms(tItr->getBinError() * std::sqrt(timeEntries));
int channelStatus(qItr->getBinContent());
bool channelBad(channelStatus == kBad || channelStatus == kMBad);
EcalLogicID logicID(crystalID(id));
switch(wl){
case 1:
{
MonLed1Dat& aData(l1Amp[logicID]);
aData.setVPTMean(ampMean);
aData.setVPTRMS(ampRms);
aData.setVPTOverPNMean(aopMean);
aData.setVPTOverPNRMS(aopRms);
aData.setTaskStatus(channelBad);
MonTimingLed1CrystalDat& tData(l1Time[logicID]);
tData.setTimingMean(timeMean);
tData.setTimingRMS(timeRms);
tData.setTaskStatus(channelBad);
}
break;
case 2:
{
MonLed2Dat& aData(l2Amp[logicID]);
aData.setVPTMean(ampMean);
aData.setVPTRMS(ampRms);
aData.setVPTOverPNMean(aopMean);
aData.setVPTOverPNRMS(aopRms);
aData.setTaskStatus(channelBad);
MonTimingLed2CrystalDat& tData(l2Time[logicID]);
tData.setTimingMean(timeMean);
tData.setTimingRMS(timeRms);
tData.setTaskStatus(channelBad);
}
break;
}
result &= qualityOK(channelStatus);
}
// for(unsigned iMD(0); iMD < memDCC.size(); ++iMD){
// unsigned iDCC(memDCC[iMD]);
// if(iDCC >= kEBmLow && iDCC <= kEBpHigh) continue;
// for(unsigned iPN(1); iPN <= 10; ++iPN){
// EcalPnDiodeDetId pnid(EcalEndcap, iDCC + 1, iPN);
// float entries(pnME.getBinEntries(pnid));
// if(entries < 1.) continue;
// float mean(pnME.getBinContent(pnid));
// float rms(pnME.getBinError(pnid) * std::sqrt(entries));
// float pedestalEntries(pnPedestalME.getBinEntries(pnid));
// float pedestalMean(pnPedestalME.getBinContent(pnid));
// float pedestalRms(pnPedestalME.getBinError(pnid) * std::sqrt(pedestalEntries));
// int channelStatus(pnQualityME.getBinContent(pnid));
// bool channelBad(channelStatus == kBad || channelStatus == kMBad);
// switch(wl){
// case 1:
// {
// MonPNLed1Dat& data(l1PN[lmPNID(pnid)]);
// data.setADCMeanG1(-1.);
// data.setADCRMSG1(-1.);
// data.setPedMeanG1(-1.);
// data.setPedRMSG1(-1.);
// data.setADCMeanG16(mean);
// data.setADCRMSG16(rms);
// data.setPedMeanG16(pedestalMean);
// data.setPedRMSG16(pedestalRms);
// data.setTaskStatus(channelBad);
// }
// break;
// case 2:
// {
// MonPNLed2Dat& data(l2PN[lmPNID(pnid)]);
// data.setADCMeanG1(-1.);
// data.setADCRMSG1(-1.);
// data.setPedMeanG1(-1.);
// data.setPedRMSG1(-1.);
// data.setADCMeanG16(mean);
// data.setADCRMSG16(rms);
// data.setPedMeanG16(pedestalMean);
// data.setPedRMSG16(pedestalRms);
// data.setTaskStatus(channelBad);
// }
// break;
// }
// result &= qualityOK(channelStatus);
// }
// }
}
try{
if(l1Amp.size() > 0)
_db->insertDataArraySet(&l1Amp, &_iov);
if(l1Time.size() > 0)
_db->insertDataArraySet(&l1Time, &_iov);
// if(l1PN.size() > 0)
// _db->insertDataArraySet(&l1PN, &_iov);
if(l2Amp.size() > 0)
_db->insertDataArraySet(&l2Amp, &_iov);
if(l2Time.size() > 0)
_db->insertDataArraySet(&l2Time, &_iov);
// if(l2PN.size() > 0)
// _db->insertDataArraySet(&l2PN, &_iov);
}
catch(std::runtime_error& e){
if(std::string(e.what()).find("unique constraint") != std::string::npos)
edm::LogWarning("EcalDQM") << e.what();
else
throw cms::Exception("DBError") << e.what();
}
return result;
}
bool
OccupancyWriter::run(EcalCondDBInterface* _db, MonRunIOV& _iov)
{
/*
uses
OccupancyTask.Digi (i01)
EnergyTask.HitMap (i02)
*/
std::map<EcalLogicID, MonOccupancyDat> occupancy;
MESet const& occupancyME(source_.at("Occupancy"));
MESet const& energyME(source_.at("Energy"));
MESet::const_iterator oEnd(occupancyME.end());
MESet::const_iterator eItr(energyME);
for(MESet::const_iterator oItr(occupancyME.beginChannel()); oItr != oEnd; oItr.toNextChannel()){
if(oItr->getME()->getTH1()->GetEntries() < 1000.) continue;
int entries(oItr->getBinContent());
if(entries < 10) continue;
eItr = oItr;
int eEntries(eItr->getBinEntries());
float energy(eEntries > 10 ? eItr->getBinContent() : -1.);
MonOccupancyDat& data(occupancy[crystalID(oItr->getId())]);
data.setEventsOverLowThreshold(entries);
data.setEventsOverHighThreshold(eEntries);
data.setAvgEnergy(energy);
}
try{
if(occupancy.size() > 0)
_db->insertDataArraySet(&occupancy, &_iov);
}
catch(std::runtime_error& e){
if(std::string(e.what()).find("unique constraint") != std::string::npos)
edm::LogWarning("EcalDQM") << e.what();
else
throw cms::Exception("DBError") << e.what();
}
return true;
}
bool
SummaryWriter::run(EcalCondDBInterface* _db, MonRunIOV& _iov)
{
std::map<EcalLogicID, MonRunDat> dataset;
MonRunDat& ebDat(dataset[subdetID(EcalBarrel)]);
MonRunDat& eeDat(dataset[subdetID(EcalEndcap)]);
// CURRENTLY ONLY WRITING SUCCESS
MonRunOutcomeDef outcomeDef;
outcomeDef.setShortDesc("success");
ebDat.setNumEvents(processedEvents_);
eeDat.setNumEvents(processedEvents_);
ebDat.setMonRunOutcomeDef(outcomeDef);
eeDat.setMonRunOutcomeDef(outcomeDef);
ebDat.setTaskList(taskList_);
eeDat.setTaskList(taskList_);
ebDat.setTaskOutcome(outcome_);
eeDat.setTaskOutcome(outcome_);
try{
_db->insertDataSet(&dataset, &_iov);
}
catch(std::runtime_error& e){
if(std::string(e.what()).find("unique constraint") != std::string::npos)
edm::LogWarning("EcalDQM") << e.what();
else
throw cms::Exception("DBError") << e.what();
}
return true;
}
}
| [
"yutaro.iiyama@cern.ch"
] | yutaro.iiyama@cern.ch |
7091d8d6cd2ee68df122c83b7cf5d15b3d3b3dea | dc278b54bd3ba022654c172419077c40bffacd77 | /Day_33/Move Zeroes.cpp | 0e09f099819159a96768d746c2f166e7685c0843 | [] | no_license | Ridhi-priya/faang_interview_questions | 637ea406edfcff7b444999aa3981ad7886a105f9 | eff3c3c25ffc22bd1a90f3069225dae921a27dc3 | refs/heads/main | 2023-04-21T23:13:21.846084 | 2021-05-01T17:32:53 | 2021-05-01T17:32:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 598 | cpp | Code:
void moveZeroes(vector<int>& nums) {
int lastNonZeroFoundAt = 0;
// If the current element is not 0, then we need to
// append it just in front of last non 0 element we found.
for (int i = 0; i < nums.size(); i++) {
if (nums[i] != 0) {
nums[lastNonZeroFoundAt++] = nums[i];
}
}
// After we have finished processing new elements,
// all the non-zero elements are already at beginning of array.
// We just need to fill remaining array with 0's.
for (int i = lastNonZeroFoundAt; i < nums.size(); i++) {
nums[i] = 0;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
544c7912d7dd4a68111c4b93e4a1c59939f4cef8 | 40b85924238752137a60c3c434e803f461479598 | /Laboratories/Lectures/cpp11/cpp.11.01_stl_vector/main.cpp | 544eabc2b5bc21eb6b0a2268b64dc884d078ce1c | [] | no_license | L0GI0/CPP | 4ec3cb557c0d1d24a2be8dfcee526378bc0faace | 063d8c177485745c28231665e895e1b2ca6360b8 | refs/heads/master | 2020-05-03T09:32:26.443048 | 2019-04-27T19:04:54 | 2019-04-27T19:04:54 | 178,556,663 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,247 | cpp | /////////////////////////////////////////////////////////////////////////
/// \file
/// \author Bartosz Mindur
/// \author mindur@fatcat.ftj.agh.edu.pl
/// \version 0.1
/// \date 22-12-2004
/// \brief STL. Vector.
/////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <vector>
/////////////////////////////////////////////////////////////////////////
int main(int argc, char** argv)
{
using namespace std;
typedef vector<double> VecDbl;
//tworzenie
VecDbl c1;
VecDbl c2(10, 3.14159);
VecDbl c3(c2.begin(), c2.end() - 2 );
//info
cout << "c1(info): " << c1.max_size() << ' ' << c1.size() << ' ' << c1.capacity() << '\n'
<< "c2(info): " << c2.max_size() << ' ' << c2.size() << ' ' << c2.capacity() << '\n'
<< "c3(info): " << c3.max_size() << ' ' << c3.size() << ' ' << c3.capacity() << '\n';
//przypisanie
c1.assign(2, 2.2);
cout << "c1: " << c1.at(0) << ' ' << c1[1] << endl;
for(unsigned i = 0; i < 10; ++i)
cout << c2[i] << ' ';
//ustawienie
for(unsigned i = 0; i < 10; ++i)
c2[i] = i * 3.14159;
//wypisanie
cout << "c2: " << c2.front() << ' ' << c2.back() << endl;
swap(c1, c2);
cout << "c2: " << c2.front() << ' ' << c2.back() << endl;
}
| [
"logiocorp@gmail.com"
] | logiocorp@gmail.com |
73a39864f997da579715629287e8da39638d008b | f1314eb482ae7287996d10ee47c8619b1367d45d | /AnalogHeatMidi/AnalogHeatMidi.ino | e22174dd35a45cdb679fca063104e34a0130023a | [
"Unlicense"
] | permissive | johndjameson/analog-heat-midi | 0749cbf775483f3147eca0b73d6327c173697405 | 4ebc700c244455a8a16b3757019c131212f5b93b | refs/heads/main | 2022-04-30T17:18:05.518510 | 2018-07-13T16:18:15 | 2018-07-13T16:19:38 | 140,856,989 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,111 | ino | #include <Bounce2.h>
#include <MIDI.h>
#define NEXT_PIN 8
#define PREVIOUS_PIN 7
int channel = 1;
int program = 0;
Bounce nextDebouncer = Bounce();
Bounce previousDebouncer = Bounce();
MIDI_CREATE_DEFAULT_INSTANCE();
void setup() {
pinMode(NEXT_PIN, INPUT_PULLUP);
pinMode(PREVIOUS_PIN, INPUT_PULLUP);
nextDebouncer.attach(NEXT_PIN);
nextDebouncer.interval(5);
previousDebouncer.attach(PREVIOUS_PIN);
previousDebouncer.interval(5);
MIDI.begin(MIDI_CHANNEL_OFF);
}
void decrementProgram() {
if (program == 0) {
program = 127;
} else {
program--;
}
}
void incrementProgram() {
if (program == 127) {
program = 0;
} else {
program++;
}
}
void updateDebouncers() {
nextDebouncer.update();
previousDebouncer.update();
}
void loop() {
bool queueProgramChange = false;
updateDebouncers();
if (nextDebouncer.fell()) {
queueProgramChange = true;
incrementProgram();
}
if (previousDebouncer.fell()) {
queueProgramChange = true;
decrementProgram();
}
if (queueProgramChange) {
MIDI.sendProgramChange(program, channel);
}
}
| [
"thejohnjameson@gmail.com"
] | thejohnjameson@gmail.com |
7a5873489c85d47929502deca057884e6ef28453 | 0b4b52c2502bf5f18864712b770d772e7bbefb5f | /src/libs/sps30.h | 329476487e69fc218f9e0385ea59e744e0a1aa89 | [
"Apache-2.0"
] | permissive | hackerspace-silesia/Smogomierz | 184d9fdb39d4af01811a389c395cc5146a9c7787 | 8a3d3815724687ed5cc783d41be49795a91efe5e | refs/heads/master | 2023-05-11T19:15:41.951145 | 2022-01-05T20:48:48 | 2022-01-05T20:48:48 | 112,631,365 | 124 | 52 | Apache-2.0 | 2022-11-13T23:19:59 | 2017-11-30T16:03:54 | C++ | UTF-8 | C++ | false | false | 23,714 | h | /**
* sps-30 Library Header file
*
* Copyright (c) January 2019, Paul van Haastrecht
*
* All rights reserved.
* Will work with either UART or I2c communication.
* The I2C link has a number of restrictions. See detailed document
*
* Development environment specifics:
* Arduino IDE 1.8.12 and 1.8.13
*
*
* 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/>.
*
**********************************************************************
* Version 1.0 / January 2019
* - Initial version by paulvha
*
* Version 1.2 / January 2019
* - added force serial1 when TX = RX = 8
* - added flag INCLUDE_SOFTWARE_SERIAL to exclude software Serial
*
* version 1.2.1 / February 2019
* - added flag in sps30.h SOFTI2C_ESP32 to use SoftWire on ESP32 in case of SCD30 and SPS30 working on I2C
*
* version 1.3.0 / February 2019
* - added check on the I2C receive buffer. If at least 64 bytes it try to read ALL information else only MASS results
* - added || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__) for small footprint
*
* version 1.3.1 / April 2019
* - corrected bool stop() {return(Instruct(SER_STOP_MEASUREMENT));}
*
* version 1.3.2 / May 2019
* - added support to detect SAMD I2C buffer size
*
* Version 1.3.6 / October 2019
* - fixed I2C_Max_bytes () error when I2C is excluded
* - improve receive buffer checks larger than 3 bytes
*
* Version 1.3.7 / December 2019
* - fixed ESP32 serial connection / flushing
*
* version 1.3.8 / January 2020
* - optimized the fix from October 2019 for I2C max bytes
*
* version 1.3.9 / February 2020
* - optimized autodetection for SAMD SERCOM and ESP32 to undef softwareSerial
* - removed to typedef warnings
*
* version 1.3.10 / April 2020
* - changed debug message handling
* - added DEBUGSERIAL to define the Serial port for messages
* - some typo's and cosmetic update
* - still backward compatible with earlier sketches
*
* version 1.4 / April 2020
* - Based on the new SPS30 datasheet (March 2020) a number of functions
* are added or updated. Some are depending on the new firmware.
* - Added sleep() and wakeup(). Requires firmware 2.0
* - Added GetVersion() to obtain the current firmware / hardware info
* - Added GetStatusReg() to obtain SPS30 status information. Requires firmware 2.2
* - Added structure SPS30_version for GetVersion
* - Added internal function to check on correct firmware level
* - Added INCLUDE_FWCHECK in SPS30.h to enable /disable check.
* - Changed probe() to obtain firmware levels instead of serial number.
* - Changed on how to obtaining product-type
* - Depreciated GetArticleCode(). Still supporting backward compatibility
* - Update the example sketches to include version levels
* - Added example11 for sleep(), wakeup() and GetStatusreg()
* - Update to documentation
* - Added the new datasheet in extras-folder
*
* version 1.4.1 / May 2020
* - fixed issue in setOpmode() when NO UART is available.
* - added setOpmode() to exclude in small footprint
*
* version 1.4.2 / May 2020
* - added NANO 33 IOT board = SAMD21G18A (addition from Firepoo)
* - added option to select in sketch any serial or wire channel to use (many user requests)
* - added example12 and example13 sketches to demonstrate any channel selection option
*
* version 1.4.3 / June 2020
* - update to I2C_WAKEUP code
*
* version 1.4.4 / July 2020
* - added embedded support for Arduino Due
* - As I now have a SPS30 firmware level 2.2 to test, corrected GetStatusReg() and SetOpMode()
* - changed Example11 to demonstrate reading status register only
* - added Example14 to demonstrate sleep and wakeup function.
*
* version 1.4.5 / August 2020
* - added example20 for connecting multiple SPS30 (5!) to single board
* - updated sps30.odt around multiple SPS30 connected to Mega2560, DUE and ESP32
*
* version 1.4.6 / September 2020
* - corrected return code in instruct()
*
* version 1.4.7 / September 2020
* - corrected another return code in instruct()
*
* version 1.4.8 / October 2020
* - added support for Artemis / Apollo3 for SoftwareSerial detection
* - added check on return code in GetStatusReg()
* - added setClock() for I2C as the Artemis/Apollo3 is standard 400K
* - added flushing in case of Checkzero() (problem in Artemis)
*
* version 1.4.9 / December 2020
* - autodetection for Nano BLE 33 to undef softwareSerial
*
* version 1.4.10 / February 2021
* - Fixed typos in autodetection for Nano BLE 33 / Apollo3 for SoftwareSerial detection
*
* version 1.4.11 / July 2021
* - fixed error handling in Getvalues()
*
*********************************************************************
*/
#ifndef SPS30_H
#define SPS30_H
/**
* library version levels
*/
#define DRIVER_MAJOR 1
#define DRIVER_MINOR 4
/**
* select debug serial (1.3.10)
*/
#define SPS30_DEBUGSERIAL Serial // default
#if defined(ARDUINO_SODAQ_AUTONOMO) || defined(ARDUINO_SODAQ_SARA) || defined(ARDUINO_SODAQ_SFF)
#define SPS30_DEBUGSERIAL_SODAQ SerialUSB
#endif
enum debug_serial {
STANDARD = 0, // default
#ifdef SPS30_DEBUGSERIAL_SODAQ
SODAQ = 1
#endif
};
/**
* ADDED version 1.4
* New firmware levels have been slipped streamed into the SPS30
* The datasheet from March 2020 shows added / updated functions on new
* firmware level. E.g. sleep(), wakeup(), status register are new
*
* On serial connection the new functions are accepted and positive
* acknowledged on lower level firmware, but execution does not seem
* to happen or should be expected.
*
* On I2C reading Status register gives an error on lower level firmware.
* Sleep and wakeup are accepted and positive acknowledged on lower level
* firmware, but execution does not seem to happen or should be expected.
*
* Starting version 1.4 of this driver a firmware level check has been implemented
* and in case a function is called that requires a higher level than
* on the current SPS30, it will return an error.
* By setting INCLUDE_FWCHECK to 0, this check can be disabled
*/
#define INCLUDE_FWCHECK 1
/**
* To EXCLUDE I2C communication, maybe for resource reasons,
* comment out the line below.
*/
#define INCLUDE_I2C 1
/**
* To EXCLUDE the serial communication, maybe for resource reasons
* as your board does not have a seperate serial, comment out the line below
* It will also exclude Software_serial
*/
#define INCLUDE_UART 1
/**
* On some IDE / boards software Serial is not available
* comment out line below in that case
* 1.3.9 : Autodetection for SAMD SERCOM and ESP32 to undef softwareSerial
*/
#define INCLUDE_SOFTWARE_SERIAL 1
/**
* If the platform is an ESP32 AND it is planned to connect an SCD30,
* you have to remove the comments from the line below
*
* The standard I2C on an ESP32 does NOT support clock stretching
* which is needed for the SCD30. You must have SCD30 library downloaded
* from https://github.com/paulvha/scd30 and included in your sketch
* (see examples)
*
* If you do not plan the SPS30 to run on I2C you can exclude the I2C in total
*/
//#define SOFTI2C_ESP32 1
#include <Arduino.h> // Needed for Stream
/**
* Auto detect that some boards have low memory. (like Uno)
*/
#if defined (__AVR_ATmega328__) || defined(__AVR_ATmega328P__)|| defined(__AVR_ATmega16U4__) || (__AVR_ATmega32U4__)
#define SMALLFOOTPRINT 1
#if defined INCLUDE_UART
#undef INCLUDE_UART
#endif //INCLUDE_UART
#endif // AVR definition check
#if defined INCLUDE_I2C
#if defined SOFTI2C_ESP32 // in case of SCD30
#include <SoftWire/SoftWire.h>
#else
#include "Wire.h" // for I2c
#endif
/** Version 1.3.0
*
* The read results is depending on the Wire / I2c buffer size, defined in Wire.h.
*
* The buffer size needed for each float value is 6 (LSB + MSB + CRC ++++ LSB + MSB + CRC)
* To read all values an I2C buffer of atleast 6 x 10 = 60 bytes is needed
* On many boards the default buffer size is set to 32 in Wire.h, thus providing 5 valid float values.
* You can increase (if memory size allows) that yourself in Wire.h
*
* Here we determine the buffersize and the calculation is done in the constructor for sps30
* IF the buffer size is less than 64 only the MASS values are provided. This is for I2C only!!
*
* From a sketch you can check the impact by calling I2C_expect(), which will return the number of valid float values.
*/
#define I2C_LENGTH 32
#if defined BUFFER_LENGTH // Arduino & ESP8266 & Softwire
#undef I2C_LENGTH
#define I2C_LENGTH BUFFER_LENGTH
#endif
#if defined I2C_BUFFER_LENGTH // ESP32
#undef I2C_LENGTH
#define I2C_LENGTH I2C_BUFFER_LENGTH
#endif
/* version 1.3.2 added support for SAMD SERCOM detection */
/* version 1.4.8 autodetection for Apollo3 */
// Depending on definition in wire.h (RingBufferN<256> rxBuffer;)
#if defined ARDUINO_ARCH_SAMD || defined ARDUINO_ARCH_SAM21D || defined ARDUINO_ARCH_APOLLO3
#undef I2C_LENGTH
#define I2C_LENGTH 256
#endif
#endif // INCLUDE_I2C
#if defined INCLUDE_UART
#if defined INCLUDE_SOFTWARE_SERIAL
/* version 1.3.2 added support for SAMD SERCOM detection */
/* version 1.3.9 autodetection for SAMD SERCOM and ESP32 to undef softwareSerial */
/* version 1.4.4 autodetection for Arduino DUE to undef softwareSerial */
/* version 1.4.8 autodetection for Apollo3 to undef softwareSerial */
/* version 1.4.9 autodetection for Nano BLE 33 to undef softwareSerial */
#if defined ARDUINO_ARCH_SAMD || defined ARDUINO_ARCH_SAM21D || defined ARDUINO_ARCH_ESP32 || defined ARDUINO_SAM_DUE || defined ARDUINO_ARCH_APOLLO3 ||defined ARDUINO_ARCH_NRF52840
#undef INCLUDE_SOFTWARE_SERIAL
#else
#include <SoftwareSerial.h> // softserial
#endif // not defined ARDUINO_ARCH_SAMD & ESP32 & DUE & Apollo3
#endif // INCLUDE_SOFTWARE_SERIAL
#endif // INCLUDE_UART
/**
* The communication it can be :
* I2C_COMMS use I2C communication
* SOFTWARE_SERIAL Arduino variants and ESP8266 (On ESP32 software Serial is NOT very stable)
* SERIALPORT ONLY IF there is NO monitor attached
* SERIALPORT1 Arduino MEGA2560, 32U4, Sparkfun ESP32 Thing : MUST define new pins as defaults are used for flash memory)
* SERIALPORT2 Arduino MEGA2560, Due and ESP32
* SERIALPORT3 Arduino MEGA2560 and Due only for now
* NONE No port defined
*
* Softserial has been left in as an option, but as the SPS30 is only
* working on 115K the connection will probably NOT work on most devices.
*/
enum serial_port {
I2C_COMMS = 0,
SOFTWARE_SERIAL = 1,
SERIALPORT = 2,
SERIALPORT1 = 3,
SERIALPORT2 = 4,
SERIALPORT3 = 5,
COMM_TYPE_SERIAL = 6, // added 1.4.2
NONE = 6
};
/* structure to return all values */
struct sps_values {
float MassPM1; // Mass Concentration PM1.0 [μg/m3]
float MassPM2; // Mass Concentration PM2.5 [μg/m3]
float MassPM4; // Mass Concentration PM4.0 [μg/m3]
float MassPM10; // Mass Concentration PM10 [μg/m3]
float NumPM0; // Number Concentration PM0.5 [#/cm3]
float NumPM1; // Number Concentration PM1.0 [#/cm3]
float NumPM2; // Number Concentration PM2.5 [#/cm3]
float NumPM4; // Number Concentration PM4.0 [#/cm3]
float NumPM10; // Number Concentration PM4.0 [#/cm3]
float PartSize; // Typical Particle Size [μm]
};
/* used to get single value */
#define v_MassPM1 1
#define v_MassPM2 2
#define v_MassPM4 3
#define v_MassPM10 4
#define v_NumPM0 5
#define v_NumPM1 6
#define v_NumPM2 7
#define v_NumPM4 8
#define v_NumPM10 9
#define v_PartSize 10
/* needed for conversion float IEE754 */
typedef union {
byte array[4];
float value;
} ByteToFloat;
/* needed for auto interval timing */
typedef union {
byte array[4];
uint32_t value;
} ByteToU32;
/*************************************************************/
/* error codes */
#define SPS30_ERR_OK 0x00
#define ERR_DATALENGTH 0X01
#define ERR_UNKNOWNCMD 0x02
#define ERR_ACCESSRIGHT 0x03
#define ERR_PARAMETER 0x04
#define ERR_OUTOFRANGE 0x28
#define ERR_CMDSTATE 0x43
#define ERR_TIMEOUT 0x50
#define ERR_PROTOCOL 0x51
#define ERR_FIRMWARE 0x88 // added version 1.4
/* Receive buffer length. Expected is 40 bytes max
* but you never know in the future.. */
#if defined SMALLFOOTPRINT
#define MAXRECVBUFLENGTH 50 // for light boards
#else
#define MAXRECVBUFLENGTH 128
struct Description {
uint8_t code;
char desc[80];
};
#endif
/**
* added version 1.4
*
* New call was explained to obtain the version levels
* datasheet SPS30 March 2020, page 14
*
*/
struct SPS30_version {
uint8_t major; // Firmware level
uint8_t minor;
uint8_t HW_version; // zero on I2C
uint8_t SHDLC_major; // zero on I2C
uint8_t SHDLC_minor; // zero on I2C
uint8_t DRV_major;
uint8_t DRV_minor;
};
/**
* added version 1.4
*
* Status register result
*
* REQUIRES FIRMWARE LEVEL 2.2
*/
enum SPS_status {
STATUS_OK = 0,
STATUS_SPEED_ERROR = 1,
STATUS_LASER_ERROR = 2,
STATUS_FAN_ERROR = 4
};
/**
* added version 1.4
*
* Measurement can be done in FLOAR or unsigned 16bits
* page 6 datasheet SPS30 page 6.
*
* This driver only uses float
*/
#define START_MEASURE_FLOAT 0X03
#define START_MEASURE_UNS16 0X05
/*************************************************************/
/* SERIAL COMMUNICATION INFORMATION */
#define SER_START_MEASUREMENT 0x00
#define SER_STOP_MEASUREMENT 0x01
#define SER_READ_MEASURED_VALUE 0x03
#define SER_SLEEP 0x10 // added 1.4
#define SER_WAKEUP 0x11 // added 1.4
#define SER_START_FAN_CLEANING 0x56
#define SER_RESET 0xD3
#define SER_AUTO_CLEANING_INTERVAL 0x80 // Generic autoclean request
#define SER_READ_AUTO_CLEANING 0x81 // read autoclean
#define SER_WRITE_AUTO_CLEANING 0x82 // write autoclean
#define SER_READ_DEVICE_INFO 0xD0 // GENERIC device request
#define SER_READ_DEVICE_PRODUCT_TYPE 0xF0 // CHANGED 1.4
#define SER_READ_DEVICE_RESERVED1 0xF1 // CHANGED 1.4
#define SER_READ_DEVICE_RESERVED2 0xF2 // CHANGED 1.4
#define SER_READ_DEVICE_SERIAL_NUMBER 0xF3
#define SER_READ_VERSION 0xD1 // Added 1.4
#define SER_READ_STATUS 0xD2 // Added 1.4
#define SHDLC_IND 0x7e // header & trailer
#define TIME_OUT 5000 // timeout to prevent deadlock read
#define RX_DELAY_MS 100 // wait between write and read
/*************************************************************/
/* I2C COMMUNICATION INFORMATION */
#define I2C_START_MEASUREMENT 0x0010
#define I2C_STOP_MEASUREMENT 0x0104
#define I2C_READ_DATA_RDY_FLAG 0x0202
#define I2C_READ_MEASURED_VALUE 0x0300
#define I2C_SLEEP 0X1001 // ADDED 1.4
#define I2C_WAKEUP 0X1103 // ADDED 1.4 / update 1.4.3
#define I2C_START_FAN_CLEANING 0x5607
#define I2C_AUTO_CLEANING_INTERVAL 0x8004
#define I2C_SET_AUTO_CLEANING_INTERVAL 0x8005
#define I2C_READ_PRODUCT_TYPE 0xD002 // CHANGED 1.4
#define I2C_READ_SERIAL_NUMBER 0xD033
#define I2C_READ_VERSION 0xD100 // ADDED 1.4
#define I2C_READ_STATUS_REGISTER 0xD206 // ADDED 1.4
#define I2C_CLEAR_STATUS_REGISTER 0xD210 // ADDED 1.4 / update 1.4.4
#define I2C_RESET 0xD304
#define SPS30_ADDRESS 0x69 // I2c address
/***************************************************************/
class SPS30
{
public:
SPS30(void);
/**
* @brief Enable or disable the printing of sent/response HEX values.
*
* @param act : level of debug to set
* 0 : no debug message
* 1 : sending and receiving data
* 2 : 1 + protocol progress
*
* @param SelectDebugSerial : select Serial port (see top of SPS30.h)
* This will allow to select a different port than Serial for debug
* messages. As real example an SODAQ NB board is using SerialUSB.
*/
void EnableDebugging(uint8_t act, debug_serial SelectDebugSerial = STANDARD);
/**
* @brief Initialize the communication port
*
* @param port : communication channel to be used (see sps30.h)
*/
bool begin(serial_port port = SERIALPORT2); // If user doesn't specify Serial2 will be used
/**
* @brief Manual assigment of the serial communication port added 1.4.2
*
* @param serialPort: serial communication port to use
*
* User must have preformed the serialPort.begin(115200) in the sketch.
*/
bool begin(Stream *serialPort);
bool begin(Stream &serialPort);
/**
* @brief Manual assigment I2C communication port added 1.4.2
*
* @param port : I2C communication channel to be used
*
* User must have preformed the wirePort.begin() in the sketch.
*/
bool begin(TwoWire *wirePort);
/**
* @brief : Perform SPS-30 instructions
*/
bool probe();
bool reset() {return(Instruct(SER_RESET));}
bool start() {return(Instruct(SER_START_MEASUREMENT));}
bool stop() {return(Instruct(SER_STOP_MEASUREMENT));}
bool clean() {return(Instruct(SER_START_FAN_CLEANING));}
/**
* Added 1.4
* @brief Set SPS30 to sleep or wakeup
* Requires Firmwarelevel 2.0
*/
uint8_t sleep() {return(SetOpMode(SER_SLEEP));}
uint8_t wakeup(){return(SetOpMode(SER_WAKEUP));}
/**
* @brief : Set or get Auto Clean interval
*/
uint8_t GetAutoCleanInt(uint32_t *val);
uint8_t SetAutoCleanInt(uint32_t val);
/**
* @brief : retrieve Error message details
*/
void GetErrDescription(uint8_t code, char *buf, int len);
/**
* @brief : retrieve device information from the SPS-30
*
* On none of the device so far Article code and Product name are
* available.
*/
uint8_t GetSerialNumber(char *ser, uint8_t len) {return(Get_Device_info( SER_READ_DEVICE_SERIAL_NUMBER, ser, len));}
uint8_t GetProductName(char *ser, uint8_t len) {return(Get_Device_info(SER_READ_DEVICE_PRODUCT_TYPE, ser, len));} // CHANGED 1.4
/**
* CHANGED 1.4
* Depreciated in Datasheet March 2020
* left for backward compatibility with older sketches
*/
uint8_t GetArticleCode(char *ser, uint8_t len) {ser[0] = 0x0; return SPS30_ERR_OK;}
/** ADDED 1.4
* @brief : retrieve software/hardware version information from the SPS-30
*
*/
uint8_t GetVersion(SPS30_version *v);
/** ADDED 1.4
* @brief : Read Device Status from the SPS-30
*
* REQUIRES FIRMWARE 2.2
* The commands are accepted and positive acknowledged on lower level
* firmware, but do not execute.
*
* @param *status
* return status as an 'or':
* STATUS_OK = 0,
* STATUS_SPEED_ERROR = 1,
* STATUS_SPEED_CURRENT_ERROR = 2,
* STATUS_FAN_ERROR = 4
*
* @return
* ERR_OK = ok, no isues found
* else ERR_OUTOFRANGE, issues found
*/
uint8_t GetStatusReg(uint8_t *status);
/**
* @brief : retrieve all measurement values from SPS-30
*/
uint8_t GetValues(struct sps_values *v);
/**
* @brief : retrieve a specific value from the SPS-30
*/
float GetMassPM1() {return(Get_Single_Value(v_MassPM1));}
float GetMassPM2() {return(Get_Single_Value(v_MassPM2));}
float GetMassPM4() {return(Get_Single_Value(v_MassPM4));}
float GetMassPM10() {return(Get_Single_Value(v_MassPM10));}
float GetNumPM0() {return(Get_Single_Value(v_NumPM0));}
float GetNumPM1() {return(Get_Single_Value(v_NumPM1));}
float GetNumPM2() {return(Get_Single_Value(v_NumPM2));}
float GetNumPM4() {return(Get_Single_Value(v_NumPM4));}
float GetNumPM10() {return(Get_Single_Value(v_NumPM10));}
float GetPartSize() {return(Get_Single_Value(v_PartSize));}
/**
* @brief : set RX and TX pin for softserial and Serial1 on ESP32
* Setting both to 8 (tx=rx=8) will force a Serial1 communication
* on any device (assuming the pins are hard coded)
*/
void SetSerialPin(uint8_t rx, uint8_t tx);
#if defined INCLUDE_I2C
/**
* @brief : Return the expected number of valid values read from device
*
* This is depending on the buffer defined in Wire.h
*
* Return
* 4 = Valid Mass values only
* 10 = All values are expected to be valid
*/
uint8_t I2C_expect();
#else
uint8_t I2C_expect() {return 0;}
#endif
private:
void DebugPrintf(const char *pcFmt, ...);
/** shared variables */
uint8_t _Receive_BUF[MAXRECVBUFLENGTH]; // buffers
uint8_t _Send_BUF[10];
uint8_t _Receive_BUF_Length;
uint8_t _Send_BUF_Length;
serial_port _Sensor_Comms; // communication channel to use
int _SPS30_Debug; // program debug level
debug_serial _SPS30_Debug_Serial; // serial debug-port to use
bool _started; // indicate the measurement has started
bool _sleep; // indicate that SPS30 is in sleep (added 1.4)
bool _WasStarted; // restart if SPS30 was started before setting sleep (added 1.4)
uint8_t Reported[11]; // use as cache indicator single value
uint8_t _I2C_Max_bytes;
uint8_t Serial_RX = 0, Serial_TX = 0; // softserial or Serial1 on ESP32
uint8_t _FW_Major, _FW_Minor; // holds firmware major (added 1.4)
/** shared supporting routines */
uint8_t Get_Device_info(uint8_t type, char *ser, uint8_t len);
bool Instruct(uint8_t type);
uint8_t SetOpMode(uint8_t mode); // added 1.4
bool FWCheck(uint8_t major, uint8_t minor); // added 1.4
float byte_to_float(int x);
uint32_t byte_to_U32(int x);
float Get_Single_Value(uint8_t value);
#if defined INCLUDE_UART
/** UART / serial related */
// calls
bool setSerialSpeed();
uint8_t ReadFromSerial();
uint8_t SerialToBuffer();
uint8_t SendToSerial();
bool SHDLC_fill_buffer(uint8_t command, uint32_t parameter = 0);
uint8_t SHDLC_calc_CRC(uint8_t * buf, uint8_t first, uint8_t last);
int ByteStuff(uint8_t b, int off);
uint8_t ByteUnStuff(uint8_t b);
// variables
Stream *_serial; // serial port to use
#endif // INCLUDE_UART
#if defined INCLUDE_I2C
/** I2C communication */
TwoWire *_i2cPort; // holds the I2C port
void I2C_init();
void I2C_fill_buffer(uint16_t cmd, uint32_t interval = 0);
uint8_t I2C_ReadToBuffer(uint8_t count, bool chk_zero);
uint8_t I2C_SetPointer_Read(uint8_t cnt, bool chk_zero = false);
uint8_t I2C_SetPointer();
bool I2C_Check_data_ready();
uint8_t I2C_calc_CRC(uint8_t data[2]);
#endif // INCLUDE_I2C
};
#endif /* SPS30_H */
| [
"blazejfaliszek@gmail.com"
] | blazejfaliszek@gmail.com |
b046d76b183230ca4fa354c162747253d71642e9 | 36508abd5ce33fdb37ecafe2cb8f80f28290c59e | /MWEIMS/source.cpp | d28db4747d9298446c11f18e18cdf0b244b539ea | [] | no_license | FireBrother/MWEIMS | 77c4ad49569d826c65f9527771a684b82bc0f932 | 264f85d319c139bf6e24c4fd3b767b31fe2b4615 | refs/heads/master | 2016-08-12T23:21:25.240702 | 2016-05-06T12:21:58 | 2016-05-06T12:21:58 | 54,399,679 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 4,889 | cpp | #define _CRT_SECURE_NO_WARNINGS
#include "Unicode.h"
#include "ngram.h"
#include "cutter.h"
using namespace std;
enum debug_mode_t { debug_mode_bigram, debug_mode_dict};
void debug_shell(debug_mode_t debug_mode) {
cout << "debug shell" << endl;
switch (debug_mode) {
case debug_mode_bigram:
while (true) {
string a, b;
cin >> a >> b;
printf("unigram %s: %lld\n", a.c_str(), global_unigram[gbk2Unicode(a)]);
printf("unigram %s: %lld\n", b.c_str(), global_unigram[gbk2Unicode(b)]);
printf("bigram %s: %lld\n", make_bigram(a, b).c_str(), global_bigram[gbk2Unicode(make_bigram(a, b))]);
printf("pmi %s: %lf\n", make_bigram(a, b).c_str(), global_pmi[gbk2Unicode(make_bigram(a, b))]);
printf("le %s: %lf\n", a.c_str(), global_le[gbk2Unicode(a)]);
printf("le %s: %lf\n", b.c_str(), global_le[gbk2Unicode(b)]);
printf("re %s: %lf\n", a.c_str(), global_re[gbk2Unicode(a)]);
printf("re %s: %lf\n", b.c_str(), global_re[gbk2Unicode(b)]);
printf("le %s: %lf\n", make_bigram(a, b).c_str(), global_le[gbk2Unicode(make_bigram(a, b))]);
printf("re %s: %lf\n\n", make_bigram(a, b).c_str(), global_re[gbk2Unicode(make_bigram(a, b))]);
}
case debug_mode_dict:
while (true) {
string s;
cin >> s;
printf("dict %s: %lf\n", s.c_str(), cutter::global_dict[gbk2Unicode(s)]);
printf("weight %s: %lf\n", s.c_str(), cutter::global_weight[gbk2Unicode(s)]);
}
}
}
template<typename TDICT>
void save(string filename, const TDICT &dict,long long thresh = 10) {
LogInfo("Saving %s started.", filename.c_str());
ofstream fout;
fout.open(filename, ios::out);
vector<pair<Unicode, double> > vec(dict.begin(), dict.end());
sort(vec.begin(), vec.end(), [](auto x, auto y) { return x.second > y.second; });
for_each(vec.begin(), vec.end(), [&](auto x) {
if (get(global_bigram, x.first, (long long)0) > thresh) {
auto lu = x.first.substr(0, x.first.find(u'→'));
auto ru = x.first.substr(x.first.find(u'→') + 1);
fout << x.first << '\t' << x.second << endl;
}
});
fout.close();
LogInfo("Saving %s finished.", filename.c_str());
}
void calc_statistic() {
init_ngram({ "data\\PeopleDaily_seg.txt" });
cout << experiment::dict.size() << endl;
init_pmi();
init_ent();
ent_t ent, diff_le, diff_re;
double min_le = 2000000000, min_re = 2000000000;
for_each(global_le.begin(), global_le.end(), [&](auto x) {min_le = min(min_le, x.second); });
for_each(global_re.begin(), global_re.end(), [&](auto x) {min_re = min(min_re, x.second); });
for_each(global_le.begin(), global_le.end(), [&](auto x) {
ent[x.first] = global_le[x.first] + get(global_re, x.first, min_re);
});
for_each(global_re.begin(), global_re.end(), [&](auto x) {
ent[x.first] = global_re[x.first] + get(global_le, x.first, min_le);
});
for_each(global_le.begin(), global_le.end(), [&](auto x) {
if (get(global_bigram, x.first, (long long)0) > 5) {
auto lu = x.first.substr(0, x.first.find(u'→'));
diff_le[x.first] = global_le[x.first] - global_le[lu];
}
});
for_each(global_re.begin(), global_re.end(), [&](auto x) {
if (get(global_bigram, x.first, (long long)0) > 5) {
auto ru = x.first.substr(x.first.find(u'→') + 1);
diff_re[x.first] = global_re[x.first] - global_re[ru];
}
});
ent_t weight;
for_each(global_bigram.begin(), global_bigram.end(), [&](auto x) {
if (get(global_bigram, x.first, (long long)0) > 5) {
// weight[x.first] = double(2 * ent[x.first] * global_pmi[x.first]) / double(ent[x.first] + global_pmi[x.first]);
weight[x.first] = double(ent[x.first] + global_pmi[x.first]) / 2.0;
}
});
//save("result\\pmi.txt", global_pmi);
//save("result\\le.txt", global_le);
//save("result\\re.txt", global_re);
//save("result\\ent.txt", ent);
//save("result\\diff_le.txt", diff_le);
//save("result\\diff_re.txt", diff_re);
//save("result\\weight.txt", weight);
string pmis[] = { "pmi_exact", "pmi_high", "pmi_laohu", "pmi_shy1", "pmi_shy2" };
save("experiment\\pmi_exact.txt", experiment::pmi_exact);
save("experiment\\pmi_high.txt", experiment::pmi_high);
save("experiment\\pmi_laohu.txt", experiment::pmi_laohu);
save("experiment\\pmi_shy1.txt", experiment::pmi_shy1);
save("experiment\\pmi_shy2.txt", experiment::pmi_shy2);
save("experiment\\dict.txt", experiment::dict, -1);
}
int main() {
calc_statistic();
//cutter::init_dict({ "data\\jieba.dict" });
//cutter::init_weight({ "result\\weight.txt" });
//string sentence = "继续推进经济体制和经济增长方式的根本转变,坚定不移地沿着有中国特色社会主义道路前进";
////while (getline(cin, sentence))
//{
////if (sentence == "EXIT") break;
// for (auto a : cutter::cut(sentence)) {
// cout << Limonp::join(a.begin(), a.end(), " ") << endl;
// for (auto w : a)
// if (get(cutter::global_weight, gbk2Unicode(w), -10.0) != -10.0)
// cout << w << endl;
// }
//}
debug_shell(debug_mode_dict);
} | [
"wuxian94@pku.edu.cn"
] | wuxian94@pku.edu.cn |
68c7321cbdc1ff307aea42d8843662c510e34044 | 86d0360af5da077fb6a9d6635ebcdd6abf793845 | /chapter16/ex16_62.cpp | c8c148ed8a32d1530acbfbf7ba7db8c974e28ebb | [] | no_license | LukaMod/cpp-primer | d99f1bce499788817417096d468958df9f9fe75f | 80334c1c89baff474260c1322899540c8d7b1138 | refs/heads/master | 2021-01-22T07:32:03.926702 | 2018-06-07T06:27:46 | 2018-06-07T06:27:46 | 81,827,412 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 401 | cpp | #include <iostream>
#include <unordered_set>
#include "ex16_62_Sales_data.h"
using namespace std;
int main()
{
unordered_multiset<Sales_data> mset;
Sales_data item("xyx", 14, 0.7);
mset.emplace(item);
mset.emplace("luka", 5, 0.25);
for (const auto &i : mset)
cout << "the hash code of " << i.isbn() << ":\n"
<< hash<Sales_data>()(i) << endl;
return 0;
} | [
"Luka M"
] | Luka M |
ff62a038dc178450efb0be0407db175495ff69d9 | 145c589fe5ad1db2ec932381513b665864b38bb0 | /introduction-cpp/module-1_introduction-cpp/lesson-7_for-and-vector/step-05.cpp | 5b2d5d6b8523c46d84cd55ec0a08cca18fdce1da | [] | no_license | YSeredich/stepik-courses | d212770a3afb67f2b0c9996de92ff250c5d3275a | a3159d0e9c20d65b25b737ce77aedf628649563e | refs/heads/master | 2021-01-13T04:04:02.290770 | 2017-03-12T21:22:15 | 2017-03-12T21:22:15 | 77,947,038 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 235 | cpp | #include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int main()
{
int n, temp, pos = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> temp;
if (temp > 0) {
pos++;
}
}
cout << pos;
return 0;
} | [
"yseredich@gmail.com"
] | yseredich@gmail.com |
1939de2775c49f97d58906ab545faf51cc274650 | 9b26cd6e9aec677b52acadac84fb38455a2766b9 | /src/alert.cpp | 0d7501a8ef75d46f72339b2bfe7d64d2af756686 | [
"MIT"
] | permissive | ProfProfcompile/zarbitfast | ff543a17e957e6b295aa509c3dc1955071e75ca5 | 9a895bd328ddc2ca8454b8fcc2e8ac67d305ca76 | refs/heads/master | 2020-04-14T03:45:42.223146 | 2019-01-08T22:20:27 | 2019-01-08T22:20:27 | 163,616,116 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,139 | cpp | //
// Alert system
//
#include <boost/foreach.hpp>
#include <map>
#include "alert.h"
#include "key.h"
#include "net.h"
#include "sync.h"
#include "ui_interface.h"
using namespace std;
map<uint256, CAlert> mapAlerts;
CCriticalSection cs_mapAlerts;
static const char* pszMainKey = "040e2442e50d219447c3414ef46252d0a53e86aeec0fdd44fc4dd393a0248265dfff320d6956aa92d6bc0aee14e715c0a2db52e9f1c1fa654680a4247a16dff042";
// TestNet alerts pubKey
static const char* pszTestKey = "040e2442e50d219447c3414ef46252d0a53e86aeec0fdd44fc4dd393a0248265dfff320d6956aa92d6bc0aee14e715c0a2db52e9f1c1fa654680a4247a16dff042";
// TestNet alerts private key
// "308201130201010420b665cff1884e53da26376fd1b433812c9a5a8a4d5221533b15b9629789bb7e42a081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a144034200040de7d639c12262717deffc2f588c5af6230161ca13d1e4bb9a7cf64fbbb271673a5e530582a970070afcd96d009ddc9505bb5466af7d9c4a75786aa3072bab4f"
void CUnsignedAlert::SetNull()
{
nVersion = 1;
nRelayUntil = 0;
nExpiration = 0;
nID = 0;
nCancel = 0;
setCancel.clear();
nMinVer = 0;
nMaxVer = 0;
setSubVer.clear();
nPriority = 0;
strComment.clear();
strStatusBar.clear();
strReserved.clear();
}
std::string CUnsignedAlert::ToString() const
{
std::string strSetCancel;
BOOST_FOREACH(int n, setCancel)
strSetCancel += strprintf("%d ", n);
std::string strSetSubVer;
BOOST_FOREACH(std::string str, setSubVer)
strSetSubVer += "\"" + str + "\" ";
return strprintf(
"CAlert(\n"
" nVersion = %d\n"
" nRelayUntil = %"PRI64d"\n"
" nExpiration = %"PRI64d"\n"
" nID = %d\n"
" nCancel = %d\n"
" setCancel = %s\n"
" nMinVer = %d\n"
" nMaxVer = %d\n"
" setSubVer = %s\n"
" nPriority = %d\n"
" strComment = \"%s\"\n"
" strStatusBar = \"%s\"\n"
")\n",
nVersion,
nRelayUntil,
nExpiration,
nID,
nCancel,
strSetCancel.c_str(),
nMinVer,
nMaxVer,
strSetSubVer.c_str(),
nPriority,
strComment.c_str(),
strStatusBar.c_str());
}
void CUnsignedAlert::print() const
{
printf("%s", ToString().c_str());
}
void CAlert::SetNull()
{
CUnsignedAlert::SetNull();
vchMsg.clear();
vchSig.clear();
}
bool CAlert::IsNull() const
{
return (nExpiration == 0);
}
uint256 CAlert::GetHash() const
{
return Hash(this->vchMsg.begin(), this->vchMsg.end());
}
bool CAlert::IsInEffect() const
{
return (GetAdjustedTime() < nExpiration);
}
bool CAlert::Cancels(const CAlert& alert) const
{
if (!IsInEffect())
return false; // this was a no-op before 31403
return (alert.nID <= nCancel || setCancel.count(alert.nID));
}
bool CAlert::AppliesTo(int nVersion, std::string strSubVerIn) const
{
// TODO: rework for client-version-embedded-in-strSubVer ?
return (IsInEffect() &&
nMinVer <= nVersion && nVersion <= nMaxVer &&
(setSubVer.empty() || setSubVer.count(strSubVerIn)));
}
bool CAlert::AppliesToMe() const
{
return AppliesTo(PROTOCOL_VERSION, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector<std::string>()));
}
bool CAlert::RelayTo(CNode* pnode) const
{
if (!IsInEffect())
return false;
// returns true if wasn't already contained in the set
if (pnode->setKnown.insert(GetHash()).second)
{
if (AppliesTo(pnode->nVersion, pnode->strSubVer) ||
AppliesToMe() ||
GetAdjustedTime() < nRelayUntil)
{
pnode->PushMessage("alert", *this);
return true;
}
}
return false;
}
bool CAlert::CheckSignature() const
{
CKey key;
if (!key.SetPubKey(ParseHex(fTestNet ? pszTestKey : pszMainKey)))
return error("CAlert::CheckSignature() : SetPubKey failed");
if (!key.Verify(Hash(vchMsg.begin(), vchMsg.end()), vchSig))
return error("CAlert::CheckSignature() : verify signature failed");
// Now unserialize the data
CDataStream sMsg(vchMsg, SER_NETWORK, PROTOCOL_VERSION);
sMsg >> *(CUnsignedAlert*)this;
return true;
}
CAlert CAlert::getAlertByHash(const uint256 &hash)
{
CAlert retval;
{
LOCK(cs_mapAlerts);
map<uint256, CAlert>::iterator mi = mapAlerts.find(hash);
if(mi != mapAlerts.end())
retval = mi->second;
}
return retval;
}
bool CAlert::ProcessAlert()
{
if (!CheckSignature())
return false;
if (!IsInEffect())
return false;
// alert.nID=max is reserved for if the alert key is
// compromised. It must have a pre-defined message,
// must never expire, must apply to all versions,
// and must cancel all previous
// alerts or it will be ignored (so an attacker can't
// send an "everything is OK, don't panic" version that
// cannot be overridden):
int maxInt = std::numeric_limits<int>::max();
if (nID == maxInt)
{
if (!(
nExpiration == maxInt &&
nCancel == (maxInt-1) &&
nMinVer == 0 &&
nMaxVer == maxInt &&
setSubVer.empty() &&
nPriority == maxInt &&
strStatusBar == "URGENT: Alert key compromised, upgrade required"
))
return false;
}
{
LOCK(cs_mapAlerts);
// Cancel previous alerts
for (map<uint256, CAlert>::iterator mi = mapAlerts.begin(); mi != mapAlerts.end();)
{
const CAlert& alert = (*mi).second;
if (Cancels(alert))
{
printf("cancelling alert %d\n", alert.nID);
uiInterface.NotifyAlertChanged((*mi).first, CT_DELETED);
mapAlerts.erase(mi++);
}
else if (!alert.IsInEffect())
{
printf("expiring alert %d\n", alert.nID);
uiInterface.NotifyAlertChanged((*mi).first, CT_DELETED);
mapAlerts.erase(mi++);
}
else
mi++;
}
// Check if this alert has been cancelled
BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)
{
const CAlert& alert = item.second;
if (alert.Cancels(*this))
{
printf("alert already cancelled by %d\n", alert.nID);
return false;
}
}
// Add to mapAlerts
mapAlerts.insert(make_pair(GetHash(), *this));
// Notify UI if it applies to me
if(AppliesToMe())
uiInterface.NotifyAlertChanged(GetHash(), CT_NEW);
}
printf("accepted alert %d, AppliesToMe()=%d\n", nID, AppliesToMe());
return true;
}
| [
"noreply@github.com"
] | noreply@github.com |
de7233180991ad49c7a0f954ed51579dee56d989 | 7dfbb019a76f27c0c178f44bf5d678a2bd1b0230 | /Engine.cpp | ac478b7659e2190b8b86d8f8c2424eafdc01b52b | [] | no_license | gofawer/magame | 4e1ede113240edf326e061a2a24a6d2141255c4a | cf28c68a7e795caf8bbf7389b443f65fd00dce88 | refs/heads/master | 2021-05-28T05:54:14.571821 | 2013-03-31T05:28:30 | 2013-03-31T05:28:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 41 | cpp | #include "StdAfx.h"
#include "Engine.h"
| [
"mmilewski@gmail.com"
] | mmilewski@gmail.com |
3ee2adf8381b3a7197d4571e15468de942d2cdb9 | 160075e9aada20399e16abfa61b281c0fa931e43 | /src/Engine/Core/Window.hpp | 85127197e180a7eca3ec72effe57d653928ba546 | [
"MIT"
] | permissive | Belfer/Galaxian1979-Remake | 2d33e4f709277fcf37a46ab963b459523cd2fe18 | a553b1fec104f7fb63ac8ae1d9ae1c367cce010d | refs/heads/master | 2021-08-06T09:20:24.509767 | 2017-11-04T18:06:24 | 2017-11-04T18:06:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,452 | hpp | #pragma once
#include <glad/glad.h>
#include "Input.hpp"
#include "NonCopyable.hpp"
#include "Types.hpp"
#include <GLFW/glfw3.h>
#include <string>
namespace NHTV {
struct WinConfig {
std::string title;
uint xpos = 0, ypos = 0;
uint width = 1, height = 1;
bool vsync = false;
};
struct Window : NonCopyable {
Window(const WinConfig &config);
~Window();
bool shouldClose();
void pollEvents();
void display();
void getWindowSize(int &width, int &height) const;
void getFramebufferSize(int &width, int &height) const;
void getWindowFrameSize(int &left, int &top, int &right, int &bottom) const;
void getWindowPos(int &xpos, int &ypos) const;
void setWindowPos(int xpos, int ypos);
void setWindowTitle(const char *title);
void showWindow();
void hideWindow();
// inline void focusWindow() { glfwFocusWindow(m_pWindow); }
// int focused = glfwGetWindowAttrib(window, GLFW_FOCUSED);
// int visible = glfwGetWindowAttrib(window, GLFW_VISIBLE);
int getKey(int key) const;
int getMouseBtn(int btn) const;
void getMousePos(double &xpos, double &ypos) const;
int isJoystickPresent(int joy) const;
const float *getJoystickAxes(int joy, int &count) const;
const uchar *getJoystickBtns(int joy, int &count) const;
const char *getJoystickName(int joy) const;
GLFWwindow *getPtr() const;
private:
GLFWwindow *m_pWindow;
};
inline bool Window::shouldClose() { return glfwWindowShouldClose(m_pWindow); }
inline void Window::pollEvents() { glfwPollEvents(); }
inline void Window::display() { glfwSwapBuffers(m_pWindow); }
inline void Window::getWindowSize(int &width, int &height) const {
glfwGetWindowSize(m_pWindow, &width, &height);
}
inline void Window::getFramebufferSize(int &width, int &height) const {
glfwGetFramebufferSize(m_pWindow, &width, &height);
}
inline void Window::getWindowFrameSize(int &left, int &top, int &right,
int &bottom) const {
glfwGetWindowFrameSize(m_pWindow, &left, &top, &right, &bottom);
}
inline void Window::getWindowPos(int &xpos, int &ypos) const {
glfwGetWindowPos(m_pWindow, &xpos, &ypos);
}
inline void Window::setWindowPos(int xpos, int ypos) {
glfwSetWindowPos(m_pWindow, xpos, ypos);
}
inline void Window::setWindowTitle(const char *title) {
glfwSetWindowTitle(m_pWindow, title);
}
inline void Window::showWindow() { glfwShowWindow(m_pWindow); }
inline void Window::hideWindow() { glfwHideWindow(m_pWindow); }
// inline void focusWindow() { glfwFocusWindow(m_pWindow); }
// int focused = glfwGetWindowAttrib(window, GLFW_FOCUSED);
// int visible = glfwGetWindowAttrib(window, GLFW_VISIBLE);
inline int Window::getKey(int key) const { return glfwGetKey(m_pWindow, key); }
inline int Window::getMouseBtn(int btn) const {
return glfwGetMouseButton(m_pWindow, btn);
}
inline void Window::getMousePos(double &xpos, double &ypos) const {
glfwGetCursorPos(m_pWindow, &xpos, &ypos);
}
inline int Window::isJoystickPresent(int joy) const {
return glfwJoystickPresent(joy);
}
inline const float *Window::getJoystickAxes(int joy, int &count) const {
return glfwGetJoystickAxes(joy, &count);
}
inline const uchar *Window::getJoystickBtns(int joy, int &count) const {
return glfwGetJoystickButtons(joy, &count);
}
inline const char *Window::getJoystickName(int joy) const {
return glfwGetJoystickName(joy);
}
inline GLFWwindow *Window::getPtr() const { return m_pWindow; }
}
| [
"mike@alonica.net"
] | mike@alonica.net |
70efddb977d7f89f00ba3e292099e5cff22cb17d | f75ff4a2c4ef88334c4a575b6c593a996afc019a | /10208_전문가를 위한 C++(개정4판)/c14_code/02_ExceptionsAndPolymorphism/04_CatchingPolymorphicallyIncorrect.cpp | c261f7fed33dca1943360a958500f416f4b209f6 | [] | no_license | tasddc1226/CPP_For_Prof | b4e11ce2b7dbf70f72d9a18d67a692e5219f1793 | 8bd59ab7d9611c214467817bbc165ff03b7b329d | refs/heads/master | 2023-09-03T16:51:41.527312 | 2021-10-31T07:56:20 | 2021-10-31T07:56:20 | 393,961,609 | 1 | 1 | null | null | null | null | UHC | C++ | false | false | 1,346 | cpp | #include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <string_view>
#include <stdexcept>
using namespace std;
vector<int> readIntegerFile(string_view fileName)
{
ifstream inputStream(fileName.data());
if (inputStream.fail()) {
// 파일 열기 실패: 익셉션을 던진다.
const string error = "Unable to open file "s + fileName.data();
throw invalid_argument(error);
}
// 파일에 담긴 정숫값을 하나씩 읽어서 벡터에 추가한다.
vector<int> integers;
int temp;
while (inputStream >> temp) {
integers.push_back(temp);
}
if (!inputStream.eof()) {
// 파일 끝(EOF)에 도달하지 않았다.
// 다시 말해 파일을 읽는 도중에 에러가 발생했다.
// 따라서 익셉션을 던진다.
const string error = "Unable to read file "s + fileName.data();
throw runtime_error(error);
}
return integers;
}
int main()
{
const string fileName = "IntegerFile.txt";
vector<int> myInts;
try {
myInts = readIntegerFile(fileName);
} catch (const exception& e) { // 버그: 베이스 클래스를 먼저 잡는다.
cerr << e.what() << endl;
return 1;
} catch (const invalid_argument& /* e */) {
// 파일 이름이 잘못된 경우를 처리한다.
}
for (const auto& element : myInts) {
cout << element << " ";
}
cout << endl;
return 0;
}
| [
"tasddc@naver.com"
] | tasddc@naver.com |
ac945661accec68059ff5da268f5fce967e9ce2a | e6b4a9fb699feb39ae4c80ae5c59c539440ccb43 | /Junk/C++/updater.cpp | b9d626e54c65a0f2f0d66815c0f0eefcdb376256 | [] | no_license | Hedede/various-things | 2451154473892546c94633289b66b9d6cd341f9c | ae813b21d70a1dab72a091035332c898d89e5eda | refs/heads/master | 2023-08-09T17:46:52.906049 | 2023-07-30T09:55:41 | 2023-07-30T09:55:41 | 63,462,461 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 537 | cpp |
class Updater {
public:
std::vector<NodeUpdate> data;
void set_status(bool status) {
m.lock();
updated = status;
m.unlock()
}
bool has_updates() {
return updated;
}
private:
bool updated;
std::mutex m;
}
int main() {
Updater* u = new Updater();
// ...
while (run) {
game->update();
if (!u->has_updates()) {
copy(game->getUpdate(), u->data);
u->set_status(true);
}
}
}
int graphics(Updater* u) {
while (run) {
if(med->has_updates()) {
copy(med->data, tmp);
u->set_status(false);
}
}
}
| [
"hededrk@gmail.com"
] | hededrk@gmail.com |
f9cc2e328ed001fd6c821b6c05a08ebd42849dda | 18d6674e9387774824cfb7239d15694798fd120e | /src/test/bip32_tests.cpp | f98467cd3f0fb271ed2e2f2464a38d6a75f0dbb2 | [
"MIT"
] | permissive | spiraltech/Silk-Core | 5b7115153f20a1e2bb81bdac5ad4e1e6eead6e0a | f233cd1113437ef22ec93b125b706e6f46b22028 | refs/heads/master | 2021-01-11T05:50:50.654841 | 2016-10-23T05:32:15 | 2016-10-23T05:32:15 | 71,719,261 | 0 | 0 | null | 2016-10-23T17:48:17 | 2016-10-23T17:48:15 | null | UTF-8 | C++ | false | false | 5,529 | cpp | // Copyright (c) 2009-2016 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin Developers
// Copyright (c) 2015-2016 Silk Network Developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/test/unit_test.hpp>
#include "base58.h"
#include "key.h"
#include "uint256.h"
#include "util.h"
#include <string>
#include <vector>
struct TestDerivation {
std::string pub;
std::string prv;
unsigned int nChild;
};
struct TestVector {
std::string strHexMaster;
std::vector<TestDerivation> vDerive;
TestVector(std::string strHexMasterIn) : strHexMaster(strHexMasterIn) {}
TestVector& operator()(std::string pub, std::string prv, unsigned int nChild) {
vDerive.push_back(TestDerivation());
TestDerivation &der = vDerive.back();
der.pub = pub;
der.prv = prv;
der.nChild = nChild;
return *this;
}
};
TestVector test1 =
TestVector("000102030405060708090a0b0c0d0e0f")
("xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8",
"xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi",
0x80000000)
("xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQRKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw",
"xprv9uHRZZhk6KAJC1avXpDAp4MDc3sQKNxDiPvvkX8Br5ngLNv1TxvUxt4cV1rGL5hj6KCesnDYUhd7oWgT11eZG7XnxHrnYeSvkzY7d2bhkJ7",
1)
("xpub6ASuArnXKPbfEwhqN6e3mwBcDTgzisQN1wXN9BJcM47sSikHjJf3UFHKkNAWbWMiGj7Wf5uMash7SyYq527Hqck2AxYysAA7xmALppuCkwQ",
"xprv9wTYmMFdV23N2TdNG573QoEsfRrWKQgWeibmLntzniatZvR9BmLnvSxqu53Kw1UmYPxLgboyZQaXwTCg8MSY3H2EU4pWcQDnRnrVA1xe8fs",
0x80000002)
("xpub6D4BDPcP2GT577Vvch3R8wDkScZWzQzMMUm3PWbmWvVJrZwQY4VUNgqFJPMM3No2dFDFGTsxxpG5uJh7n7epu4trkrX7x7DogT5Uv6fcLW5",
"xprv9z4pot5VBttmtdRTWfWQmoH1taj2axGVzFqSb8C9xaxKymcFzXBDptWmT7FwuEzG3ryjH4ktypQSAewRiNMjANTtpgP4mLTj34bhnZX7UiM",
2)
("xpub6FHa3pjLCk84BayeJxFW2SP4XRrFd1JYnxeLeU8EqN3vDfZmbqBqaGJAyiLjTAwm6ZLRQUMv1ZACTj37sR62cfN7fe5JnJ7dh8zL4fiyLHV",
"xprvA2JDeKCSNNZky6uBCviVfJSKyQ1mDYahRjijr5idH2WwLsEd4Hsb2Tyh8RfQMuPh7f7RtyzTtdrbdqqsunu5Mm3wDvUAKRHSC34sJ7in334",
1000000000)
("xpub6H1LXWLaKsWFhvm6RVpEL9P4KfRZSW7abD2ttkWP3SSQvnyA8FSVqNTEcYFgJS2UaFcxupHiYkro49S8yGasTvXEYBVPamhGW6cFJodrTHy",
"xprvA41z7zogVVwxVSgdKUHDy1SKmdb533PjDz7J6N6mV6uS3ze1ai8FHa8kmHScGpWmj4WggLyQjgPie1rFSruoUihUZREPSL39UNdE3BBDu76",
0);
TestVector test2 =
TestVector("fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542")
("xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB",
"xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U",
0)
("xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH",
"xprv9vHkqa6EV4sPZHYqZznhT2NPtPCjKuDKGY38FBWLvgaDx45zo9WQRUT3dKYnjwih2yJD9mkrocEZXo1ex8G81dwSM1fwqWpWkeS3v86pgKt",
0xFFFFFFFF)
("xpub6ASAVgeehLbnwdqV6UKMHVzgqAG8Gr6riv3Fxxpj8ksbH9ebxaEyBLZ85ySDhKiLDBrQSARLq1uNRts8RuJiHjaDMBU4Zn9h8LZNnBC5y4a",
"xprv9wSp6B7kry3Vj9m1zSnLvN3xH8RdsPP1Mh7fAaR7aRLcQMKTR2vidYEeEg2mUCTAwCd6vnxVrcjfy2kRgVsFawNzmjuHc2YmYRmagcEPdU9",
1)
("xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon",
"xprv9zFnWC6h2cLgpmSA46vutJzBcfJ8yaJGg8cX1e5StJh45BBciYTRXSd25UEPVuesF9yog62tGAQtHjXajPPdbRCHuWS6T8XA2ECKADdw4Ef",
0xFFFFFFFE)
("xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL",
"xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc",
2)
("xpub6FnCn6nSzZAw5Tw7cgR9bi15UV96gLZhjDstkXXxvCLsUXBGXPdSnLFbdpq8p9HmGsApME5hQTZ3emM2rnY5agb9rXpVGyy3bdW6EEgAtqt",
"xprvA2nrNbFZABcdryreWet9Ea4LvTJcGsqrMzxHx98MMrotbir7yrKCEXw7nadnHM8Dq38EGfSh6dqA9QWTyefMLEcBYJUuekgW4BYPJcr9E7j",
0);
void RunTest(const TestVector &test) {
std::vector<unsigned char> seed = ParseHex(test.strHexMaster);
CExtKey key;
CExtPubKey pubkey;
key.SetMaster(&seed[0], seed.size());
pubkey = key.Neuter();
BOOST_FOREACH(const TestDerivation &derive, test.vDerive) {
unsigned char data[74];
key.Encode(data);
pubkey.Encode(data);
// Test private key
CSilkExtKey b58key; b58key.SetKey(key);
BOOST_CHECK(b58key.ToString() == derive.prv);
// Test public key
CSilkExtPubKey b58pubkey; b58pubkey.SetKey(pubkey);
BOOST_CHECK(b58pubkey.ToString() == derive.pub);
// Derive new keys
CExtKey keyNew;
BOOST_CHECK(key.Derive(keyNew, derive.nChild));
CExtPubKey pubkeyNew = keyNew.Neuter();
if (!(derive.nChild & 0x80000000)) {
// Compare with public derivation
CExtPubKey pubkeyNew2;
BOOST_CHECK(pubkey.Derive(pubkeyNew2, derive.nChild));
BOOST_CHECK(pubkeyNew == pubkeyNew2);
}
key = keyNew;
pubkey = pubkeyNew;
}
}
BOOST_AUTO_TEST_SUITE(bip32_tests)
BOOST_AUTO_TEST_CASE(bip32_test1) {
RunTest(test1);
}
BOOST_AUTO_TEST_CASE(bip32_test2) {
RunTest(test2);
}
BOOST_AUTO_TEST_SUITE_END()
| [
"amirabrams@mail.com"
] | amirabrams@mail.com |
a66c5f359eae3176b33b951942519ffc42d881fc | 9b7035e0e0fcf140e9b83e6145709d526a750e9f | /searchwindow.cpp | 735939146c123b00c5f8d54c160ca2989ff2c7bc | [] | no_license | NastyaArt/PPvIS_lab2 | 55fb8a3fdf813d30f7cd33675f1f5c13554012e7 | 1be7f2aa41012de8ba873eb4eb79506bd439d109 | refs/heads/master | 2021-01-22T11:04:38.936363 | 2017-05-30T14:18:33 | 2017-05-30T14:18:33 | 92,669,603 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,615 | cpp | #include "searchwindow.h"
SearchWindow::SearchWindow()
{
setModal(true);
box1 = new QGroupBox("Поиск по фамилии и номеру группы студента");
butSrch1 = new QPushButton("Найти запись(и)");
butClr1 = new QPushButton("Очистить поля ввода");
lbl11 = new QLabel("Фамилия студента");
lbl12 = new QLabel("Номер группы");
line11 = new QLineEdit;
line12 = new QLineEdit;
QVBoxLayout *lay11 = new QVBoxLayout;
lay11->addWidget(lbl11);
lay11->addWidget(lbl12);
QVBoxLayout *lay12 = new QVBoxLayout;
lay12->addWidget(line11);
lay12->addWidget(line12);
QVBoxLayout *lay13 = new QVBoxLayout;
lay13->addWidget(butSrch1);
lay13->addWidget(butClr1);
QHBoxLayout *lay14 = new QHBoxLayout;
lay14->addLayout(lay11);
lay14->addLayout(lay12);
lay14->addLayout(lay13);
box1->setLayout(lay14);
box2 = new QGroupBox("Поиск по фамилии и виду общественной работы");
butSrch2 = new QPushButton("Найти запись(и)");
butClr2 = new QPushButton("Очистить поля ввода");
lbl21 = new QLabel("Фамилия студента");
lbl22 = new QLabel("Вид общественной работы");
line21 = new QLineEdit;
line22 = new QLineEdit;
QVBoxLayout *lay21 = new QVBoxLayout;
lay21->addWidget(lbl21);
lay21->addWidget(lbl22);
QVBoxLayout *lay22 = new QVBoxLayout;
lay22->addWidget(line21);
lay22->addWidget(line22);
QVBoxLayout *lay23 = new QVBoxLayout;
lay23->addWidget(butSrch2);
lay23->addWidget(butClr2);
QHBoxLayout *lay24 = new QHBoxLayout;
lay24->addLayout(lay21);
lay24->addLayout(lay22);
lay24->addLayout(lay23);
box2->setLayout(lay24);
box3 = new QGroupBox("Поиск по фамилии и количеству часов вида обественной работы");
butSrch3 = new QPushButton("Найти запись(и)");
butClr3 = new QPushButton("Очистить поля ввода");
lbl31 = new QLabel("Фамилия студента");
lbl32 = new QLabel("Количество часов: от ");
lbl33 = new QLabel("до");
lbl34 = new QLabel("Вид общественной работы");
line31 = new QLineEdit;
line32 = new QLineEdit;
line33 = new QLineEdit;
line34 = new QLineEdit;
QHBoxLayout *lay31 = new QHBoxLayout;
lay31->addWidget(lbl32);
lay31->addWidget(line32);
lay31->addWidget(lbl33);
lay31->addWidget(line33);
lay31->addWidget(butClr3);
QHBoxLayout *lay32 = new QHBoxLayout;
lay32->addWidget(lbl31);
lay32->addWidget(line31);
lay32->addWidget(butSrch3);
QHBoxLayout *lay33 = new QHBoxLayout;
lay33->addWidget(lbl34);
lay33->addWidget(line34);
QVBoxLayout *lay34 = new QVBoxLayout;
lay34->addLayout(lay32);
lay34->addLayout(lay31);
lay34->addLayout(lay33);
box3->setLayout(lay34);
tableData = new TableDatadase;
QVBoxLayout *layall = new QVBoxLayout;
layall->addWidget(box1);
layall->addWidget(box2);
layall->addWidget(box3);
layall->addWidget(tableData);
setLayout(layall);
setWindowTitle("Поиск записи");
connect(butSrch1, SIGNAL(clicked(bool)), this, SLOT(PushButtonSrch1()));
connect(butClr1, SIGNAL(clicked(bool)), this, SLOT(PushButtonClr1()));
connect(butSrch2, SIGNAL(clicked(bool)), this, SLOT(PushButtonSrch2()));
connect(butClr2, SIGNAL(clicked(bool)), this, SLOT(PushButtonClr2()));
connect(butSrch3, SIGNAL(clicked(bool)), this, SLOT(PushButtonSrch3()));
connect(butClr3, SIGNAL(clicked(bool)), this, SLOT(PushButtonClr3()));
}
void SearchWindow::PushButtonSrch1()
{
bool ok;
if (line11->text()==NULL)
checkFull = false;
if (line12->text()==NULL)
checkFull = false;
checkFIO = fio.exactMatch (line11->text());
line12->text().toInt(&checkNum, 10);
if (checkFull==false)
(new QErrorMessage(this))->showMessage("Введите все данные!");
else
if (checkFIO==false)
(new QErrorMessage(this))->showMessage("В поле <b>Фамилия студента</b> введено некорректное значение!");
else
if (checkNum==false)
(new QErrorMessage(this))->showMessage("В поле <b>Номер группы</b> должно быть введено целое число!");
else {
emit SendDataSrch1(line11->text(), line12->text().toInt(&ok, 10));
}
checkFull = checkNum = checkFIO = true;
}
void SearchWindow::PushButtonSrch2()
{
if (line21->text()==NULL)
checkFull = false;
if (line22->text()==NULL)
checkFull = false;
checkFIO = fio.exactMatch (line21->text());
if (checkFull==false)
(new QErrorMessage(this))->showMessage("Введите все данные!");
else
if (checkFIO==false)
(new QErrorMessage(this))->showMessage("В поле <b>Фамилия студента</b> введено некорректное значение!");
else {
emit SendDataSrch2(line21->text(), line22->text());
}
checkFull = checkFIO = true;
}
void SearchWindow::PushButtonSrch3()
{
bool ok=false;
checkNum = false;
if (line31->text()==NULL)
checkFull = false;
else
if (line32->text()==NULL)
checkFull = false;
else
if (line33->text()==NULL)
checkFull = false;
else
if (line34->text()==NULL)
checkFull = false;
checkFIO = fio.exactMatch (line31->text());
line32->text().toInt(&ok, 10);
if (ok == true){
line32->text().toInt(&ok, 10);
if (ok == true){
checkNum = true;
}
}
if (checkFull==false)
(new QErrorMessage(this))->showMessage("Введите все данные!");
else
if (checkFIO==false)
(new QErrorMessage(this))->showMessage("В поле <b>Фамилия студента</b> введено некорректное значение!");
else
if (checkNum==false)
(new QErrorMessage(this))->showMessage("В полях, задающих <b>Количество часов</b> должны быть введены целые числа!");
else {
emit SendDataSrch3(line31->text(), line32->text().toInt(&ok, 10), line33->text().toInt(&ok, 10), line34->text());
}
checkFull = checkNum = checkFIO = true;
}
void SearchWindow::PushButtonClr1()
{
line11->clear();
line12->clear();
checkFull = checkNum = checkFIO = true;
}
void SearchWindow::PushButtonClr2()
{
line21->clear();
line22->clear();
checkFull = checkFIO = true;
}
void SearchWindow::PushButtonClr3()
{
line31->clear();
line32->clear();
line33->clear();
line34->clear();
checkFull = checkNum = checkFIO = true;
}
void SearchWindow::SrchState(int colStd)
{
QMessageBox::information(this, "Поиск записей", "Найдено " + QString::number(colStd) + " записей(и)", QMessageBox::Ok);
}
void SearchWindow::UpdateDataSrch(QList<Student> database)
{
search_result = database;
tableData->UpdateData(search_result);
}
void SearchWindow::SetWorks()
{
QCompleter *completer = new QCompleter(actual_works);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion);
line22->setCompleter(completer);
line34->setCompleter(completer);
}
| [
"artemchuk.nastya@gmail.com"
] | artemchuk.nastya@gmail.com |
63e3ca68137a12f7bb0993759a5391f24f2d9789 | bdc02a328a21b053c4dc23392a1588f9af205b24 | /HNNK/HNNK_UI/Update191106/temp/moc/moc_qcustomplot.cpp | b35f2a34df0af78d44e209ee495e0e44c1dd8c32 | [] | no_license | Stefan-China/Keil_HomeControl | 64037219b0e7f046e550b4e5c6240818ddfdd402 | f4294af9f5df37e3f1a882dc487fe32040327a84 | refs/heads/master | 2023-06-19T05:36:30.771461 | 2021-07-19T00:23:40 | 2021-07-19T00:23:40 | 377,675,333 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 277,658 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'qcustomplot.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.9.8)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../../../../../../oldproject/hnnk_standard/qcustomplot.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#include <QtCore/QSharedPointer>
#include <QtCore/QList>
#include <QtCore/QVector>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'qcustomplot.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.9.8. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_QCP_t {
QByteArrayData data[62];
char stringdata0[713];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCP_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCP_t qt_meta_stringdata_QCP = {
{
QT_MOC_LITERAL(0, 0, 3), // "QCP"
QT_MOC_LITERAL(1, 4, 14), // "ResolutionUnit"
QT_MOC_LITERAL(2, 19, 14), // "ruDotsPerMeter"
QT_MOC_LITERAL(3, 34, 19), // "ruDotsPerCentimeter"
QT_MOC_LITERAL(4, 54, 13), // "ruDotsPerInch"
QT_MOC_LITERAL(5, 68, 9), // "ExportPen"
QT_MOC_LITERAL(6, 78, 12), // "epNoCosmetic"
QT_MOC_LITERAL(7, 91, 15), // "epAllowCosmetic"
QT_MOC_LITERAL(8, 107, 10), // "SignDomain"
QT_MOC_LITERAL(9, 118, 10), // "sdNegative"
QT_MOC_LITERAL(10, 129, 6), // "sdBoth"
QT_MOC_LITERAL(11, 136, 10), // "sdPositive"
QT_MOC_LITERAL(12, 147, 10), // "MarginSide"
QT_MOC_LITERAL(13, 158, 6), // "msLeft"
QT_MOC_LITERAL(14, 165, 7), // "msRight"
QT_MOC_LITERAL(15, 173, 5), // "msTop"
QT_MOC_LITERAL(16, 179, 8), // "msBottom"
QT_MOC_LITERAL(17, 188, 5), // "msAll"
QT_MOC_LITERAL(18, 194, 6), // "msNone"
QT_MOC_LITERAL(19, 201, 11), // "MarginSides"
QT_MOC_LITERAL(20, 213, 18), // "AntialiasedElement"
QT_MOC_LITERAL(21, 232, 6), // "aeAxes"
QT_MOC_LITERAL(22, 239, 6), // "aeGrid"
QT_MOC_LITERAL(23, 246, 9), // "aeSubGrid"
QT_MOC_LITERAL(24, 256, 8), // "aeLegend"
QT_MOC_LITERAL(25, 265, 13), // "aeLegendItems"
QT_MOC_LITERAL(26, 279, 12), // "aePlottables"
QT_MOC_LITERAL(27, 292, 7), // "aeItems"
QT_MOC_LITERAL(28, 300, 10), // "aeScatters"
QT_MOC_LITERAL(29, 311, 7), // "aeFills"
QT_MOC_LITERAL(30, 319, 10), // "aeZeroLine"
QT_MOC_LITERAL(31, 330, 7), // "aeOther"
QT_MOC_LITERAL(32, 338, 5), // "aeAll"
QT_MOC_LITERAL(33, 344, 6), // "aeNone"
QT_MOC_LITERAL(34, 351, 19), // "AntialiasedElements"
QT_MOC_LITERAL(35, 371, 12), // "PlottingHint"
QT_MOC_LITERAL(36, 384, 6), // "phNone"
QT_MOC_LITERAL(37, 391, 15), // "phFastPolylines"
QT_MOC_LITERAL(38, 407, 18), // "phImmediateRefresh"
QT_MOC_LITERAL(39, 426, 13), // "phCacheLabels"
QT_MOC_LITERAL(40, 440, 13), // "PlottingHints"
QT_MOC_LITERAL(41, 454, 11), // "Interaction"
QT_MOC_LITERAL(42, 466, 10), // "iRangeDrag"
QT_MOC_LITERAL(43, 477, 10), // "iRangeZoom"
QT_MOC_LITERAL(44, 488, 12), // "iMultiSelect"
QT_MOC_LITERAL(45, 501, 17), // "iSelectPlottables"
QT_MOC_LITERAL(46, 519, 11), // "iSelectAxes"
QT_MOC_LITERAL(47, 531, 13), // "iSelectLegend"
QT_MOC_LITERAL(48, 545, 12), // "iSelectItems"
QT_MOC_LITERAL(49, 558, 12), // "iSelectOther"
QT_MOC_LITERAL(50, 571, 12), // "Interactions"
QT_MOC_LITERAL(51, 584, 17), // "SelectionRectMode"
QT_MOC_LITERAL(52, 602, 7), // "srmNone"
QT_MOC_LITERAL(53, 610, 7), // "srmZoom"
QT_MOC_LITERAL(54, 618, 9), // "srmSelect"
QT_MOC_LITERAL(55, 628, 9), // "srmCustom"
QT_MOC_LITERAL(56, 638, 13), // "SelectionType"
QT_MOC_LITERAL(57, 652, 6), // "stNone"
QT_MOC_LITERAL(58, 659, 7), // "stWhole"
QT_MOC_LITERAL(59, 667, 12), // "stSingleData"
QT_MOC_LITERAL(60, 680, 11), // "stDataRange"
QT_MOC_LITERAL(61, 692, 20) // "stMultipleDataRanges"
},
"QCP\0ResolutionUnit\0ruDotsPerMeter\0"
"ruDotsPerCentimeter\0ruDotsPerInch\0"
"ExportPen\0epNoCosmetic\0epAllowCosmetic\0"
"SignDomain\0sdNegative\0sdBoth\0sdPositive\0"
"MarginSide\0msLeft\0msRight\0msTop\0"
"msBottom\0msAll\0msNone\0MarginSides\0"
"AntialiasedElement\0aeAxes\0aeGrid\0"
"aeSubGrid\0aeLegend\0aeLegendItems\0"
"aePlottables\0aeItems\0aeScatters\0aeFills\0"
"aeZeroLine\0aeOther\0aeAll\0aeNone\0"
"AntialiasedElements\0PlottingHint\0"
"phNone\0phFastPolylines\0phImmediateRefresh\0"
"phCacheLabels\0PlottingHints\0Interaction\0"
"iRangeDrag\0iRangeZoom\0iMultiSelect\0"
"iSelectPlottables\0iSelectAxes\0"
"iSelectLegend\0iSelectItems\0iSelectOther\0"
"Interactions\0SelectionRectMode\0srmNone\0"
"srmZoom\0srmSelect\0srmCustom\0SelectionType\0"
"stNone\0stWhole\0stSingleData\0stDataRange\0"
"stMultipleDataRanges"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCP[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
13, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 3, 66,
5, 0x0, 2, 72,
8, 0x0, 3, 76,
12, 0x0, 6, 82,
19, 0x1, 6, 94,
20, 0x0, 13, 106,
34, 0x1, 13, 132,
35, 0x0, 4, 158,
40, 0x1, 4, 166,
41, 0x0, 8, 174,
50, 0x1, 8, 190,
51, 0x0, 4, 206,
56, 0x0, 5, 214,
// enum data: key, value
2, uint(QCP::ruDotsPerMeter),
3, uint(QCP::ruDotsPerCentimeter),
4, uint(QCP::ruDotsPerInch),
6, uint(QCP::epNoCosmetic),
7, uint(QCP::epAllowCosmetic),
9, uint(QCP::sdNegative),
10, uint(QCP::sdBoth),
11, uint(QCP::sdPositive),
13, uint(QCP::msLeft),
14, uint(QCP::msRight),
15, uint(QCP::msTop),
16, uint(QCP::msBottom),
17, uint(QCP::msAll),
18, uint(QCP::msNone),
13, uint(QCP::msLeft),
14, uint(QCP::msRight),
15, uint(QCP::msTop),
16, uint(QCP::msBottom),
17, uint(QCP::msAll),
18, uint(QCP::msNone),
21, uint(QCP::aeAxes),
22, uint(QCP::aeGrid),
23, uint(QCP::aeSubGrid),
24, uint(QCP::aeLegend),
25, uint(QCP::aeLegendItems),
26, uint(QCP::aePlottables),
27, uint(QCP::aeItems),
28, uint(QCP::aeScatters),
29, uint(QCP::aeFills),
30, uint(QCP::aeZeroLine),
31, uint(QCP::aeOther),
32, uint(QCP::aeAll),
33, uint(QCP::aeNone),
21, uint(QCP::aeAxes),
22, uint(QCP::aeGrid),
23, uint(QCP::aeSubGrid),
24, uint(QCP::aeLegend),
25, uint(QCP::aeLegendItems),
26, uint(QCP::aePlottables),
27, uint(QCP::aeItems),
28, uint(QCP::aeScatters),
29, uint(QCP::aeFills),
30, uint(QCP::aeZeroLine),
31, uint(QCP::aeOther),
32, uint(QCP::aeAll),
33, uint(QCP::aeNone),
36, uint(QCP::phNone),
37, uint(QCP::phFastPolylines),
38, uint(QCP::phImmediateRefresh),
39, uint(QCP::phCacheLabels),
36, uint(QCP::phNone),
37, uint(QCP::phFastPolylines),
38, uint(QCP::phImmediateRefresh),
39, uint(QCP::phCacheLabels),
42, uint(QCP::iRangeDrag),
43, uint(QCP::iRangeZoom),
44, uint(QCP::iMultiSelect),
45, uint(QCP::iSelectPlottables),
46, uint(QCP::iSelectAxes),
47, uint(QCP::iSelectLegend),
48, uint(QCP::iSelectItems),
49, uint(QCP::iSelectOther),
42, uint(QCP::iRangeDrag),
43, uint(QCP::iRangeZoom),
44, uint(QCP::iMultiSelect),
45, uint(QCP::iSelectPlottables),
46, uint(QCP::iSelectAxes),
47, uint(QCP::iSelectLegend),
48, uint(QCP::iSelectItems),
49, uint(QCP::iSelectOther),
52, uint(QCP::srmNone),
53, uint(QCP::srmZoom),
54, uint(QCP::srmSelect),
55, uint(QCP::srmCustom),
57, uint(QCP::stNone),
58, uint(QCP::stWhole),
59, uint(QCP::stSingleData),
60, uint(QCP::stDataRange),
61, uint(QCP::stMultipleDataRanges),
0 // eod
};
const QMetaObject QCP::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCP.data,
qt_meta_data_QCP, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPPainter_t {
QByteArrayData data[7];
char stringdata0[85];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPPainter_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPPainter_t qt_meta_stringdata_QCPPainter = {
{
QT_MOC_LITERAL(0, 0, 10), // "QCPPainter"
QT_MOC_LITERAL(1, 11, 11), // "PainterMode"
QT_MOC_LITERAL(2, 23, 9), // "pmDefault"
QT_MOC_LITERAL(3, 33, 12), // "pmVectorized"
QT_MOC_LITERAL(4, 46, 11), // "pmNoCaching"
QT_MOC_LITERAL(5, 58, 13), // "pmNonCosmetic"
QT_MOC_LITERAL(6, 72, 12) // "PainterModes"
},
"QCPPainter\0PainterMode\0pmDefault\0"
"pmVectorized\0pmNoCaching\0pmNonCosmetic\0"
"PainterModes"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPPainter[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
2, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 4, 22,
6, 0x1, 4, 30,
// enum data: key, value
2, uint(QCPPainter::pmDefault),
3, uint(QCPPainter::pmVectorized),
4, uint(QCPPainter::pmNoCaching),
5, uint(QCPPainter::pmNonCosmetic),
2, uint(QCPPainter::pmDefault),
3, uint(QCPPainter::pmVectorized),
4, uint(QCPPainter::pmNoCaching),
5, uint(QCPPainter::pmNonCosmetic),
0 // eod
};
const QMetaObject QCPPainter::staticMetaObject = {
{ &QPainter::staticMetaObject, qt_meta_stringdata_QCPPainter.data,
qt_meta_data_QCPPainter, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPLayer_t {
QByteArrayData data[12];
char stringdata0[118];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayer_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayer_t qt_meta_stringdata_QCPLayer = {
{
QT_MOC_LITERAL(0, 0, 8), // "QCPLayer"
QT_MOC_LITERAL(1, 9, 10), // "parentPlot"
QT_MOC_LITERAL(2, 20, 12), // "QCustomPlot*"
QT_MOC_LITERAL(3, 33, 4), // "name"
QT_MOC_LITERAL(4, 38, 5), // "index"
QT_MOC_LITERAL(5, 44, 8), // "children"
QT_MOC_LITERAL(6, 53, 20), // "QList<QCPLayerable*>"
QT_MOC_LITERAL(7, 74, 7), // "visible"
QT_MOC_LITERAL(8, 82, 4), // "mode"
QT_MOC_LITERAL(9, 87, 9), // "LayerMode"
QT_MOC_LITERAL(10, 97, 9), // "lmLogical"
QT_MOC_LITERAL(11, 107, 10) // "lmBuffered"
},
"QCPLayer\0parentPlot\0QCustomPlot*\0name\0"
"index\0children\0QList<QCPLayerable*>\0"
"visible\0mode\0LayerMode\0lmLogical\0"
"lmBuffered"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayer[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
6, 14, // properties
1, 32, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x00095009,
3, QMetaType::QString, 0x00095001,
4, QMetaType::Int, 0x00095001,
5, 0x80000000 | 6, 0x00095009,
7, QMetaType::Bool, 0x00095103,
8, 0x80000000 | 9, 0x0009510b,
// enums: name, flags, count, data
9, 0x0, 2, 36,
// enum data: key, value
10, uint(QCPLayer::lmLogical),
11, uint(QCPLayer::lmBuffered),
0 // eod
};
void QCPLayer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCustomPlot* >(); break;
case 3:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QList<QCPLayerable*> >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLayer *_t = static_cast<QCPLayer *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCustomPlot**>(_v) = _t->parentPlot(); break;
case 1: *reinterpret_cast< QString*>(_v) = _t->name(); break;
case 2: *reinterpret_cast< int*>(_v) = _t->index(); break;
case 3: *reinterpret_cast< QList<QCPLayerable*>*>(_v) = _t->children(); break;
case 4: *reinterpret_cast< bool*>(_v) = _t->visible(); break;
case 5: *reinterpret_cast< LayerMode*>(_v) = _t->mode(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLayer *_t = static_cast<QCPLayer *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 4: _t->setVisible(*reinterpret_cast< bool*>(_v)); break;
case 5: _t->setMode(*reinterpret_cast< LayerMode*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
const QMetaObject QCPLayer::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QCPLayer.data,
qt_meta_data_QCPLayer, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayer::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayer::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayer.stringdata0))
return static_cast<void*>(this);
return QObject::qt_metacast(_clname);
}
int QCPLayer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 6;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPLayerable_t {
QByteArrayData data[13];
char stringdata0[135];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayerable_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayerable_t qt_meta_stringdata_QCPLayerable = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPLayerable"
QT_MOC_LITERAL(1, 13, 12), // "layerChanged"
QT_MOC_LITERAL(2, 26, 0), // ""
QT_MOC_LITERAL(3, 27, 9), // "QCPLayer*"
QT_MOC_LITERAL(4, 37, 8), // "newLayer"
QT_MOC_LITERAL(5, 46, 8), // "setLayer"
QT_MOC_LITERAL(6, 55, 5), // "layer"
QT_MOC_LITERAL(7, 61, 7), // "visible"
QT_MOC_LITERAL(8, 69, 10), // "parentPlot"
QT_MOC_LITERAL(9, 80, 12), // "QCustomPlot*"
QT_MOC_LITERAL(10, 93, 15), // "parentLayerable"
QT_MOC_LITERAL(11, 109, 13), // "QCPLayerable*"
QT_MOC_LITERAL(12, 123, 11) // "antialiased"
},
"QCPLayerable\0layerChanged\0\0QCPLayer*\0"
"newLayer\0setLayer\0layer\0visible\0"
"parentPlot\0QCustomPlot*\0parentLayerable\0"
"QCPLayerable*\0antialiased"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayerable[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
2, 14, // methods
5, 30, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 24, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
5, 1, 27, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
// slots: parameters
QMetaType::Bool, 0x80000000 | 3, 6,
// properties: name, type, flags
7, QMetaType::Bool, 0x00095103,
8, 0x80000000 | 9, 0x00095009,
10, 0x80000000 | 11, 0x00095009,
6, 0x80000000 | 3, 0x0049510b,
12, QMetaType::Bool, 0x00095103,
// properties: notify_signal_id
0,
0,
0,
0,
0,
0 // eod
};
void QCPLayerable::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPLayerable *_t = static_cast<QCPLayerable *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->layerChanged((*reinterpret_cast< QCPLayer*(*)>(_a[1]))); break;
case 1: { bool _r = _t->setLayer((*reinterpret_cast< QCPLayer*(*)>(_a[1])));
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = std::move(_r); } break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayer* >(); break;
}
break;
case 1:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayer* >(); break;
}
break;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPLayerable::*_t)(QCPLayer * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPLayerable::layerChanged)) {
*result = 0;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 3:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayer* >(); break;
case 2:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayerable* >(); break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCustomPlot* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLayerable *_t = static_cast<QCPLayerable *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< bool*>(_v) = _t->visible(); break;
case 1: *reinterpret_cast< QCustomPlot**>(_v) = _t->parentPlot(); break;
case 2: *reinterpret_cast< QCPLayerable**>(_v) = _t->parentLayerable(); break;
case 3: *reinterpret_cast< QCPLayer**>(_v) = _t->layer(); break;
case 4: *reinterpret_cast< bool*>(_v) = _t->antialiased(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLayerable *_t = static_cast<QCPLayerable *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setVisible(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setLayer(*reinterpret_cast< QCPLayer**>(_v)); break;
case 4: _t->setAntialiased(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
const QMetaObject QCPLayerable::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QCPLayerable.data,
qt_meta_data_QCPLayerable, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayerable::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayerable::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayerable.stringdata0))
return static_cast<void*>(this);
return QObject::qt_metacast(_clname);
}
int QCPLayerable::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 5;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPLayerable::layerChanged(QCPLayer * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
struct qt_meta_stringdata_QCPSelectionRect_t {
QByteArrayData data[11];
char stringdata0[96];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPSelectionRect_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPSelectionRect_t qt_meta_stringdata_QCPSelectionRect = {
{
QT_MOC_LITERAL(0, 0, 16), // "QCPSelectionRect"
QT_MOC_LITERAL(1, 17, 7), // "started"
QT_MOC_LITERAL(2, 25, 0), // ""
QT_MOC_LITERAL(3, 26, 12), // "QMouseEvent*"
QT_MOC_LITERAL(4, 39, 5), // "event"
QT_MOC_LITERAL(5, 45, 7), // "changed"
QT_MOC_LITERAL(6, 53, 4), // "rect"
QT_MOC_LITERAL(7, 58, 8), // "canceled"
QT_MOC_LITERAL(8, 67, 12), // "QInputEvent*"
QT_MOC_LITERAL(9, 80, 8), // "accepted"
QT_MOC_LITERAL(10, 89, 6) // "cancel"
},
"QCPSelectionRect\0started\0\0QMouseEvent*\0"
"event\0changed\0rect\0canceled\0QInputEvent*\0"
"accepted\0cancel"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPSelectionRect[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
5, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
4, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 39, 2, 0x06 /* Public */,
5, 2, 42, 2, 0x06 /* Public */,
7, 2, 47, 2, 0x06 /* Public */,
9, 2, 52, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
10, 0, 57, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, QMetaType::QRect, 0x80000000 | 3, 6, 4,
QMetaType::Void, QMetaType::QRect, 0x80000000 | 8, 6, 4,
QMetaType::Void, QMetaType::QRect, 0x80000000 | 3, 6, 4,
// slots: parameters
QMetaType::Void,
0 // eod
};
void QCPSelectionRect::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPSelectionRect *_t = static_cast<QCPSelectionRect *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->started((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 1: _t->changed((*reinterpret_cast< const QRect(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 2: _t->canceled((*reinterpret_cast< const QRect(*)>(_a[1])),(*reinterpret_cast< QInputEvent*(*)>(_a[2]))); break;
case 3: _t->accepted((*reinterpret_cast< const QRect(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 4: _t->cancel(); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPSelectionRect::*_t)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPSelectionRect::started)) {
*result = 0;
return;
}
}
{
typedef void (QCPSelectionRect::*_t)(const QRect & , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPSelectionRect::changed)) {
*result = 1;
return;
}
}
{
typedef void (QCPSelectionRect::*_t)(const QRect & , QInputEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPSelectionRect::canceled)) {
*result = 2;
return;
}
}
{
typedef void (QCPSelectionRect::*_t)(const QRect & , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPSelectionRect::accepted)) {
*result = 3;
return;
}
}
}
}
const QMetaObject QCPSelectionRect::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPSelectionRect.data,
qt_meta_data_QCPSelectionRect, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPSelectionRect::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPSelectionRect::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPSelectionRect.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPSelectionRect::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 5)
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 5)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 5;
}
return _id;
}
// SIGNAL 0
void QCPSelectionRect::started(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPSelectionRect::changed(const QRect & _t1, QMouseEvent * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCPSelectionRect::canceled(const QRect & _t1, QInputEvent * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
// SIGNAL 3
void QCPSelectionRect::accepted(const QRect & _t1, QMouseEvent * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 3, _a);
}
struct qt_meta_stringdata_QCPMarginGroup_t {
QByteArrayData data[1];
char stringdata0[15];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPMarginGroup_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPMarginGroup_t qt_meta_stringdata_QCPMarginGroup = {
{
QT_MOC_LITERAL(0, 0, 14) // "QCPMarginGroup"
},
"QCPMarginGroup"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPMarginGroup[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void QCPMarginGroup::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPMarginGroup::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QCPMarginGroup.data,
qt_meta_data_QCPMarginGroup, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPMarginGroup::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPMarginGroup::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPMarginGroup.stringdata0))
return static_cast<void*>(this);
return QObject::qt_metacast(_clname);
}
int QCPMarginGroup::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
return _id;
}
struct qt_meta_stringdata_QCPLayoutElement_t {
QByteArrayData data[18];
char stringdata0[215];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayoutElement_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayoutElement_t qt_meta_stringdata_QCPLayoutElement = {
{
QT_MOC_LITERAL(0, 0, 16), // "QCPLayoutElement"
QT_MOC_LITERAL(1, 17, 6), // "layout"
QT_MOC_LITERAL(2, 24, 10), // "QCPLayout*"
QT_MOC_LITERAL(3, 35, 4), // "rect"
QT_MOC_LITERAL(4, 40, 9), // "outerRect"
QT_MOC_LITERAL(5, 50, 7), // "margins"
QT_MOC_LITERAL(6, 58, 8), // "QMargins"
QT_MOC_LITERAL(7, 67, 14), // "minimumMargins"
QT_MOC_LITERAL(8, 82, 11), // "minimumSize"
QT_MOC_LITERAL(9, 94, 11), // "maximumSize"
QT_MOC_LITERAL(10, 106, 18), // "sizeConstraintRect"
QT_MOC_LITERAL(11, 125, 18), // "SizeConstraintRect"
QT_MOC_LITERAL(12, 144, 11), // "UpdatePhase"
QT_MOC_LITERAL(13, 156, 13), // "upPreparation"
QT_MOC_LITERAL(14, 170, 9), // "upMargins"
QT_MOC_LITERAL(15, 180, 8), // "upLayout"
QT_MOC_LITERAL(16, 189, 12), // "scrInnerRect"
QT_MOC_LITERAL(17, 202, 12) // "scrOuterRect"
},
"QCPLayoutElement\0layout\0QCPLayout*\0"
"rect\0outerRect\0margins\0QMargins\0"
"minimumMargins\0minimumSize\0maximumSize\0"
"sizeConstraintRect\0SizeConstraintRect\0"
"UpdatePhase\0upPreparation\0upMargins\0"
"upLayout\0scrInnerRect\0scrOuterRect"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayoutElement[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
8, 14, // properties
2, 38, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x00095009,
3, QMetaType::QRect, 0x00095001,
4, QMetaType::QRect, 0x00095103,
5, 0x80000000 | 6, 0x0009510b,
7, 0x80000000 | 6, 0x0009510b,
8, QMetaType::QSize, 0x00095103,
9, QMetaType::QSize, 0x00095103,
10, 0x80000000 | 11, 0x0009510b,
// enums: name, flags, count, data
12, 0x0, 3, 46,
11, 0x0, 2, 52,
// enum data: key, value
13, uint(QCPLayoutElement::upPreparation),
14, uint(QCPLayoutElement::upMargins),
15, uint(QCPLayoutElement::upLayout),
16, uint(QCPLayoutElement::scrInnerRect),
17, uint(QCPLayoutElement::scrOuterRect),
0 // eod
};
void QCPLayoutElement::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayout* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLayoutElement *_t = static_cast<QCPLayoutElement *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPLayout**>(_v) = _t->layout(); break;
case 1: *reinterpret_cast< QRect*>(_v) = _t->rect(); break;
case 2: *reinterpret_cast< QRect*>(_v) = _t->outerRect(); break;
case 3: *reinterpret_cast< QMargins*>(_v) = _t->margins(); break;
case 4: *reinterpret_cast< QMargins*>(_v) = _t->minimumMargins(); break;
case 5: *reinterpret_cast< QSize*>(_v) = _t->minimumSize(); break;
case 6: *reinterpret_cast< QSize*>(_v) = _t->maximumSize(); break;
case 7: *reinterpret_cast< SizeConstraintRect*>(_v) = _t->sizeConstraintRect(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLayoutElement *_t = static_cast<QCPLayoutElement *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 2: _t->setOuterRect(*reinterpret_cast< QRect*>(_v)); break;
case 3: _t->setMargins(*reinterpret_cast< QMargins*>(_v)); break;
case 4: _t->setMinimumMargins(*reinterpret_cast< QMargins*>(_v)); break;
case 5: _t->setMinimumSize(*reinterpret_cast< QSize*>(_v)); break;
case 6: _t->setMaximumSize(*reinterpret_cast< QSize*>(_v)); break;
case 7: _t->setSizeConstraintRect(*reinterpret_cast< SizeConstraintRect*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
const QMetaObject QCPLayoutElement::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPLayoutElement.data,
qt_meta_data_QCPLayoutElement, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayoutElement::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayoutElement::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayoutElement.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPLayoutElement::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 8;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPLayout_t {
QByteArrayData data[1];
char stringdata0[10];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayout_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayout_t qt_meta_stringdata_QCPLayout = {
{
QT_MOC_LITERAL(0, 0, 9) // "QCPLayout"
},
"QCPLayout"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayout[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void QCPLayout::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPLayout::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPLayout.data,
qt_meta_data_QCPLayout, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayout::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayout::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayout.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPLayout::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
return _id;
}
struct qt_meta_stringdata_QCPLayoutGrid_t {
QByteArrayData data[13];
char stringdata0[165];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayoutGrid_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayoutGrid_t qt_meta_stringdata_QCPLayoutGrid = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPLayoutGrid"
QT_MOC_LITERAL(1, 14, 8), // "rowCount"
QT_MOC_LITERAL(2, 23, 11), // "columnCount"
QT_MOC_LITERAL(3, 35, 20), // "columnStretchFactors"
QT_MOC_LITERAL(4, 56, 13), // "QList<double>"
QT_MOC_LITERAL(5, 70, 17), // "rowStretchFactors"
QT_MOC_LITERAL(6, 88, 13), // "columnSpacing"
QT_MOC_LITERAL(7, 102, 10), // "rowSpacing"
QT_MOC_LITERAL(8, 113, 9), // "fillOrder"
QT_MOC_LITERAL(9, 123, 9), // "FillOrder"
QT_MOC_LITERAL(10, 133, 4), // "wrap"
QT_MOC_LITERAL(11, 138, 11), // "foRowsFirst"
QT_MOC_LITERAL(12, 150, 14) // "foColumnsFirst"
},
"QCPLayoutGrid\0rowCount\0columnCount\0"
"columnStretchFactors\0QList<double>\0"
"rowStretchFactors\0columnSpacing\0"
"rowSpacing\0fillOrder\0FillOrder\0wrap\0"
"foRowsFirst\0foColumnsFirst"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayoutGrid[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
8, 14, // properties
1, 38, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::Int, 0x00095001,
2, QMetaType::Int, 0x00095001,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 4, 0x0009510b,
6, QMetaType::Int, 0x00095103,
7, QMetaType::Int, 0x00095103,
8, 0x80000000 | 9, 0x0009510b,
10, QMetaType::Int, 0x00095103,
// enums: name, flags, count, data
9, 0x0, 2, 42,
// enum data: key, value
11, uint(QCPLayoutGrid::foRowsFirst),
12, uint(QCPLayoutGrid::foColumnsFirst),
0 // eod
};
void QCPLayoutGrid::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 3:
case 2:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QList<double> >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLayoutGrid *_t = static_cast<QCPLayoutGrid *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< int*>(_v) = _t->rowCount(); break;
case 1: *reinterpret_cast< int*>(_v) = _t->columnCount(); break;
case 2: *reinterpret_cast< QList<double>*>(_v) = _t->columnStretchFactors(); break;
case 3: *reinterpret_cast< QList<double>*>(_v) = _t->rowStretchFactors(); break;
case 4: *reinterpret_cast< int*>(_v) = _t->columnSpacing(); break;
case 5: *reinterpret_cast< int*>(_v) = _t->rowSpacing(); break;
case 6: *reinterpret_cast< FillOrder*>(_v) = _t->fillOrder(); break;
case 7: *reinterpret_cast< int*>(_v) = _t->wrap(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLayoutGrid *_t = static_cast<QCPLayoutGrid *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 2: _t->setColumnStretchFactors(*reinterpret_cast< QList<double>*>(_v)); break;
case 3: _t->setRowStretchFactors(*reinterpret_cast< QList<double>*>(_v)); break;
case 4: _t->setColumnSpacing(*reinterpret_cast< int*>(_v)); break;
case 5: _t->setRowSpacing(*reinterpret_cast< int*>(_v)); break;
case 6: _t->setFillOrder(*reinterpret_cast< FillOrder*>(_v)); break;
case 7: _t->setWrap(*reinterpret_cast< int*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
const QMetaObject QCPLayoutGrid::staticMetaObject = {
{ &QCPLayout::staticMetaObject, qt_meta_stringdata_QCPLayoutGrid.data,
qt_meta_data_QCPLayoutGrid, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayoutGrid::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayoutGrid::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayoutGrid.stringdata0))
return static_cast<void*>(this);
return QCPLayout::qt_metacast(_clname);
}
int QCPLayoutGrid::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayout::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 8;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPLayoutInset_t {
QByteArrayData data[4];
char stringdata0[53];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLayoutInset_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLayoutInset_t qt_meta_stringdata_QCPLayoutInset = {
{
QT_MOC_LITERAL(0, 0, 14), // "QCPLayoutInset"
QT_MOC_LITERAL(1, 15, 14), // "InsetPlacement"
QT_MOC_LITERAL(2, 30, 6), // "ipFree"
QT_MOC_LITERAL(3, 37, 15) // "ipBorderAligned"
},
"QCPLayoutInset\0InsetPlacement\0ipFree\0"
"ipBorderAligned"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLayoutInset[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 2, 18,
// enum data: key, value
2, uint(QCPLayoutInset::ipFree),
3, uint(QCPLayoutInset::ipBorderAligned),
0 // eod
};
void QCPLayoutInset::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPLayoutInset::staticMetaObject = {
{ &QCPLayout::staticMetaObject, qt_meta_stringdata_QCPLayoutInset.data,
qt_meta_data_QCPLayoutInset, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLayoutInset::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLayoutInset::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLayoutInset.stringdata0))
return static_cast<void*>(this);
return QCPLayout::qt_metacast(_clname);
}
int QCPLayoutInset::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayout::qt_metacall(_c, _id, _a);
return _id;
}
struct qt_meta_stringdata_QCPLineEnding_t {
QByteArrayData data[12];
char stringdata0[124];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLineEnding_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLineEnding_t qt_meta_stringdata_QCPLineEnding = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPLineEnding"
QT_MOC_LITERAL(1, 14, 11), // "EndingStyle"
QT_MOC_LITERAL(2, 26, 6), // "esNone"
QT_MOC_LITERAL(3, 33, 11), // "esFlatArrow"
QT_MOC_LITERAL(4, 45, 12), // "esSpikeArrow"
QT_MOC_LITERAL(5, 58, 11), // "esLineArrow"
QT_MOC_LITERAL(6, 70, 6), // "esDisc"
QT_MOC_LITERAL(7, 77, 8), // "esSquare"
QT_MOC_LITERAL(8, 86, 9), // "esDiamond"
QT_MOC_LITERAL(9, 96, 5), // "esBar"
QT_MOC_LITERAL(10, 102, 9), // "esHalfBar"
QT_MOC_LITERAL(11, 112, 11) // "esSkewedBar"
},
"QCPLineEnding\0EndingStyle\0esNone\0"
"esFlatArrow\0esSpikeArrow\0esLineArrow\0"
"esDisc\0esSquare\0esDiamond\0esBar\0"
"esHalfBar\0esSkewedBar"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLineEnding[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 10, 18,
// enum data: key, value
2, uint(QCPLineEnding::esNone),
3, uint(QCPLineEnding::esFlatArrow),
4, uint(QCPLineEnding::esSpikeArrow),
5, uint(QCPLineEnding::esLineArrow),
6, uint(QCPLineEnding::esDisc),
7, uint(QCPLineEnding::esSquare),
8, uint(QCPLineEnding::esDiamond),
9, uint(QCPLineEnding::esBar),
10, uint(QCPLineEnding::esHalfBar),
11, uint(QCPLineEnding::esSkewedBar),
0 // eod
};
const QMetaObject QCPLineEnding::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCPLineEnding.data,
qt_meta_data_QCPLineEnding, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPAxisTicker_t {
QByteArrayData data[4];
char stringdata0[63];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAxisTicker_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAxisTicker_t qt_meta_stringdata_QCPAxisTicker = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPAxisTicker"
QT_MOC_LITERAL(1, 14, 16), // "TickStepStrategy"
QT_MOC_LITERAL(2, 31, 14), // "tssReadability"
QT_MOC_LITERAL(3, 46, 16) // "tssMeetTickCount"
},
"QCPAxisTicker\0TickStepStrategy\0"
"tssReadability\0tssMeetTickCount"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAxisTicker[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 2, 18,
// enum data: key, value
2, uint(QCPAxisTicker::tssReadability),
3, uint(QCPAxisTicker::tssMeetTickCount),
0 // eod
};
const QMetaObject QCPAxisTicker::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCPAxisTicker.data,
qt_meta_data_QCPAxisTicker, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPAxisTickerTime_t {
QByteArrayData data[7];
char stringdata0[77];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAxisTickerTime_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAxisTickerTime_t qt_meta_stringdata_QCPAxisTickerTime = {
{
QT_MOC_LITERAL(0, 0, 17), // "QCPAxisTickerTime"
QT_MOC_LITERAL(1, 18, 8), // "TimeUnit"
QT_MOC_LITERAL(2, 27, 14), // "tuMilliseconds"
QT_MOC_LITERAL(3, 42, 9), // "tuSeconds"
QT_MOC_LITERAL(4, 52, 9), // "tuMinutes"
QT_MOC_LITERAL(5, 62, 7), // "tuHours"
QT_MOC_LITERAL(6, 70, 6) // "tuDays"
},
"QCPAxisTickerTime\0TimeUnit\0tuMilliseconds\0"
"tuSeconds\0tuMinutes\0tuHours\0tuDays"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAxisTickerTime[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 5, 18,
// enum data: key, value
2, uint(QCPAxisTickerTime::tuMilliseconds),
3, uint(QCPAxisTickerTime::tuSeconds),
4, uint(QCPAxisTickerTime::tuMinutes),
5, uint(QCPAxisTickerTime::tuHours),
6, uint(QCPAxisTickerTime::tuDays),
0 // eod
};
const QMetaObject QCPAxisTickerTime::staticMetaObject = {
{ &QCPAxisTicker::staticMetaObject, qt_meta_stringdata_QCPAxisTickerTime.data,
qt_meta_data_QCPAxisTickerTime, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPAxisTickerFixed_t {
QByteArrayData data[5];
char stringdata0[61];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAxisTickerFixed_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAxisTickerFixed_t qt_meta_stringdata_QCPAxisTickerFixed = {
{
QT_MOC_LITERAL(0, 0, 18), // "QCPAxisTickerFixed"
QT_MOC_LITERAL(1, 19, 13), // "ScaleStrategy"
QT_MOC_LITERAL(2, 33, 6), // "ssNone"
QT_MOC_LITERAL(3, 40, 11), // "ssMultiples"
QT_MOC_LITERAL(4, 52, 8) // "ssPowers"
},
"QCPAxisTickerFixed\0ScaleStrategy\0"
"ssNone\0ssMultiples\0ssPowers"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAxisTickerFixed[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 3, 18,
// enum data: key, value
2, uint(QCPAxisTickerFixed::ssNone),
3, uint(QCPAxisTickerFixed::ssMultiples),
4, uint(QCPAxisTickerFixed::ssPowers),
0 // eod
};
const QMetaObject QCPAxisTickerFixed::staticMetaObject = {
{ &QCPAxisTicker::staticMetaObject, qt_meta_stringdata_QCPAxisTickerFixed.data,
qt_meta_data_QCPAxisTickerFixed, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPAxisTickerPi_t {
QByteArrayData data[5];
char stringdata0[82];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAxisTickerPi_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAxisTickerPi_t qt_meta_stringdata_QCPAxisTickerPi = {
{
QT_MOC_LITERAL(0, 0, 15), // "QCPAxisTickerPi"
QT_MOC_LITERAL(1, 16, 13), // "FractionStyle"
QT_MOC_LITERAL(2, 30, 15), // "fsFloatingPoint"
QT_MOC_LITERAL(3, 46, 16), // "fsAsciiFractions"
QT_MOC_LITERAL(4, 63, 18) // "fsUnicodeFractions"
},
"QCPAxisTickerPi\0FractionStyle\0"
"fsFloatingPoint\0fsAsciiFractions\0"
"fsUnicodeFractions"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAxisTickerPi[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 3, 18,
// enum data: key, value
2, uint(QCPAxisTickerPi::fsFloatingPoint),
3, uint(QCPAxisTickerPi::fsAsciiFractions),
4, uint(QCPAxisTickerPi::fsUnicodeFractions),
0 // eod
};
const QMetaObject QCPAxisTickerPi::staticMetaObject = {
{ &QCPAxisTicker::staticMetaObject, qt_meta_stringdata_QCPAxisTickerPi.data,
qt_meta_data_QCPAxisTickerPi, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPGrid_t {
QByteArrayData data[7];
char stringdata0[89];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPGrid_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPGrid_t qt_meta_stringdata_QCPGrid = {
{
QT_MOC_LITERAL(0, 0, 7), // "QCPGrid"
QT_MOC_LITERAL(1, 8, 14), // "subGridVisible"
QT_MOC_LITERAL(2, 23, 18), // "antialiasedSubGrid"
QT_MOC_LITERAL(3, 42, 19), // "antialiasedZeroLine"
QT_MOC_LITERAL(4, 62, 3), // "pen"
QT_MOC_LITERAL(5, 66, 10), // "subGridPen"
QT_MOC_LITERAL(6, 77, 11) // "zeroLinePen"
},
"QCPGrid\0subGridVisible\0antialiasedSubGrid\0"
"antialiasedZeroLine\0pen\0subGridPen\0"
"zeroLinePen"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPGrid[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
6, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::Bool, 0x00095103,
2, QMetaType::Bool, 0x00095103,
3, QMetaType::Bool, 0x00095103,
4, QMetaType::QPen, 0x00095103,
5, QMetaType::QPen, 0x00095103,
6, QMetaType::QPen, 0x00095103,
0 // eod
};
void QCPGrid::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPGrid *_t = static_cast<QCPGrid *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< bool*>(_v) = _t->subGridVisible(); break;
case 1: *reinterpret_cast< bool*>(_v) = _t->antialiasedSubGrid(); break;
case 2: *reinterpret_cast< bool*>(_v) = _t->antialiasedZeroLine(); break;
case 3: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 4: *reinterpret_cast< QPen*>(_v) = _t->subGridPen(); break;
case 5: *reinterpret_cast< QPen*>(_v) = _t->zeroLinePen(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPGrid *_t = static_cast<QCPGrid *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setSubGridVisible(*reinterpret_cast< bool*>(_v)); break;
case 1: _t->setAntialiasedSubGrid(*reinterpret_cast< bool*>(_v)); break;
case 2: _t->setAntialiasedZeroLine(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 4: _t->setSubGridPen(*reinterpret_cast< QPen*>(_v)); break;
case 5: _t->setZeroLinePen(*reinterpret_cast< QPen*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPGrid::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPGrid.data,
qt_meta_data_QCPGrid, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPGrid::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPGrid::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPGrid.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPGrid::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 6;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPAxis_t {
QByteArrayData data[84];
char stringdata0[1044];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAxis_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAxis_t qt_meta_stringdata_QCPAxis = {
{
QT_MOC_LITERAL(0, 0, 7), // "QCPAxis"
QT_MOC_LITERAL(1, 8, 12), // "rangeChanged"
QT_MOC_LITERAL(2, 21, 0), // ""
QT_MOC_LITERAL(3, 22, 8), // "QCPRange"
QT_MOC_LITERAL(4, 31, 8), // "newRange"
QT_MOC_LITERAL(5, 40, 8), // "oldRange"
QT_MOC_LITERAL(6, 49, 16), // "scaleTypeChanged"
QT_MOC_LITERAL(7, 66, 18), // "QCPAxis::ScaleType"
QT_MOC_LITERAL(8, 85, 9), // "scaleType"
QT_MOC_LITERAL(9, 95, 16), // "selectionChanged"
QT_MOC_LITERAL(10, 112, 24), // "QCPAxis::SelectableParts"
QT_MOC_LITERAL(11, 137, 5), // "parts"
QT_MOC_LITERAL(12, 143, 17), // "selectableChanged"
QT_MOC_LITERAL(13, 161, 12), // "setScaleType"
QT_MOC_LITERAL(14, 174, 4), // "type"
QT_MOC_LITERAL(15, 179, 8), // "setRange"
QT_MOC_LITERAL(16, 188, 5), // "range"
QT_MOC_LITERAL(17, 194, 18), // "setSelectableParts"
QT_MOC_LITERAL(18, 213, 15), // "selectableParts"
QT_MOC_LITERAL(19, 229, 16), // "setSelectedParts"
QT_MOC_LITERAL(20, 246, 13), // "selectedParts"
QT_MOC_LITERAL(21, 260, 8), // "axisType"
QT_MOC_LITERAL(22, 269, 8), // "AxisType"
QT_MOC_LITERAL(23, 278, 8), // "axisRect"
QT_MOC_LITERAL(24, 287, 12), // "QCPAxisRect*"
QT_MOC_LITERAL(25, 300, 9), // "ScaleType"
QT_MOC_LITERAL(26, 310, 13), // "rangeReversed"
QT_MOC_LITERAL(27, 324, 6), // "ticker"
QT_MOC_LITERAL(28, 331, 29), // "QSharedPointer<QCPAxisTicker>"
QT_MOC_LITERAL(29, 361, 5), // "ticks"
QT_MOC_LITERAL(30, 367, 10), // "tickLabels"
QT_MOC_LITERAL(31, 378, 16), // "tickLabelPadding"
QT_MOC_LITERAL(32, 395, 13), // "tickLabelFont"
QT_MOC_LITERAL(33, 409, 14), // "tickLabelColor"
QT_MOC_LITERAL(34, 424, 17), // "tickLabelRotation"
QT_MOC_LITERAL(35, 442, 13), // "tickLabelSide"
QT_MOC_LITERAL(36, 456, 9), // "LabelSide"
QT_MOC_LITERAL(37, 466, 12), // "numberFormat"
QT_MOC_LITERAL(38, 479, 15), // "numberPrecision"
QT_MOC_LITERAL(39, 495, 10), // "tickVector"
QT_MOC_LITERAL(40, 506, 15), // "QVector<double>"
QT_MOC_LITERAL(41, 522, 16), // "tickVectorLabels"
QT_MOC_LITERAL(42, 539, 16), // "QVector<QString>"
QT_MOC_LITERAL(43, 556, 12), // "tickLengthIn"
QT_MOC_LITERAL(44, 569, 13), // "tickLengthOut"
QT_MOC_LITERAL(45, 583, 8), // "subTicks"
QT_MOC_LITERAL(46, 592, 15), // "subTickLengthIn"
QT_MOC_LITERAL(47, 608, 16), // "subTickLengthOut"
QT_MOC_LITERAL(48, 625, 7), // "basePen"
QT_MOC_LITERAL(49, 633, 7), // "tickPen"
QT_MOC_LITERAL(50, 641, 10), // "subTickPen"
QT_MOC_LITERAL(51, 652, 9), // "labelFont"
QT_MOC_LITERAL(52, 662, 10), // "labelColor"
QT_MOC_LITERAL(53, 673, 5), // "label"
QT_MOC_LITERAL(54, 679, 12), // "labelPadding"
QT_MOC_LITERAL(55, 692, 7), // "padding"
QT_MOC_LITERAL(56, 700, 6), // "offset"
QT_MOC_LITERAL(57, 707, 15), // "SelectableParts"
QT_MOC_LITERAL(58, 723, 21), // "selectedTickLabelFont"
QT_MOC_LITERAL(59, 745, 17), // "selectedLabelFont"
QT_MOC_LITERAL(60, 763, 22), // "selectedTickLabelColor"
QT_MOC_LITERAL(61, 786, 18), // "selectedLabelColor"
QT_MOC_LITERAL(62, 805, 15), // "selectedBasePen"
QT_MOC_LITERAL(63, 821, 15), // "selectedTickPen"
QT_MOC_LITERAL(64, 837, 18), // "selectedSubTickPen"
QT_MOC_LITERAL(65, 856, 11), // "lowerEnding"
QT_MOC_LITERAL(66, 868, 13), // "QCPLineEnding"
QT_MOC_LITERAL(67, 882, 11), // "upperEnding"
QT_MOC_LITERAL(68, 894, 4), // "grid"
QT_MOC_LITERAL(69, 899, 8), // "QCPGrid*"
QT_MOC_LITERAL(70, 908, 6), // "atLeft"
QT_MOC_LITERAL(71, 915, 7), // "atRight"
QT_MOC_LITERAL(72, 923, 5), // "atTop"
QT_MOC_LITERAL(73, 929, 8), // "atBottom"
QT_MOC_LITERAL(74, 938, 9), // "AxisTypes"
QT_MOC_LITERAL(75, 948, 8), // "lsInside"
QT_MOC_LITERAL(76, 957, 9), // "lsOutside"
QT_MOC_LITERAL(77, 967, 8), // "stLinear"
QT_MOC_LITERAL(78, 976, 13), // "stLogarithmic"
QT_MOC_LITERAL(79, 990, 14), // "SelectablePart"
QT_MOC_LITERAL(80, 1005, 6), // "spNone"
QT_MOC_LITERAL(81, 1012, 6), // "spAxis"
QT_MOC_LITERAL(82, 1019, 12), // "spTickLabels"
QT_MOC_LITERAL(83, 1032, 11) // "spAxisLabel"
},
"QCPAxis\0rangeChanged\0\0QCPRange\0newRange\0"
"oldRange\0scaleTypeChanged\0QCPAxis::ScaleType\0"
"scaleType\0selectionChanged\0"
"QCPAxis::SelectableParts\0parts\0"
"selectableChanged\0setScaleType\0type\0"
"setRange\0range\0setSelectableParts\0"
"selectableParts\0setSelectedParts\0"
"selectedParts\0axisType\0AxisType\0"
"axisRect\0QCPAxisRect*\0ScaleType\0"
"rangeReversed\0ticker\0QSharedPointer<QCPAxisTicker>\0"
"ticks\0tickLabels\0tickLabelPadding\0"
"tickLabelFont\0tickLabelColor\0"
"tickLabelRotation\0tickLabelSide\0"
"LabelSide\0numberFormat\0numberPrecision\0"
"tickVector\0QVector<double>\0tickVectorLabels\0"
"QVector<QString>\0tickLengthIn\0"
"tickLengthOut\0subTicks\0subTickLengthIn\0"
"subTickLengthOut\0basePen\0tickPen\0"
"subTickPen\0labelFont\0labelColor\0label\0"
"labelPadding\0padding\0offset\0SelectableParts\0"
"selectedTickLabelFont\0selectedLabelFont\0"
"selectedTickLabelColor\0selectedLabelColor\0"
"selectedBasePen\0selectedTickPen\0"
"selectedSubTickPen\0lowerEnding\0"
"QCPLineEnding\0upperEnding\0grid\0QCPGrid*\0"
"atLeft\0atRight\0atTop\0atBottom\0AxisTypes\0"
"lsInside\0lsOutside\0stLinear\0stLogarithmic\0"
"SelectablePart\0spNone\0spAxis\0spTickLabels\0"
"spAxisLabel"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAxis[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
9, 14, // methods
43, 88, // properties
6, 260, // enums/sets
0, 0, // constructors
0, // flags
5, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 59, 2, 0x06 /* Public */,
1, 2, 62, 2, 0x06 /* Public */,
6, 1, 67, 2, 0x06 /* Public */,
9, 1, 70, 2, 0x06 /* Public */,
12, 1, 73, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
13, 1, 76, 2, 0x0a /* Public */,
15, 1, 79, 2, 0x0a /* Public */,
17, 1, 82, 2, 0x0a /* Public */,
19, 1, 85, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 0x80000000 | 3, 4, 5,
QMetaType::Void, 0x80000000 | 7, 8,
QMetaType::Void, 0x80000000 | 10, 11,
QMetaType::Void, 0x80000000 | 10, 11,
// slots: parameters
QMetaType::Void, 0x80000000 | 7, 14,
QMetaType::Void, 0x80000000 | 3, 16,
QMetaType::Void, 0x80000000 | 10, 18,
QMetaType::Void, 0x80000000 | 10, 20,
// properties: name, type, flags
21, 0x80000000 | 22, 0x00095009,
23, 0x80000000 | 24, 0x00095009,
8, 0x80000000 | 25, 0x0049510b,
16, 0x80000000 | 3, 0x0049510b,
26, QMetaType::Bool, 0x00095103,
27, 0x80000000 | 28, 0x0009510b,
29, QMetaType::Bool, 0x00095103,
30, QMetaType::Bool, 0x00095103,
31, QMetaType::Int, 0x00095103,
32, QMetaType::QFont, 0x00095103,
33, QMetaType::QColor, 0x00095103,
34, QMetaType::Double, 0x00095103,
35, 0x80000000 | 36, 0x0009510b,
37, QMetaType::QString, 0x00095103,
38, QMetaType::Int, 0x00095103,
39, 0x80000000 | 40, 0x00095009,
41, 0x80000000 | 42, 0x00095009,
43, QMetaType::Int, 0x00095103,
44, QMetaType::Int, 0x00095103,
45, QMetaType::Bool, 0x00095103,
46, QMetaType::Int, 0x00095103,
47, QMetaType::Int, 0x00095103,
48, QMetaType::QPen, 0x00095103,
49, QMetaType::QPen, 0x00095103,
50, QMetaType::QPen, 0x00095103,
51, QMetaType::QFont, 0x00095103,
52, QMetaType::QColor, 0x00095103,
53, QMetaType::QString, 0x00095103,
54, QMetaType::Int, 0x00095103,
55, QMetaType::Int, 0x00095103,
56, QMetaType::Int, 0x00095103,
20, 0x80000000 | 57, 0x0049510b,
18, 0x80000000 | 57, 0x0049510b,
58, QMetaType::QFont, 0x00095103,
59, QMetaType::QFont, 0x00095103,
60, QMetaType::QColor, 0x00095103,
61, QMetaType::QColor, 0x00095103,
62, QMetaType::QPen, 0x00095103,
63, QMetaType::QPen, 0x00095103,
64, QMetaType::QPen, 0x00095103,
65, 0x80000000 | 66, 0x0009510b,
67, 0x80000000 | 66, 0x0009510b,
68, 0x80000000 | 69, 0x00095009,
// properties: notify_signal_id
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
3,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
// enums: name, flags, count, data
22, 0x0, 4, 284,
74, 0x1, 4, 292,
36, 0x0, 2, 300,
25, 0x0, 2, 304,
79, 0x0, 4, 308,
57, 0x1, 4, 316,
// enum data: key, value
70, uint(QCPAxis::atLeft),
71, uint(QCPAxis::atRight),
72, uint(QCPAxis::atTop),
73, uint(QCPAxis::atBottom),
70, uint(QCPAxis::atLeft),
71, uint(QCPAxis::atRight),
72, uint(QCPAxis::atTop),
73, uint(QCPAxis::atBottom),
75, uint(QCPAxis::lsInside),
76, uint(QCPAxis::lsOutside),
77, uint(QCPAxis::stLinear),
78, uint(QCPAxis::stLogarithmic),
80, uint(QCPAxis::spNone),
81, uint(QCPAxis::spAxis),
82, uint(QCPAxis::spTickLabels),
83, uint(QCPAxis::spAxisLabel),
80, uint(QCPAxis::spNone),
81, uint(QCPAxis::spAxis),
82, uint(QCPAxis::spTickLabels),
83, uint(QCPAxis::spAxisLabel),
0 // eod
};
void QCPAxis::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPAxis *_t = static_cast<QCPAxis *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->rangeChanged((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 1: _t->rangeChanged((*reinterpret_cast< const QCPRange(*)>(_a[1])),(*reinterpret_cast< const QCPRange(*)>(_a[2]))); break;
case 2: _t->scaleTypeChanged((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 3: _t->selectionChanged((*reinterpret_cast< const QCPAxis::SelectableParts(*)>(_a[1]))); break;
case 4: _t->selectableChanged((*reinterpret_cast< const QCPAxis::SelectableParts(*)>(_a[1]))); break;
case 5: _t->setScaleType((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 6: _t->setRange((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 7: _t->setSelectableParts((*reinterpret_cast< const QCPAxis::SelectableParts(*)>(_a[1]))); break;
case 8: _t->setSelectedParts((*reinterpret_cast< const QCPAxis::SelectableParts(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 2:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::ScaleType >(); break;
}
break;
case 5:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::ScaleType >(); break;
}
break;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPAxis::*_t)(const QCPRange & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::rangeChanged)) {
*result = 0;
return;
}
}
{
typedef void (QCPAxis::*_t)(const QCPRange & , const QCPRange & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::rangeChanged)) {
*result = 1;
return;
}
}
{
typedef void (QCPAxis::*_t)(QCPAxis::ScaleType );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::scaleTypeChanged)) {
*result = 2;
return;
}
}
{
typedef void (QCPAxis::*_t)(const QCPAxis::SelectableParts & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::selectionChanged)) {
*result = 3;
return;
}
}
{
typedef void (QCPAxis::*_t)(const QCPAxis::SelectableParts & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAxis::selectableChanged)) {
*result = 4;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxisRect* >(); break;
case 42:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPGrid* >(); break;
case 5:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QSharedPointer<QCPAxisTicker> >(); break;
case 16:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QVector<QString> >(); break;
case 15:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QVector<double> >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPAxis *_t = static_cast<QCPAxis *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< AxisType*>(_v) = _t->axisType(); break;
case 1: *reinterpret_cast< QCPAxisRect**>(_v) = _t->axisRect(); break;
case 2: *reinterpret_cast< ScaleType*>(_v) = _t->scaleType(); break;
case 3: *reinterpret_cast< QCPRange*>(_v) = _t->range(); break;
case 4: *reinterpret_cast< bool*>(_v) = _t->rangeReversed(); break;
case 5: *reinterpret_cast< QSharedPointer<QCPAxisTicker>*>(_v) = _t->ticker(); break;
case 6: *reinterpret_cast< bool*>(_v) = _t->ticks(); break;
case 7: *reinterpret_cast< bool*>(_v) = _t->tickLabels(); break;
case 8: *reinterpret_cast< int*>(_v) = _t->tickLabelPadding(); break;
case 9: *reinterpret_cast< QFont*>(_v) = _t->tickLabelFont(); break;
case 10: *reinterpret_cast< QColor*>(_v) = _t->tickLabelColor(); break;
case 11: *reinterpret_cast< double*>(_v) = _t->tickLabelRotation(); break;
case 12: *reinterpret_cast< LabelSide*>(_v) = _t->tickLabelSide(); break;
case 13: *reinterpret_cast< QString*>(_v) = _t->numberFormat(); break;
case 14: *reinterpret_cast< int*>(_v) = _t->numberPrecision(); break;
case 15: *reinterpret_cast< QVector<double>*>(_v) = _t->tickVector(); break;
case 16: *reinterpret_cast< QVector<QString>*>(_v) = _t->tickVectorLabels(); break;
case 17: *reinterpret_cast< int*>(_v) = _t->tickLengthIn(); break;
case 18: *reinterpret_cast< int*>(_v) = _t->tickLengthOut(); break;
case 19: *reinterpret_cast< bool*>(_v) = _t->subTicks(); break;
case 20: *reinterpret_cast< int*>(_v) = _t->subTickLengthIn(); break;
case 21: *reinterpret_cast< int*>(_v) = _t->subTickLengthOut(); break;
case 22: *reinterpret_cast< QPen*>(_v) = _t->basePen(); break;
case 23: *reinterpret_cast< QPen*>(_v) = _t->tickPen(); break;
case 24: *reinterpret_cast< QPen*>(_v) = _t->subTickPen(); break;
case 25: *reinterpret_cast< QFont*>(_v) = _t->labelFont(); break;
case 26: *reinterpret_cast< QColor*>(_v) = _t->labelColor(); break;
case 27: *reinterpret_cast< QString*>(_v) = _t->label(); break;
case 28: *reinterpret_cast< int*>(_v) = _t->labelPadding(); break;
case 29: *reinterpret_cast< int*>(_v) = _t->padding(); break;
case 30: *reinterpret_cast< int*>(_v) = _t->offset(); break;
case 31: *reinterpret_cast<int*>(_v) = QFlag(_t->selectedParts()); break;
case 32: *reinterpret_cast<int*>(_v) = QFlag(_t->selectableParts()); break;
case 33: *reinterpret_cast< QFont*>(_v) = _t->selectedTickLabelFont(); break;
case 34: *reinterpret_cast< QFont*>(_v) = _t->selectedLabelFont(); break;
case 35: *reinterpret_cast< QColor*>(_v) = _t->selectedTickLabelColor(); break;
case 36: *reinterpret_cast< QColor*>(_v) = _t->selectedLabelColor(); break;
case 37: *reinterpret_cast< QPen*>(_v) = _t->selectedBasePen(); break;
case 38: *reinterpret_cast< QPen*>(_v) = _t->selectedTickPen(); break;
case 39: *reinterpret_cast< QPen*>(_v) = _t->selectedSubTickPen(); break;
case 40: *reinterpret_cast< QCPLineEnding*>(_v) = _t->lowerEnding(); break;
case 41: *reinterpret_cast< QCPLineEnding*>(_v) = _t->upperEnding(); break;
case 42: *reinterpret_cast< QCPGrid**>(_v) = _t->grid(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAxis *_t = static_cast<QCPAxis *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 2: _t->setScaleType(*reinterpret_cast< ScaleType*>(_v)); break;
case 3: _t->setRange(*reinterpret_cast< QCPRange*>(_v)); break;
case 4: _t->setRangeReversed(*reinterpret_cast< bool*>(_v)); break;
case 5: _t->setTicker(*reinterpret_cast< QSharedPointer<QCPAxisTicker>*>(_v)); break;
case 6: _t->setTicks(*reinterpret_cast< bool*>(_v)); break;
case 7: _t->setTickLabels(*reinterpret_cast< bool*>(_v)); break;
case 8: _t->setTickLabelPadding(*reinterpret_cast< int*>(_v)); break;
case 9: _t->setTickLabelFont(*reinterpret_cast< QFont*>(_v)); break;
case 10: _t->setTickLabelColor(*reinterpret_cast< QColor*>(_v)); break;
case 11: _t->setTickLabelRotation(*reinterpret_cast< double*>(_v)); break;
case 12: _t->setTickLabelSide(*reinterpret_cast< LabelSide*>(_v)); break;
case 13: _t->setNumberFormat(*reinterpret_cast< QString*>(_v)); break;
case 14: _t->setNumberPrecision(*reinterpret_cast< int*>(_v)); break;
case 17: _t->setTickLengthIn(*reinterpret_cast< int*>(_v)); break;
case 18: _t->setTickLengthOut(*reinterpret_cast< int*>(_v)); break;
case 19: _t->setSubTicks(*reinterpret_cast< bool*>(_v)); break;
case 20: _t->setSubTickLengthIn(*reinterpret_cast< int*>(_v)); break;
case 21: _t->setSubTickLengthOut(*reinterpret_cast< int*>(_v)); break;
case 22: _t->setBasePen(*reinterpret_cast< QPen*>(_v)); break;
case 23: _t->setTickPen(*reinterpret_cast< QPen*>(_v)); break;
case 24: _t->setSubTickPen(*reinterpret_cast< QPen*>(_v)); break;
case 25: _t->setLabelFont(*reinterpret_cast< QFont*>(_v)); break;
case 26: _t->setLabelColor(*reinterpret_cast< QColor*>(_v)); break;
case 27: _t->setLabel(*reinterpret_cast< QString*>(_v)); break;
case 28: _t->setLabelPadding(*reinterpret_cast< int*>(_v)); break;
case 29: _t->setPadding(*reinterpret_cast< int*>(_v)); break;
case 30: _t->setOffset(*reinterpret_cast< int*>(_v)); break;
case 31: _t->setSelectedParts(QFlag(*reinterpret_cast<int*>(_v))); break;
case 32: _t->setSelectableParts(QFlag(*reinterpret_cast<int*>(_v))); break;
case 33: _t->setSelectedTickLabelFont(*reinterpret_cast< QFont*>(_v)); break;
case 34: _t->setSelectedLabelFont(*reinterpret_cast< QFont*>(_v)); break;
case 35: _t->setSelectedTickLabelColor(*reinterpret_cast< QColor*>(_v)); break;
case 36: _t->setSelectedLabelColor(*reinterpret_cast< QColor*>(_v)); break;
case 37: _t->setSelectedBasePen(*reinterpret_cast< QPen*>(_v)); break;
case 38: _t->setSelectedTickPen(*reinterpret_cast< QPen*>(_v)); break;
case 39: _t->setSelectedSubTickPen(*reinterpret_cast< QPen*>(_v)); break;
case 40: _t->setLowerEnding(*reinterpret_cast< QCPLineEnding*>(_v)); break;
case 41: _t->setUpperEnding(*reinterpret_cast< QCPLineEnding*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
const QMetaObject QCPAxis::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPAxis.data,
qt_meta_data_QCPAxis, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPAxis::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAxis::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAxis.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPAxis::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 9)
qt_static_metacall(this, _c, _id, _a);
_id -= 9;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 9)
qt_static_metacall(this, _c, _id, _a);
_id -= 9;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 43;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 43;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 43;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 43;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 43;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 43;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPAxis::rangeChanged(const QCPRange & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPAxis::rangeChanged(const QCPRange & _t1, const QCPRange & _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCPAxis::scaleTypeChanged(QCPAxis::ScaleType _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
// SIGNAL 3
void QCPAxis::selectionChanged(const QCPAxis::SelectableParts & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 3, _a);
}
// SIGNAL 4
void QCPAxis::selectableChanged(const QCPAxis::SelectableParts & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 4, _a);
}
struct qt_meta_stringdata_QCPScatterStyle_t {
QByteArrayData data[28];
char stringdata0[285];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPScatterStyle_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPScatterStyle_t qt_meta_stringdata_QCPScatterStyle = {
{
QT_MOC_LITERAL(0, 0, 15), // "QCPScatterStyle"
QT_MOC_LITERAL(1, 16, 15), // "ScatterProperty"
QT_MOC_LITERAL(2, 32, 6), // "spNone"
QT_MOC_LITERAL(3, 39, 5), // "spPen"
QT_MOC_LITERAL(4, 45, 7), // "spBrush"
QT_MOC_LITERAL(5, 53, 6), // "spSize"
QT_MOC_LITERAL(6, 60, 7), // "spShape"
QT_MOC_LITERAL(7, 68, 5), // "spAll"
QT_MOC_LITERAL(8, 74, 17), // "ScatterProperties"
QT_MOC_LITERAL(9, 92, 12), // "ScatterShape"
QT_MOC_LITERAL(10, 105, 6), // "ssNone"
QT_MOC_LITERAL(11, 112, 5), // "ssDot"
QT_MOC_LITERAL(12, 118, 7), // "ssCross"
QT_MOC_LITERAL(13, 126, 6), // "ssPlus"
QT_MOC_LITERAL(14, 133, 8), // "ssCircle"
QT_MOC_LITERAL(15, 142, 6), // "ssDisc"
QT_MOC_LITERAL(16, 149, 8), // "ssSquare"
QT_MOC_LITERAL(17, 158, 9), // "ssDiamond"
QT_MOC_LITERAL(18, 168, 6), // "ssStar"
QT_MOC_LITERAL(19, 175, 10), // "ssTriangle"
QT_MOC_LITERAL(20, 186, 18), // "ssTriangleInverted"
QT_MOC_LITERAL(21, 205, 13), // "ssCrossSquare"
QT_MOC_LITERAL(22, 219, 12), // "ssPlusSquare"
QT_MOC_LITERAL(23, 232, 13), // "ssCrossCircle"
QT_MOC_LITERAL(24, 246, 12), // "ssPlusCircle"
QT_MOC_LITERAL(25, 259, 7), // "ssPeace"
QT_MOC_LITERAL(26, 267, 8), // "ssPixmap"
QT_MOC_LITERAL(27, 276, 8) // "ssCustom"
},
"QCPScatterStyle\0ScatterProperty\0spNone\0"
"spPen\0spBrush\0spSize\0spShape\0spAll\0"
"ScatterProperties\0ScatterShape\0ssNone\0"
"ssDot\0ssCross\0ssPlus\0ssCircle\0ssDisc\0"
"ssSquare\0ssDiamond\0ssStar\0ssTriangle\0"
"ssTriangleInverted\0ssCrossSquare\0"
"ssPlusSquare\0ssCrossCircle\0ssPlusCircle\0"
"ssPeace\0ssPixmap\0ssCustom"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPScatterStyle[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
3, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 6, 26,
8, 0x1, 6, 38,
9, 0x0, 18, 50,
// enum data: key, value
2, uint(QCPScatterStyle::spNone),
3, uint(QCPScatterStyle::spPen),
4, uint(QCPScatterStyle::spBrush),
5, uint(QCPScatterStyle::spSize),
6, uint(QCPScatterStyle::spShape),
7, uint(QCPScatterStyle::spAll),
2, uint(QCPScatterStyle::spNone),
3, uint(QCPScatterStyle::spPen),
4, uint(QCPScatterStyle::spBrush),
5, uint(QCPScatterStyle::spSize),
6, uint(QCPScatterStyle::spShape),
7, uint(QCPScatterStyle::spAll),
10, uint(QCPScatterStyle::ssNone),
11, uint(QCPScatterStyle::ssDot),
12, uint(QCPScatterStyle::ssCross),
13, uint(QCPScatterStyle::ssPlus),
14, uint(QCPScatterStyle::ssCircle),
15, uint(QCPScatterStyle::ssDisc),
16, uint(QCPScatterStyle::ssSquare),
17, uint(QCPScatterStyle::ssDiamond),
18, uint(QCPScatterStyle::ssStar),
19, uint(QCPScatterStyle::ssTriangle),
20, uint(QCPScatterStyle::ssTriangleInverted),
21, uint(QCPScatterStyle::ssCrossSquare),
22, uint(QCPScatterStyle::ssPlusSquare),
23, uint(QCPScatterStyle::ssCrossCircle),
24, uint(QCPScatterStyle::ssPlusCircle),
25, uint(QCPScatterStyle::ssPeace),
26, uint(QCPScatterStyle::ssPixmap),
27, uint(QCPScatterStyle::ssCustom),
0 // eod
};
const QMetaObject QCPScatterStyle::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCPScatterStyle.data,
qt_meta_data_QCPScatterStyle, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPSelectionDecorator_t {
QByteArrayData data[1];
char stringdata0[22];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPSelectionDecorator_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPSelectionDecorator_t qt_meta_stringdata_QCPSelectionDecorator = {
{
QT_MOC_LITERAL(0, 0, 21) // "QCPSelectionDecorator"
},
"QCPSelectionDecorator"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPSelectionDecorator[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
0 // eod
};
const QMetaObject QCPSelectionDecorator::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCPSelectionDecorator.data,
qt_meta_data_QCPSelectionDecorator, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPAbstractPlottable_t {
QByteArrayData data[21];
char stringdata0[270];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAbstractPlottable_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAbstractPlottable_t qt_meta_stringdata_QCPAbstractPlottable = {
{
QT_MOC_LITERAL(0, 0, 20), // "QCPAbstractPlottable"
QT_MOC_LITERAL(1, 21, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 38, 0), // ""
QT_MOC_LITERAL(3, 39, 8), // "selected"
QT_MOC_LITERAL(4, 48, 16), // "QCPDataSelection"
QT_MOC_LITERAL(5, 65, 9), // "selection"
QT_MOC_LITERAL(6, 75, 17), // "selectableChanged"
QT_MOC_LITERAL(7, 93, 18), // "QCP::SelectionType"
QT_MOC_LITERAL(8, 112, 10), // "selectable"
QT_MOC_LITERAL(9, 123, 13), // "setSelectable"
QT_MOC_LITERAL(10, 137, 12), // "setSelection"
QT_MOC_LITERAL(11, 150, 4), // "name"
QT_MOC_LITERAL(12, 155, 15), // "antialiasedFill"
QT_MOC_LITERAL(13, 171, 19), // "antialiasedScatters"
QT_MOC_LITERAL(14, 191, 3), // "pen"
QT_MOC_LITERAL(15, 195, 5), // "brush"
QT_MOC_LITERAL(16, 201, 7), // "keyAxis"
QT_MOC_LITERAL(17, 209, 8), // "QCPAxis*"
QT_MOC_LITERAL(18, 218, 9), // "valueAxis"
QT_MOC_LITERAL(19, 228, 18), // "selectionDecorator"
QT_MOC_LITERAL(20, 247, 22) // "QCPSelectionDecorator*"
},
"QCPAbstractPlottable\0selectionChanged\0"
"\0selected\0QCPDataSelection\0selection\0"
"selectableChanged\0QCP::SelectionType\0"
"selectable\0setSelectable\0setSelection\0"
"name\0antialiasedFill\0antialiasedScatters\0"
"pen\0brush\0keyAxis\0QCPAxis*\0valueAxis\0"
"selectionDecorator\0QCPSelectionDecorator*"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAbstractPlottable[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
5, 14, // methods
10, 54, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
3, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 39, 2, 0x06 /* Public */,
1, 1, 42, 2, 0x06 /* Public */,
6, 1, 45, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
9, 1, 48, 2, 0x0a /* Public */,
10, 1, 51, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Bool, 3,
QMetaType::Void, 0x80000000 | 4, 5,
QMetaType::Void, 0x80000000 | 7, 8,
// slots: parameters
QMetaType::Void, 0x80000000 | 7, 8,
QMetaType::Void, 0x80000000 | 4, 5,
// properties: name, type, flags
11, QMetaType::QString, 0x00095103,
12, QMetaType::Bool, 0x00095103,
13, QMetaType::Bool, 0x00095103,
14, QMetaType::QPen, 0x00095103,
15, QMetaType::QBrush, 0x00095103,
16, 0x80000000 | 17, 0x0009510b,
18, 0x80000000 | 17, 0x0009510b,
8, 0x80000000 | 7, 0x0049510b,
5, 0x80000000 | 4, 0x0049510b,
19, 0x80000000 | 20, 0x0009510b,
// properties: notify_signal_id
0,
0,
0,
0,
0,
0,
0,
2,
0,
0,
0 // eod
};
void QCPAbstractPlottable::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPAbstractPlottable *_t = static_cast<QCPAbstractPlottable *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 1: _t->selectionChanged((*reinterpret_cast< const QCPDataSelection(*)>(_a[1]))); break;
case 2: _t->selectableChanged((*reinterpret_cast< QCP::SelectionType(*)>(_a[1]))); break;
case 3: _t->setSelectable((*reinterpret_cast< QCP::SelectionType(*)>(_a[1]))); break;
case 4: _t->setSelection((*reinterpret_cast< QCPDataSelection(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPDataSelection >(); break;
}
break;
case 2:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCP::SelectionType >(); break;
}
break;
case 3:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCP::SelectionType >(); break;
}
break;
case 4:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPDataSelection >(); break;
}
break;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPAbstractPlottable::*_t)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractPlottable::selectionChanged)) {
*result = 0;
return;
}
}
{
typedef void (QCPAbstractPlottable::*_t)(const QCPDataSelection & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractPlottable::selectionChanged)) {
*result = 1;
return;
}
}
{
typedef void (QCPAbstractPlottable::*_t)(QCP::SelectionType );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractPlottable::selectableChanged)) {
*result = 2;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 7:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCP::SelectionType >(); break;
case 6:
case 5:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis* >(); break;
case 8:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPDataSelection >(); break;
case 9:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPSelectionDecorator* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPAbstractPlottable *_t = static_cast<QCPAbstractPlottable *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QString*>(_v) = _t->name(); break;
case 1: *reinterpret_cast< bool*>(_v) = _t->antialiasedFill(); break;
case 2: *reinterpret_cast< bool*>(_v) = _t->antialiasedScatters(); break;
case 3: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 4: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 5: *reinterpret_cast< QCPAxis**>(_v) = _t->keyAxis(); break;
case 6: *reinterpret_cast< QCPAxis**>(_v) = _t->valueAxis(); break;
case 7: *reinterpret_cast< QCP::SelectionType*>(_v) = _t->selectable(); break;
case 8: *reinterpret_cast< QCPDataSelection*>(_v) = _t->selection(); break;
case 9: *reinterpret_cast< QCPSelectionDecorator**>(_v) = _t->selectionDecorator(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAbstractPlottable *_t = static_cast<QCPAbstractPlottable *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setName(*reinterpret_cast< QString*>(_v)); break;
case 1: _t->setAntialiasedFill(*reinterpret_cast< bool*>(_v)); break;
case 2: _t->setAntialiasedScatters(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 4: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 5: _t->setKeyAxis(*reinterpret_cast< QCPAxis**>(_v)); break;
case 6: _t->setValueAxis(*reinterpret_cast< QCPAxis**>(_v)); break;
case 7: _t->setSelectable(*reinterpret_cast< QCP::SelectionType*>(_v)); break;
case 8: _t->setSelection(*reinterpret_cast< QCPDataSelection*>(_v)); break;
case 9: _t->setSelectionDecorator(*reinterpret_cast< QCPSelectionDecorator**>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
static const QMetaObject * const qt_meta_extradata_QCPAbstractPlottable[] = {
&QCP::staticMetaObject,
nullptr
};
const QMetaObject QCPAbstractPlottable::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPAbstractPlottable.data,
qt_meta_data_QCPAbstractPlottable, qt_static_metacall, qt_meta_extradata_QCPAbstractPlottable, nullptr}
};
const QMetaObject *QCPAbstractPlottable::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAbstractPlottable::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAbstractPlottable.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPAbstractPlottable::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 5)
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 5)
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 10;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPAbstractPlottable::selectionChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPAbstractPlottable::selectionChanged(const QCPDataSelection & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCPAbstractPlottable::selectableChanged(QCP::SelectionType _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
struct qt_meta_stringdata_QCPItemAnchor_t {
QByteArrayData data[1];
char stringdata0[14];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemAnchor_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemAnchor_t qt_meta_stringdata_QCPItemAnchor = {
{
QT_MOC_LITERAL(0, 0, 13) // "QCPItemAnchor"
},
"QCPItemAnchor"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemAnchor[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
0 // eod
};
const QMetaObject QCPItemAnchor::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCPItemAnchor.data,
qt_meta_data_QCPItemAnchor, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPItemPosition_t {
QByteArrayData data[6];
char stringdata0[85];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemPosition_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemPosition_t qt_meta_stringdata_QCPItemPosition = {
{
QT_MOC_LITERAL(0, 0, 15), // "QCPItemPosition"
QT_MOC_LITERAL(1, 16, 12), // "PositionType"
QT_MOC_LITERAL(2, 29, 10), // "ptAbsolute"
QT_MOC_LITERAL(3, 40, 15), // "ptViewportRatio"
QT_MOC_LITERAL(4, 56, 15), // "ptAxisRectRatio"
QT_MOC_LITERAL(5, 72, 12) // "ptPlotCoords"
},
"QCPItemPosition\0PositionType\0ptAbsolute\0"
"ptViewportRatio\0ptAxisRectRatio\0"
"ptPlotCoords"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemPosition[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 4, 18,
// enum data: key, value
2, uint(QCPItemPosition::ptAbsolute),
3, uint(QCPItemPosition::ptViewportRatio),
4, uint(QCPItemPosition::ptAxisRectRatio),
5, uint(QCPItemPosition::ptPlotCoords),
0 // eod
};
const QMetaObject QCPItemPosition::staticMetaObject = {
{ &QCPItemAnchor::staticMetaObject, qt_meta_stringdata_QCPItemPosition.data,
qt_meta_data_QCPItemPosition, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPAbstractItem_t {
QByteArrayData data[11];
char stringdata0[139];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAbstractItem_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAbstractItem_t qt_meta_stringdata_QCPAbstractItem = {
{
QT_MOC_LITERAL(0, 0, 15), // "QCPAbstractItem"
QT_MOC_LITERAL(1, 16, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 33, 0), // ""
QT_MOC_LITERAL(3, 34, 8), // "selected"
QT_MOC_LITERAL(4, 43, 17), // "selectableChanged"
QT_MOC_LITERAL(5, 61, 10), // "selectable"
QT_MOC_LITERAL(6, 72, 13), // "setSelectable"
QT_MOC_LITERAL(7, 86, 11), // "setSelected"
QT_MOC_LITERAL(8, 98, 14), // "clipToAxisRect"
QT_MOC_LITERAL(9, 113, 12), // "clipAxisRect"
QT_MOC_LITERAL(10, 126, 12) // "QCPAxisRect*"
},
"QCPAbstractItem\0selectionChanged\0\0"
"selected\0selectableChanged\0selectable\0"
"setSelectable\0setSelected\0clipToAxisRect\0"
"clipAxisRect\0QCPAxisRect*"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAbstractItem[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
4, 46, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 34, 2, 0x06 /* Public */,
4, 1, 37, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
6, 1, 40, 2, 0x0a /* Public */,
7, 1, 43, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Bool, 3,
QMetaType::Void, QMetaType::Bool, 5,
// slots: parameters
QMetaType::Void, QMetaType::Bool, 5,
QMetaType::Void, QMetaType::Bool, 3,
// properties: name, type, flags
8, QMetaType::Bool, 0x00095103,
9, 0x80000000 | 10, 0x0009510b,
5, QMetaType::Bool, 0x00495103,
3, QMetaType::Bool, 0x00495103,
// properties: notify_signal_id
0,
0,
1,
0,
0 // eod
};
void QCPAbstractItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPAbstractItem *_t = static_cast<QCPAbstractItem *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 1: _t->selectableChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 2: _t->setSelectable((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 3: _t->setSelected((*reinterpret_cast< bool(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPAbstractItem::*_t)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractItem::selectionChanged)) {
*result = 0;
return;
}
}
{
typedef void (QCPAbstractItem::*_t)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractItem::selectableChanged)) {
*result = 1;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxisRect* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPAbstractItem *_t = static_cast<QCPAbstractItem *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< bool*>(_v) = _t->clipToAxisRect(); break;
case 1: *reinterpret_cast< QCPAxisRect**>(_v) = _t->clipAxisRect(); break;
case 2: *reinterpret_cast< bool*>(_v) = _t->selectable(); break;
case 3: *reinterpret_cast< bool*>(_v) = _t->selected(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAbstractItem *_t = static_cast<QCPAbstractItem *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setClipToAxisRect(*reinterpret_cast< bool*>(_v)); break;
case 1: _t->setClipAxisRect(*reinterpret_cast< QCPAxisRect**>(_v)); break;
case 2: _t->setSelectable(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setSelected(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
const QMetaObject QCPAbstractItem::staticMetaObject = {
{ &QCPLayerable::staticMetaObject, qt_meta_stringdata_QCPAbstractItem.data,
qt_meta_data_QCPAbstractItem, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPAbstractItem::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAbstractItem::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAbstractItem.stringdata0))
return static_cast<void*>(this);
return QCPLayerable::qt_metacast(_clname);
}
int QCPAbstractItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayerable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPAbstractItem::selectionChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPAbstractItem::selectableChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
struct qt_meta_stringdata_QCustomPlot_t {
QByteArrayData data[64];
char stringdata0[914];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCustomPlot_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCustomPlot_t qt_meta_stringdata_QCustomPlot = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCustomPlot"
QT_MOC_LITERAL(1, 12, 16), // "mouseDoubleClick"
QT_MOC_LITERAL(2, 29, 0), // ""
QT_MOC_LITERAL(3, 30, 12), // "QMouseEvent*"
QT_MOC_LITERAL(4, 43, 5), // "event"
QT_MOC_LITERAL(5, 49, 10), // "mousePress"
QT_MOC_LITERAL(6, 60, 9), // "mouseMove"
QT_MOC_LITERAL(7, 70, 12), // "mouseRelease"
QT_MOC_LITERAL(8, 83, 10), // "mouseWheel"
QT_MOC_LITERAL(9, 94, 12), // "QWheelEvent*"
QT_MOC_LITERAL(10, 107, 14), // "plottableClick"
QT_MOC_LITERAL(11, 122, 21), // "QCPAbstractPlottable*"
QT_MOC_LITERAL(12, 144, 9), // "plottable"
QT_MOC_LITERAL(13, 154, 9), // "dataIndex"
QT_MOC_LITERAL(14, 164, 20), // "plottableDoubleClick"
QT_MOC_LITERAL(15, 185, 9), // "itemClick"
QT_MOC_LITERAL(16, 195, 16), // "QCPAbstractItem*"
QT_MOC_LITERAL(17, 212, 4), // "item"
QT_MOC_LITERAL(18, 217, 15), // "itemDoubleClick"
QT_MOC_LITERAL(19, 233, 9), // "axisClick"
QT_MOC_LITERAL(20, 243, 8), // "QCPAxis*"
QT_MOC_LITERAL(21, 252, 4), // "axis"
QT_MOC_LITERAL(22, 257, 23), // "QCPAxis::SelectablePart"
QT_MOC_LITERAL(23, 281, 4), // "part"
QT_MOC_LITERAL(24, 286, 15), // "axisDoubleClick"
QT_MOC_LITERAL(25, 302, 11), // "legendClick"
QT_MOC_LITERAL(26, 314, 10), // "QCPLegend*"
QT_MOC_LITERAL(27, 325, 6), // "legend"
QT_MOC_LITERAL(28, 332, 22), // "QCPAbstractLegendItem*"
QT_MOC_LITERAL(29, 355, 17), // "legendDoubleClick"
QT_MOC_LITERAL(30, 373, 22), // "selectionChangedByUser"
QT_MOC_LITERAL(31, 396, 12), // "beforeReplot"
QT_MOC_LITERAL(32, 409, 11), // "afterReplot"
QT_MOC_LITERAL(33, 421, 11), // "rescaleAxes"
QT_MOC_LITERAL(34, 433, 21), // "onlyVisiblePlottables"
QT_MOC_LITERAL(35, 455, 11), // "deselectAll"
QT_MOC_LITERAL(36, 467, 6), // "replot"
QT_MOC_LITERAL(37, 474, 28), // "QCustomPlot::RefreshPriority"
QT_MOC_LITERAL(38, 503, 15), // "refreshPriority"
QT_MOC_LITERAL(39, 519, 20), // "processRectSelection"
QT_MOC_LITERAL(40, 540, 4), // "rect"
QT_MOC_LITERAL(41, 545, 15), // "processRectZoom"
QT_MOC_LITERAL(42, 561, 21), // "processPointSelection"
QT_MOC_LITERAL(43, 583, 8), // "viewport"
QT_MOC_LITERAL(44, 592, 10), // "background"
QT_MOC_LITERAL(45, 603, 16), // "backgroundScaled"
QT_MOC_LITERAL(46, 620, 20), // "backgroundScaledMode"
QT_MOC_LITERAL(47, 641, 19), // "Qt::AspectRatioMode"
QT_MOC_LITERAL(48, 661, 10), // "plotLayout"
QT_MOC_LITERAL(49, 672, 14), // "QCPLayoutGrid*"
QT_MOC_LITERAL(50, 687, 24), // "autoAddPlottableToLegend"
QT_MOC_LITERAL(51, 712, 18), // "selectionTolerance"
QT_MOC_LITERAL(52, 731, 20), // "noAntialiasingOnDrag"
QT_MOC_LITERAL(53, 752, 19), // "multiSelectModifier"
QT_MOC_LITERAL(54, 772, 20), // "Qt::KeyboardModifier"
QT_MOC_LITERAL(55, 793, 6), // "openGl"
QT_MOC_LITERAL(56, 800, 15), // "LayerInsertMode"
QT_MOC_LITERAL(57, 816, 8), // "limBelow"
QT_MOC_LITERAL(58, 825, 8), // "limAbove"
QT_MOC_LITERAL(59, 834, 15), // "RefreshPriority"
QT_MOC_LITERAL(60, 850, 18), // "rpImmediateRefresh"
QT_MOC_LITERAL(61, 869, 15), // "rpQueuedRefresh"
QT_MOC_LITERAL(62, 885, 13), // "rpRefreshHint"
QT_MOC_LITERAL(63, 899, 14) // "rpQueuedReplot"
},
"QCustomPlot\0mouseDoubleClick\0\0"
"QMouseEvent*\0event\0mousePress\0mouseMove\0"
"mouseRelease\0mouseWheel\0QWheelEvent*\0"
"plottableClick\0QCPAbstractPlottable*\0"
"plottable\0dataIndex\0plottableDoubleClick\0"
"itemClick\0QCPAbstractItem*\0item\0"
"itemDoubleClick\0axisClick\0QCPAxis*\0"
"axis\0QCPAxis::SelectablePart\0part\0"
"axisDoubleClick\0legendClick\0QCPLegend*\0"
"legend\0QCPAbstractLegendItem*\0"
"legendDoubleClick\0selectionChangedByUser\0"
"beforeReplot\0afterReplot\0rescaleAxes\0"
"onlyVisiblePlottables\0deselectAll\0"
"replot\0QCustomPlot::RefreshPriority\0"
"refreshPriority\0processRectSelection\0"
"rect\0processRectZoom\0processPointSelection\0"
"viewport\0background\0backgroundScaled\0"
"backgroundScaledMode\0Qt::AspectRatioMode\0"
"plotLayout\0QCPLayoutGrid*\0"
"autoAddPlottableToLegend\0selectionTolerance\0"
"noAntialiasingOnDrag\0multiSelectModifier\0"
"Qt::KeyboardModifier\0openGl\0LayerInsertMode\0"
"limBelow\0limAbove\0RefreshPriority\0"
"rpImmediateRefresh\0rpQueuedRefresh\0"
"rpRefreshHint\0rpQueuedReplot"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCustomPlot[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
24, 14, // methods
10, 226, // properties
2, 256, // enums/sets
0, 0, // constructors
0, // flags
16, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 134, 2, 0x06 /* Public */,
5, 1, 137, 2, 0x06 /* Public */,
6, 1, 140, 2, 0x06 /* Public */,
7, 1, 143, 2, 0x06 /* Public */,
8, 1, 146, 2, 0x06 /* Public */,
10, 3, 149, 2, 0x06 /* Public */,
14, 3, 156, 2, 0x06 /* Public */,
15, 2, 163, 2, 0x06 /* Public */,
18, 2, 168, 2, 0x06 /* Public */,
19, 3, 173, 2, 0x06 /* Public */,
24, 3, 180, 2, 0x06 /* Public */,
25, 3, 187, 2, 0x06 /* Public */,
29, 3, 194, 2, 0x06 /* Public */,
30, 0, 201, 2, 0x06 /* Public */,
31, 0, 202, 2, 0x06 /* Public */,
32, 0, 203, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
33, 1, 204, 2, 0x0a /* Public */,
33, 0, 207, 2, 0x2a /* Public | MethodCloned */,
35, 0, 208, 2, 0x0a /* Public */,
36, 1, 209, 2, 0x0a /* Public */,
36, 0, 212, 2, 0x2a /* Public | MethodCloned */,
39, 2, 213, 2, 0x09 /* Protected */,
41, 2, 218, 2, 0x09 /* Protected */,
42, 1, 223, 2, 0x09 /* Protected */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 9, 4,
QMetaType::Void, 0x80000000 | 11, QMetaType::Int, 0x80000000 | 3, 12, 13, 4,
QMetaType::Void, 0x80000000 | 11, QMetaType::Int, 0x80000000 | 3, 12, 13, 4,
QMetaType::Void, 0x80000000 | 16, 0x80000000 | 3, 17, 4,
QMetaType::Void, 0x80000000 | 16, 0x80000000 | 3, 17, 4,
QMetaType::Void, 0x80000000 | 20, 0x80000000 | 22, 0x80000000 | 3, 21, 23, 4,
QMetaType::Void, 0x80000000 | 20, 0x80000000 | 22, 0x80000000 | 3, 21, 23, 4,
QMetaType::Void, 0x80000000 | 26, 0x80000000 | 28, 0x80000000 | 3, 27, 17, 4,
QMetaType::Void, 0x80000000 | 26, 0x80000000 | 28, 0x80000000 | 3, 27, 17, 4,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
// slots: parameters
QMetaType::Void, QMetaType::Bool, 34,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void, 0x80000000 | 37, 38,
QMetaType::Void,
QMetaType::Void, QMetaType::QRect, 0x80000000 | 3, 40, 4,
QMetaType::Void, QMetaType::QRect, 0x80000000 | 3, 40, 4,
QMetaType::Void, 0x80000000 | 3, 4,
// properties: name, type, flags
43, QMetaType::QRect, 0x00095103,
44, QMetaType::QPixmap, 0x00095103,
45, QMetaType::Bool, 0x00095103,
46, 0x80000000 | 47, 0x0009510b,
48, 0x80000000 | 49, 0x00095009,
50, QMetaType::Bool, 0x00095103,
51, QMetaType::Int, 0x00095103,
52, QMetaType::Bool, 0x00095103,
53, 0x80000000 | 54, 0x0009510b,
55, QMetaType::Bool, 0x00095103,
// enums: name, flags, count, data
56, 0x0, 2, 264,
59, 0x0, 4, 268,
// enum data: key, value
57, uint(QCustomPlot::limBelow),
58, uint(QCustomPlot::limAbove),
60, uint(QCustomPlot::rpImmediateRefresh),
61, uint(QCustomPlot::rpQueuedRefresh),
62, uint(QCustomPlot::rpRefreshHint),
63, uint(QCustomPlot::rpQueuedReplot),
0 // eod
};
void QCustomPlot::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCustomPlot *_t = static_cast<QCustomPlot *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->mouseDoubleClick((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 1: _t->mousePress((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 2: _t->mouseMove((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 3: _t->mouseRelease((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 4: _t->mouseWheel((*reinterpret_cast< QWheelEvent*(*)>(_a[1]))); break;
case 5: _t->plottableClick((*reinterpret_cast< QCPAbstractPlottable*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 6: _t->plottableDoubleClick((*reinterpret_cast< QCPAbstractPlottable*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 7: _t->itemClick((*reinterpret_cast< QCPAbstractItem*(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 8: _t->itemDoubleClick((*reinterpret_cast< QCPAbstractItem*(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 9: _t->axisClick((*reinterpret_cast< QCPAxis*(*)>(_a[1])),(*reinterpret_cast< QCPAxis::SelectablePart(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 10: _t->axisDoubleClick((*reinterpret_cast< QCPAxis*(*)>(_a[1])),(*reinterpret_cast< QCPAxis::SelectablePart(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 11: _t->legendClick((*reinterpret_cast< QCPLegend*(*)>(_a[1])),(*reinterpret_cast< QCPAbstractLegendItem*(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 12: _t->legendDoubleClick((*reinterpret_cast< QCPLegend*(*)>(_a[1])),(*reinterpret_cast< QCPAbstractLegendItem*(*)>(_a[2])),(*reinterpret_cast< QMouseEvent*(*)>(_a[3]))); break;
case 13: _t->selectionChangedByUser(); break;
case 14: _t->beforeReplot(); break;
case 15: _t->afterReplot(); break;
case 16: _t->rescaleAxes((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 17: _t->rescaleAxes(); break;
case 18: _t->deselectAll(); break;
case 19: _t->replot((*reinterpret_cast< QCustomPlot::RefreshPriority(*)>(_a[1]))); break;
case 20: _t->replot(); break;
case 21: _t->processRectSelection((*reinterpret_cast< QRect(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 22: _t->processRectZoom((*reinterpret_cast< QRect(*)>(_a[1])),(*reinterpret_cast< QMouseEvent*(*)>(_a[2]))); break;
case 23: _t->processPointSelection((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 5:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractPlottable* >(); break;
}
break;
case 6:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractPlottable* >(); break;
}
break;
case 7:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractItem* >(); break;
}
break;
case 8:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractItem* >(); break;
}
break;
case 9:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis* >(); break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::SelectablePart >(); break;
}
break;
case 10:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis* >(); break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::SelectablePart >(); break;
}
break;
case 11:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractLegendItem* >(); break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLegend* >(); break;
}
break;
case 12:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractLegendItem* >(); break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLegend* >(); break;
}
break;
case 19:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCustomPlot::RefreshPriority >(); break;
}
break;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCustomPlot::*_t)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mouseDoubleClick)) {
*result = 0;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mousePress)) {
*result = 1;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mouseMove)) {
*result = 2;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mouseRelease)) {
*result = 3;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QWheelEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::mouseWheel)) {
*result = 4;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QCPAbstractPlottable * , int , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::plottableClick)) {
*result = 5;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QCPAbstractPlottable * , int , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::plottableDoubleClick)) {
*result = 6;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QCPAbstractItem * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::itemClick)) {
*result = 7;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QCPAbstractItem * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::itemDoubleClick)) {
*result = 8;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QCPAxis * , QCPAxis::SelectablePart , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::axisClick)) {
*result = 9;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QCPAxis * , QCPAxis::SelectablePart , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::axisDoubleClick)) {
*result = 10;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QCPLegend * , QCPAbstractLegendItem * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::legendClick)) {
*result = 11;
return;
}
}
{
typedef void (QCustomPlot::*_t)(QCPLegend * , QCPAbstractLegendItem * , QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::legendDoubleClick)) {
*result = 12;
return;
}
}
{
typedef void (QCustomPlot::*_t)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::selectionChangedByUser)) {
*result = 13;
return;
}
}
{
typedef void (QCustomPlot::*_t)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::beforeReplot)) {
*result = 14;
return;
}
}
{
typedef void (QCustomPlot::*_t)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCustomPlot::afterReplot)) {
*result = 15;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 4:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLayoutGrid* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCustomPlot *_t = static_cast<QCustomPlot *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QRect*>(_v) = _t->viewport(); break;
case 1: *reinterpret_cast< QPixmap*>(_v) = _t->background(); break;
case 2: *reinterpret_cast< bool*>(_v) = _t->backgroundScaled(); break;
case 3: *reinterpret_cast< Qt::AspectRatioMode*>(_v) = _t->backgroundScaledMode(); break;
case 4: *reinterpret_cast< QCPLayoutGrid**>(_v) = _t->plotLayout(); break;
case 5: *reinterpret_cast< bool*>(_v) = _t->autoAddPlottableToLegend(); break;
case 6: *reinterpret_cast< int*>(_v) = _t->selectionTolerance(); break;
case 7: *reinterpret_cast< bool*>(_v) = _t->noAntialiasingOnDrag(); break;
case 8: *reinterpret_cast< Qt::KeyboardModifier*>(_v) = _t->multiSelectModifier(); break;
case 9: *reinterpret_cast< bool*>(_v) = _t->openGl(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCustomPlot *_t = static_cast<QCustomPlot *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setViewport(*reinterpret_cast< QRect*>(_v)); break;
case 1: _t->setBackground(*reinterpret_cast< QPixmap*>(_v)); break;
case 2: _t->setBackgroundScaled(*reinterpret_cast< bool*>(_v)); break;
case 3: _t->setBackgroundScaledMode(*reinterpret_cast< Qt::AspectRatioMode*>(_v)); break;
case 5: _t->setAutoAddPlottableToLegend(*reinterpret_cast< bool*>(_v)); break;
case 6: _t->setSelectionTolerance(*reinterpret_cast< int*>(_v)); break;
case 7: _t->setNoAntialiasingOnDrag(*reinterpret_cast< bool*>(_v)); break;
case 8: _t->setMultiSelectModifier(*reinterpret_cast< Qt::KeyboardModifier*>(_v)); break;
case 9: _t->setOpenGl(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
const QMetaObject QCustomPlot::staticMetaObject = {
{ &QWidget::staticMetaObject, qt_meta_stringdata_QCustomPlot.data,
qt_meta_data_QCustomPlot, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCustomPlot::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCustomPlot::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCustomPlot.stringdata0))
return static_cast<void*>(this);
return QWidget::qt_metacast(_clname);
}
int QCustomPlot::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 24)
qt_static_metacall(this, _c, _id, _a);
_id -= 24;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 24)
qt_static_metacall(this, _c, _id, _a);
_id -= 24;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 10;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 10;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCustomPlot::mouseDoubleClick(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCustomPlot::mousePress(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCustomPlot::mouseMove(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
// SIGNAL 3
void QCustomPlot::mouseRelease(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 3, _a);
}
// SIGNAL 4
void QCustomPlot::mouseWheel(QWheelEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 4, _a);
}
// SIGNAL 5
void QCustomPlot::plottableClick(QCPAbstractPlottable * _t1, int _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 5, _a);
}
// SIGNAL 6
void QCustomPlot::plottableDoubleClick(QCPAbstractPlottable * _t1, int _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 6, _a);
}
// SIGNAL 7
void QCustomPlot::itemClick(QCPAbstractItem * _t1, QMouseEvent * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 7, _a);
}
// SIGNAL 8
void QCustomPlot::itemDoubleClick(QCPAbstractItem * _t1, QMouseEvent * _t2)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 8, _a);
}
// SIGNAL 9
void QCustomPlot::axisClick(QCPAxis * _t1, QCPAxis::SelectablePart _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 9, _a);
}
// SIGNAL 10
void QCustomPlot::axisDoubleClick(QCPAxis * _t1, QCPAxis::SelectablePart _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 10, _a);
}
// SIGNAL 11
void QCustomPlot::legendClick(QCPLegend * _t1, QCPAbstractLegendItem * _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 11, _a);
}
// SIGNAL 12
void QCustomPlot::legendDoubleClick(QCPLegend * _t1, QCPAbstractLegendItem * _t2, QMouseEvent * _t3)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)), const_cast<void*>(reinterpret_cast<const void*>(&_t3)) };
QMetaObject::activate(this, &staticMetaObject, 12, _a);
}
// SIGNAL 13
void QCustomPlot::selectionChangedByUser()
{
QMetaObject::activate(this, &staticMetaObject, 13, nullptr);
}
// SIGNAL 14
void QCustomPlot::beforeReplot()
{
QMetaObject::activate(this, &staticMetaObject, 14, nullptr);
}
// SIGNAL 15
void QCustomPlot::afterReplot()
{
QMetaObject::activate(this, &staticMetaObject, 15, nullptr);
}
struct qt_meta_stringdata_QCPColorGradient_t {
QByteArrayData data[17];
char stringdata0[164];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPColorGradient_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPColorGradient_t qt_meta_stringdata_QCPColorGradient = {
{
QT_MOC_LITERAL(0, 0, 16), // "QCPColorGradient"
QT_MOC_LITERAL(1, 17, 18), // "ColorInterpolation"
QT_MOC_LITERAL(2, 36, 5), // "ciRGB"
QT_MOC_LITERAL(3, 42, 5), // "ciHSV"
QT_MOC_LITERAL(4, 48, 14), // "GradientPreset"
QT_MOC_LITERAL(5, 63, 11), // "gpGrayscale"
QT_MOC_LITERAL(6, 75, 5), // "gpHot"
QT_MOC_LITERAL(7, 81, 6), // "gpCold"
QT_MOC_LITERAL(8, 88, 7), // "gpNight"
QT_MOC_LITERAL(9, 96, 7), // "gpCandy"
QT_MOC_LITERAL(10, 104, 11), // "gpGeography"
QT_MOC_LITERAL(11, 116, 5), // "gpIon"
QT_MOC_LITERAL(12, 122, 9), // "gpThermal"
QT_MOC_LITERAL(13, 132, 7), // "gpPolar"
QT_MOC_LITERAL(14, 140, 10), // "gpSpectrum"
QT_MOC_LITERAL(15, 151, 5), // "gpJet"
QT_MOC_LITERAL(16, 157, 6) // "gpHues"
},
"QCPColorGradient\0ColorInterpolation\0"
"ciRGB\0ciHSV\0GradientPreset\0gpGrayscale\0"
"gpHot\0gpCold\0gpNight\0gpCandy\0gpGeography\0"
"gpIon\0gpThermal\0gpPolar\0gpSpectrum\0"
"gpJet\0gpHues"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPColorGradient[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
2, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 2, 22,
4, 0x0, 12, 26,
// enum data: key, value
2, uint(QCPColorGradient::ciRGB),
3, uint(QCPColorGradient::ciHSV),
5, uint(QCPColorGradient::gpGrayscale),
6, uint(QCPColorGradient::gpHot),
7, uint(QCPColorGradient::gpCold),
8, uint(QCPColorGradient::gpNight),
9, uint(QCPColorGradient::gpCandy),
10, uint(QCPColorGradient::gpGeography),
11, uint(QCPColorGradient::gpIon),
12, uint(QCPColorGradient::gpThermal),
13, uint(QCPColorGradient::gpPolar),
14, uint(QCPColorGradient::gpSpectrum),
15, uint(QCPColorGradient::gpJet),
16, uint(QCPColorGradient::gpHues),
0 // eod
};
const QMetaObject QCPColorGradient::staticMetaObject = {
{ nullptr, qt_meta_stringdata_QCPColorGradient.data,
qt_meta_data_QCPColorGradient, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPSelectionDecoratorBracket_t {
QByteArrayData data[7];
char stringdata0[101];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPSelectionDecoratorBracket_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPSelectionDecoratorBracket_t qt_meta_stringdata_QCPSelectionDecoratorBracket = {
{
QT_MOC_LITERAL(0, 0, 28), // "QCPSelectionDecoratorBracket"
QT_MOC_LITERAL(1, 29, 12), // "BracketStyle"
QT_MOC_LITERAL(2, 42, 15), // "bsSquareBracket"
QT_MOC_LITERAL(3, 58, 13), // "bsHalfEllipse"
QT_MOC_LITERAL(4, 72, 9), // "bsEllipse"
QT_MOC_LITERAL(5, 82, 6), // "bsPlus"
QT_MOC_LITERAL(6, 89, 11) // "bsUserStyle"
},
"QCPSelectionDecoratorBracket\0BracketStyle\0"
"bsSquareBracket\0bsHalfEllipse\0bsEllipse\0"
"bsPlus\0bsUserStyle"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPSelectionDecoratorBracket[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
1, 14, // enums/sets
0, 0, // constructors
4, // flags
0, // signalCount
// enums: name, flags, count, data
1, 0x0, 5, 18,
// enum data: key, value
2, uint(QCPSelectionDecoratorBracket::bsSquareBracket),
3, uint(QCPSelectionDecoratorBracket::bsHalfEllipse),
4, uint(QCPSelectionDecoratorBracket::bsEllipse),
5, uint(QCPSelectionDecoratorBracket::bsPlus),
6, uint(QCPSelectionDecoratorBracket::bsUserStyle),
0 // eod
};
const QMetaObject QCPSelectionDecoratorBracket::staticMetaObject = {
{ &QCPSelectionDecorator::staticMetaObject, qt_meta_stringdata_QCPSelectionDecoratorBracket.data,
qt_meta_data_QCPSelectionDecoratorBracket, nullptr, nullptr, nullptr}
};
struct qt_meta_stringdata_QCPAxisRect_t {
QByteArrayData data[8];
char stringdata0[118];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAxisRect_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAxisRect_t qt_meta_stringdata_QCPAxisRect = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPAxisRect"
QT_MOC_LITERAL(1, 12, 10), // "background"
QT_MOC_LITERAL(2, 23, 16), // "backgroundScaled"
QT_MOC_LITERAL(3, 40, 20), // "backgroundScaledMode"
QT_MOC_LITERAL(4, 61, 19), // "Qt::AspectRatioMode"
QT_MOC_LITERAL(5, 81, 9), // "rangeDrag"
QT_MOC_LITERAL(6, 91, 16), // "Qt::Orientations"
QT_MOC_LITERAL(7, 108, 9) // "rangeZoom"
},
"QCPAxisRect\0background\0backgroundScaled\0"
"backgroundScaledMode\0Qt::AspectRatioMode\0"
"rangeDrag\0Qt::Orientations\0rangeZoom"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAxisRect[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
5, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPixmap, 0x00095103,
2, QMetaType::Bool, 0x00095103,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 6, 0x0009510b,
7, 0x80000000 | 6, 0x0009510b,
0 // eod
};
void QCPAxisRect::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPAxisRect *_t = static_cast<QCPAxisRect *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPixmap*>(_v) = _t->background(); break;
case 1: *reinterpret_cast< bool*>(_v) = _t->backgroundScaled(); break;
case 2: *reinterpret_cast< Qt::AspectRatioMode*>(_v) = _t->backgroundScaledMode(); break;
case 3: *reinterpret_cast< Qt::Orientations*>(_v) = _t->rangeDrag(); break;
case 4: *reinterpret_cast< Qt::Orientations*>(_v) = _t->rangeZoom(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAxisRect *_t = static_cast<QCPAxisRect *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setBackground(*reinterpret_cast< QPixmap*>(_v)); break;
case 1: _t->setBackgroundScaled(*reinterpret_cast< bool*>(_v)); break;
case 2: _t->setBackgroundScaledMode(*reinterpret_cast< Qt::AspectRatioMode*>(_v)); break;
case 3: _t->setRangeDrag(*reinterpret_cast< Qt::Orientations*>(_v)); break;
case 4: _t->setRangeZoom(*reinterpret_cast< Qt::Orientations*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPAxisRect::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPAxisRect.data,
qt_meta_data_QCPAxisRect, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPAxisRect::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAxisRect::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAxisRect.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPAxisRect::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 5;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPAbstractLegendItem_t {
QByteArrayData data[14];
char stringdata0[174];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPAbstractLegendItem_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPAbstractLegendItem_t qt_meta_stringdata_QCPAbstractLegendItem = {
{
QT_MOC_LITERAL(0, 0, 21), // "QCPAbstractLegendItem"
QT_MOC_LITERAL(1, 22, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 39, 0), // ""
QT_MOC_LITERAL(3, 40, 8), // "selected"
QT_MOC_LITERAL(4, 49, 17), // "selectableChanged"
QT_MOC_LITERAL(5, 67, 10), // "selectable"
QT_MOC_LITERAL(6, 78, 13), // "setSelectable"
QT_MOC_LITERAL(7, 92, 11), // "setSelected"
QT_MOC_LITERAL(8, 104, 12), // "parentLegend"
QT_MOC_LITERAL(9, 117, 10), // "QCPLegend*"
QT_MOC_LITERAL(10, 128, 4), // "font"
QT_MOC_LITERAL(11, 133, 9), // "textColor"
QT_MOC_LITERAL(12, 143, 12), // "selectedFont"
QT_MOC_LITERAL(13, 156, 17) // "selectedTextColor"
},
"QCPAbstractLegendItem\0selectionChanged\0"
"\0selected\0selectableChanged\0selectable\0"
"setSelectable\0setSelected\0parentLegend\0"
"QCPLegend*\0font\0textColor\0selectedFont\0"
"selectedTextColor"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPAbstractLegendItem[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
7, 46, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 34, 2, 0x06 /* Public */,
4, 1, 37, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
6, 1, 40, 2, 0x0a /* Public */,
7, 1, 43, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Bool, 3,
QMetaType::Void, QMetaType::Bool, 5,
// slots: parameters
QMetaType::Void, QMetaType::Bool, 5,
QMetaType::Void, QMetaType::Bool, 3,
// properties: name, type, flags
8, 0x80000000 | 9, 0x00095009,
10, QMetaType::QFont, 0x00095103,
11, QMetaType::QColor, 0x00095103,
12, QMetaType::QFont, 0x00095103,
13, QMetaType::QColor, 0x00095103,
5, QMetaType::Bool, 0x00495103,
3, QMetaType::Bool, 0x00495103,
// properties: notify_signal_id
0,
0,
0,
0,
0,
0,
1,
0 // eod
};
void QCPAbstractLegendItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPAbstractLegendItem *_t = static_cast<QCPAbstractLegendItem *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 1: _t->selectableChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 2: _t->setSelectable((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 3: _t->setSelected((*reinterpret_cast< bool(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPAbstractLegendItem::*_t)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractLegendItem::selectionChanged)) {
*result = 0;
return;
}
}
{
typedef void (QCPAbstractLegendItem::*_t)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPAbstractLegendItem::selectableChanged)) {
*result = 1;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPLegend* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPAbstractLegendItem *_t = static_cast<QCPAbstractLegendItem *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPLegend**>(_v) = _t->parentLegend(); break;
case 1: *reinterpret_cast< QFont*>(_v) = _t->font(); break;
case 2: *reinterpret_cast< QColor*>(_v) = _t->textColor(); break;
case 3: *reinterpret_cast< QFont*>(_v) = _t->selectedFont(); break;
case 4: *reinterpret_cast< QColor*>(_v) = _t->selectedTextColor(); break;
case 5: *reinterpret_cast< bool*>(_v) = _t->selectable(); break;
case 6: *reinterpret_cast< bool*>(_v) = _t->selected(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPAbstractLegendItem *_t = static_cast<QCPAbstractLegendItem *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 1: _t->setFont(*reinterpret_cast< QFont*>(_v)); break;
case 2: _t->setTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 3: _t->setSelectedFont(*reinterpret_cast< QFont*>(_v)); break;
case 4: _t->setSelectedTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 5: _t->setSelectable(*reinterpret_cast< bool*>(_v)); break;
case 6: _t->setSelected(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
const QMetaObject QCPAbstractLegendItem::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPAbstractLegendItem.data,
qt_meta_data_QCPAbstractLegendItem, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPAbstractLegendItem::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPAbstractLegendItem::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPAbstractLegendItem.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPAbstractLegendItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPAbstractLegendItem::selectionChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPAbstractLegendItem::selectableChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
struct qt_meta_stringdata_QCPPlottableLegendItem_t {
QByteArrayData data[1];
char stringdata0[23];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPPlottableLegendItem_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPPlottableLegendItem_t qt_meta_stringdata_QCPPlottableLegendItem = {
{
QT_MOC_LITERAL(0, 0, 22) // "QCPPlottableLegendItem"
},
"QCPPlottableLegendItem"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPPlottableLegendItem[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
void QCPPlottableLegendItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPPlottableLegendItem::staticMetaObject = {
{ &QCPAbstractLegendItem::staticMetaObject, qt_meta_stringdata_QCPPlottableLegendItem.data,
qt_meta_data_QCPPlottableLegendItem, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPPlottableLegendItem::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPPlottableLegendItem::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPPlottableLegendItem.stringdata0))
return static_cast<void*>(this);
return QCPAbstractLegendItem::qt_metacast(_clname);
}
int QCPPlottableLegendItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractLegendItem::qt_metacall(_c, _id, _a);
return _id;
}
struct qt_meta_stringdata_QCPLegend_t {
QByteArrayData data[27];
char stringdata0[358];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPLegend_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPLegend_t qt_meta_stringdata_QCPLegend = {
{
QT_MOC_LITERAL(0, 0, 9), // "QCPLegend"
QT_MOC_LITERAL(1, 10, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 27, 0), // ""
QT_MOC_LITERAL(3, 28, 26), // "QCPLegend::SelectableParts"
QT_MOC_LITERAL(4, 55, 5), // "parts"
QT_MOC_LITERAL(5, 61, 17), // "selectableChanged"
QT_MOC_LITERAL(6, 79, 18), // "setSelectableParts"
QT_MOC_LITERAL(7, 98, 15), // "SelectableParts"
QT_MOC_LITERAL(8, 114, 15), // "selectableParts"
QT_MOC_LITERAL(9, 130, 16), // "setSelectedParts"
QT_MOC_LITERAL(10, 147, 13), // "selectedParts"
QT_MOC_LITERAL(11, 161, 9), // "borderPen"
QT_MOC_LITERAL(12, 171, 5), // "brush"
QT_MOC_LITERAL(13, 177, 4), // "font"
QT_MOC_LITERAL(14, 182, 9), // "textColor"
QT_MOC_LITERAL(15, 192, 8), // "iconSize"
QT_MOC_LITERAL(16, 201, 15), // "iconTextPadding"
QT_MOC_LITERAL(17, 217, 13), // "iconBorderPen"
QT_MOC_LITERAL(18, 231, 17), // "selectedBorderPen"
QT_MOC_LITERAL(19, 249, 21), // "selectedIconBorderPen"
QT_MOC_LITERAL(20, 271, 13), // "selectedBrush"
QT_MOC_LITERAL(21, 285, 12), // "selectedFont"
QT_MOC_LITERAL(22, 298, 17), // "selectedTextColor"
QT_MOC_LITERAL(23, 316, 14), // "SelectablePart"
QT_MOC_LITERAL(24, 331, 6), // "spNone"
QT_MOC_LITERAL(25, 338, 11), // "spLegendBox"
QT_MOC_LITERAL(26, 350, 7) // "spItems"
},
"QCPLegend\0selectionChanged\0\0"
"QCPLegend::SelectableParts\0parts\0"
"selectableChanged\0setSelectableParts\0"
"SelectableParts\0selectableParts\0"
"setSelectedParts\0selectedParts\0borderPen\0"
"brush\0font\0textColor\0iconSize\0"
"iconTextPadding\0iconBorderPen\0"
"selectedBorderPen\0selectedIconBorderPen\0"
"selectedBrush\0selectedFont\0selectedTextColor\0"
"SelectablePart\0spNone\0spLegendBox\0"
"spItems"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPLegend[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
14, 46, // properties
2, 102, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 34, 2, 0x06 /* Public */,
5, 1, 37, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
6, 1, 40, 2, 0x0a /* Public */,
9, 1, 43, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 4,
// slots: parameters
QMetaType::Void, 0x80000000 | 7, 8,
QMetaType::Void, 0x80000000 | 7, 10,
// properties: name, type, flags
11, QMetaType::QPen, 0x00095103,
12, QMetaType::QBrush, 0x00095103,
13, QMetaType::QFont, 0x00095103,
14, QMetaType::QColor, 0x00095103,
15, QMetaType::QSize, 0x00095103,
16, QMetaType::Int, 0x00095103,
17, QMetaType::QPen, 0x00095103,
8, 0x80000000 | 7, 0x0049510b,
10, 0x80000000 | 7, 0x0049510b,
18, QMetaType::QPen, 0x00095103,
19, QMetaType::QPen, 0x00095103,
20, QMetaType::QBrush, 0x00095103,
21, QMetaType::QFont, 0x00095103,
22, QMetaType::QColor, 0x00095103,
// properties: notify_signal_id
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
// enums: name, flags, count, data
23, 0x0, 3, 110,
7, 0x1, 3, 116,
// enum data: key, value
24, uint(QCPLegend::spNone),
25, uint(QCPLegend::spLegendBox),
26, uint(QCPLegend::spItems),
24, uint(QCPLegend::spNone),
25, uint(QCPLegend::spLegendBox),
26, uint(QCPLegend::spItems),
0 // eod
};
void QCPLegend::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPLegend *_t = static_cast<QCPLegend *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< QCPLegend::SelectableParts(*)>(_a[1]))); break;
case 1: _t->selectableChanged((*reinterpret_cast< QCPLegend::SelectableParts(*)>(_a[1]))); break;
case 2: _t->setSelectableParts((*reinterpret_cast< const SelectableParts(*)>(_a[1]))); break;
case 3: _t->setSelectedParts((*reinterpret_cast< const SelectableParts(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPLegend::*_t)(QCPLegend::SelectableParts );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPLegend::selectionChanged)) {
*result = 0;
return;
}
}
{
typedef void (QCPLegend::*_t)(QCPLegend::SelectableParts );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPLegend::selectableChanged)) {
*result = 1;
return;
}
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPLegend *_t = static_cast<QCPLegend *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->borderPen(); break;
case 1: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 2: *reinterpret_cast< QFont*>(_v) = _t->font(); break;
case 3: *reinterpret_cast< QColor*>(_v) = _t->textColor(); break;
case 4: *reinterpret_cast< QSize*>(_v) = _t->iconSize(); break;
case 5: *reinterpret_cast< int*>(_v) = _t->iconTextPadding(); break;
case 6: *reinterpret_cast< QPen*>(_v) = _t->iconBorderPen(); break;
case 7: *reinterpret_cast<int*>(_v) = QFlag(_t->selectableParts()); break;
case 8: *reinterpret_cast<int*>(_v) = QFlag(_t->selectedParts()); break;
case 9: *reinterpret_cast< QPen*>(_v) = _t->selectedBorderPen(); break;
case 10: *reinterpret_cast< QPen*>(_v) = _t->selectedIconBorderPen(); break;
case 11: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
case 12: *reinterpret_cast< QFont*>(_v) = _t->selectedFont(); break;
case 13: *reinterpret_cast< QColor*>(_v) = _t->selectedTextColor(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPLegend *_t = static_cast<QCPLegend *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setBorderPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 2: _t->setFont(*reinterpret_cast< QFont*>(_v)); break;
case 3: _t->setTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 4: _t->setIconSize(*reinterpret_cast< QSize*>(_v)); break;
case 5: _t->setIconTextPadding(*reinterpret_cast< int*>(_v)); break;
case 6: _t->setIconBorderPen(*reinterpret_cast< QPen*>(_v)); break;
case 7: _t->setSelectableParts(QFlag(*reinterpret_cast<int*>(_v))); break;
case 8: _t->setSelectedParts(QFlag(*reinterpret_cast<int*>(_v))); break;
case 9: _t->setSelectedBorderPen(*reinterpret_cast< QPen*>(_v)); break;
case 10: _t->setSelectedIconBorderPen(*reinterpret_cast< QPen*>(_v)); break;
case 11: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 12: _t->setSelectedFont(*reinterpret_cast< QFont*>(_v)); break;
case 13: _t->setSelectedTextColor(*reinterpret_cast< QColor*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
const QMetaObject QCPLegend::staticMetaObject = {
{ &QCPLayoutGrid::staticMetaObject, qt_meta_stringdata_QCPLegend.data,
qt_meta_data_QCPLegend, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPLegend::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPLegend::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPLegend.stringdata0))
return static_cast<void*>(this);
return QCPLayoutGrid::qt_metacast(_clname);
}
int QCPLegend::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutGrid::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 14;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 14;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPLegend::selectionChanged(QCPLegend::SelectableParts _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPLegend::selectableChanged(QCPLegend::SelectableParts _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
struct qt_meta_stringdata_QCPTextElement_t {
QByteArrayData data[17];
char stringdata0[189];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPTextElement_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPTextElement_t qt_meta_stringdata_QCPTextElement = {
{
QT_MOC_LITERAL(0, 0, 14), // "QCPTextElement"
QT_MOC_LITERAL(1, 15, 16), // "selectionChanged"
QT_MOC_LITERAL(2, 32, 0), // ""
QT_MOC_LITERAL(3, 33, 8), // "selected"
QT_MOC_LITERAL(4, 42, 17), // "selectableChanged"
QT_MOC_LITERAL(5, 60, 10), // "selectable"
QT_MOC_LITERAL(6, 71, 7), // "clicked"
QT_MOC_LITERAL(7, 79, 12), // "QMouseEvent*"
QT_MOC_LITERAL(8, 92, 5), // "event"
QT_MOC_LITERAL(9, 98, 13), // "doubleClicked"
QT_MOC_LITERAL(10, 112, 13), // "setSelectable"
QT_MOC_LITERAL(11, 126, 11), // "setSelected"
QT_MOC_LITERAL(12, 138, 4), // "text"
QT_MOC_LITERAL(13, 143, 4), // "font"
QT_MOC_LITERAL(14, 148, 9), // "textColor"
QT_MOC_LITERAL(15, 158, 12), // "selectedFont"
QT_MOC_LITERAL(16, 171, 17) // "selectedTextColor"
},
"QCPTextElement\0selectionChanged\0\0"
"selected\0selectableChanged\0selectable\0"
"clicked\0QMouseEvent*\0event\0doubleClicked\0"
"setSelectable\0setSelected\0text\0font\0"
"textColor\0selectedFont\0selectedTextColor"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPTextElement[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
6, 14, // methods
7, 62, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
4, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 44, 2, 0x06 /* Public */,
4, 1, 47, 2, 0x06 /* Public */,
6, 1, 50, 2, 0x06 /* Public */,
9, 1, 53, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
10, 1, 56, 2, 0x0a /* Public */,
11, 1, 59, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::Bool, 3,
QMetaType::Void, QMetaType::Bool, 5,
QMetaType::Void, 0x80000000 | 7, 8,
QMetaType::Void, 0x80000000 | 7, 8,
// slots: parameters
QMetaType::Void, QMetaType::Bool, 5,
QMetaType::Void, QMetaType::Bool, 3,
// properties: name, type, flags
12, QMetaType::QString, 0x00095103,
13, QMetaType::QFont, 0x00095103,
14, QMetaType::QColor, 0x00095103,
15, QMetaType::QFont, 0x00095103,
16, QMetaType::QColor, 0x00095103,
5, QMetaType::Bool, 0x00495103,
3, QMetaType::Bool, 0x00495103,
// properties: notify_signal_id
0,
0,
0,
0,
0,
1,
0,
0 // eod
};
void QCPTextElement::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPTextElement *_t = static_cast<QCPTextElement *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->selectionChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 1: _t->selectableChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 2: _t->clicked((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 3: _t->doubleClicked((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
case 4: _t->setSelectable((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 5: _t->setSelected((*reinterpret_cast< bool(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPTextElement::*_t)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPTextElement::selectionChanged)) {
*result = 0;
return;
}
}
{
typedef void (QCPTextElement::*_t)(bool );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPTextElement::selectableChanged)) {
*result = 1;
return;
}
}
{
typedef void (QCPTextElement::*_t)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPTextElement::clicked)) {
*result = 2;
return;
}
}
{
typedef void (QCPTextElement::*_t)(QMouseEvent * );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPTextElement::doubleClicked)) {
*result = 3;
return;
}
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPTextElement *_t = static_cast<QCPTextElement *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QString*>(_v) = _t->text(); break;
case 1: *reinterpret_cast< QFont*>(_v) = _t->font(); break;
case 2: *reinterpret_cast< QColor*>(_v) = _t->textColor(); break;
case 3: *reinterpret_cast< QFont*>(_v) = _t->selectedFont(); break;
case 4: *reinterpret_cast< QColor*>(_v) = _t->selectedTextColor(); break;
case 5: *reinterpret_cast< bool*>(_v) = _t->selectable(); break;
case 6: *reinterpret_cast< bool*>(_v) = _t->selected(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPTextElement *_t = static_cast<QCPTextElement *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setText(*reinterpret_cast< QString*>(_v)); break;
case 1: _t->setFont(*reinterpret_cast< QFont*>(_v)); break;
case 2: _t->setTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 3: _t->setSelectedFont(*reinterpret_cast< QFont*>(_v)); break;
case 4: _t->setSelectedTextColor(*reinterpret_cast< QColor*>(_v)); break;
case 5: _t->setSelectable(*reinterpret_cast< bool*>(_v)); break;
case 6: _t->setSelected(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
const QMetaObject QCPTextElement::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPTextElement.data,
qt_meta_data_QCPTextElement, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPTextElement::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPTextElement::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPTextElement.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPTextElement::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 6)
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 6)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 6;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPTextElement::selectionChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPTextElement::selectableChanged(bool _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCPTextElement::clicked(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
// SIGNAL 3
void QCPTextElement::doubleClicked(QMouseEvent * _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 3, _a);
}
struct qt_meta_stringdata_QCPColorScaleAxisRectPrivate_t {
QByteArrayData data[7];
char stringdata0[128];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPColorScaleAxisRectPrivate_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPColorScaleAxisRectPrivate_t qt_meta_stringdata_QCPColorScaleAxisRectPrivate = {
{
QT_MOC_LITERAL(0, 0, 28), // "QCPColorScaleAxisRectPrivate"
QT_MOC_LITERAL(1, 29, 20), // "axisSelectionChanged"
QT_MOC_LITERAL(2, 50, 0), // ""
QT_MOC_LITERAL(3, 51, 24), // "QCPAxis::SelectableParts"
QT_MOC_LITERAL(4, 76, 13), // "selectedParts"
QT_MOC_LITERAL(5, 90, 21), // "axisSelectableChanged"
QT_MOC_LITERAL(6, 112, 15) // "selectableParts"
},
"QCPColorScaleAxisRectPrivate\0"
"axisSelectionChanged\0\0QCPAxis::SelectableParts\0"
"selectedParts\0axisSelectableChanged\0"
"selectableParts"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPColorScaleAxisRectPrivate[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
2, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 1, 24, 2, 0x09 /* Protected */,
5, 1, 27, 2, 0x09 /* Protected */,
// slots: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 3, 6,
0 // eod
};
void QCPColorScaleAxisRectPrivate::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPColorScaleAxisRectPrivate *_t = static_cast<QCPColorScaleAxisRectPrivate *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->axisSelectionChanged((*reinterpret_cast< QCPAxis::SelectableParts(*)>(_a[1]))); break;
case 1: _t->axisSelectableChanged((*reinterpret_cast< QCPAxis::SelectableParts(*)>(_a[1]))); break;
default: ;
}
}
}
const QMetaObject QCPColorScaleAxisRectPrivate::staticMetaObject = {
{ &QCPAxisRect::staticMetaObject, qt_meta_stringdata_QCPColorScaleAxisRectPrivate.data,
qt_meta_data_QCPColorScaleAxisRectPrivate, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPColorScaleAxisRectPrivate::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPColorScaleAxisRectPrivate::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPColorScaleAxisRectPrivate.stringdata0))
return static_cast<void*>(this);
return QCPAxisRect::qt_metacast(_clname);
}
int QCPColorScaleAxisRectPrivate::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAxisRect::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 2)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 2;
}
return _id;
}
struct qt_meta_stringdata_QCPColorScale_t {
QByteArrayData data[23];
char stringdata0[278];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPColorScale_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPColorScale_t qt_meta_stringdata_QCPColorScale = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPColorScale"
QT_MOC_LITERAL(1, 14, 16), // "dataRangeChanged"
QT_MOC_LITERAL(2, 31, 0), // ""
QT_MOC_LITERAL(3, 32, 8), // "QCPRange"
QT_MOC_LITERAL(4, 41, 8), // "newRange"
QT_MOC_LITERAL(5, 50, 20), // "dataScaleTypeChanged"
QT_MOC_LITERAL(6, 71, 18), // "QCPAxis::ScaleType"
QT_MOC_LITERAL(7, 90, 9), // "scaleType"
QT_MOC_LITERAL(8, 100, 15), // "gradientChanged"
QT_MOC_LITERAL(9, 116, 16), // "QCPColorGradient"
QT_MOC_LITERAL(10, 133, 11), // "newGradient"
QT_MOC_LITERAL(11, 145, 12), // "setDataRange"
QT_MOC_LITERAL(12, 158, 9), // "dataRange"
QT_MOC_LITERAL(13, 168, 16), // "setDataScaleType"
QT_MOC_LITERAL(14, 185, 11), // "setGradient"
QT_MOC_LITERAL(15, 197, 8), // "gradient"
QT_MOC_LITERAL(16, 206, 4), // "type"
QT_MOC_LITERAL(17, 211, 17), // "QCPAxis::AxisType"
QT_MOC_LITERAL(18, 229, 13), // "dataScaleType"
QT_MOC_LITERAL(19, 243, 5), // "label"
QT_MOC_LITERAL(20, 249, 8), // "barWidth"
QT_MOC_LITERAL(21, 258, 9), // "rangeDrag"
QT_MOC_LITERAL(22, 268, 9) // "rangeZoom"
},
"QCPColorScale\0dataRangeChanged\0\0"
"QCPRange\0newRange\0dataScaleTypeChanged\0"
"QCPAxis::ScaleType\0scaleType\0"
"gradientChanged\0QCPColorGradient\0"
"newGradient\0setDataRange\0dataRange\0"
"setDataScaleType\0setGradient\0gradient\0"
"type\0QCPAxis::AxisType\0dataScaleType\0"
"label\0barWidth\0rangeDrag\0rangeZoom"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPColorScale[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
6, 14, // methods
8, 62, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
3, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 44, 2, 0x06 /* Public */,
5, 1, 47, 2, 0x06 /* Public */,
8, 1, 50, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
11, 1, 53, 2, 0x0a /* Public */,
13, 1, 56, 2, 0x0a /* Public */,
14, 1, 59, 2, 0x0a /* Public */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void, 0x80000000 | 9, 10,
// slots: parameters
QMetaType::Void, 0x80000000 | 3, 12,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void, 0x80000000 | 9, 15,
// properties: name, type, flags
16, 0x80000000 | 17, 0x0009510b,
12, 0x80000000 | 3, 0x0049510b,
18, 0x80000000 | 6, 0x0049510b,
15, 0x80000000 | 9, 0x0049510b,
19, QMetaType::QString, 0x00095103,
20, QMetaType::Int, 0x00095103,
21, QMetaType::Bool, 0x00095103,
22, QMetaType::Bool, 0x00095103,
// properties: notify_signal_id
0,
0,
1,
2,
0,
0,
0,
0,
0 // eod
};
void QCPColorScale::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPColorScale *_t = static_cast<QCPColorScale *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->dataRangeChanged((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 1: _t->dataScaleTypeChanged((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 2: _t->gradientChanged((*reinterpret_cast< const QCPColorGradient(*)>(_a[1]))); break;
case 3: _t->setDataRange((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 4: _t->setDataScaleType((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 5: _t->setGradient((*reinterpret_cast< const QCPColorGradient(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::ScaleType >(); break;
}
break;
case 4:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::ScaleType >(); break;
}
break;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPColorScale::*_t)(const QCPRange & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorScale::dataRangeChanged)) {
*result = 0;
return;
}
}
{
typedef void (QCPColorScale::*_t)(QCPAxis::ScaleType );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorScale::dataScaleTypeChanged)) {
*result = 1;
return;
}
}
{
typedef void (QCPColorScale::*_t)(const QCPColorGradient & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorScale::gradientChanged)) {
*result = 2;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::AxisType >(); break;
case 2:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::ScaleType >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPColorScale *_t = static_cast<QCPColorScale *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPAxis::AxisType*>(_v) = _t->type(); break;
case 1: *reinterpret_cast< QCPRange*>(_v) = _t->dataRange(); break;
case 2: *reinterpret_cast< QCPAxis::ScaleType*>(_v) = _t->dataScaleType(); break;
case 3: *reinterpret_cast< QCPColorGradient*>(_v) = _t->gradient(); break;
case 4: *reinterpret_cast< QString*>(_v) = _t->label(); break;
case 5: *reinterpret_cast< int*>(_v) = _t->barWidth(); break;
case 6: *reinterpret_cast< bool*>(_v) = _t->rangeDrag(); break;
case 7: *reinterpret_cast< bool*>(_v) = _t->rangeZoom(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPColorScale *_t = static_cast<QCPColorScale *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setType(*reinterpret_cast< QCPAxis::AxisType*>(_v)); break;
case 1: _t->setDataRange(*reinterpret_cast< QCPRange*>(_v)); break;
case 2: _t->setDataScaleType(*reinterpret_cast< QCPAxis::ScaleType*>(_v)); break;
case 3: _t->setGradient(*reinterpret_cast< QCPColorGradient*>(_v)); break;
case 4: _t->setLabel(*reinterpret_cast< QString*>(_v)); break;
case 5: _t->setBarWidth(*reinterpret_cast< int*>(_v)); break;
case 6: _t->setRangeDrag(*reinterpret_cast< bool*>(_v)); break;
case 7: _t->setRangeZoom(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
static const QMetaObject * const qt_meta_extradata_QCPColorScale[] = {
&QCPAxis::staticMetaObject,
nullptr
};
const QMetaObject QCPColorScale::staticMetaObject = {
{ &QCPLayoutElement::staticMetaObject, qt_meta_stringdata_QCPColorScale.data,
qt_meta_data_QCPColorScale, qt_static_metacall, qt_meta_extradata_QCPColorScale, nullptr}
};
const QMetaObject *QCPColorScale::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPColorScale::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPColorScale.stringdata0))
return static_cast<void*>(this);
return QCPLayoutElement::qt_metacast(_clname);
}
int QCPColorScale::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPLayoutElement::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 6)
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 6)
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 8;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPColorScale::dataRangeChanged(const QCPRange & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPColorScale::dataScaleTypeChanged(QCPAxis::ScaleType _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCPColorScale::gradientChanged(const QCPColorGradient & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
struct qt_meta_stringdata_QCPGraph_t {
QByteArrayData data[15];
char stringdata0[174];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPGraph_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPGraph_t qt_meta_stringdata_QCPGraph = {
{
QT_MOC_LITERAL(0, 0, 8), // "QCPGraph"
QT_MOC_LITERAL(1, 9, 9), // "lineStyle"
QT_MOC_LITERAL(2, 19, 9), // "LineStyle"
QT_MOC_LITERAL(3, 29, 12), // "scatterStyle"
QT_MOC_LITERAL(4, 42, 15), // "QCPScatterStyle"
QT_MOC_LITERAL(5, 58, 11), // "scatterSkip"
QT_MOC_LITERAL(6, 70, 16), // "channelFillGraph"
QT_MOC_LITERAL(7, 87, 9), // "QCPGraph*"
QT_MOC_LITERAL(8, 97, 16), // "adaptiveSampling"
QT_MOC_LITERAL(9, 114, 6), // "lsNone"
QT_MOC_LITERAL(10, 121, 6), // "lsLine"
QT_MOC_LITERAL(11, 128, 10), // "lsStepLeft"
QT_MOC_LITERAL(12, 139, 11), // "lsStepRight"
QT_MOC_LITERAL(13, 151, 12), // "lsStepCenter"
QT_MOC_LITERAL(14, 164, 9) // "lsImpulse"
},
"QCPGraph\0lineStyle\0LineStyle\0scatterStyle\0"
"QCPScatterStyle\0scatterSkip\0"
"channelFillGraph\0QCPGraph*\0adaptiveSampling\0"
"lsNone\0lsLine\0lsStepLeft\0lsStepRight\0"
"lsStepCenter\0lsImpulse"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPGraph[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
5, 14, // properties
1, 29, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x0009510b,
3, 0x80000000 | 4, 0x0009510b,
5, QMetaType::Int, 0x00095103,
6, 0x80000000 | 7, 0x0009510b,
8, QMetaType::Bool, 0x00095103,
// enums: name, flags, count, data
2, 0x0, 6, 33,
// enum data: key, value
9, uint(QCPGraph::lsNone),
10, uint(QCPGraph::lsLine),
11, uint(QCPGraph::lsStepLeft),
12, uint(QCPGraph::lsStepRight),
13, uint(QCPGraph::lsStepCenter),
14, uint(QCPGraph::lsImpulse),
0 // eod
};
void QCPGraph::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 3:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPGraph* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPGraph *_t = static_cast<QCPGraph *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< LineStyle*>(_v) = _t->lineStyle(); break;
case 1: *reinterpret_cast< QCPScatterStyle*>(_v) = _t->scatterStyle(); break;
case 2: *reinterpret_cast< int*>(_v) = _t->scatterSkip(); break;
case 3: *reinterpret_cast< QCPGraph**>(_v) = _t->channelFillGraph(); break;
case 4: *reinterpret_cast< bool*>(_v) = _t->adaptiveSampling(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPGraph *_t = static_cast<QCPGraph *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setLineStyle(*reinterpret_cast< LineStyle*>(_v)); break;
case 1: _t->setScatterStyle(*reinterpret_cast< QCPScatterStyle*>(_v)); break;
case 2: _t->setScatterSkip(*reinterpret_cast< int*>(_v)); break;
case 3: _t->setChannelFillGraph(*reinterpret_cast< QCPGraph**>(_v)); break;
case 4: _t->setAdaptiveSampling(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
const QMetaObject QCPGraph::staticMetaObject = {
{ &QCPAbstractPlottable1D<QCPGraphData>::staticMetaObject, qt_meta_stringdata_QCPGraph.data,
qt_meta_data_QCPGraph, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPGraph::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPGraph::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPGraph.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable1D<QCPGraphData>::qt_metacast(_clname);
}
int QCPGraph::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable1D<QCPGraphData>::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 5;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPCurve_t {
QByteArrayData data[8];
char stringdata0[84];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPCurve_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPCurve_t qt_meta_stringdata_QCPCurve = {
{
QT_MOC_LITERAL(0, 0, 8), // "QCPCurve"
QT_MOC_LITERAL(1, 9, 12), // "scatterStyle"
QT_MOC_LITERAL(2, 22, 15), // "QCPScatterStyle"
QT_MOC_LITERAL(3, 38, 11), // "scatterSkip"
QT_MOC_LITERAL(4, 50, 9), // "lineStyle"
QT_MOC_LITERAL(5, 60, 9), // "LineStyle"
QT_MOC_LITERAL(6, 70, 6), // "lsNone"
QT_MOC_LITERAL(7, 77, 6) // "lsLine"
},
"QCPCurve\0scatterStyle\0QCPScatterStyle\0"
"scatterSkip\0lineStyle\0LineStyle\0lsNone\0"
"lsLine"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPCurve[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
3, 14, // properties
1, 23, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x0009510b,
3, QMetaType::Int, 0x00095103,
4, 0x80000000 | 5, 0x0009510b,
// enums: name, flags, count, data
5, 0x0, 2, 27,
// enum data: key, value
6, uint(QCPCurve::lsNone),
7, uint(QCPCurve::lsLine),
0 // eod
};
void QCPCurve::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPCurve *_t = static_cast<QCPCurve *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPScatterStyle*>(_v) = _t->scatterStyle(); break;
case 1: *reinterpret_cast< int*>(_v) = _t->scatterSkip(); break;
case 2: *reinterpret_cast< LineStyle*>(_v) = _t->lineStyle(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPCurve *_t = static_cast<QCPCurve *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setScatterStyle(*reinterpret_cast< QCPScatterStyle*>(_v)); break;
case 1: _t->setScatterSkip(*reinterpret_cast< int*>(_v)); break;
case 2: _t->setLineStyle(*reinterpret_cast< LineStyle*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPCurve::staticMetaObject = {
{ &QCPAbstractPlottable1D<QCPCurveData>::staticMetaObject, qt_meta_stringdata_QCPCurve.data,
qt_meta_data_QCPCurve, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPCurve::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPCurve::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPCurve.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable1D<QCPCurveData>::qt_metacast(_clname);
}
int QCPCurve::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable1D<QCPCurveData>::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 3;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPBarsGroup_t {
QByteArrayData data[7];
char stringdata0[85];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPBarsGroup_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPBarsGroup_t qt_meta_stringdata_QCPBarsGroup = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPBarsGroup"
QT_MOC_LITERAL(1, 13, 11), // "spacingType"
QT_MOC_LITERAL(2, 25, 11), // "SpacingType"
QT_MOC_LITERAL(3, 37, 7), // "spacing"
QT_MOC_LITERAL(4, 45, 10), // "stAbsolute"
QT_MOC_LITERAL(5, 56, 15), // "stAxisRectRatio"
QT_MOC_LITERAL(6, 72, 12) // "stPlotCoords"
},
"QCPBarsGroup\0spacingType\0SpacingType\0"
"spacing\0stAbsolute\0stAxisRectRatio\0"
"stPlotCoords"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPBarsGroup[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
2, 14, // properties
1, 20, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x0009510b,
3, QMetaType::Double, 0x00095103,
// enums: name, flags, count, data
2, 0x0, 3, 24,
// enum data: key, value
4, uint(QCPBarsGroup::stAbsolute),
5, uint(QCPBarsGroup::stAxisRectRatio),
6, uint(QCPBarsGroup::stPlotCoords),
0 // eod
};
void QCPBarsGroup::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPBarsGroup *_t = static_cast<QCPBarsGroup *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< SpacingType*>(_v) = _t->spacingType(); break;
case 1: *reinterpret_cast< double*>(_v) = _t->spacing(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPBarsGroup *_t = static_cast<QCPBarsGroup *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setSpacingType(*reinterpret_cast< SpacingType*>(_v)); break;
case 1: _t->setSpacing(*reinterpret_cast< double*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPBarsGroup::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QCPBarsGroup.data,
qt_meta_data_QCPBarsGroup, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPBarsGroup::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPBarsGroup::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPBarsGroup.stringdata0))
return static_cast<void*>(this);
return QObject::qt_metacast(_clname);
}
int QCPBarsGroup::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 2;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPBars_t {
QByteArrayData data[14];
char stringdata0[147];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPBars_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPBars_t qt_meta_stringdata_QCPBars = {
{
QT_MOC_LITERAL(0, 0, 7), // "QCPBars"
QT_MOC_LITERAL(1, 8, 5), // "width"
QT_MOC_LITERAL(2, 14, 9), // "widthType"
QT_MOC_LITERAL(3, 24, 9), // "WidthType"
QT_MOC_LITERAL(4, 34, 9), // "barsGroup"
QT_MOC_LITERAL(5, 44, 13), // "QCPBarsGroup*"
QT_MOC_LITERAL(6, 58, 9), // "baseValue"
QT_MOC_LITERAL(7, 68, 11), // "stackingGap"
QT_MOC_LITERAL(8, 80, 8), // "barBelow"
QT_MOC_LITERAL(9, 89, 8), // "QCPBars*"
QT_MOC_LITERAL(10, 98, 8), // "barAbove"
QT_MOC_LITERAL(11, 107, 10), // "wtAbsolute"
QT_MOC_LITERAL(12, 118, 15), // "wtAxisRectRatio"
QT_MOC_LITERAL(13, 134, 12) // "wtPlotCoords"
},
"QCPBars\0width\0widthType\0WidthType\0"
"barsGroup\0QCPBarsGroup*\0baseValue\0"
"stackingGap\0barBelow\0QCPBars*\0barAbove\0"
"wtAbsolute\0wtAxisRectRatio\0wtPlotCoords"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPBars[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
7, 14, // properties
1, 35, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::Double, 0x00095103,
2, 0x80000000 | 3, 0x0009510b,
4, 0x80000000 | 5, 0x0009510b,
6, QMetaType::Double, 0x00095103,
7, QMetaType::Double, 0x00095103,
8, 0x80000000 | 9, 0x00095009,
10, 0x80000000 | 9, 0x00095009,
// enums: name, flags, count, data
3, 0x0, 3, 39,
// enum data: key, value
11, uint(QCPBars::wtAbsolute),
12, uint(QCPBars::wtAxisRectRatio),
13, uint(QCPBars::wtPlotCoords),
0 // eod
};
void QCPBars::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 6:
case 5:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPBars* >(); break;
case 2:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPBarsGroup* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPBars *_t = static_cast<QCPBars *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< double*>(_v) = _t->width(); break;
case 1: *reinterpret_cast< WidthType*>(_v) = _t->widthType(); break;
case 2: *reinterpret_cast< QCPBarsGroup**>(_v) = _t->barsGroup(); break;
case 3: *reinterpret_cast< double*>(_v) = _t->baseValue(); break;
case 4: *reinterpret_cast< double*>(_v) = _t->stackingGap(); break;
case 5: *reinterpret_cast< QCPBars**>(_v) = _t->barBelow(); break;
case 6: *reinterpret_cast< QCPBars**>(_v) = _t->barAbove(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPBars *_t = static_cast<QCPBars *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setWidth(*reinterpret_cast< double*>(_v)); break;
case 1: _t->setWidthType(*reinterpret_cast< WidthType*>(_v)); break;
case 2: _t->setBarsGroup(*reinterpret_cast< QCPBarsGroup**>(_v)); break;
case 3: _t->setBaseValue(*reinterpret_cast< double*>(_v)); break;
case 4: _t->setStackingGap(*reinterpret_cast< double*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
const QMetaObject QCPBars::staticMetaObject = {
{ &QCPAbstractPlottable1D<QCPBarsData>::staticMetaObject, qt_meta_stringdata_QCPBars.data,
qt_meta_data_QCPBars, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPBars::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPBars::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPBars.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable1D<QCPBarsData>::qt_metacast(_clname);
}
int QCPBars::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable1D<QCPBarsData>::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPStatisticalBox_t {
QByteArrayData data[9];
char stringdata0[120];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPStatisticalBox_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPStatisticalBox_t qt_meta_stringdata_QCPStatisticalBox = {
{
QT_MOC_LITERAL(0, 0, 17), // "QCPStatisticalBox"
QT_MOC_LITERAL(1, 18, 5), // "width"
QT_MOC_LITERAL(2, 24, 12), // "whiskerWidth"
QT_MOC_LITERAL(3, 37, 10), // "whiskerPen"
QT_MOC_LITERAL(4, 48, 13), // "whiskerBarPen"
QT_MOC_LITERAL(5, 62, 18), // "whiskerAntialiased"
QT_MOC_LITERAL(6, 81, 9), // "medianPen"
QT_MOC_LITERAL(7, 91, 12), // "outlierStyle"
QT_MOC_LITERAL(8, 104, 15) // "QCPScatterStyle"
},
"QCPStatisticalBox\0width\0whiskerWidth\0"
"whiskerPen\0whiskerBarPen\0whiskerAntialiased\0"
"medianPen\0outlierStyle\0QCPScatterStyle"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPStatisticalBox[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
7, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::Double, 0x00095103,
2, QMetaType::Double, 0x00095103,
3, QMetaType::QPen, 0x00095103,
4, QMetaType::QPen, 0x00095103,
5, QMetaType::Bool, 0x00095103,
6, QMetaType::QPen, 0x00095103,
7, 0x80000000 | 8, 0x0009510b,
0 // eod
};
void QCPStatisticalBox::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPStatisticalBox *_t = static_cast<QCPStatisticalBox *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< double*>(_v) = _t->width(); break;
case 1: *reinterpret_cast< double*>(_v) = _t->whiskerWidth(); break;
case 2: *reinterpret_cast< QPen*>(_v) = _t->whiskerPen(); break;
case 3: *reinterpret_cast< QPen*>(_v) = _t->whiskerBarPen(); break;
case 4: *reinterpret_cast< bool*>(_v) = _t->whiskerAntialiased(); break;
case 5: *reinterpret_cast< QPen*>(_v) = _t->medianPen(); break;
case 6: *reinterpret_cast< QCPScatterStyle*>(_v) = _t->outlierStyle(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPStatisticalBox *_t = static_cast<QCPStatisticalBox *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setWidth(*reinterpret_cast< double*>(_v)); break;
case 1: _t->setWhiskerWidth(*reinterpret_cast< double*>(_v)); break;
case 2: _t->setWhiskerPen(*reinterpret_cast< QPen*>(_v)); break;
case 3: _t->setWhiskerBarPen(*reinterpret_cast< QPen*>(_v)); break;
case 4: _t->setWhiskerAntialiased(*reinterpret_cast< bool*>(_v)); break;
case 5: _t->setMedianPen(*reinterpret_cast< QPen*>(_v)); break;
case 6: _t->setOutlierStyle(*reinterpret_cast< QCPScatterStyle*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPStatisticalBox::staticMetaObject = {
{ &QCPAbstractPlottable1D<QCPStatisticalBoxData>::staticMetaObject, qt_meta_stringdata_QCPStatisticalBox.data,
qt_meta_data_QCPStatisticalBox, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPStatisticalBox::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPStatisticalBox::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPStatisticalBox.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable1D<QCPStatisticalBoxData>::qt_metacast(_clname);
}
int QCPStatisticalBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable1D<QCPStatisticalBoxData>::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPColorMap_t {
QByteArrayData data[25];
char stringdata0[334];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPColorMap_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPColorMap_t qt_meta_stringdata_QCPColorMap = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPColorMap"
QT_MOC_LITERAL(1, 12, 16), // "dataRangeChanged"
QT_MOC_LITERAL(2, 29, 0), // ""
QT_MOC_LITERAL(3, 30, 8), // "QCPRange"
QT_MOC_LITERAL(4, 39, 8), // "newRange"
QT_MOC_LITERAL(5, 48, 20), // "dataScaleTypeChanged"
QT_MOC_LITERAL(6, 69, 18), // "QCPAxis::ScaleType"
QT_MOC_LITERAL(7, 88, 9), // "scaleType"
QT_MOC_LITERAL(8, 98, 15), // "gradientChanged"
QT_MOC_LITERAL(9, 114, 16), // "QCPColorGradient"
QT_MOC_LITERAL(10, 131, 11), // "newGradient"
QT_MOC_LITERAL(11, 143, 12), // "setDataRange"
QT_MOC_LITERAL(12, 156, 9), // "dataRange"
QT_MOC_LITERAL(13, 166, 16), // "setDataScaleType"
QT_MOC_LITERAL(14, 183, 11), // "setGradient"
QT_MOC_LITERAL(15, 195, 8), // "gradient"
QT_MOC_LITERAL(16, 204, 16), // "updateLegendIcon"
QT_MOC_LITERAL(17, 221, 22), // "Qt::TransformationMode"
QT_MOC_LITERAL(18, 244, 13), // "transformMode"
QT_MOC_LITERAL(19, 258, 9), // "thumbSize"
QT_MOC_LITERAL(20, 268, 13), // "dataScaleType"
QT_MOC_LITERAL(21, 282, 11), // "interpolate"
QT_MOC_LITERAL(22, 294, 13), // "tightBoundary"
QT_MOC_LITERAL(23, 308, 10), // "colorScale"
QT_MOC_LITERAL(24, 319, 14) // "QCPColorScale*"
},
"QCPColorMap\0dataRangeChanged\0\0QCPRange\0"
"newRange\0dataScaleTypeChanged\0"
"QCPAxis::ScaleType\0scaleType\0"
"gradientChanged\0QCPColorGradient\0"
"newGradient\0setDataRange\0dataRange\0"
"setDataScaleType\0setGradient\0gradient\0"
"updateLegendIcon\0Qt::TransformationMode\0"
"transformMode\0thumbSize\0dataScaleType\0"
"interpolate\0tightBoundary\0colorScale\0"
"QCPColorScale*"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPColorMap[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
9, 14, // methods
6, 86, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
3, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 59, 2, 0x06 /* Public */,
5, 1, 62, 2, 0x06 /* Public */,
8, 1, 65, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
11, 1, 68, 2, 0x0a /* Public */,
13, 1, 71, 2, 0x0a /* Public */,
14, 1, 74, 2, 0x0a /* Public */,
16, 2, 77, 2, 0x0a /* Public */,
16, 1, 82, 2, 0x2a /* Public | MethodCloned */,
16, 0, 85, 2, 0x2a /* Public | MethodCloned */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void, 0x80000000 | 9, 10,
// slots: parameters
QMetaType::Void, 0x80000000 | 3, 12,
QMetaType::Void, 0x80000000 | 6, 7,
QMetaType::Void, 0x80000000 | 9, 15,
QMetaType::Void, 0x80000000 | 17, QMetaType::QSize, 18, 19,
QMetaType::Void, 0x80000000 | 17, 18,
QMetaType::Void,
// properties: name, type, flags
12, 0x80000000 | 3, 0x0049510b,
20, 0x80000000 | 6, 0x0049510b,
15, 0x80000000 | 9, 0x0049510b,
21, QMetaType::Bool, 0x00095103,
22, QMetaType::Bool, 0x00095103,
23, 0x80000000 | 24, 0x0009510b,
// properties: notify_signal_id
0,
1,
2,
0,
0,
0,
0 // eod
};
void QCPColorMap::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
QCPColorMap *_t = static_cast<QCPColorMap *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->dataRangeChanged((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 1: _t->dataScaleTypeChanged((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 2: _t->gradientChanged((*reinterpret_cast< const QCPColorGradient(*)>(_a[1]))); break;
case 3: _t->setDataRange((*reinterpret_cast< const QCPRange(*)>(_a[1]))); break;
case 4: _t->setDataScaleType((*reinterpret_cast< QCPAxis::ScaleType(*)>(_a[1]))); break;
case 5: _t->setGradient((*reinterpret_cast< const QCPColorGradient(*)>(_a[1]))); break;
case 6: _t->updateLegendIcon((*reinterpret_cast< Qt::TransformationMode(*)>(_a[1])),(*reinterpret_cast< const QSize(*)>(_a[2]))); break;
case 7: _t->updateLegendIcon((*reinterpret_cast< Qt::TransformationMode(*)>(_a[1]))); break;
case 8: _t->updateLegendIcon(); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::ScaleType >(); break;
}
break;
case 4:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::ScaleType >(); break;
}
break;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
typedef void (QCPColorMap::*_t)(const QCPRange & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorMap::dataRangeChanged)) {
*result = 0;
return;
}
}
{
typedef void (QCPColorMap::*_t)(QCPAxis::ScaleType );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorMap::dataScaleTypeChanged)) {
*result = 1;
return;
}
}
{
typedef void (QCPColorMap::*_t)(const QCPColorGradient & );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QCPColorMap::gradientChanged)) {
*result = 2;
return;
}
}
} else if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAxis::ScaleType >(); break;
case 5:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPColorScale* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPColorMap *_t = static_cast<QCPColorMap *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QCPRange*>(_v) = _t->dataRange(); break;
case 1: *reinterpret_cast< QCPAxis::ScaleType*>(_v) = _t->dataScaleType(); break;
case 2: *reinterpret_cast< QCPColorGradient*>(_v) = _t->gradient(); break;
case 3: *reinterpret_cast< bool*>(_v) = _t->interpolate(); break;
case 4: *reinterpret_cast< bool*>(_v) = _t->tightBoundary(); break;
case 5: *reinterpret_cast< QCPColorScale**>(_v) = _t->colorScale(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPColorMap *_t = static_cast<QCPColorMap *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setDataRange(*reinterpret_cast< QCPRange*>(_v)); break;
case 1: _t->setDataScaleType(*reinterpret_cast< QCPAxis::ScaleType*>(_v)); break;
case 2: _t->setGradient(*reinterpret_cast< QCPColorGradient*>(_v)); break;
case 3: _t->setInterpolate(*reinterpret_cast< bool*>(_v)); break;
case 4: _t->setTightBoundary(*reinterpret_cast< bool*>(_v)); break;
case 5: _t->setColorScale(*reinterpret_cast< QCPColorScale**>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
}
static const QMetaObject * const qt_meta_extradata_QCPColorMap[] = {
&QCPAxis::staticMetaObject,
nullptr
};
const QMetaObject QCPColorMap::staticMetaObject = {
{ &QCPAbstractPlottable::staticMetaObject, qt_meta_stringdata_QCPColorMap.data,
qt_meta_data_QCPColorMap, qt_static_metacall, qt_meta_extradata_QCPColorMap, nullptr}
};
const QMetaObject *QCPColorMap::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPColorMap::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPColorMap.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable::qt_metacast(_clname);
}
int QCPColorMap::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 9)
qt_static_metacall(this, _c, _id, _a);
_id -= 9;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 9)
qt_static_metacall(this, _c, _id, _a);
_id -= 9;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 6;
}
#endif // QT_NO_PROPERTIES
return _id;
}
// SIGNAL 0
void QCPColorMap::dataRangeChanged(const QCPRange & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void QCPColorMap::dataScaleTypeChanged(QCPAxis::ScaleType _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void QCPColorMap::gradientChanged(const QCPColorGradient & _t1)
{
void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
struct qt_meta_stringdata_QCPFinancial_t {
QByteArrayData data[16];
char stringdata0[185];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPFinancial_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPFinancial_t qt_meta_stringdata_QCPFinancial = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPFinancial"
QT_MOC_LITERAL(1, 13, 10), // "chartStyle"
QT_MOC_LITERAL(2, 24, 10), // "ChartStyle"
QT_MOC_LITERAL(3, 35, 5), // "width"
QT_MOC_LITERAL(4, 41, 9), // "widthType"
QT_MOC_LITERAL(5, 51, 9), // "WidthType"
QT_MOC_LITERAL(6, 61, 10), // "twoColored"
QT_MOC_LITERAL(7, 72, 13), // "brushPositive"
QT_MOC_LITERAL(8, 86, 13), // "brushNegative"
QT_MOC_LITERAL(9, 100, 11), // "penPositive"
QT_MOC_LITERAL(10, 112, 11), // "penNegative"
QT_MOC_LITERAL(11, 124, 10), // "wtAbsolute"
QT_MOC_LITERAL(12, 135, 15), // "wtAxisRectRatio"
QT_MOC_LITERAL(13, 151, 12), // "wtPlotCoords"
QT_MOC_LITERAL(14, 164, 6), // "csOhlc"
QT_MOC_LITERAL(15, 171, 13) // "csCandlestick"
},
"QCPFinancial\0chartStyle\0ChartStyle\0"
"width\0widthType\0WidthType\0twoColored\0"
"brushPositive\0brushNegative\0penPositive\0"
"penNegative\0wtAbsolute\0wtAxisRectRatio\0"
"wtPlotCoords\0csOhlc\0csCandlestick"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPFinancial[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
8, 14, // properties
2, 38, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x0009510b,
3, QMetaType::Double, 0x00095103,
4, 0x80000000 | 5, 0x0009510b,
6, QMetaType::Bool, 0x00095103,
7, QMetaType::QBrush, 0x00095103,
8, QMetaType::QBrush, 0x00095103,
9, QMetaType::QPen, 0x00095103,
10, QMetaType::QPen, 0x00095103,
// enums: name, flags, count, data
5, 0x0, 3, 46,
2, 0x0, 2, 52,
// enum data: key, value
11, uint(QCPFinancial::wtAbsolute),
12, uint(QCPFinancial::wtAxisRectRatio),
13, uint(QCPFinancial::wtPlotCoords),
14, uint(QCPFinancial::csOhlc),
15, uint(QCPFinancial::csCandlestick),
0 // eod
};
void QCPFinancial::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPFinancial *_t = static_cast<QCPFinancial *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< ChartStyle*>(_v) = _t->chartStyle(); break;
case 1: *reinterpret_cast< double*>(_v) = _t->width(); break;
case 2: *reinterpret_cast< WidthType*>(_v) = _t->widthType(); break;
case 3: *reinterpret_cast< bool*>(_v) = _t->twoColored(); break;
case 4: *reinterpret_cast< QBrush*>(_v) = _t->brushPositive(); break;
case 5: *reinterpret_cast< QBrush*>(_v) = _t->brushNegative(); break;
case 6: *reinterpret_cast< QPen*>(_v) = _t->penPositive(); break;
case 7: *reinterpret_cast< QPen*>(_v) = _t->penNegative(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPFinancial *_t = static_cast<QCPFinancial *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setChartStyle(*reinterpret_cast< ChartStyle*>(_v)); break;
case 1: _t->setWidth(*reinterpret_cast< double*>(_v)); break;
case 2: _t->setWidthType(*reinterpret_cast< WidthType*>(_v)); break;
case 3: _t->setTwoColored(*reinterpret_cast< bool*>(_v)); break;
case 4: _t->setBrushPositive(*reinterpret_cast< QBrush*>(_v)); break;
case 5: _t->setBrushNegative(*reinterpret_cast< QBrush*>(_v)); break;
case 6: _t->setPenPositive(*reinterpret_cast< QPen*>(_v)); break;
case 7: _t->setPenNegative(*reinterpret_cast< QPen*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPFinancial::staticMetaObject = {
{ &QCPAbstractPlottable1D<QCPFinancialData>::staticMetaObject, qt_meta_stringdata_QCPFinancial.data,
qt_meta_data_QCPFinancial, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPFinancial::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPFinancial::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPFinancial.stringdata0))
return static_cast<void*>(this);
return QCPAbstractPlottable1D<QCPFinancialData>::qt_metacast(_clname);
}
int QCPFinancial::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable1D<QCPFinancialData>::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 8;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPErrorBars_t {
QByteArrayData data[11];
char stringdata0[163];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPErrorBars_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPErrorBars_t qt_meta_stringdata_QCPErrorBars = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPErrorBars"
QT_MOC_LITERAL(1, 13, 4), // "data"
QT_MOC_LITERAL(2, 18, 41), // "QSharedPointer<QCPErrorBarsDa..."
QT_MOC_LITERAL(3, 60, 13), // "dataPlottable"
QT_MOC_LITERAL(4, 74, 21), // "QCPAbstractPlottable*"
QT_MOC_LITERAL(5, 96, 9), // "errorType"
QT_MOC_LITERAL(6, 106, 9), // "ErrorType"
QT_MOC_LITERAL(7, 116, 12), // "whiskerWidth"
QT_MOC_LITERAL(8, 129, 9), // "symbolGap"
QT_MOC_LITERAL(9, 139, 10), // "etKeyError"
QT_MOC_LITERAL(10, 150, 12) // "etValueError"
},
"QCPErrorBars\0data\0"
"QSharedPointer<QCPErrorBarsDataContainer>\0"
"dataPlottable\0QCPAbstractPlottable*\0"
"errorType\0ErrorType\0whiskerWidth\0"
"symbolGap\0etKeyError\0etValueError"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPErrorBars[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
5, 14, // properties
1, 29, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, 0x80000000 | 2, 0x0009510b,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 6, 0x0009510b,
7, QMetaType::Double, 0x00095103,
8, QMetaType::Double, 0x00095103,
// enums: name, flags, count, data
6, 0x0, 2, 33,
// enum data: key, value
9, uint(QCPErrorBars::etKeyError),
10, uint(QCPErrorBars::etValueError),
0 // eod
};
void QCPErrorBars::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPAbstractPlottable* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPErrorBars *_t = static_cast<QCPErrorBars *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QSharedPointer<QCPErrorBarsDataContainer>*>(_v) = _t->data(); break;
case 1: *reinterpret_cast< QCPAbstractPlottable**>(_v) = _t->dataPlottable(); break;
case 2: *reinterpret_cast< ErrorType*>(_v) = _t->errorType(); break;
case 3: *reinterpret_cast< double*>(_v) = _t->whiskerWidth(); break;
case 4: *reinterpret_cast< double*>(_v) = _t->symbolGap(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPErrorBars *_t = static_cast<QCPErrorBars *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setData(*reinterpret_cast< QSharedPointer<QCPErrorBarsDataContainer>*>(_v)); break;
case 1: _t->setDataPlottable(*reinterpret_cast< QCPAbstractPlottable**>(_v)); break;
case 2: _t->setErrorType(*reinterpret_cast< ErrorType*>(_v)); break;
case 3: _t->setWhiskerWidth(*reinterpret_cast< double*>(_v)); break;
case 4: _t->setSymbolGap(*reinterpret_cast< double*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
const QMetaObject QCPErrorBars::staticMetaObject = {
{ &QCPAbstractPlottable::staticMetaObject, qt_meta_stringdata_QCPErrorBars.data,
qt_meta_data_QCPErrorBars, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPErrorBars::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPErrorBars::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPErrorBars.stringdata0))
return static_cast<void*>(this);
if (!strcmp(_clname, "QCPPlottableInterface1D"))
return static_cast< QCPPlottableInterface1D*>(this);
return QCPAbstractPlottable::qt_metacast(_clname);
}
int QCPErrorBars::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractPlottable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 5;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemStraightLine_t {
QByteArrayData data[3];
char stringdata0[36];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemStraightLine_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemStraightLine_t qt_meta_stringdata_QCPItemStraightLine = {
{
QT_MOC_LITERAL(0, 0, 19), // "QCPItemStraightLine"
QT_MOC_LITERAL(1, 20, 3), // "pen"
QT_MOC_LITERAL(2, 24, 11) // "selectedPen"
},
"QCPItemStraightLine\0pen\0selectedPen"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemStraightLine[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
2, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
0 // eod
};
void QCPItemStraightLine::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemStraightLine *_t = static_cast<QCPItemStraightLine *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemStraightLine *_t = static_cast<QCPItemStraightLine *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPItemStraightLine::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemStraightLine.data,
qt_meta_data_QCPItemStraightLine, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemStraightLine::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemStraightLine::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemStraightLine.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemStraightLine::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 2;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemLine_t {
QByteArrayData data[6];
char stringdata0[52];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemLine_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemLine_t qt_meta_stringdata_QCPItemLine = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPItemLine"
QT_MOC_LITERAL(1, 12, 3), // "pen"
QT_MOC_LITERAL(2, 16, 11), // "selectedPen"
QT_MOC_LITERAL(3, 28, 4), // "head"
QT_MOC_LITERAL(4, 33, 13), // "QCPLineEnding"
QT_MOC_LITERAL(5, 47, 4) // "tail"
},
"QCPItemLine\0pen\0selectedPen\0head\0"
"QCPLineEnding\0tail"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemLine[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 4, 0x0009510b,
0 // eod
};
void QCPItemLine::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemLine *_t = static_cast<QCPItemLine *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QCPLineEnding*>(_v) = _t->head(); break;
case 3: *reinterpret_cast< QCPLineEnding*>(_v) = _t->tail(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemLine *_t = static_cast<QCPItemLine *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setHead(*reinterpret_cast< QCPLineEnding*>(_v)); break;
case 3: _t->setTail(*reinterpret_cast< QCPLineEnding*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPItemLine::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemLine.data,
qt_meta_data_QCPItemLine, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemLine::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemLine::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemLine.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemLine::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemCurve_t {
QByteArrayData data[6];
char stringdata0[53];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemCurve_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemCurve_t qt_meta_stringdata_QCPItemCurve = {
{
QT_MOC_LITERAL(0, 0, 12), // "QCPItemCurve"
QT_MOC_LITERAL(1, 13, 3), // "pen"
QT_MOC_LITERAL(2, 17, 11), // "selectedPen"
QT_MOC_LITERAL(3, 29, 4), // "head"
QT_MOC_LITERAL(4, 34, 13), // "QCPLineEnding"
QT_MOC_LITERAL(5, 48, 4) // "tail"
},
"QCPItemCurve\0pen\0selectedPen\0head\0"
"QCPLineEnding\0tail"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemCurve[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, 0x80000000 | 4, 0x0009510b,
5, 0x80000000 | 4, 0x0009510b,
0 // eod
};
void QCPItemCurve::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemCurve *_t = static_cast<QCPItemCurve *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QCPLineEnding*>(_v) = _t->head(); break;
case 3: *reinterpret_cast< QCPLineEnding*>(_v) = _t->tail(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemCurve *_t = static_cast<QCPItemCurve *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setHead(*reinterpret_cast< QCPLineEnding*>(_v)); break;
case 3: _t->setTail(*reinterpret_cast< QCPLineEnding*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPItemCurve::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemCurve.data,
qt_meta_data_QCPItemCurve, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemCurve::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemCurve::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemCurve.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemCurve::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemRect_t {
QByteArrayData data[5];
char stringdata0[48];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemRect_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemRect_t qt_meta_stringdata_QCPItemRect = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPItemRect"
QT_MOC_LITERAL(1, 12, 3), // "pen"
QT_MOC_LITERAL(2, 16, 11), // "selectedPen"
QT_MOC_LITERAL(3, 28, 5), // "brush"
QT_MOC_LITERAL(4, 34, 13) // "selectedBrush"
},
"QCPItemRect\0pen\0selectedPen\0brush\0"
"selectedBrush"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemRect[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, QMetaType::QBrush, 0x00095103,
4, QMetaType::QBrush, 0x00095103,
0 // eod
};
void QCPItemRect::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemRect *_t = static_cast<QCPItemRect *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 3: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemRect *_t = static_cast<QCPItemRect *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 3: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPItemRect::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemRect.data,
qt_meta_data_QCPItemRect, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemRect::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemRect::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemRect.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemRect::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemText_t {
QByteArrayData data[16];
char stringdata0[163];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemText_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemText_t qt_meta_stringdata_QCPItemText = {
{
QT_MOC_LITERAL(0, 0, 11), // "QCPItemText"
QT_MOC_LITERAL(1, 12, 5), // "color"
QT_MOC_LITERAL(2, 18, 13), // "selectedColor"
QT_MOC_LITERAL(3, 32, 3), // "pen"
QT_MOC_LITERAL(4, 36, 11), // "selectedPen"
QT_MOC_LITERAL(5, 48, 5), // "brush"
QT_MOC_LITERAL(6, 54, 13), // "selectedBrush"
QT_MOC_LITERAL(7, 68, 4), // "font"
QT_MOC_LITERAL(8, 73, 12), // "selectedFont"
QT_MOC_LITERAL(9, 86, 4), // "text"
QT_MOC_LITERAL(10, 91, 17), // "positionAlignment"
QT_MOC_LITERAL(11, 109, 13), // "Qt::Alignment"
QT_MOC_LITERAL(12, 123, 13), // "textAlignment"
QT_MOC_LITERAL(13, 137, 8), // "rotation"
QT_MOC_LITERAL(14, 146, 7), // "padding"
QT_MOC_LITERAL(15, 154, 8) // "QMargins"
},
"QCPItemText\0color\0selectedColor\0pen\0"
"selectedPen\0brush\0selectedBrush\0font\0"
"selectedFont\0text\0positionAlignment\0"
"Qt::Alignment\0textAlignment\0rotation\0"
"padding\0QMargins"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemText[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
13, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QColor, 0x00095103,
2, QMetaType::QColor, 0x00095103,
3, QMetaType::QPen, 0x00095103,
4, QMetaType::QPen, 0x00095103,
5, QMetaType::QBrush, 0x00095103,
6, QMetaType::QBrush, 0x00095103,
7, QMetaType::QFont, 0x00095103,
8, QMetaType::QFont, 0x00095103,
9, QMetaType::QString, 0x00095103,
10, 0x80000000 | 11, 0x0009510b,
12, 0x80000000 | 11, 0x0009510b,
13, QMetaType::Double, 0x00095103,
14, 0x80000000 | 15, 0x0009510b,
0 // eod
};
void QCPItemText::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemText *_t = static_cast<QCPItemText *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QColor*>(_v) = _t->color(); break;
case 1: *reinterpret_cast< QColor*>(_v) = _t->selectedColor(); break;
case 2: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 3: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 4: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 5: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
case 6: *reinterpret_cast< QFont*>(_v) = _t->font(); break;
case 7: *reinterpret_cast< QFont*>(_v) = _t->selectedFont(); break;
case 8: *reinterpret_cast< QString*>(_v) = _t->text(); break;
case 9: *reinterpret_cast< Qt::Alignment*>(_v) = _t->positionAlignment(); break;
case 10: *reinterpret_cast< Qt::Alignment*>(_v) = _t->textAlignment(); break;
case 11: *reinterpret_cast< double*>(_v) = _t->rotation(); break;
case 12: *reinterpret_cast< QMargins*>(_v) = _t->padding(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemText *_t = static_cast<QCPItemText *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setColor(*reinterpret_cast< QColor*>(_v)); break;
case 1: _t->setSelectedColor(*reinterpret_cast< QColor*>(_v)); break;
case 2: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 3: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 4: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 5: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 6: _t->setFont(*reinterpret_cast< QFont*>(_v)); break;
case 7: _t->setSelectedFont(*reinterpret_cast< QFont*>(_v)); break;
case 8: _t->setText(*reinterpret_cast< QString*>(_v)); break;
case 9: _t->setPositionAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break;
case 10: _t->setTextAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break;
case 11: _t->setRotation(*reinterpret_cast< double*>(_v)); break;
case 12: _t->setPadding(*reinterpret_cast< QMargins*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPItemText::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemText.data,
qt_meta_data_QCPItemText, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemText::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemText::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemText.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemText::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 13;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 13;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemEllipse_t {
QByteArrayData data[5];
char stringdata0[51];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemEllipse_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemEllipse_t qt_meta_stringdata_QCPItemEllipse = {
{
QT_MOC_LITERAL(0, 0, 14), // "QCPItemEllipse"
QT_MOC_LITERAL(1, 15, 3), // "pen"
QT_MOC_LITERAL(2, 19, 11), // "selectedPen"
QT_MOC_LITERAL(3, 31, 5), // "brush"
QT_MOC_LITERAL(4, 37, 13) // "selectedBrush"
},
"QCPItemEllipse\0pen\0selectedPen\0brush\0"
"selectedBrush"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemEllipse[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, QMetaType::QBrush, 0x00095103,
4, QMetaType::QBrush, 0x00095103,
0 // eod
};
void QCPItemEllipse::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemEllipse *_t = static_cast<QCPItemEllipse *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 3: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemEllipse *_t = static_cast<QCPItemEllipse *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 3: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPItemEllipse::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemEllipse.data,
qt_meta_data_QCPItemEllipse, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemEllipse::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemEllipse::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemEllipse.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemEllipse::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemPixmap_t {
QByteArrayData data[9];
char stringdata0[122];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemPixmap_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemPixmap_t qt_meta_stringdata_QCPItemPixmap = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPItemPixmap"
QT_MOC_LITERAL(1, 14, 6), // "pixmap"
QT_MOC_LITERAL(2, 21, 6), // "scaled"
QT_MOC_LITERAL(3, 28, 15), // "aspectRatioMode"
QT_MOC_LITERAL(4, 44, 19), // "Qt::AspectRatioMode"
QT_MOC_LITERAL(5, 64, 18), // "transformationMode"
QT_MOC_LITERAL(6, 83, 22), // "Qt::TransformationMode"
QT_MOC_LITERAL(7, 106, 3), // "pen"
QT_MOC_LITERAL(8, 110, 11) // "selectedPen"
},
"QCPItemPixmap\0pixmap\0scaled\0aspectRatioMode\0"
"Qt::AspectRatioMode\0transformationMode\0"
"Qt::TransformationMode\0pen\0selectedPen"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemPixmap[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
6, 14, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPixmap, 0x00095103,
2, QMetaType::Bool, 0x00095103,
3, 0x80000000 | 4, 0x00095009,
5, 0x80000000 | 6, 0x00095009,
7, QMetaType::QPen, 0x00095103,
8, QMetaType::QPen, 0x00095103,
0 // eod
};
void QCPItemPixmap::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemPixmap *_t = static_cast<QCPItemPixmap *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPixmap*>(_v) = _t->pixmap(); break;
case 1: *reinterpret_cast< bool*>(_v) = _t->scaled(); break;
case 2: *reinterpret_cast< Qt::AspectRatioMode*>(_v) = _t->aspectRatioMode(); break;
case 3: *reinterpret_cast< Qt::TransformationMode*>(_v) = _t->transformationMode(); break;
case 4: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 5: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemPixmap *_t = static_cast<QCPItemPixmap *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPixmap(*reinterpret_cast< QPixmap*>(_v)); break;
case 1: _t->setScaled(*reinterpret_cast< bool*>(_v)); break;
case 4: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 5: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPItemPixmap::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemPixmap.data,
qt_meta_data_QCPItemPixmap, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemPixmap::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemPixmap::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemPixmap.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemPixmap::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 6;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 6;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemTracer_t {
QByteArrayData data[17];
char stringdata0[156];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemTracer_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemTracer_t qt_meta_stringdata_QCPItemTracer = {
{
QT_MOC_LITERAL(0, 0, 13), // "QCPItemTracer"
QT_MOC_LITERAL(1, 14, 3), // "pen"
QT_MOC_LITERAL(2, 18, 11), // "selectedPen"
QT_MOC_LITERAL(3, 30, 5), // "brush"
QT_MOC_LITERAL(4, 36, 13), // "selectedBrush"
QT_MOC_LITERAL(5, 50, 4), // "size"
QT_MOC_LITERAL(6, 55, 5), // "style"
QT_MOC_LITERAL(7, 61, 11), // "TracerStyle"
QT_MOC_LITERAL(8, 73, 5), // "graph"
QT_MOC_LITERAL(9, 79, 9), // "QCPGraph*"
QT_MOC_LITERAL(10, 89, 8), // "graphKey"
QT_MOC_LITERAL(11, 98, 13), // "interpolating"
QT_MOC_LITERAL(12, 112, 6), // "tsNone"
QT_MOC_LITERAL(13, 119, 6), // "tsPlus"
QT_MOC_LITERAL(14, 126, 11), // "tsCrosshair"
QT_MOC_LITERAL(15, 138, 8), // "tsCircle"
QT_MOC_LITERAL(16, 147, 8) // "tsSquare"
},
"QCPItemTracer\0pen\0selectedPen\0brush\0"
"selectedBrush\0size\0style\0TracerStyle\0"
"graph\0QCPGraph*\0graphKey\0interpolating\0"
"tsNone\0tsPlus\0tsCrosshair\0tsCircle\0"
"tsSquare"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemTracer[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
9, 14, // properties
1, 41, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, QMetaType::QBrush, 0x00095103,
4, QMetaType::QBrush, 0x00095103,
5, QMetaType::Double, 0x00095103,
6, 0x80000000 | 7, 0x0009510b,
8, 0x80000000 | 9, 0x0009510b,
10, QMetaType::Double, 0x00095103,
11, QMetaType::Bool, 0x00095103,
// enums: name, flags, count, data
7, 0x0, 5, 45,
// enum data: key, value
12, uint(QCPItemTracer::tsNone),
13, uint(QCPItemTracer::tsPlus),
14, uint(QCPItemTracer::tsCrosshair),
15, uint(QCPItemTracer::tsCircle),
16, uint(QCPItemTracer::tsSquare),
0 // eod
};
void QCPItemTracer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::RegisterPropertyMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 6:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QCPGraph* >(); break;
}
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
QCPItemTracer *_t = static_cast<QCPItemTracer *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< QBrush*>(_v) = _t->brush(); break;
case 3: *reinterpret_cast< QBrush*>(_v) = _t->selectedBrush(); break;
case 4: *reinterpret_cast< double*>(_v) = _t->size(); break;
case 5: *reinterpret_cast< TracerStyle*>(_v) = _t->style(); break;
case 6: *reinterpret_cast< QCPGraph**>(_v) = _t->graph(); break;
case 7: *reinterpret_cast< double*>(_v) = _t->graphKey(); break;
case 8: *reinterpret_cast< bool*>(_v) = _t->interpolating(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemTracer *_t = static_cast<QCPItemTracer *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 3: _t->setSelectedBrush(*reinterpret_cast< QBrush*>(_v)); break;
case 4: _t->setSize(*reinterpret_cast< double*>(_v)); break;
case 5: _t->setStyle(*reinterpret_cast< TracerStyle*>(_v)); break;
case 6: _t->setGraph(*reinterpret_cast< QCPGraph**>(_v)); break;
case 7: _t->setGraphKey(*reinterpret_cast< double*>(_v)); break;
case 8: _t->setInterpolating(*reinterpret_cast< bool*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
}
const QMetaObject QCPItemTracer::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemTracer.data,
qt_meta_data_QCPItemTracer, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemTracer::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemTracer::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemTracer.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemTracer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 9;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 9;
}
#endif // QT_NO_PROPERTIES
return _id;
}
struct qt_meta_stringdata_QCPItemBracket_t {
QByteArrayData data[10];
char stringdata0[97];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QCPItemBracket_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QCPItemBracket_t qt_meta_stringdata_QCPItemBracket = {
{
QT_MOC_LITERAL(0, 0, 14), // "QCPItemBracket"
QT_MOC_LITERAL(1, 15, 3), // "pen"
QT_MOC_LITERAL(2, 19, 11), // "selectedPen"
QT_MOC_LITERAL(3, 31, 6), // "length"
QT_MOC_LITERAL(4, 38, 5), // "style"
QT_MOC_LITERAL(5, 44, 12), // "BracketStyle"
QT_MOC_LITERAL(6, 57, 8), // "bsSquare"
QT_MOC_LITERAL(7, 66, 7), // "bsRound"
QT_MOC_LITERAL(8, 74, 7), // "bsCurly"
QT_MOC_LITERAL(9, 82, 14) // "bsCalligraphic"
},
"QCPItemBracket\0pen\0selectedPen\0length\0"
"style\0BracketStyle\0bsSquare\0bsRound\0"
"bsCurly\0bsCalligraphic"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QCPItemBracket[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
4, 14, // properties
1, 26, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// properties: name, type, flags
1, QMetaType::QPen, 0x00095103,
2, QMetaType::QPen, 0x00095103,
3, QMetaType::Double, 0x00095103,
4, 0x80000000 | 5, 0x0009510b,
// enums: name, flags, count, data
5, 0x0, 4, 30,
// enum data: key, value
6, uint(QCPItemBracket::bsSquare),
7, uint(QCPItemBracket::bsRound),
8, uint(QCPItemBracket::bsCurly),
9, uint(QCPItemBracket::bsCalligraphic),
0 // eod
};
void QCPItemBracket::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
QCPItemBracket *_t = static_cast<QCPItemBracket *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QPen*>(_v) = _t->pen(); break;
case 1: *reinterpret_cast< QPen*>(_v) = _t->selectedPen(); break;
case 2: *reinterpret_cast< double*>(_v) = _t->length(); break;
case 3: *reinterpret_cast< BracketStyle*>(_v) = _t->style(); break;
default: break;
}
} else if (_c == QMetaObject::WriteProperty) {
QCPItemBracket *_t = static_cast<QCPItemBracket *>(_o);
Q_UNUSED(_t)
void *_v = _a[0];
switch (_id) {
case 0: _t->setPen(*reinterpret_cast< QPen*>(_v)); break;
case 1: _t->setSelectedPen(*reinterpret_cast< QPen*>(_v)); break;
case 2: _t->setLength(*reinterpret_cast< double*>(_v)); break;
case 3: _t->setStyle(*reinterpret_cast< BracketStyle*>(_v)); break;
default: break;
}
} else if (_c == QMetaObject::ResetProperty) {
}
#endif // QT_NO_PROPERTIES
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObject QCPItemBracket::staticMetaObject = {
{ &QCPAbstractItem::staticMetaObject, qt_meta_stringdata_QCPItemBracket.data,
qt_meta_data_QCPItemBracket, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *QCPItemBracket::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QCPItemBracket::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QCPItemBracket.stringdata0))
return static_cast<void*>(this);
return QCPAbstractItem::qt_metacast(_clname);
}
int QCPItemBracket::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QCPAbstractItem::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty
|| _c == QMetaObject::ResetProperty || _c == QMetaObject::RegisterPropertyMetaType) {
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 4;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 4;
}
#endif // QT_NO_PROPERTIES
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
| [
"309496562@qq.com"
] | 309496562@qq.com |
290ae129b46e0b603cdd98da1fe381ec233400ba | 0a4c495e391a1df3fb44a50850dccbbc98637629 | /Direct3D/TextureManager.cpp | 85b51567641c0adc744b460c12743d9ac6860265 | [] | no_license | MrGodin67/Defenders | 0f2c33cb438ee3fb6f20f08570dafd77de0e7206 | 31ffddbfcc157a1f962a42f0cb24e95d7b69ce89 | refs/heads/master | 2021-01-02T22:16:45.547162 | 2017-01-24T18:56:37 | 2017-01-24T18:56:37 | 78,721,463 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 963 | cpp | #include "TextureManager.h"
void TextureManager::LoadImages(std::vector<ImageData>& images)
{
for (size_t i = 0;i < images.size(); i++)
{
auto& it = m_textures.find( images[i].name);
if (it == m_textures.end())// if not found
{
m_textures[images[i].name] = std::make_unique<SpriteSheet>(images[i].filepath, images[i].clipW, images[i].clipH);
assert(m_textures[images[i].name]);
}
}
}
TextureManager::ImageClip TextureManager::GetClip(std::string imageName, const int & index)
{
auto& it = m_textures.find(imageName);
if (it != m_textures.end())// if found
{
ImageClip clip;
clip.bitmap = m_textures[imageName]->GetTexture();
clip.rect = m_textures[imageName]->GetClippedImage(index);
return clip;
}
return ImageClip();
}
SpriteSheet * TextureManager::GetImage(const std::string& name)
{
auto& it = m_textures.find(name);
if (it != m_textures.end())// if found
{
return m_textures[name].get();
}
return nullptr;
}
| [
"apixiehunter@hotmail.com"
] | apixiehunter@hotmail.com |
cb063d94c3ec90fd1581573356caa7d337a4e05d | ddb1f1ec57d4b5987edc26d8bef388d624838993 | /libonvif/include/soapDoorControlBindingProxy.h | a099ad5a61b2dc0ac861c859b34c92c31bb71a25 | [] | no_license | cxhaizxm/onvif-1 | 7f0ab1ddad6c42bf7392338c955c69407d8e480e | 53da94c09870f452e035b23c539576711f94f418 | refs/heads/master | 2023-04-16T12:51:08.083491 | 2021-01-13T01:27:08 | 2021-01-13T01:27:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,872 | h | /* soapDoorControlBindingProxy.h
Generated by gSOAP 2.8.45 for onvif.h
gSOAP XML Web services tools
Copyright (C) 2000-2017, Robert van Engelen, Genivia Inc. All Rights Reserved.
The soapcpp2 tool and its generated software are released under the GPL.
This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
--------------------------------------------------------------------------------
A commercial use license is available from Genivia Inc., contact@genivia.com
--------------------------------------------------------------------------------
*/
#ifndef soapDoorControlBindingProxy_H
#define soapDoorControlBindingProxy_H
#include "soapH.h"
class SOAP_CMAC DoorControlBindingProxy {
public:
/// Context to manage proxy IO and data
struct soap *soap;
bool soap_own; ///< flag indicating that this context is owned by this proxy when context is shared
/// Endpoint URL of service 'DoorControlBindingProxy' (change as needed)
const char *soap_endpoint;
/// Variables globally declared in onvif.h, if any
/// Construct a proxy with new managing context
DoorControlBindingProxy();
/// Copy constructor
DoorControlBindingProxy(const DoorControlBindingProxy& rhs);
/// Construct proxy given a shared managing context
DoorControlBindingProxy(struct soap*);
/// Constructor taking an endpoint URL
DoorControlBindingProxy(const char *endpoint);
/// Constructor taking input and output mode flags for the new managing context
DoorControlBindingProxy(soap_mode iomode);
/// Constructor taking endpoint URL and input and output mode flags for the new managing context
DoorControlBindingProxy(const char *endpoint, soap_mode iomode);
/// Constructor taking input and output mode flags for the new managing context
DoorControlBindingProxy(soap_mode imode, soap_mode omode);
/// Destructor deletes non-shared managing context only (use destroy() to delete deserialized data)
virtual ~DoorControlBindingProxy();
/// Initializer used by constructors
virtual void DoorControlBindingProxy_init(soap_mode imode, soap_mode omode);
/// Return a copy that has a new managing context with the same engine state
virtual DoorControlBindingProxy *copy() SOAP_PURE_VIRTUAL;
/// Copy assignment
DoorControlBindingProxy& operator=(const DoorControlBindingProxy&);
/// Delete all deserialized data (uses soap_destroy() and soap_end())
virtual void destroy();
/// Delete all deserialized data and reset to default
virtual void reset();
/// Disables and removes SOAP Header from message by setting soap->header = NULL
virtual void soap_noheader();
/// Add SOAP Header to message
virtual void soap_header(char *wsa__MessageID, struct wsa__Relationship *wsa__RelatesTo, struct wsa__EndpointReferenceType *wsa__From, struct wsa__EndpointReferenceType *wsa__ReplyTo, struct wsa__EndpointReferenceType *wsa__FaultTo, char *wsa__To, char *wsa__Action, struct wsdd__AppSequenceType *wsdd__AppSequence, char *wsa5__MessageID, struct wsa5__RelatesToType *wsa5__RelatesTo, struct wsa5__EndpointReferenceType *wsa5__From, struct wsa5__EndpointReferenceType *wsa5__ReplyTo, struct wsa5__EndpointReferenceType *wsa5__FaultTo, char *wsa5__To, char *wsa5__Action, struct chan__ChannelInstanceType *chan__ChannelInstance, struct _wsse__Security *wsse__Security);
/// Get SOAP Header structure (i.e. soap->header, which is NULL when absent)
virtual ::SOAP_ENV__Header *soap_header();
/// Get SOAP Fault structure (i.e. soap->fault, which is NULL when absent)
virtual ::SOAP_ENV__Fault *soap_fault();
/// Get SOAP Fault string (NULL when absent)
virtual const char *soap_fault_string();
/// Get SOAP Fault detail as string (NULL when absent)
virtual const char *soap_fault_detail();
/// Close connection (normally automatic, except for send_X ops)
virtual int soap_close_socket();
/// Force close connection (can kill a thread blocked on IO)
virtual int soap_force_close_socket();
/// Print fault
virtual void soap_print_fault(FILE*);
#ifndef WITH_LEAN
#ifndef WITH_COMPAT
/// Print fault to stream
virtual void soap_stream_fault(std::ostream&);
#endif
/// Write fault to buffer
virtual char *soap_sprint_fault(char *buf, size_t len);
#endif
/// Web service operation 'GetServiceCapabilities' (returns SOAP_OK or error code)
virtual int GetServiceCapabilities(_ns7__GetServiceCapabilities *ns7__GetServiceCapabilities, _ns7__GetServiceCapabilitiesResponse &ns7__GetServiceCapabilitiesResponse)
{ return this->GetServiceCapabilities(NULL, NULL, ns7__GetServiceCapabilities, ns7__GetServiceCapabilitiesResponse); }
virtual int GetServiceCapabilities(const char *soap_endpoint, const char *soap_action, _ns7__GetServiceCapabilities *ns7__GetServiceCapabilities, _ns7__GetServiceCapabilitiesResponse &ns7__GetServiceCapabilitiesResponse);
/// Web service operation 'GetDoorInfoList' (returns SOAP_OK or error code)
virtual int GetDoorInfoList(_ns7__GetDoorInfoList *ns7__GetDoorInfoList, _ns7__GetDoorInfoListResponse &ns7__GetDoorInfoListResponse)
{ return this->GetDoorInfoList(NULL, NULL, ns7__GetDoorInfoList, ns7__GetDoorInfoListResponse); }
virtual int GetDoorInfoList(const char *soap_endpoint, const char *soap_action, _ns7__GetDoorInfoList *ns7__GetDoorInfoList, _ns7__GetDoorInfoListResponse &ns7__GetDoorInfoListResponse);
/// Web service operation 'GetDoorInfo' (returns SOAP_OK or error code)
virtual int GetDoorInfo(_ns7__GetDoorInfo *ns7__GetDoorInfo, _ns7__GetDoorInfoResponse &ns7__GetDoorInfoResponse)
{ return this->GetDoorInfo(NULL, NULL, ns7__GetDoorInfo, ns7__GetDoorInfoResponse); }
virtual int GetDoorInfo(const char *soap_endpoint, const char *soap_action, _ns7__GetDoorInfo *ns7__GetDoorInfo, _ns7__GetDoorInfoResponse &ns7__GetDoorInfoResponse);
/// Web service operation 'GetDoorList' (returns SOAP_OK or error code)
virtual int GetDoorList(_ns7__GetDoorList *ns7__GetDoorList, _ns7__GetDoorListResponse &ns7__GetDoorListResponse)
{ return this->GetDoorList(NULL, NULL, ns7__GetDoorList, ns7__GetDoorListResponse); }
virtual int GetDoorList(const char *soap_endpoint, const char *soap_action, _ns7__GetDoorList *ns7__GetDoorList, _ns7__GetDoorListResponse &ns7__GetDoorListResponse);
/// Web service operation 'GetDoors' (returns SOAP_OK or error code)
virtual int GetDoors(_ns7__GetDoors *ns7__GetDoors, _ns7__GetDoorsResponse &ns7__GetDoorsResponse)
{ return this->GetDoors(NULL, NULL, ns7__GetDoors, ns7__GetDoorsResponse); }
virtual int GetDoors(const char *soap_endpoint, const char *soap_action, _ns7__GetDoors *ns7__GetDoors, _ns7__GetDoorsResponse &ns7__GetDoorsResponse);
/// Web service operation 'CreateDoor' (returns SOAP_OK or error code)
virtual int CreateDoor(_ns7__CreateDoor *ns7__CreateDoor, _ns7__CreateDoorResponse &ns7__CreateDoorResponse)
{ return this->CreateDoor(NULL, NULL, ns7__CreateDoor, ns7__CreateDoorResponse); }
virtual int CreateDoor(const char *soap_endpoint, const char *soap_action, _ns7__CreateDoor *ns7__CreateDoor, _ns7__CreateDoorResponse &ns7__CreateDoorResponse);
/// Web service operation 'SetDoor' (returns SOAP_OK or error code)
virtual int SetDoor(_ns7__SetDoor *ns7__SetDoor, _ns7__SetDoorResponse &ns7__SetDoorResponse)
{ return this->SetDoor(NULL, NULL, ns7__SetDoor, ns7__SetDoorResponse); }
virtual int SetDoor(const char *soap_endpoint, const char *soap_action, _ns7__SetDoor *ns7__SetDoor, _ns7__SetDoorResponse &ns7__SetDoorResponse);
/// Web service operation 'ModifyDoor' (returns SOAP_OK or error code)
virtual int ModifyDoor(_ns7__ModifyDoor *ns7__ModifyDoor, _ns7__ModifyDoorResponse &ns7__ModifyDoorResponse)
{ return this->ModifyDoor(NULL, NULL, ns7__ModifyDoor, ns7__ModifyDoorResponse); }
virtual int ModifyDoor(const char *soap_endpoint, const char *soap_action, _ns7__ModifyDoor *ns7__ModifyDoor, _ns7__ModifyDoorResponse &ns7__ModifyDoorResponse);
/// Web service operation 'DeleteDoor' (returns SOAP_OK or error code)
virtual int DeleteDoor(_ns7__DeleteDoor *ns7__DeleteDoor, _ns7__DeleteDoorResponse &ns7__DeleteDoorResponse)
{ return this->DeleteDoor(NULL, NULL, ns7__DeleteDoor, ns7__DeleteDoorResponse); }
virtual int DeleteDoor(const char *soap_endpoint, const char *soap_action, _ns7__DeleteDoor *ns7__DeleteDoor, _ns7__DeleteDoorResponse &ns7__DeleteDoorResponse);
/// Web service operation 'GetDoorState' (returns SOAP_OK or error code)
virtual int GetDoorState(_ns7__GetDoorState *ns7__GetDoorState, _ns7__GetDoorStateResponse &ns7__GetDoorStateResponse)
{ return this->GetDoorState(NULL, NULL, ns7__GetDoorState, ns7__GetDoorStateResponse); }
virtual int GetDoorState(const char *soap_endpoint, const char *soap_action, _ns7__GetDoorState *ns7__GetDoorState, _ns7__GetDoorStateResponse &ns7__GetDoorStateResponse);
/// Web service operation 'AccessDoor' (returns SOAP_OK or error code)
virtual int AccessDoor(_ns7__AccessDoor *ns7__AccessDoor, _ns7__AccessDoorResponse &ns7__AccessDoorResponse)
{ return this->AccessDoor(NULL, NULL, ns7__AccessDoor, ns7__AccessDoorResponse); }
virtual int AccessDoor(const char *soap_endpoint, const char *soap_action, _ns7__AccessDoor *ns7__AccessDoor, _ns7__AccessDoorResponse &ns7__AccessDoorResponse);
/// Web service operation 'LockDoor' (returns SOAP_OK or error code)
virtual int LockDoor(_ns7__LockDoor *ns7__LockDoor, _ns7__LockDoorResponse &ns7__LockDoorResponse)
{ return this->LockDoor(NULL, NULL, ns7__LockDoor, ns7__LockDoorResponse); }
virtual int LockDoor(const char *soap_endpoint, const char *soap_action, _ns7__LockDoor *ns7__LockDoor, _ns7__LockDoorResponse &ns7__LockDoorResponse);
/// Web service operation 'UnlockDoor' (returns SOAP_OK or error code)
virtual int UnlockDoor(_ns7__UnlockDoor *ns7__UnlockDoor, _ns7__UnlockDoorResponse &ns7__UnlockDoorResponse)
{ return this->UnlockDoor(NULL, NULL, ns7__UnlockDoor, ns7__UnlockDoorResponse); }
virtual int UnlockDoor(const char *soap_endpoint, const char *soap_action, _ns7__UnlockDoor *ns7__UnlockDoor, _ns7__UnlockDoorResponse &ns7__UnlockDoorResponse);
/// Web service operation 'BlockDoor' (returns SOAP_OK or error code)
virtual int BlockDoor(_ns7__BlockDoor *ns7__BlockDoor, _ns7__BlockDoorResponse &ns7__BlockDoorResponse)
{ return this->BlockDoor(NULL, NULL, ns7__BlockDoor, ns7__BlockDoorResponse); }
virtual int BlockDoor(const char *soap_endpoint, const char *soap_action, _ns7__BlockDoor *ns7__BlockDoor, _ns7__BlockDoorResponse &ns7__BlockDoorResponse);
/// Web service operation 'LockDownDoor' (returns SOAP_OK or error code)
virtual int LockDownDoor(_ns7__LockDownDoor *ns7__LockDownDoor, _ns7__LockDownDoorResponse &ns7__LockDownDoorResponse)
{ return this->LockDownDoor(NULL, NULL, ns7__LockDownDoor, ns7__LockDownDoorResponse); }
virtual int LockDownDoor(const char *soap_endpoint, const char *soap_action, _ns7__LockDownDoor *ns7__LockDownDoor, _ns7__LockDownDoorResponse &ns7__LockDownDoorResponse);
/// Web service operation 'LockDownReleaseDoor' (returns SOAP_OK or error code)
virtual int LockDownReleaseDoor(_ns7__LockDownReleaseDoor *ns7__LockDownReleaseDoor, _ns7__LockDownReleaseDoorResponse &ns7__LockDownReleaseDoorResponse)
{ return this->LockDownReleaseDoor(NULL, NULL, ns7__LockDownReleaseDoor, ns7__LockDownReleaseDoorResponse); }
virtual int LockDownReleaseDoor(const char *soap_endpoint, const char *soap_action, _ns7__LockDownReleaseDoor *ns7__LockDownReleaseDoor, _ns7__LockDownReleaseDoorResponse &ns7__LockDownReleaseDoorResponse);
/// Web service operation 'LockOpenDoor' (returns SOAP_OK or error code)
virtual int LockOpenDoor(_ns7__LockOpenDoor *ns7__LockOpenDoor, _ns7__LockOpenDoorResponse &ns7__LockOpenDoorResponse)
{ return this->LockOpenDoor(NULL, NULL, ns7__LockOpenDoor, ns7__LockOpenDoorResponse); }
virtual int LockOpenDoor(const char *soap_endpoint, const char *soap_action, _ns7__LockOpenDoor *ns7__LockOpenDoor, _ns7__LockOpenDoorResponse &ns7__LockOpenDoorResponse);
/// Web service operation 'LockOpenReleaseDoor' (returns SOAP_OK or error code)
virtual int LockOpenReleaseDoor(_ns7__LockOpenReleaseDoor *ns7__LockOpenReleaseDoor, _ns7__LockOpenReleaseDoorResponse &ns7__LockOpenReleaseDoorResponse)
{ return this->LockOpenReleaseDoor(NULL, NULL, ns7__LockOpenReleaseDoor, ns7__LockOpenReleaseDoorResponse); }
virtual int LockOpenReleaseDoor(const char *soap_endpoint, const char *soap_action, _ns7__LockOpenReleaseDoor *ns7__LockOpenReleaseDoor, _ns7__LockOpenReleaseDoorResponse &ns7__LockOpenReleaseDoorResponse);
/// Web service operation 'DoubleLockDoor' (returns SOAP_OK or error code)
virtual int DoubleLockDoor(_ns7__DoubleLockDoor *ns7__DoubleLockDoor, _ns7__DoubleLockDoorResponse &ns7__DoubleLockDoorResponse)
{ return this->DoubleLockDoor(NULL, NULL, ns7__DoubleLockDoor, ns7__DoubleLockDoorResponse); }
virtual int DoubleLockDoor(const char *soap_endpoint, const char *soap_action, _ns7__DoubleLockDoor *ns7__DoubleLockDoor, _ns7__DoubleLockDoorResponse &ns7__DoubleLockDoorResponse);
};
#endif
| [
"wangchch01@inspur.com"
] | wangchch01@inspur.com |
a695a1438e0d15898aebbb0ed7d7fac8f4a02c4b | 3abb2c363791dc0df0045e83400ccc28f0d7f248 | /src/ofxBaseJoint.h | d3decb765a3ed1fb1a42d8589d774175443466b8 | [
"MIT"
] | permissive | ovicin/ofxPiMapper | 87743a66b327adaf7d75e5cce9c7f2a0dfb482a0 | eb76d42c768d45d7d485762eaa57bae0f5c8bb46 | refs/heads/master | 2021-01-20T17:54:18.926669 | 2014-09-09T17:17:45 | 2014-09-09T17:17:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,075 | h | #ifndef H_OFX_BASE_JOINT
#define H_OFX_BASE_JOINT
#include "ofMain.h"
class ofxBaseJoint {
public:
ofxBaseJoint();
~ofxBaseJoint();
void registerMouseEvents();
void unregisterMouseEvents();
ofVec2f position;
bool enabled;
bool visible;
bool selected;
void mousePressed(ofMouseEventArgs& args);
void mouseReleased(int x, int y, int button);
void mouseDragged(ofMouseEventArgs& args);
void startDrag();
void stopDrag();
void select();
void unselect();
void setClickDistance(ofVec2f newClickDistance);
bool isDragged();
bool isSelected();
virtual void update(){};
virtual void draw(){};
virtual bool hitTest(ofVec2f position){};
protected:
ofColor fillColor;
ofColor strokeColor;
ofColor fillColorSelected;
ofColor strokeColorSelected;
float strokeWidth;
ofVec2f clickDistance; // How far from the center of the joint the user has clicked?
bool bDrag;
private:
void setDefaultColors();
void setDefaultProperties();
};
#endif
| [
"krisjanis.rijnieks@gmail.com"
] | krisjanis.rijnieks@gmail.com |
0876f3f863fe37d6f70664cd9c9ef99a944676ea | 0f0f2bc6f364edbcffe0495a14c0d87abfbbc1b5 | /Lista 3 - Backtracking e Divisão e Conquista/2 - Freshman Beats Veteran.cpp | 458c27ef4839e4504c0b081cdbc3d88cbbee61c1 | [
"Apache-2.0"
] | permissive | Dsbaule/INE5452 | c6bb542df222e79022fd11624ad4cc36f8990eb9 | 1f9898c1ae5bf5ec1dbdc948e96a0a603a206113 | refs/heads/master | 2021-03-10T07:03:30.084113 | 2020-12-15T01:40:18 | 2020-12-15T01:40:18 | 246,432,326 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 736 | cpp | #include <iostream>
using namespace std;
int main() {
int N, cur_number, i, index, total;
string inputString;
while(cin >> N ){
int numbers[N];
total = 0;
for(i = 0; i < N; i++)
numbers[i] = 0;
for(i = 0; i < N; i++) {
cin >> inputString;
for(index = 0; (inputString[index] != '/') && (index < 10); index++);
cur_number = stoi(inputString.substr(0, index));
//cout << cur_number << endl;
for(int j = 0; j < i; j++)
if(numbers[j] > cur_number)
total++;
numbers[i] = cur_number;
}
cout << total << endl;
}
} | [
"dsbaule@gmail.com"
] | dsbaule@gmail.com |
18ccf8781c0c3bcb71ec8f65a691c4ae0a88bbe0 | 0cb85cd0c88a9b9f0cca4472742c2bf9febef2d8 | /CS AdminKit/development2/kca/test/prts/prts_test.h | 8e7341daf2760b0dea54e81a7b5aa1ef33d46f27 | [] | no_license | seth1002/antivirus-1 | 9dfbadc68e16e51f141ac8b3bb283c1d25792572 | 3752a3b20e1a8390f0889f6192ee6b851e99e8a4 | refs/heads/master | 2020-07-15T00:30:19.131934 | 2016-07-21T13:59:11 | 2016-07-21T13:59:11 | null | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 2,516 | h | // Test.h: interface for the CTest class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(PRTS_TEST_H)
#define PRTS_TEST_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "build/general.h"
#include <kca/prts/tasksstorage.h>
#include <exception>
#include <list>
#include <vector>
#include <testmodule.h>
#include <helpers.h>
using namespace KLPAR;
using namespace KLERR;
using namespace KLSTD;
using namespace KLPRTS;
//////////////////////////////////////////////////////////////////////
#ifdef WIN32
# define TASK_STORAGE_FILE_PATH TEXT("c:\\PRTS_STORAGE")
# define TASK_STORAGE_FILE_PATH_W L"c:\\PRTS_STORAGE"
#endif
#ifdef __unix
# define TASK_STORAGE_FILE_PATH L"./PRTS_STORAGE"
# define TASK_STORAGE_FILE_PATH_W L"./PRTS_STORAGE"
#endif
#ifdef N_PLAT_NLM
# define TASK_STORAGE_FILE_PATH L"sys:/csdata/PRTS_STORAGE"
# define TASK_STORAGE_FILE_PATH_W L"sys:/csdata/PRTS_STORAGE"
#endif
#define TR_PRTS_SERVER_ADDRESSL L"http://127.0.0.1:16001"
#define KLPRTS_TASK_STORAGE_TEST std::wstring(L"KLPRTS_TASK_STORAGE_TEST")
extern std::wstring g_sPRTSTrServerCompName; // транспортное имя компоненты
extern KLPRCI::ComponentId g_cidPRTSServerComponent;
//////////////////////////////////////////////////////////////////////
// CPRTSTest
class CPRTSTest
{
public:
CPRTSTest();
bool Run();
private:
time_t m_time;
std::wstring m_sComponentName;
bool IsItMyOwnTask(std::wstring TaskID, std::vector<std::wstring>& arTaskUniqueIDs);
// Steps
void AddTasks(TasksStorage* pTasks, std::vector<std::wstring>& arTaskUniqueIDs);
void VerifyAddTasks(TasksStorage* pTasks, std::vector<std::wstring>& arTaskUniqueIDs);
void UpdateTasks(TasksStorage* pTasks, std::vector<std::wstring>& arTaskUniqueIDs);
void VerifyUpdateTasks(TasksStorage* pTasks, std::vector<std::wstring>& arTaskUniqueIDs);
void DeleteTasks(TasksStorage* pTasks, std::vector<std::wstring>& arTaskUniqueIDs);
void VerifyDeleteTasks(TasksStorage* pTasks, std::vector<std::wstring>& arTaskUniqueIDs);
};
class CPRTSGeneralTest2 : public KLSTD::KLBaseImpl<KLTST2::Test2>
{
public:
IMPLEMENT_TEST2_INSTANTIATE(CPRTSGeneralTest2)
void Initialize(KLTST2::TestData2* pTestData);
KLSTD_NOTHROW void Deinitialize() throw();
virtual long Run();
protected:
CPRTSTest m_Test;
};
void PRTSTestInit();
void PRTSTestDeInit();
#endif // !defined(PRTS_TEST_H)
| [
"idrez.mochamad@gmail.com"
] | idrez.mochamad@gmail.com |
7592f7a67e50f6f84cefec0e7658a456ec35c0c6 | 7d276c47a466258925f2bbaccb81f4c64d28a6c5 | /scanner.h | fd8664898b2f339c053e81f385576873515b72df | [] | no_license | ThomasAtlantis/CCompile | aae71d033301ce995198473c9492cc60220dade3 | 0bf04b86137cc9f118b58456e513d62aee74e004 | refs/heads/master | 2020-04-05T06:14:58.734193 | 2018-12-10T15:20:45 | 2018-12-10T15:20:45 | 156,631,415 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,197 | h | #ifndef SCANNER_H_INCLUDED
#define SCANNER_H_INCLUDED
#include "public_tools.h"
#include "process_constant_num.h"
#include "process_character.h"
#include "process_character_string.h"
// 扫描器函数返回值类型
typedef struct {
Token token; // token
int error_type; // 错误类型:0:无错误;1:EOF;-1:fatal error
string error_log; // 错误的详细报告
} ScannerGet;
// 扫描器函数
ScannerGet scanner(
string& buffer, // 存储源程序全文的缓冲区
unsigned int& cur_index, // 当前处理位置
unsigned int& line_label, // 当前处理行标
vector<string>& KT, // 关键字表
vector<string>& PT, // 界符表
vector<string>& IT, // 标识符表
vector<char>& cT, // 字符常量表
vector<string>& ST, // 字符串常量表
vector<double>& CT // 算术常量表
);
template <typename T>
void print_vector(vector<T>& vec) {
if (vec.empty()) return;
for (unsigned int i = 0; i < vec.size(); i++) {
cout << left << "[" << setw(4) << i << "] " << setw(30) << vec[i];
if (i % 4 == 3) cout << endl;
}
if (vec.size() % 4) cout << endl;
}
#endif // SCANNER_H_INCLUDED
| [
"1138670081@qq.com"
] | 1138670081@qq.com |
3b6f010570e3940dd45461c6d0a13ba547c4292d | c93abb5a3d88dbc9a55bd449ad50ae9e39d971a1 | /MiniTreeAnalysis/NTupleAnalysis/macros/TopDileptons_SpinCorr/Unfolding/UNFOLDING/pseudoexp.cpp | aa660d7b92138ffb92b735a73c623a655221d141 | [] | no_license | fhoehle/NTupleFWKIPHC | 883fba9bbb79a9351d0fe818ac35660f071b7d45 | 03c379461b02efa484f9d428f650e3a83e9490b7 | refs/heads/master | 2020-08-05T00:52:23.238768 | 2013-05-21T23:12:54 | 2013-05-21T23:12:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19,867 | cpp | #include <iostream>
#include <assert.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TF1.h>
#include <THStack.h>
#include <TCanvas.h>
#include <TLegend.h>
#include <TMath.h>
#include <TFile.h>
#include <TLatex.h>
#include <TROOT.h>
#include <TSpline.h>
#include <TUnfold.h>
#include <TUnfoldSys.h>
#include <TGraphAsymmErrors.h>
#include <TGraphErrors.h>
#include <sstream>
#include <vector>
#include <utility>
#include <algorithm>
#include <TPave.h>
#include <TPaveText.h>
#include <TVirtualPad.h>
#include <TClass.h>
#include "TApplication.h"
#include "TRandom3.h"
#include <fstream>
#include <sys/stat.h> // for mkdir
#include <sys/types.h>
#include "cmsstyle.hpp"
#include "fitresults.hpp"
#include "helpers.hpp"
#include "binning.hpp"
#include "specialhelpers.hpp"
// WARNING make sure variables in binning.hpp are set correctly
#include "myunfold_class.hpp"
#include "myunfold_class1d.hpp"
#ifndef FINDTAU
const int numexperiments = 5000; // should be about 50,000: to run pseudo experiments for linearity plots
#else
const int numexperiments = 100; // to find tau
#endif
int pseudoexp()
{
TH1::SetDefaultSumw2(true);
// if(correct_for_lincheck)
// cout << "WARNING: correcting for lincheck results!" << endl << endl;
// else
// cout << "WARNING: NOT correcting for lincheck results!" << endl << endl;
TRandom3* random = new TRandom3();
random->SetSeed();
//style stuff
CMSStyle* cmsstyle = new CMSStyle();
//gStyle->SetOptStat("");
TCanvas* canv1 = new TCanvas("canv1","canv1",300,0,800,600);
canv1->SetBatch();
canv1->SetRightMargin(0.04); // this would be cms recommendation, but we need...
canv1->SetRightMargin(0.14); // this - to make z-axis stuff show completely in 2d plots
// get true generated values from before selection
// TFile* preselfile = new TFile(TString("output/")+fileSuffix+"/seleff.root");
TFile* preselfile = new TFile(TString("output/")+"seleff.root");
TH2F* hpresel = (TH2F*)preselfile->Get("preN");
TH1F* hpreselunwrapped = new TH1F("hpreselunwrapped","hpreselunwrapped", nbinsafter, 0.5, nbinsafter+0.5); ;
unwrap2dhisto(hpresel, hpreselunwrapped);
cmsstyle->setup_style_2D(hpresel, labelOfXAxisVar, labelOfSensVar);
// same for "1d" case where there's only 1 m-bin
// TFile* preselfile1d = new TFile(TString("output/")+fileSuffix+"/1dseleff.root");
TFile* preselfile1d = new TFile(TString("output/")+"1dseleff.root");
TH2F* hpresel1d = (TH2F*)preselfile1d->Get("preN");
TH1F* hpreselunwrapped1d = new TH1F("hpreselunwrapped1d","hpreselunwrapped1d", nbinsafter1d, 0.5, nbinsafter1d+0.5); ;
unwrap2dhisto(hpresel1d, hpreselunwrapped1d);
cmsstyle->setup_style_2D(hpresel1d, labelOfXAxisVar, labelOfSensVar);
MyUnfold myunfold;
MyUnfold1d myunfold1d;
// calculate value for MC to be normalized to
// (basically, the fit result of ttbar divided by selection efficiency)
const double npresel = hpresel->Integral();
TH2F* hnonselected = (TH2F*)preselfile->Get("nonselected_reweighted");
const double nmigmatrixselected = myunfold.migmatrix->Integral();
const double nmigmatrix = nmigmatrixselected + hnonselected->Integral();
const double totalseleff = nmigmatrixselected / nmigmatrix;
const double expected_ttbar_presel = (nttbarele /*+ nttbarmu*/) / totalseleff;
// calculate "true" asymmetry of our sample
const double truepos = hpresel->Integral(1, nbinsmafter, nbinsetaafter/2+1, nbinsetaafter);
const double trueneg = hpresel->Integral(1, nbinsmafter, 1, nbinsetaafter/2);
const double trueasy = (truepos-trueneg)/(truepos+trueneg);
// ...and also true asymmetries for the individual mass bins
double difftrueasys[nbinsmafter];
for(int i=0; i<nbinsmafter; i++)
{
const double pos = hpresel->Integral(i+1, i+1, nbinsetaafter/2+1, nbinsetaafter);
const double neg = hpresel->Integral(i+1, i+1, 1, nbinsetaafter/2);
difftrueasys[i] = (pos-neg)/(pos+neg);
}
/// init all kinds of histograms for our results
TH1F* asys = new TH1F("asys", "asys", 500, -1., 1.);
TH1F* asys1d = new TH1F("asys1d", "asys1d", 500, -1., 1.);
TH1F* asypull = new TH1F("asypull", "asypull", 500, -10.0, 10.0);
TH1F* asypull1d = new TH1F("asypull1d", "asypull1d", 500, -10.0, 10.0);
TH1F* asydiff = new TH1F("asydiff", "asydiff", 100, -0.1, 0.1);
TH1F* asydiff1d = new TH1F("asydiff1d", "asydiff1d", 100, -0.1, 0.1);
TH1F* ndiff = new TH1F("ndiff", "ndiff", 100, -1200000, 1200000);
TH1F* ndiff1d = new TH1F("ndiff1d", "ndiff1d", 100, -1200000, 1200000);
TH1F* nreldiff = new TH1F("nreldiff", "nreldiff", 100, -3, 3);
TH1F* nreldiff1d = new TH1F("nreldiff1d", "nreldiff1d", 100, -3, 3);
TH1F* log10taus = new TH1F("log10taus", "log10taus", 1000, -6, -1.5);
TH1F* log10taus1d = new TH1F("log10taus1d", "log10taus1d", 1000, -6, -1.5);
// TH1F* asyerrors = new TH1F("asyerrors", "asyerrors", 100, 0.008, 0.014);
// TH1F* asyerrors1d = new TH1F("asyerrors1d", "asyerrors1d", 100, 0.008, 0.014);
TH1F* asyerrors = new TH1F("asyerrors", "asyerrors", 1000, 0., 0.5);
TH1F* asyerrors1d = new TH1F("asyerrors1d", "asyerrors1d", 1000, 0., 0.5);
TH2F* asy1dvs2d = new TH2F("asy1dvs2d", "asy1dvs2d", 50, -0.1, 0.1, 50, -0.1, 0.1);
TH1F* asydifference = new TH1F("asydifference", "asydifference", 100, -0.25, 0.25); // differences for 1d vs 2d unfolding
// init histos for relative differences bin-by-bin
TH1F* reldiffs[nbinsafter];
TH1F* pulls[nbinsafter];
for(int i=0; i<nbinsafter; i++)
{
char name[20];
sprintf(name, "reldiff%d", i);
reldiffs[i] = new TH1F(name, name, 100, -0.5, 0.5);
sprintf(name, "pull%d", i);
pulls[i] = new TH1F(name, name, 100, -5, 5);
}
TH1F* reldiffs1d[nbinsafter1d];
TH1F* pulls1d[nbinsafter1d];
for(int i=0; i<nbinsafter1d; i++)
{
char name[20];
sprintf(name, "1dreldiff%d", i);
reldiffs1d[i] = new TH1F(name, name, 100, -0.5, 0.5);
sprintf(name, "1dpull%d", i);
pulls1d[i] = new TH1F(name, name, 100, -5, 5);
}
// histos for asymmetries in the different mass bins
TH1F* diffasys[nbinsmafter];
for(int i=0; i<nbinsmafter; i++)
{
char name[20];
sprintf(name, "diffasybin%d", i);
diffasys[i] = new TH1F(name, name, 100, -0.35, 0.35);
}
TH1F* diffasydiffs[nbinsmafter];
TH1F* diffasypulls[nbinsmafter];
TH1F* diffasyerrors[nbinsmafter];
for(int i=0; i<nbinsmafter; i++)
{
char name[20];
sprintf(name, "diffasydiffbin%d", i);
diffasydiffs[i] = new TH1F(name, name, 100, -0.35, 0.35);
sprintf(name, "diffasypullbin%d", i);
diffasypulls[i] = new TH1F(name, name, 500, -10., 10.);
sprintf(name, "diffasyerrorbin%d", i);
double lowedge = 0.;
double highedge = 0.5;
/*
if(!TString(nameOfXAxisVarShort).CompareTo("m"))
{
if(i==0) {lowedge=0.025; highedge=0.035;}
else if(i==1) {lowedge=0.01; highedge=0.02;}
else {lowedge=0.015; highedge=0.025;}
}
else if(!TString(nameOfXAxisVarShort).CompareTo("pt"))
{
if(i==0) {lowedge=0.02; highedge=0.03;}
else if(i==1) {lowedge=0.01; highedge=0.02;}
else {lowedge=0.015; highedge=0.025;}
}
else if(!TString(nameOfXAxisVarShort).CompareTo("y"))
{
if(i==0) {lowedge=0.015; highedge=0.025;}
else if(i==1) {lowedge=0.01; highedge=0.02;}
else {lowedge=0.015; highedge=0.025;}
}
*/
diffasyerrors[i] = new TH1F(name, name, 1000, lowedge, highedge);
}
// init array with true presel bin contents for comparison
double truecontents[nbinsafter];
for(int i=0; i<nbinsafter; i++)
{
truecontents[i] = hpreselunwrapped->GetBinContent(i+1) * expected_ttbar_presel / npresel;
}
double truecontents1d[nbinsafter1d];
for(int i=0; i<nbinsafter1d; i++)
{
truecontents1d[i] = hpreselunwrapped1d->GetBinContent(i+1) * expected_ttbar_presel / npresel;
}
TH1::AddDirectory(kFALSE);
/// perform actual experiments
for(int n=0; n<numexperiments; n++)
{
if(n%1000 == 0)
cout << "Experiment number " << n << endl;
// create pseudo data histo
TH2F hrec("hrec","hrec", nbinsm, 0.5, nbinsm+0.5, nbinseta, 0.5, nbinseta+0.5);
TH2F hrec1d("hrec1d","hrec1d", nbinsm1d, mbinedges1d, nbinseta1d, etabinedges1d);
// loop over backgrounds and signal to compose pseudo-data-sample
for(int i=0; i<4; i++)
{
TH2F* h = 0;
TH2F* h1d = 0;
double nfit = 0;
double fiterror = 0;
switch (i)
{
case 0: h=myunfold.httbar_ele; h1d=myunfold1d.httbar_ele; nfit=nttbarele; fiterror=0; break;
// case 1: h=myunfold.httbar_mu; h1d=myunfold1d.httbar_mu; nfit=nttbarmu; fiterror=0; break;
default: const int tempi = i-1;
h=myunfold.bgwrappedlist[tempi];
h1d=myunfold1d.bgwrappedlist[tempi];
nfit=myunfold.bgintegrals[tempi];
fiterror=myunfold.bgabserrors[tempi];
break;
// case 2: h=myunfold.hwjets_neg_ele; h1d=myunfold1d.hwjets_neg_ele; nfit=nwjetsnegele; fiterror=nwjetsnegeleerror; break;
// case 3: h=myunfold.hzjets_ele; h1d=myunfold1d.hzjets_ele; nfit=nzjetsele; fiterror=nzjetseleerror; break;
// case 4: h=myunfold.hstt_ele; h1d=myunfold1d.hstt_ele; nfit=nstele; fiterror=nsteleerror; break; //it's named stt, but it's whole single t
// case 5: h=myunfold.hqcd_ele; h1d=myunfold1d.hqcd_ele; nfit=nqcdele; fiterror=nqcdeleerror; break;
//
// case 6: h=myunfold.httbar_mu; h1d=myunfold1d.httbar_mu; nfit=nttbarmu; fiterror=0; break;
// case 7: h=myunfold.hwjets_pos_mu; h1d=myunfold1d.hwjets_pos_mu; nfit=nwjetsposmu; fiterror=nwjetsposmuerror; break;
// case 8: h=myunfold.hwjets_neg_mu; h1d=myunfold1d.hwjets_neg_mu; nfit=nwjetsnegmu; fiterror=nwjetsnegmuerror; break;
// case 9: h=myunfold.hzjets_mu; h1d=myunfold1d.hzjets_mu; nfit=nzjetsmu; fiterror=nzjetsmuerror; break;
// case 10: h=myunfold.hstt_mu; h1d=myunfold1d.hstt_mu; nfit=nstmu; fiterror=nstmuerror; break; //it's named stt, but it's whole single t
// case 11: h=myunfold.hqcd_mu; h1d=myunfold1d.hqcd_mu; nfit=nqcdmu; fiterror=nqcdmuerror; break;
}
// WARNING assumes fiterror scales with lumi - pessimistic
const int ndraw = random->Poisson(drawfactor * ( fiterror != 0 ? random->Gaus(nfit, fiterror) : nfit ));
// vary all distributions using bin-by-bin errors.
// this accounts for the limited MC statistics
{
TH2F* hclone = (TH2F*) h->Clone();
TH2F* h1dclone = (TH2F*) h1d->Clone();
const int nbinsx = hclone->GetNbinsX();
const int nbinsx1d = h1dclone->GetNbinsX();
const int nbinsy = hclone->GetNbinsY();
const int nbinsy1d = h1dclone->GetNbinsY();
for(int x=0; x<nbinsx+1; x++)
{
for(int y=0; y<nbinsy+1; y++)
{
const double val = hclone->GetBinContent(x, y);
const double err = hclone->GetBinError(x, y);
hclone->SetBinContent(x, y, random->Gaus(val, err));
}
}
for(int x=0; x<nbinsx1d+1; x++)
{
for(int y=0; y<nbinsy1d+1; y++)
{
const double val = h1dclone->GetBinContent(x, y);
const double err = h1dclone->GetBinError(x, y);
h1dclone->SetBinContent(x, y, random->Gaus(val, err));
}
}
h = hclone;
h1d = h1dclone;
}
Double_t mass, sensvar;
for(int j=0; j<ndraw; j++)
{
h->GetRandom2(mass, sensvar); // writes into the two variables!
fill_nooverflow_2d(&hrec, mass, sensvar, 1);
h1d->GetRandom2(mass, sensvar); // writes into the two variables!
fill_nooverflow_2d(&hrec1d, mass, sensvar, 1);
}
}
// unfold it
TH2F* hunfold = myunfold.unfoldHisto(&hrec, true, drawfactor); // we'll treat the pseudo experiments as if they were real data.
log10taus->Fill(TMath::Log10(myunfold.lastTau));
//hrec1d.Sumw2(); // recalc errors, hopefully this works
TH2F* hunfold1d = myunfold1d.unfoldHisto(&hrec1d, true, drawfactor);
log10taus1d->Fill(TMath::Log10(myunfold1d.lastTau));
// calc asys and other values needed for histos
const double pos = hunfold->Integral(1, nbinsmafter, nbinsetaafter/2+1, nbinsetaafter);
const double neg = hunfold->Integral(1, nbinsmafter, 1, nbinsetaafter/2);
double asy = (pos-neg)/(pos+neg);
/*
if(correct_for_lincheck)
{
asy -= lincheck_offset; // correct for offset of linearity check
asy /= lincheck_slope; // correct for linearity check not yielding slope of 1
}
*/
const double asy_error = asymmetryerror_afterunfolding_2d(myunfold.errormatrix, nbinsafter, pos, neg, nbinsetaafter);
// cout << "asy_error: " << asy_error << endl;
// cout << "asydiff: " << asy-trueasy << endl;
asys->Fill(asy);
asyerrors->Fill(asy_error);
asypull->Fill((asy-trueasy)/asy_error);
asydiff->Fill(asy-trueasy);
for(int i=0; i<nbinsafter; i++)
{
const double reldiff = ( myunfold.hunfoldunwrapped->GetBinContent(i+1) - truecontents[i] * drawfactor ) / ( truecontents[i] *drawfactor );
reldiffs[i]->Fill(reldiff);
const double pull = ( myunfold.hunfoldunwrapped->GetBinContent(i+1) - truecontents[i] * drawfactor ) / myunfold.hunfoldunwrapped->GetBinError(i+1);
pulls[i]->Fill(pull);
}
for(int i=0; i<nbinsafter1d; i++)
{
const double reldiff = ( myunfold1d.hunfoldunwrapped->GetBinContent(i+1) - truecontents1d[i] * drawfactor ) / ( truecontents1d[i] *drawfactor );
reldiffs1d[i]->Fill(reldiff);
const double pull = ( myunfold1d.hunfoldunwrapped->GetBinContent(i+1) - truecontents1d[i] * drawfactor ) / myunfold1d.hunfoldunwrapped->GetBinError(i+1);
pulls1d[i]->Fill(pull);
}
for(int i=0; i<nbinsmafter; i++)
{
const double pos = hunfold->Integral(i+1, i+1, nbinsetaafter/2+1, nbinsetaafter);
const double neg = hunfold->Integral(i+1, i+1, 1, nbinsetaafter/2);
double asy = (pos-neg)/(pos+neg);
/*
if(correct_for_lincheck)
{
asy -= lincheck_diffoffset[i]; // correct for linearity check having offset
asy /= lincheck_diffslope[i]; // correct for linearity check not yielding slope of 1
}
*/
diffasys[i]->Fill(asy);
diffasydiffs[i]->Fill(asy-difftrueasys[i]);
const double differr = asymmetryerror_afterunfolding_2d_onexbin(myunfold.errormatrix, nbinsafter, pos, neg, nbinsetaafter, i);
diffasypulls[i]->Fill((asy-difftrueasys[i])/differr);
diffasyerrors[i]->Fill(differr);
}
const double pos1d = hunfold1d->Integral(1, nbinsmafter1d, nbinsetaafter1d/2+1, nbinsetaafter1d);
const double neg1d = hunfold1d->Integral(1, nbinsmafter1d, 1, nbinsetaafter1d/2);
double asy1d = (pos1d-neg1d)/(pos1d+neg1d);
const double asy_error1d = asymmetryerror_afterunfolding_1d(myunfold1d.errormatrix, myunfold1d.hunfoldunwrapped);
/*
if(correct_for_lincheck)
{
asy1d -= lincheck_offset1d; // correct for offset of linearity check
asy1d /= lincheck_slope1d; // correct for linearity check not yielding slope of 1
}
*/
// cout << "asy_error1d: " << asy_error1d << endl;
// cout << "asydiff1d: " << asy1d-trueasy << endl;
asys1d->Fill(asy1d);
asyerrors1d->Fill(asy_error1d);
asydifference->Fill(asy - asy1d);
asy1dvs2d->Fill(asy1d, asy);
asypull1d->Fill((asy1d-trueasy)/asy_error1d);
asydiff1d->Fill(asy1d-trueasy);
ndiff->Fill(pos+neg-myunfold.expectedNUnfolded);
ndiff1d->Fill(pos1d+neg1d-myunfold1d.expectedNUnfolded);
nreldiff->Fill((pos+neg-myunfold.expectedNUnfolded)/myunfold.expectedNUnfolded);
nreldiff1d->Fill((pos1d+neg1d-myunfold1d.expectedNUnfolded)/myunfold1d.expectedNUnfolded);
}
TH1::AddDirectory(kTRUE);
/*
canv1->Divide(2);
canv1->cd(1);
asys->Draw("HIST");
canv1->cd(2);
asyerrors->Draw("HIST");
*/
#ifndef FINDTAU
TString outfilename = TString("output/")+fileSuffix+"/"+"pseudo.root";
// if(correct_for_lincheck)
// outfilename = TString("output/")+fileSuffix+"/"+"pseudo_corrected.root";
#else
TString outfilename = TString("output/")+fileSuffix+"/"+"pseudo_tau.root";
#endif
TFile out(outfilename,"recreate");
asys->Write();
asyerrors->Write();
asys1d->Write();
asyerrors1d->Write();
asypull->Write();
asypull1d->Write();
asydiff->Write();
asydiff1d->Write();
log10taus->Write();
log10taus1d->Write();
cout << " log10tau mean: " << log10taus->GetMean() << endl;
cout << " log10tau1d mean: " << log10taus1d->GetMean() << endl;
ndiff->Write();
ndiff1d->Write();
nreldiff->Write();
nreldiff1d->Write();
// text-based output of reldiff offsets
TString reweightname = "noreweight";
mkdir(TString("output/")+fileSuffix+"/reweightings/",0777);
ofstream resfile(TString("output/")+fileSuffix+"/reweightings/"+reweightname+".txt");
resfile << reweightname << " ";
resfile << asydiff->GetMean() << " " << asydiff1d->GetMean() << " ";
for(int i=0; i<nbinsmafter; i++)
{
resfile << diffasydiffs[i]->GetMean() << " ";
}
resfile << endl;
resfile.close();
// from here on output of pulls and reldiffs
mkdir(TString("output/")+fileSuffix+"/pulls_and_reldiffs/",0777);
for(int i=0; i<nbinsafter; i++)
{
reldiffs[i]->Write();
reldiffs[i]->Draw("HIST");
saveAs(canv1, TString("output/")+fileSuffix+"/pulls_and_reldiffs/"+reldiffs[i]->GetName());
pulls[i]->Fit("gaus","");
pulls[i]->Draw("HIST");
saveAs(canv1, TString("output/")+fileSuffix+"/pulls_and_reldiffs/"+pulls[i]->GetName());
pulls[i]->Write();
}
for(int i=0; i<nbinsafter1d; i++)
{
reldiffs1d[i]->Write();
reldiffs1d[i]->Draw("HIST");
saveAs(canv1, TString("output/")+fileSuffix+"/pulls_and_reldiffs/"+reldiffs1d[i]->GetName());
pulls1d[i]->Fit("gaus","");
pulls1d[i]->Draw("HIST");
saveAs(canv1, TString("output/")+fileSuffix+"/pulls_and_reldiffs/"+pulls1d[i]->GetName());
pulls1d[i]->Write();
}
double reldiff_deviations = 0;
double pull_deviations = 0;
cout << "\n\n---- pulls and reldiffs ----\n";
for(int i=0; i<nbinsafter1d; i++)
{
cout << "reldiff1d[" << i << "] = " << reldiffs1d[i]->GetMean() << endl;
cout << " [" << i << "] +- " << reldiffs1d[i]->GetMeanError() << endl;
cout << "pull1d[" << i << "] = " << pulls1d[i]->GetRMS() << endl;
cout << " [" << i << "] +- " << pulls1d[i]->GetRMSError() << endl;
reldiff_deviations += fabs( reldiffs1d[i]->GetMean() / reldiffs1d[i]->GetMeanError() );
pull_deviations += fabs( (pulls1d[i]->GetRMS() -1) / pulls1d[i]->GetRMSError() ) ;
}
cout << "Mean reldiff deviation (sigma): " << reldiff_deviations/nbinsafter << endl;
cout << "Mean pull deviation (sigma): " << pull_deviations/nbinsafter << endl;
cout << "\n----------------------------\n";
for(int i=0; i<nbinsmafter; i++)
{
diffasys[i]->Write();
diffasydiffs[i]->Write();
diffasypulls[i]->Write();
diffasyerrors[i]->Write();
}
asydifference->Write();
asy1dvs2d->Write();
TNtuple* asytuple = new TNtuple("trueasys", "trueasys", "trueasy");
asytuple->Fill(trueasy);
for(int i=0; i<nbinsafter; i++)
{
asytuple->Fill(difftrueasys[i]);
}
asytuple->Write();
out.Close();
cout << "Finished successfully" << endl;
return 0;
}
int main()
{
return pseudoexp();
}
| [
"hoehle@physik.rwth-aachen.de"
] | hoehle@physik.rwth-aachen.de |
e889e975d0dc211c87d4acc3992592ff59f54a4e | dadaf21ce416a3de15f87e5a32bd0693cb7716e8 | /Classes/Helpers/UserData.cpp | 76fac5a5591c7d47673b7a11d39f2dc0c0ef5065 | [] | no_license | Crasader/Cheetah | 59d57994ed7ca88caa986164e782847e0638afa6 | e944c150c4dbd00eccb8c222e8c68b0fb1c6ce38 | refs/heads/master | 2020-12-04T17:33:17.299151 | 2015-12-25T12:08:37 | 2015-12-25T12:08:37 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 72 | cpp | //
// Created by Vaclav Samec on 11/11/14 AD.
//
#include "UserData.h"
| [
"530071127@qq.com"
] | 530071127@qq.com |
106aae94b982a5e33fdc20b27960cd1bb3ec441c | 7b1107cc2834304ed789b87a17e471b57628722e | /untests/invoke_tests.cpp | db103fca7377a87adc6f2cbca5042fe84599d733 | [
"MIT"
] | permissive | tkoolen/invoke.hpp | d7da050cba48f5262dac1361ae905ba6bda33e2a | 5a6a13a537d3b6c8dc2417b97c81aa56612ebb96 | refs/heads/master | 2020-12-08T22:29:30.088142 | 2019-05-14T12:00:35 | 2019-05-14T12:00:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 20,373 | cpp | /*******************************************************************************
* This file is part of the "https://github.com/blackmatov/invoke.hpp"
* For conditions of distribution and use, see copyright notice in LICENSE.md
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
******************************************************************************/
#define CATCH_CONFIG_FAST_COMPILE
#include <catch2/catch.hpp>
#include <invoke.hpp/invoke.hpp>
namespace inv = invoke_hpp;
namespace
{
void simple_static_function() {
}
int simple_static_function_r() {
return 42;
}
int simple_static_function_r_with_arg(int v) {
return v;
}
const int& simple_static_function_r_with_ref_arg(const int& v) {
return v;
}
class obj_t {
public:
int value = 42;
const int value_c = 42;
void member() {
}
int member_r() {
return 42;
}
int member_r_with_arg(int v) {
return v;
}
const int& member_r_with_ref_arg(const int& v) {
return v;
}
};
class obj2_t {
};
}
TEST_CASE("invoke"){
SECTION("invoke_functions"){
inv::invoke(simple_static_function);
REQUIRE(inv::invoke(simple_static_function_r) == 42);
REQUIRE(inv::invoke(simple_static_function_r_with_arg, 42) == 42);
{
int v = 42;
REQUIRE(&inv::invoke(simple_static_function_r_with_ref_arg, v) == &v);
}
}
SECTION("invoke_members"){
obj_t o;
inv::invoke(&obj_t::member, o);
inv::invoke(&obj_t::member, &o);
inv::invoke(&obj_t::member, std::ref(o));
REQUIRE(inv::invoke(&obj_t::member_r, o) == 42);
REQUIRE(inv::invoke(&obj_t::member_r, &o) == 42);
REQUIRE(inv::invoke(&obj_t::member_r, std::ref(o)) == 42);
REQUIRE(inv::invoke(&obj_t::member_r_with_arg, o, 42) == 42);
REQUIRE(inv::invoke(&obj_t::member_r_with_arg, &o, 42) == 42);
REQUIRE(inv::invoke(&obj_t::member_r_with_arg, std::ref(o), 42) == 42);
{
int v = 42;
REQUIRE(&inv::invoke(&obj_t::member_r_with_ref_arg, o, std::ref(v)) == &v);
REQUIRE(&inv::invoke(&obj_t::member_r_with_ref_arg, &o, std::ref(v)) == &v);
REQUIRE(&inv::invoke(&obj_t::member_r_with_ref_arg, std::ref(o), std::ref(v)) == &v);
}
}
SECTION("invoke_member_objects"){
obj_t o;
REQUIRE(inv::invoke(&obj_t::value, o) == 42);
REQUIRE(inv::invoke(&obj_t::value, &o) == 42);
REQUIRE(inv::invoke(&obj_t::value, std::ref(o)) == 42);
REQUIRE(inv::invoke(&obj_t::value_c, o) == 42);
REQUIRE(inv::invoke(&obj_t::value_c, &o) == 42);
REQUIRE(inv::invoke(&obj_t::value_c, std::ref(o)) == 42);
}
}
TEST_CASE("invoke_result"){
SECTION("invoke_result_functions"){
static_assert(
std::is_same<
void,
inv::invoke_result_t<decltype(simple_static_function)>>::value,
"unit test fail");
static_assert(
std::is_same<
int,
inv::invoke_result_t<decltype(simple_static_function_r)>>::value,
"unit test fail");
static_assert(
std::is_same<
int,
inv::invoke_result_t<decltype(simple_static_function_r_with_arg), int>>::value,
"unit test fail");
static_assert(
std::is_same<
const int&,
inv::invoke_result_t<decltype(simple_static_function_r_with_ref_arg), const int&>>::value,
"unit test fail");
}
SECTION("invoke_result_members"){
static_assert(
std::is_same<void,
inv::invoke_result_t<decltype(&obj_t::member), obj_t>>::value,
"unit test fail");
static_assert(
std::is_same<void,
inv::invoke_result_t<decltype(&obj_t::member), obj_t*>>::value,
"unit test fail");
static_assert(
std::is_same<void,
inv::invoke_result_t<decltype(&obj_t::member), std::reference_wrapper<obj_t>>>::value,
"unit test fail");
static_assert(
std::is_same<int,
inv::invoke_result_t<decltype(&obj_t::member_r), obj_t>>::value,
"unit test fail");
static_assert(
std::is_same<int,
inv::invoke_result_t<decltype(&obj_t::member_r), obj_t*>>::value,
"unit test fail");
static_assert(
std::is_same<int,
inv::invoke_result_t<decltype(&obj_t::member_r), std::reference_wrapper<obj_t>>>::value,
"unit test fail");
static_assert(
std::is_same<int,
inv::invoke_result_t<decltype(&obj_t::member_r_with_arg), obj_t, int>>::value,
"unit test fail");
static_assert(
std::is_same<int,
inv::invoke_result_t<decltype(&obj_t::member_r_with_arg), obj_t*, int>>::value,
"unit test fail");
static_assert(
std::is_same<int,
inv::invoke_result_t<decltype(&obj_t::member_r_with_arg), std::reference_wrapper<obj_t>, int>>::value,
"unit test fail");
static_assert(
std::is_same<const int&,
inv::invoke_result_t<decltype(&obj_t::member_r_with_ref_arg), obj_t, const int&>>::value,
"unit test fail");
static_assert(
std::is_same<const int&,
inv::invoke_result_t<decltype(&obj_t::member_r_with_ref_arg), obj_t*, const int&>>::value,
"unit test fail");
static_assert(
std::is_same<const int&,
inv::invoke_result_t<decltype(&obj_t::member_r_with_ref_arg), std::reference_wrapper<obj_t>, const int&>>::value,
"unit test fail");
}
}
TEST_CASE("is_invocable"){
SECTION("is_invocable_functions"){
static_assert(
inv::is_invocable<decltype(simple_static_function)>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(simple_static_function_r)>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(simple_static_function_r_with_arg), int>::value,
"unit test fail");
}
SECTION("is_not_invocable_functions"){
static_assert(
!inv::is_invocable<decltype(simple_static_function), int>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(simple_static_function_r), obj_t>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(simple_static_function_r_with_arg)>::value,
"unit test fail");
}
SECTION("is_invocable_members"){
static_assert(
inv::is_invocable<decltype(&obj_t::member), obj_t>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::member), obj_t*>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::member), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::member_r), obj_t>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::member_r), obj_t*>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::member_r), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::member_r_with_arg), obj_t, int>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::member_r_with_arg), obj_t*, int>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::member_r_with_arg), std::reference_wrapper<obj_t>, int>::value,
"unit test fail");
}
SECTION("is_not_invocable_members"){
static_assert(
!inv::is_invocable<decltype(&obj_t::member)>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::member), int>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::member), std::reference_wrapper<obj_t>*>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::member_r), obj_t**>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::member_r), obj2_t*>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::member_r), std::reference_wrapper<obj2_t>>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::member_r_with_arg), obj_t, char*>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::member_r_with_arg), obj_t*>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::member_r_with_arg), std::reference_wrapper<obj2_t>, int>::value,
"unit test fail");
}
SECTION("is_invocable_objects"){
static_assert(
inv::is_invocable<decltype(&obj_t::value), obj_t>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::value), obj_t*>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::value), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::value_c), obj_t>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::value_c), obj_t*>::value,
"unit test fail");
static_assert(
inv::is_invocable<decltype(&obj_t::value_c), std::reference_wrapper<obj_t>>::value,
"unit test fail");
}
SECTION("is_not_invocable_objects"){
static_assert(
!inv::is_invocable<decltype(&obj_t::value)>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::value), obj2_t*>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::value), obj_t, int>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::value_c), obj_t**>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::value_c), obj_t*, obj_t*>::value,
"unit test fail");
static_assert(
!inv::is_invocable<decltype(&obj_t::value_c), std::reference_wrapper<obj_t**>>::value,
"unit test fail");
}
}
TEST_CASE("is_invocable_r"){
SECTION("is_invocable_r_functions"){
static_assert(
inv::is_invocable_r<void, decltype(simple_static_function)>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(simple_static_function_r)>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<void, decltype(simple_static_function_r)>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<const int&, decltype(simple_static_function_r_with_arg), const int&>::value,
"unit test fail");
}
SECTION("is_not_invocable_r_functions"){
static_assert(
!inv::is_invocable_r<void, decltype(simple_static_function), int>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int, decltype(simple_static_function_r), obj_t>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<const int&, decltype(simple_static_function_r_with_arg), const obj2_t&>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int, decltype(simple_static_function)>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int*, decltype(simple_static_function_r)>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<obj_t, decltype(simple_static_function_r_with_arg), const int&>::value,
"unit test fail");
}
SECTION("is_invocable_r_members"){
static_assert(
inv::is_invocable_r<void, decltype(&obj_t::member), obj_t>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<void, decltype(&obj_t::member), obj_t*>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<void, decltype(&obj_t::member), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::member_r), obj_t>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::member_r), obj_t*>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::member_r), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<void, decltype(&obj_t::member_r), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::member_r_with_arg), obj_t, int>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::member_r_with_arg), obj_t*, int>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::member_r_with_arg), std::reference_wrapper<obj_t>, int>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<void, decltype(&obj_t::member_r_with_arg), std::reference_wrapper<obj_t>, int>::value,
"unit test fail");
}
SECTION("is_not_invocable_r_members"){
static_assert(
!inv::is_invocable_r<int, decltype(&obj_t::member), obj_t>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int*, decltype(&obj_t::member), obj_t*>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<obj_t, decltype(&obj_t::member), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<obj_t, decltype(&obj_t::member_r), obj_t>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int*, decltype(&obj_t::member_r), obj_t*>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int, decltype(&obj_t::member_r), std::reference_wrapper<obj2_t>>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<obj_t, decltype(&obj_t::member_r_with_arg), obj_t, int>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int*, decltype(&obj_t::member_r_with_arg), obj_t*, int>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int, decltype(&obj_t::member_r_with_arg), std::reference_wrapper<obj_t>, obj2_t>::value,
"unit test fail");
}
SECTION("is_invocable_r_objects"){
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::value), obj_t>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::value), obj_t*>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::value), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<void, decltype(&obj_t::value), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::value_c), obj_t>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::value_c), obj_t*>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<int, decltype(&obj_t::value_c), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
inv::is_invocable_r<void, decltype(&obj_t::value_c), std::reference_wrapper<obj_t>>::value,
"unit test fail");
}
SECTION("is_not_invocable_r_objects"){
static_assert(
!inv::is_invocable_r<obj_t, decltype(&obj_t::value), obj_t>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int*, decltype(&obj_t::value), obj_t*>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int, decltype(&obj_t::value), std::reference_wrapper<obj_t>, obj2_t>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<void, decltype(&obj_t::value), std::reference_wrapper<obj_t>, obj2_t>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<obj_t, decltype(&obj_t::value_c), obj_t>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<int*, decltype(&obj_t::value_c), obj_t*>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<obj2_t, decltype(&obj_t::value_c), std::reference_wrapper<obj_t>>::value,
"unit test fail");
static_assert(
!inv::is_invocable_r<void, decltype(&obj_t::value_c), std::reference_wrapper<obj_t**>>::value,
"unit test fail");
}
}
TEST_CASE("apply"){
SECTION("apply_functions"){
inv::apply(simple_static_function, std::make_tuple());
REQUIRE(inv::apply(simple_static_function_r, std::make_tuple()) == 42);
REQUIRE(inv::apply(simple_static_function_r_with_arg, std::make_tuple(42)) == 42);
{
int v = 42;
REQUIRE(&inv::apply(simple_static_function_r_with_ref_arg, std::make_tuple(std::ref(v))) == &v);
}
}
SECTION("apply_members"){
obj_t o;
inv::apply(&obj_t::member, std::make_tuple(o));
inv::apply(&obj_t::member, std::make_tuple(&o));
inv::apply(&obj_t::member, std::make_tuple(std::ref(o)));
REQUIRE(inv::apply(&obj_t::member_r, std::make_tuple(o)) == 42);
REQUIRE(inv::apply(&obj_t::member_r, std::make_tuple(&o)) == 42);
REQUIRE(inv::apply(&obj_t::member_r, std::make_tuple(std::ref(o))) == 42);
REQUIRE(inv::apply(&obj_t::member_r_with_arg, std::make_tuple(o, 42)) == 42);
REQUIRE(inv::apply(&obj_t::member_r_with_arg, std::make_tuple(&o, 42)) == 42);
REQUIRE(inv::apply(&obj_t::member_r_with_arg, std::make_tuple(std::ref(o), 42)) == 42);
{
int v = 42;
REQUIRE(&inv::apply(&obj_t::member_r_with_ref_arg, std::make_tuple(o, std::ref(v))) == &v);
REQUIRE(&inv::apply(&obj_t::member_r_with_ref_arg, std::make_tuple(&o, std::ref(v))) == &v);
REQUIRE(&inv::apply(&obj_t::member_r_with_ref_arg, std::make_tuple(std::ref(o), std::ref(v))) == &v);
}
}
SECTION("apply_member_objects"){
obj_t o;
REQUIRE(inv::apply(&obj_t::value, std::make_tuple(o)) == 42);
REQUIRE(inv::apply(&obj_t::value, std::make_tuple(&o)) == 42);
REQUIRE(inv::apply(&obj_t::value, std::make_tuple(std::ref(o))) == 42);
REQUIRE(inv::apply(&obj_t::value_c, std::make_tuple(o)) == 42);
REQUIRE(inv::apply(&obj_t::value_c, std::make_tuple(&o)) == 42);
REQUIRE(inv::apply(&obj_t::value_c, std::make_tuple(std::ref(o))) == 42);
}
}
| [
"blackmatov@gmail.com"
] | blackmatov@gmail.com |
dcd7f2ae368ef5525595976fdd557c74ae82dad3 | 05b738e23c8223e86ed725f87774753ace71e9b4 | /0623/RAII.cc | a68fd11b063f1c6535133a02532c3ca55e0ddca1 | [] | no_license | JiangShaoYin/Learn_cpp | dc44ef4672c3f1a44685d6b0a5e5e4377d8a2e8c | bd2e5d330428dcbd490a31a3503294338b15376a | refs/heads/master | 2020-04-09T17:24:06.634839 | 2020-03-01T15:04:45 | 2020-03-01T15:04:45 | 160,479,999 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 727 | cc |
/// @file RAII.cc
/// @author jiang(tooo_cold@163.com)
/// @date 2018-06-24 14:00:18
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
template <class T>
class RAII{
public:
RAII(T * p)
:_p(p){}
T * operator->() {
return _p;
}
T & operator*() {
return *_p;
}
~RAII() {
if(_p) {
delete _p;
cout << "~RAII" << endl;
}
}
private:
T *_p;
};
class Point{
public:
Point(int x, int y)
:_x(x)
,_y(y) {}
void print() {
cout << _x << " "
<< _y << endl;
}
private:
int _x;
int _y;
};
int main(){
RAII<int> tmp1(new int(123));
cout << *tmp1 << endl;
RAII<Point> tmp2(new Point(1,2));
tmp2->print();
(*tmp2).print();
return 0;
}
| [
"tooo_cold@163.com"
] | tooo_cold@163.com |
eaff8f9269b90907df9dea17214e3103e6dec516 | 432350046fe7020921165fec982c2073bc14a8ba | /src/loop_generator/EffetFactory.cpp | 36a1bece819eaba9d9533881305d174145e16920 | [] | no_license | taglo/AudioEditor | e2cc04dd621d400e0c00611f6972e9e7d0eeec20 | 8bca732b7af77ee6c77cbbcd1c95e00a63c627cd | refs/heads/master | 2020-04-06T03:33:22.641452 | 2016-09-16T04:30:31 | 2016-09-16T04:30:31 | 49,327,078 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 769 | cpp |
#include "EffetFactory.h"
void EffetFactory::setNew(vector<Effet*> *effetVector,
vector<Sound> *soundVector,
Parametre *parametre) {
Effet* cEffet;
count = (count + 1) %3;
switch (count) {
case 0:
cEffet = new gSine;
break;
case 1:
cEffet = new gSaw;
break;
case 2:
cEffet = new eClip;
break;
}
cEffet->setSoundVector(soundVector);
cEffet->parametre=parametre;
if(cEffet->ajoute()){
//std::cout << cEffet->parametre->typeBoucle << endl;
std::cout<<soundVector->size()<<endl;
effetVector->push_back(cEffet);
}
} | [
"tglo@tglo-PC"
] | tglo@tglo-PC |
dc7ad237400596ea03aa54f41a90c13999cb1952 | 1af49694004c6fbc31deada5618dae37255ce978 | /chrome/browser/ui/hats/hats_helper.cc | f377ea5249cdb9500b027e512b025942afbeae29 | [
"BSD-3-Clause"
] | permissive | sadrulhc/chromium | 59682b173a00269ed036eee5ebfa317ba3a770cc | a4b950c23db47a0fdd63549cccf9ac8acd8e2c41 | refs/heads/master | 2023-02-02T07:59:20.295144 | 2020-12-01T21:32:32 | 2020-12-01T21:32:32 | 317,678,056 | 3 | 0 | BSD-3-Clause | 2020-12-01T21:56:26 | 2020-12-01T21:56:25 | null | UTF-8 | C++ | false | false | 1,558 | cc | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/hats/hats_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/ui/hats/hats_service.h"
#include "chrome/browser/ui/hats/hats_service_factory.h"
#include "chrome/common/chrome_features.h"
#include "components/search/search.h"
#include "content/public/browser/web_contents.h"
HatsHelper::~HatsHelper() = default;
HatsHelper::HatsHelper(content::WebContents* web_contents)
: WebContentsObserver(web_contents) {
DCHECK(search::IsInstantExtendedAPIEnabled());
}
void HatsHelper::DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) {
const bool demo_enabled = base::FeatureList::IsEnabled(
features::kHappinessTrackingSurveysForDesktopDemo);
if (!render_frame_host->GetParent() &&
(search::IsInstantNTP(web_contents()) || demo_enabled)) {
HatsService* hats_service = HatsServiceFactory::GetForProfile(
profile(), /*create_if_necessary=*/true);
if (hats_service) {
hats_service->LaunchSurvey(demo_enabled ? kHatsSurveyTriggerTesting
: kHatsSurveyTriggerSatisfaction);
}
}
}
Profile* HatsHelper::profile() const {
return Profile::FromBrowserContext(web_contents()->GetBrowserContext());
}
WEB_CONTENTS_USER_DATA_KEY_IMPL(HatsHelper)
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
8720425838c56d9e50c2ec7ad088866d46b31dcb | 67fc9e51437e351579fe9d2d349040c25936472a | /wrappers/7.0.0/vtkPenWrap.h | 13b3ddb623f1970232c1b9f92309e490247d488a | [] | permissive | axkibe/node-vtk | 51b3207c7a7d3b59a4dd46a51e754984c3302dec | 900ad7b5500f672519da5aa24c99aa5a96466ef3 | refs/heads/master | 2023-03-05T07:45:45.577220 | 2020-03-30T09:31:07 | 2020-03-30T09:31:07 | 48,490,707 | 6 | 0 | BSD-3-Clause | 2022-12-07T20:41:45 | 2015-12-23T12:58:43 | C++ | UTF-8 | C++ | false | false | 2,095 | h | /* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */
#ifndef NATIVE_EXTENSION_VTK_VTKPENWRAP_H
#define NATIVE_EXTENSION_VTK_VTKPENWRAP_H
#include <nan.h>
#include <vtkSmartPointer.h>
#include <vtkPen.h>
#include "vtkObjectWrap.h"
#include "../../plus/plus.h"
class VtkPenWrap : public VtkObjectWrap
{
public:
using Nan::ObjectWrap::Wrap;
static void Init(v8::Local<v8::Object> exports);
static void InitPtpl();
static void ConstructorGetter(
v8::Local<v8::String> property,
const Nan::PropertyCallbackInfo<v8::Value>& info);
VtkPenWrap(vtkSmartPointer<vtkPen>);
VtkPenWrap();
~VtkPenWrap( );
static Nan::Persistent<v8::FunctionTemplate> ptpl;
private:
static void New(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void DeepCopy(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetColor(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetColorF(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetLineType(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetOpacity(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetWidth(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void IsA(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetColor(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetColorF(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetLineType(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetOpacity(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetOpacityF(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetWidth(const Nan::FunctionCallbackInfo<v8::Value>& info);
#ifdef VTK_NODE_PLUS_VTKPENWRAP_CLASSDEF
VTK_NODE_PLUS_VTKPENWRAP_CLASSDEF
#endif
};
#endif
| [
"axkibe@gmail.com"
] | axkibe@gmail.com |
6c7670cd726c854d8d556db97b88bd31913339d3 | 3b9b4049a8e7d38b49e07bb752780b2f1d792851 | /src/chrome/browser/chromeos/input_method/input_method_engine_unittest.cc | fc20b9c48729cc81d3ea586eeff91dcedba7f3d6 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | webosce/chromium53 | f8e745e91363586aee9620c609aacf15b3261540 | 9171447efcf0bb393d41d1dc877c7c13c46d8e38 | refs/heads/webosce | 2020-03-26T23:08:14.416858 | 2018-08-23T08:35:17 | 2018-09-20T14:25:18 | 145,513,343 | 0 | 2 | Apache-2.0 | 2019-08-21T22:44:55 | 2018-08-21T05:52:31 | null | UTF-8 | C++ | false | false | 10,270 | cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/input_method/input_method_engine.h"
#include <utility>
#include "base/logging.h"
#include "base/macros.h"
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_samples.h"
#include "base/metrics/statistics_recorder.h"
#include "base/test/histogram_tester.h"
#include "chrome/browser/chromeos/input_method/input_method_configuration.h"
#include "chrome/browser/chromeos/input_method/mock_input_method_manager.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/input_method/input_method_engine_base.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/ime/chromeos/extension_ime_util.h"
#include "ui/base/ime/chromeos/mock_component_extension_ime_manager_delegate.h"
#include "ui/base/ime/chromeos/mock_ime_input_context_handler.h"
#include "ui/base/ime/ime_bridge.h"
#include "ui/base/ime/ime_engine_handler_interface.h"
#include "ui/base/ime/text_input_flags.h"
#include "ui/gfx/geometry/rect.h"
using input_method::InputMethodEngineBase;
namespace chromeos {
namespace input_method {
namespace {
const char kTestExtensionId[] = "mppnpdlheglhdfmldimlhpnegondlapf";
const char kTestExtensionId2[] = "dmpipdbjkoajgdeppkffbjhngfckdloi";
const char kTestImeComponentId[] = "test_engine_id";
enum CallsBitmap {
NONE = 0U,
ACTIVATE = 1U,
DEACTIVATED = 2U,
ONFOCUS = 4U,
ONBLUR = 8U,
ONCOMPOSITIONBOUNDSCHANGED = 16U
};
void InitInputMethod() {
ComponentExtensionIMEManager* comp_ime_manager =
new ComponentExtensionIMEManager;
MockComponentExtIMEManagerDelegate* delegate =
new MockComponentExtIMEManagerDelegate;
ComponentExtensionIME ext1;
ext1.id = kTestExtensionId;
ComponentExtensionEngine ext1_engine1;
ext1_engine1.engine_id = kTestImeComponentId;
ext1_engine1.language_codes.push_back("en-US");
ext1_engine1.layouts.push_back("us");
ext1.engines.push_back(ext1_engine1);
std::vector<ComponentExtensionIME> ime_list;
ime_list.push_back(ext1);
delegate->set_ime_list(ime_list);
comp_ime_manager->Initialize(
std::unique_ptr<ComponentExtensionIMEManagerDelegate>(delegate));
MockInputMethodManager* manager = new MockInputMethodManager;
manager->SetComponentExtensionIMEManager(
std::unique_ptr<ComponentExtensionIMEManager>(comp_ime_manager));
InitializeForTesting(manager);
}
class TestObserver : public InputMethodEngineBase::Observer {
public:
TestObserver() : calls_bitmap_(NONE) {}
~TestObserver() override {}
void OnActivate(const std::string& engine_id) override {
calls_bitmap_ |= ACTIVATE;
}
void OnDeactivated(const std::string& engine_id) override {
calls_bitmap_ |= DEACTIVATED;
}
void OnFocus(
const ui::IMEEngineHandlerInterface::InputContext& context) override {
calls_bitmap_ |= ONFOCUS;
}
void OnBlur(int context_id) override { calls_bitmap_ |= ONBLUR; }
bool IsInterestedInKeyEvent() const override { return true; }
void OnKeyEvent(
const std::string& engine_id,
const InputMethodEngineBase::KeyboardEvent& event,
ui::IMEEngineHandlerInterface::KeyEventDoneCallback& key_data) override {}
void OnInputContextUpdate(
const ui::IMEEngineHandlerInterface::InputContext& context) override {}
void OnCandidateClicked(
const std::string& engine_id,
int candidate_id,
InputMethodEngineBase::MouseButtonEvent button) override {}
void OnMenuItemActivated(const std::string& engine_id,
const std::string& menu_id) override {}
void OnSurroundingTextChanged(const std::string& engine_id,
const std::string& text,
int cursor_pos,
int anchor_pos,
int offset) override {}
void OnCompositionBoundsChanged(
const std::vector<gfx::Rect>& bounds) override {
calls_bitmap_ |= ONCOMPOSITIONBOUNDSCHANGED;
}
void OnReset(const std::string& engine_id) override {}
unsigned char GetCallsBitmapAndReset() {
unsigned char ret = calls_bitmap_;
calls_bitmap_ = NONE;
return ret;
}
private:
unsigned char calls_bitmap_;
DISALLOW_COPY_AND_ASSIGN(TestObserver);
};
class InputMethodEngineTest : public testing::Test {
public:
InputMethodEngineTest() : observer_(NULL), input_view_("inputview.html") {
languages_.push_back("en-US");
layouts_.push_back("us");
InitInputMethod();
ui::IMEBridge::Initialize();
mock_ime_input_context_handler_.reset(new MockIMEInputContextHandler());
ui::IMEBridge::Get()->SetInputContextHandler(
mock_ime_input_context_handler_.get());
}
~InputMethodEngineTest() override {
ui::IMEBridge::Get()->SetInputContextHandler(NULL);
engine_.reset();
Shutdown();
}
protected:
void CreateEngine(bool whitelisted) {
engine_.reset(new InputMethodEngine());
observer_ = new TestObserver();
std::unique_ptr<InputMethodEngineBase::Observer> observer_ptr(observer_);
engine_->Initialize(std::move(observer_ptr),
whitelisted ? kTestExtensionId : kTestExtensionId2,
ProfileManager::GetActiveUserProfile());
}
void FocusIn(ui::TextInputType input_type) {
ui::IMEEngineHandlerInterface::InputContext input_context(
input_type, ui::TEXT_INPUT_MODE_DEFAULT, ui::TEXT_INPUT_FLAG_NONE);
engine_->FocusIn(input_context);
ui::IMEBridge::Get()->SetCurrentInputContext(input_context);
}
std::unique_ptr<InputMethodEngine> engine_;
TestObserver* observer_;
std::vector<std::string> languages_;
std::vector<std::string> layouts_;
GURL options_page_;
GURL input_view_;
std::unique_ptr<MockIMEInputContextHandler> mock_ime_input_context_handler_;
private:
DISALLOW_COPY_AND_ASSIGN(InputMethodEngineTest);
};
} // namespace
TEST_F(InputMethodEngineTest, TestSwitching) {
CreateEngine(false);
// Enable/disable with focus.
FocusIn(ui::TEXT_INPUT_TYPE_URL);
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
engine_->Enable(kTestImeComponentId);
EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
// Enable/disable without focus.
engine_->FocusOut();
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
engine_->Enable(kTestImeComponentId);
EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
// Focus change when enabled.
engine_->Enable(kTestImeComponentId);
EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->FocusOut();
EXPECT_EQ(ONBLUR, observer_->GetCallsBitmapAndReset());
// Focus change when disabled.
engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
FocusIn(ui::TEXT_INPUT_TYPE_TEXT);
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
engine_->FocusOut();
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
}
TEST_F(InputMethodEngineTest, TestSwitching_Password_3rd_Party) {
CreateEngine(false);
// Enable/disable with focus.
FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
engine_->Enable(kTestImeComponentId);
EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
// Focus change when enabled.
engine_->Enable(kTestImeComponentId);
EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->FocusOut();
EXPECT_EQ(ONBLUR, observer_->GetCallsBitmapAndReset());
FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_EQ(ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
}
TEST_F(InputMethodEngineTest, TestSwitching_Password_Whitelisted) {
CreateEngine(true);
// Enable/disable with focus.
FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_EQ(NONE, observer_->GetCallsBitmapAndReset());
engine_->Enable(kTestImeComponentId);
EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
// Focus change when enabled.
engine_->Enable(kTestImeComponentId);
EXPECT_EQ(ACTIVATE | ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->FocusOut();
EXPECT_EQ(ONBLUR, observer_->GetCallsBitmapAndReset());
FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD);
EXPECT_EQ(ONFOCUS, observer_->GetCallsBitmapAndReset());
engine_->Disable();
EXPECT_EQ(DEACTIVATED, observer_->GetCallsBitmapAndReset());
}
TEST_F(InputMethodEngineTest, TestHistograms) {
CreateEngine(true);
FocusIn(ui::TEXT_INPUT_TYPE_TEXT);
engine_->Enable(kTestImeComponentId);
std::vector<InputMethodEngineBase::SegmentInfo> segments;
int context = engine_->GetCotextIdForTesting();
std::string error;
base::HistogramTester histograms;
engine_->SetComposition(context, "test", 0, 0, 0, segments, NULL);
engine_->CommitText(context, "input", &error);
engine_->SetComposition(context, "test", 0, 0, 0, segments, NULL);
engine_->CommitText(context,
"\xE5\x85\xA5\xE5\x8A\x9B", // 2 UTF-8 characters
&error);
engine_->SetComposition(context, "test", 0, 0, 0, segments, NULL);
engine_->CommitText(context, "input\xE5\x85\xA5\xE5\x8A\x9B", &error);
histograms.ExpectTotalCount("InputMethod.CommitLength", 3);
histograms.ExpectBucketCount("InputMethod.CommitLength", 5, 1);
histograms.ExpectBucketCount("InputMethod.CommitLength", 2, 1);
histograms.ExpectBucketCount("InputMethod.CommitLength", 7, 1);
}
TEST_F(InputMethodEngineTest, TestCompositionBoundsChanged) {
CreateEngine(true);
// Enable/disable with focus.
std::vector<gfx::Rect> rects;
rects.push_back(gfx::Rect());
engine_->SetCompositionBounds(rects);
EXPECT_EQ(ONCOMPOSITIONBOUNDSCHANGED, observer_->GetCallsBitmapAndReset());
}
} // namespace input_method
} // namespace chromeos
| [
"changhyeok.bae@lge.com"
] | changhyeok.bae@lge.com |
a926503ec8faabd4bab5d56a50096fc35a1f6244 | caa4f5ad2bcc278610f447850979c61dd5f23bbd | /T16_pot/T16_pot.ino | 84cb20f074976ecb9f39562b930edb738aa91946 | [] | no_license | JC2020Leeds/Arduino_code_for_Teensy4 | 355f3a8ea10d4a5ebce090be503d86a1d91e8446 | 5981634ec3f76debd5e9684026e821a4396e5500 | refs/heads/master | 2022-04-22T15:09:36.766555 | 2020-04-22T20:04:50 | 2020-04-22T20:04:50 | 245,008,486 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,582 | ino | #include <PWMServo.h>
PWMServo T16; // create servo object for controlling servo
// max 8 servos can be created
int knob_pin = A0; //pin for potentiometer A0 pin
int pos = 0; // variable to store servo position
int T16_pin = 10; // servo pin for FS6530M feetech servo motor
int linearValue_knob = 0;
int knobValue;
//Max/min pulse values in microseconds for the linear actuators
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
T16.attach(T16_pin, 544, 2400); // attached pin number on Teensy as defined above
T16.write(0);
Serial.printf("Angle Read %d\r\n", T16.read());
delay(100);
}
void loop() {
knobValue = analogRead(knob_pin);
linearValue_knob = map(knobValue, 0, 1023, 0, 180); //Map analog value from the sensor to the linear actuator
//linearKnob.write(linearValue_knob);
Serial.printf("Angle Read %d\r\n", T16.read());
Serial.printf("knob %d\r\n", linearValue_knob);
T16.write(linearValue_knob);
delay(20);
// for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// // in steps of 1 degree
// P16.write(pos); // tell servo to go to position in variable 'pos'
// delay(30); // waits 15ms for the servo to reach the position
// }
// for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
// P16.write(pos); // tell servo to go to position in variable 'pos'
// delay(30); // waits 15ms for the servo to reach the position
// }
}
| [
"mn15jc@leeds.ac.uk"
] | mn15jc@leeds.ac.uk |
c44d3e1da8ae24678cba3298a39f4b649c3b9705 | 6a594317c53aa467aa85f66b79f0a1accf1a9354 | /PlayerPaddle.cpp | 585a69305410d010bba79affc3adb22c08ce1f13 | [] | no_license | davepie101/SFML-pong | ccea06bbaacffe16779c3602e00525dcd1fd9131 | 113a8e37090d8339121d365a2000c53490f42cde | refs/heads/master | 2020-07-09T17:50:34.613171 | 2020-01-01T15:44:19 | 2020-01-01T15:44:19 | 204,038,935 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 117 | cpp | #include "stdafx.h"
#include "PlayerPaddle.h"
PlayerPaddle::PlayerPaddle() {
}
PlayerPaddle::~PlayerPaddle() {
} | [
"hyu028@ucr.edu"
] | hyu028@ucr.edu |
8748272b4428d9ff07393dddb1503157f79fd84c | c3caf08e6fbe265c65ab52fce1ea1b50cd99dad7 | /src/qt/avianbitcoin/welcomecontentwidget.cpp | 49334eded47d22f304a455868d64484fda6d8dc1 | [
"MIT"
] | permissive | wizadr/avian | d7577056476175286b52076fd34bc8e4d40db427 | cac8703f3f9c53e5cc6aeb82f6d20b81737caac7 | refs/heads/main | 2023-08-06T04:39:41.858082 | 2021-10-10T11:25:07 | 2021-10-10T11:25:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,536 | cpp | //Copyright (c) 2019 The PIVX developers
//Copyright (c) 2020 The avianbitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "qt/avianbitcoin/welcomecontentwidget.h"
#include "qt/avianbitcoin/forms/ui_welcomecontentwidget.h"
#include <QFile>
#include <QListView>
#include <QDir>
#include "guiutil.h"
#include <QSettings>
#include <iostream>
#include <QDesktopWidget>
WelcomeContentWidget::WelcomeContentWidget(QWidget *parent) :
QDialog(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint),
ui(new Ui::WelcomeContentWidget),
icConfirm1(new QPushButton()),
icConfirm2(new QPushButton()),
icConfirm3(new QPushButton()),
icConfirm4(new QPushButton()),
backButton(new QPushButton()),
nextButton(new QPushButton())
{
ui->setupUi(this);
this->setStyleSheet(GUIUtil::loadStyleSheet());
ui->frame->setProperty("cssClass", "container-welcome-stack");
#ifdef Q_OS_MAC
ui->frame_2->load("://bg-welcome");
ui->frame_2->setProperty("cssClass", "container-welcome-no-image");
#else
ui->frame_2->setProperty("cssClass", "container-welcome");
#endif
backButton = new QPushButton(ui->container);
nextButton = new QPushButton(ui->container);
backButton->show();
backButton->raise();
nextButton->show();
nextButton->raise();
backButton->setProperty("cssClass", "btn-welcome-back");
nextButton->setProperty("cssClass", "btn-welcome-next");
QSize BUTTON_SIZE = QSize(60, 60);
backButton->setMinimumSize(BUTTON_SIZE);
backButton->setMaximumSize(BUTTON_SIZE);
nextButton->setMinimumSize(BUTTON_SIZE);
nextButton->setMaximumSize(BUTTON_SIZE);
int backX = 0;
int backY = 240;
int nextX = 820;
int nextY = 240;
// position
backButton->move(backX, backY);
backButton->setStyleSheet("background: url(://ic-arrow-white-left); background-repeat:no-repeat;background-position:center;border: 0;background-color:#454f83;color: #454f83; border-radius:2px;");
nextButton->move(nextX, nextY);
nextButton->setStyleSheet("background: url(://ic-arrow-white-right);background-repeat:no-repeat;background-position:center;border: 0;background-color:#454f83;color: #454f83; border-radius:2px;");
if (pos == 0) {
backButton->setVisible(false);
}
ui->labelLine1->setProperty("cssClass", "line-welcome");
ui->labelLine2->setProperty("cssClass", "line-welcome");
ui->labelLine3->setProperty("cssClass", "line-welcome");
ui->groupBoxName->setProperty("cssClass", "container-welcome-box");
ui->groupContainer->setProperty("cssClass", "container-welcome-box");
ui->pushNumber1->setProperty("cssClass", "btn-welcome-number-check");
ui->pushNumber1->setEnabled(false);
ui->pushNumber2->setProperty("cssClass", "btn-welcome-number-check");
ui->pushNumber2->setEnabled(false);
ui->pushNumber3->setProperty("cssClass", "btn-welcome-number-check");
ui->pushNumber3->setEnabled(false);
ui->pushNumber4->setProperty("cssClass", "btn-welcome-number-check");
ui->pushNumber4->setEnabled(false);
ui->pushName1->setProperty("cssClass", "btn-welcome-name-check");
ui->pushName1->setEnabled(false);
ui->pushName2->setProperty("cssClass", "btn-welcome-name-check");
ui->pushName2->setEnabled(false);
ui->pushName3->setProperty("cssClass", "btn-welcome-name-check");
ui->pushName3->setEnabled(false);
ui->pushName4->setProperty("cssClass", "btn-welcome-name-check");
ui->pushName4->setEnabled(false);
ui->stackedWidget->setCurrentIndex(0);
// Frame 1
ui->page_1->setProperty("cssClass", "container-welcome-step1");
ui->labelTitle1->setProperty("cssClass", "text-title-welcome");
ui->comboBoxLanguage->setProperty("cssClass", "btn-combo-welcome");
ui->comboBoxLanguage->setView(new QListView());
// Frame 2
ui->page_2->setProperty("cssClass", "container-welcome-step2");
ui->labelTitle2->setProperty("cssClass", "text-title-welcome");
ui->labelMessage2->setProperty("cssClass", "text-main-white");
// Frame 3
ui->page_3->setProperty("cssClass", "container-welcome-step3");
ui->labelTitle3->setProperty("cssClass", "text-title-welcome");
ui->labelMessage3->setProperty("cssClass", "text-main-white");
// Frame 4
ui->page_4->setProperty("cssClass", "container-welcome-step4");
ui->labelTitle4->setProperty("cssClass", "text-title-welcome");
ui->labelMessage4->setProperty("cssClass", "text-main-white");
// Confirm icons
icConfirm1 = new QPushButton(ui->layoutIcon1_2);
icConfirm2 = new QPushButton(ui->layoutIcon2_2);
icConfirm3 = new QPushButton(ui->layoutIcon3_2);
icConfirm4 = new QPushButton(ui->layoutIcon4_2);
QSize BUTTON_CONFIRM_SIZE = QSize(22, 22);
int posX = 0;
int posY = 0;
icConfirm1->setProperty("cssClass", "ic-step-confirm-welcome");
icConfirm1->setMinimumSize(BUTTON_CONFIRM_SIZE);
icConfirm1->setMaximumSize(BUTTON_CONFIRM_SIZE);
icConfirm1->show();
icConfirm1->raise();
icConfirm1->setVisible(false);
icConfirm1->move(posX, posY);
icConfirm2->setProperty("cssClass", "ic-step-confirm-welcome");
icConfirm2->setMinimumSize(BUTTON_CONFIRM_SIZE);
icConfirm2->setMaximumSize(BUTTON_CONFIRM_SIZE);
icConfirm2->move(posX, posY);
icConfirm2->show();
icConfirm2->raise();
icConfirm2->setVisible(false);
icConfirm3->setProperty("cssClass", "ic-step-confirm-welcome");
icConfirm3->setMinimumSize(BUTTON_CONFIRM_SIZE);
icConfirm3->setMaximumSize(BUTTON_CONFIRM_SIZE);
icConfirm3->move(posX, posY);
icConfirm3->show();
icConfirm3->raise();
icConfirm3->setVisible(false);
icConfirm4->setProperty("cssClass", "ic-step-confirm-welcome");
icConfirm4->setMinimumSize(BUTTON_CONFIRM_SIZE);
icConfirm4->setMaximumSize(BUTTON_CONFIRM_SIZE);
icConfirm4->move(posX, posY);
icConfirm4->show();
icConfirm4->raise();
icConfirm4->setVisible(false);
ui->pushButtonSkip->setProperty("cssClass", "btn-close-white");
onNextClicked();
connect(ui->pushButtonSkip, &QPushButton::clicked, this, &WelcomeContentWidget::close);
connect(nextButton, &QPushButton::clicked, this, &WelcomeContentWidget::onNextClicked);
connect(backButton, &QPushButton::clicked, this, &WelcomeContentWidget::onBackClicked);
connect(ui->comboBoxLanguage, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &WelcomeContentWidget::checkLanguage);
initLanguages();
// Resize window and move to center of desktop, disallow resizing
QRect r(QPoint(), size());
resize(r.size());
setFixedSize(r.size());
move(QApplication::desktop()->screenGeometry().center() - r.center());
}
void WelcomeContentWidget::initLanguages()
{
/* Language selector */
QDir translations(":translations");
ui->comboBoxLanguage->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
Q_FOREACH (const QString& langStr, translations.entryList()) {
QLocale locale(langStr);
/** check if the locale name consists of 2 parts (language_country) */
if (langStr.contains("_")) {
/** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */
ui->comboBoxLanguage->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
} else {
/** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */
ui->comboBoxLanguage->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
}
}
}
void WelcomeContentWidget::setModel(OptionsModel *model)
{
this->model = model;
}
void WelcomeContentWidget::checkLanguage()
{
QString sel = ui->comboBoxLanguage->currentData().toString();
QSettings settings;
if (settings.value("language") != sel){
settings.setValue("language", sel);
settings.sync();
Q_EMIT onLanguageSelected();
ui->retranslateUi(this);
}
}
void WelcomeContentWidget::onNextClicked()
{
switch(pos){
case 0:{
ui->stackedWidget->setCurrentIndex(1);
break;
}
case 1:{
backButton->setVisible(true);
ui->stackedWidget->setCurrentIndex(2);
ui->pushNumber2->setChecked(true);
ui->pushName4->setChecked(false);
ui->pushName3->setChecked(false);
ui->pushName2->setChecked(true);
ui->pushName1->setChecked(true);
icConfirm1->setVisible(true);
break;
}
case 2:{
ui->stackedWidget->setCurrentIndex(3);
ui->pushNumber3->setChecked(true);
ui->pushName4->setChecked(false);
ui->pushName3->setChecked(true);
ui->pushName2->setChecked(true);
ui->pushName1->setChecked(true);
icConfirm2->setVisible(true);
break;
}
case 3:{
ui->stackedWidget->setCurrentIndex(4);
ui->pushNumber4->setChecked(true);
ui->pushName4->setChecked(true);
ui->pushName3->setChecked(true);
ui->pushName2->setChecked(true);
ui->pushName1->setChecked(true);
icConfirm3->setVisible(true);
break;
}
case 4:{
isOk = true;
accept();
break;
}
}
pos++;
}
void WelcomeContentWidget::onBackClicked()
{
if (pos == 0) return;
pos--;
switch(pos){
case 0:{
ui->stackedWidget->setCurrentIndex(0);
break;
}
case 1:{
ui->stackedWidget->setCurrentIndex(1);
ui->pushNumber1->setChecked(true);
ui->pushNumber4->setChecked(false);
ui->pushNumber3->setChecked(false);
ui->pushNumber2->setChecked(false);
ui->pushName4->setChecked(false);
ui->pushName3->setChecked(false);
ui->pushName2->setChecked(false);
ui->pushName1->setChecked(true);
icConfirm1->setVisible(false);
backButton->setVisible(false);
break;
}
case 2:{
ui->stackedWidget->setCurrentIndex(2);
ui->pushNumber2->setChecked(true);
ui->pushNumber4->setChecked(false);
ui->pushNumber3->setChecked(false);
ui->pushName4->setChecked(false);
ui->pushName3->setChecked(false);
ui->pushName2->setChecked(true);
ui->pushName1->setChecked(true);
icConfirm2->setVisible(false);
break;
}
case 3:{
ui->stackedWidget->setCurrentIndex(3);
ui->pushNumber3->setChecked(true);
ui->pushNumber4->setChecked(false);
ui->pushName4->setChecked(false);
ui->pushName3->setChecked(true);
ui->pushName2->setChecked(true);
ui->pushName1->setChecked(true);
icConfirm3->setVisible(false);
break;
}
}
if (pos == 0) {
backButton->setVisible(false);
}
}
void WelcomeContentWidget::onSkipClicked()
{
isOk = true;
accept();
}
WelcomeContentWidget::~WelcomeContentWidget()
{
delete ui;
}
| [
"avian@github.com"
] | avian@github.com |
a5246b7b66d40769f64fd7fa4f3a87814b55c3b3 | e657ee28140130eb78380b694980c674bffd60e1 | /Source/Soulslike/Soulslike.cpp | 74766232b6684b1e5075f29c8c515d1408e1e116 | [] | no_license | Cheesemanxl/Soulslike_ProofOfConcept | 936523e3a204fea3843cf736a126a5f54c1cf847 | 6678030aec246fe4689968f6fe08912e6ccc431e | refs/heads/master | 2023-02-24T02:11:32.094679 | 2021-01-31T04:05:58 | 2021-01-31T04:05:58 | 334,525,229 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 192 | cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "Soulslike.h"
#include "Modules/ModuleManager.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, Soulslike, "Soulslike" );
| [
"owen1003@gmail.com"
] | owen1003@gmail.com |
fcabed0fa19acc45dcf8b3940d58086b04803aeb | 6cad528d791f614e8fdadffa7e478da9a5545119 | /script/welcome.cpp | 116f5288a5f7ced2b988cc2a364374b3005aa10f | [
"MIT"
] | permissive | willhunt/robo_nd_project1 | 3e533a90b351d643bff0a10f45ab3e5ed729d68f | d78261b084087483e57adbde381392572c58fed1 | refs/heads/master | 2020-12-28T09:01:24.203440 | 2020-02-09T08:34:03 | 2020-02-09T08:34:03 | 238,256,905 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 382 | cpp | #include <gazebo/gazebo.hh>
namespace gazebo
{
class WorldPluginWelcome : public WorldPlugin
{
public: WorldPluginWelcome() : WorldPlugin()
{
printf("Welcome to Will's world!\n");
}
public: void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf)
{
}
};
GZ_REGISTER_WORLD_PLUGIN(WorldPluginWelcome)
}
| [
"will.hunt.mail@gmail.com"
] | will.hunt.mail@gmail.com |
41f53a2f5590c9afbe2b4628949459185438b1ee | 86d0360af5da077fb6a9d6635ebcdd6abf793845 | /chapter03/ex3_08.cpp | ba8254eb7dae942df34348915f14afe338bdfc3e | [] | no_license | LukaMod/cpp-primer | d99f1bce499788817417096d468958df9f9fe75f | 80334c1c89baff474260c1322899540c8d7b1138 | refs/heads/master | 2021-01-22T07:32:03.926702 | 2018-06-07T06:27:46 | 2018-06-07T06:27:46 | 81,827,412 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 377 | cpp | #include <iostream>
#include <string>
using std::string;
using std::cout;
using std::endl;
int main()
{
string str("An sample string");
decltype(str.size()) i = 0;
while (i != str.size())
{
str[i] = 'X';
++i;
}
cout << str << endl;
for (i = 0; i != str.size(); ++i)
str[i] = 'Y';
cout << str << endl;
return 0;
} | [
"Luka M"
] | Luka M |
171dcf0bfc44ae8df5be52143b6e5f682977ba95 | 4c23be1a0ca76f68e7146f7d098e26c2bbfb2650 | /ic8h18/0.001/C2H | b331a497c47dc4dc3f2f2e280a6a29c65e3aa753 | [] | no_license | labsandy/OpenFOAM_workspace | a74b473903ddbd34b31dc93917e3719bc051e379 | 6e0193ad9dabd613acf40d6b3ec4c0536c90aed4 | refs/heads/master | 2022-02-25T02:36:04.164324 | 2019-08-23T02:27:16 | 2019-08-23T02:27:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 835 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.001";
object C2H;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 2.62144e-20;
boundaryField
{
boundary
{
type empty;
}
}
// ************************************************************************* //
| [
"jfeatherstone123@gmail.com"
] | jfeatherstone123@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.