blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 986
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 145
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 122
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4de421a27789e0f9b566285cd2eccc22b36f64a8 | 474ca3fbc2b3513d92ed9531a9a99a2248ec7f63 | /ThirdParty/boost_1_63_0/libs/hana/test/tuple/auto/remove_range.cpp | 3f3982dc7e711b96704a45ca4abca26c9358d52d | [
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | LazyPlanet/MX-Architecture | 17b7b2e6c730409b22b7f38633e7b1f16359d250 | 732a867a5db3ba0c716752bffaeb675ebdc13a60 | refs/heads/master | 2020-12-30T15:41:18.664826 | 2018-03-02T00:59:12 | 2018-03-02T00:59:12 | 91,156,170 | 4 | 0 | null | 2018-02-04T03:29:46 | 2017-05-13T07:05:52 | C++ | UTF-8 | C++ | false | false | 260 | cpp | // Copyright Louis Dionne 2013-2016
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
#include "_specs.hpp"
#include <auto/remove_range.hpp>
int main() { }
| [
"1211618464@qq.com"
] | 1211618464@qq.com |
a938bbd39c9e759f5a70f9583b0b1826d3328a60 | 8ad7a692130161bac7b07135326dd7cad63144fb | /Práctica 7/Main.cpp | 9fbbf44eca0905a465465298e7546deddc518426 | [] | no_license | Javi96/EDA | c5bb31e14a6d62dd1c71e31bae0becb82ba30582 | 2ebc755d0a3be7db14287d0849f20951f045c76d | refs/heads/master | 2021-01-13T14:45:19.159531 | 2017-06-28T15:22:47 | 2017-06-28T15:22:47 | 76,579,268 | 1 | 1 | null | 2017-03-06T21:27:01 | 2016-12-15T17:02:18 | C++ | UTF-8 | C++ | false | false | 1,380 | cpp | #include "Arbin.h"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void busquedaEnProfundidad(const Arbin<char>& falda, int & cuenta, int & cuentaParcial) {
Arbin<char> der = falda.hijoDer();
Arbin<char> izq = falda.hijoIz();
if (falda.raiz() == 'X') {
cuenta = cuenta + cuentaParcial * 2;
}
if (der.esVacio() && izq.esVacio()) {
cuentaParcial--;
}
else {
if (!izq.esVacio()) {
cuentaParcial++;
busquedaEnProfundidad(izq, cuenta, cuentaParcial);
}
if (!der.esVacio()) {
cuentaParcial++;
busquedaEnProfundidad(der, cuenta, cuentaParcial);
}
cuentaParcial--;
}
}
int tiempoAyuda(const Arbin<char>& falda) {
// A IMPLEMENTAR
int cuenta = 0, cuentaParcial = 0;
busquedaEnProfundidad(falda, cuenta, cuentaParcial);
return cuenta;
}
Arbin<char> leeArbol(istream& in) {
char c;
in >> c;
switch (c) {
case '#': return Arbin<char>();
case '[': {
char raiz;
in >> raiz;
in >> c;
return Arbin<char>(raiz);
}
case '(': {
Arbin<char> iz = leeArbol(in);
char raiz;
in >> raiz;
Arbin<char> dr = leeArbol(in);
in >> c;
return Arbin<char>(iz, raiz, dr);
}
default: return Arbin<char>();
}
}
int main() {
Arbin<char> falda;
while (cin.peek() != EOF) {
cout << tiempoAyuda(leeArbol(cin));
string restoLinea;
getline(cin, restoLinea);
if (cin.peek() != EOF) cout << endl;
}
return 0;
} | [
"josejaco@ucm.es"
] | josejaco@ucm.es |
4c1db2d1db314e65ec1fcf7326f22436041a6b87 | ee0af171e0fac50c041560aa8c58150cd80d73ef | /CSES/Dynamic Programming/Min.cpp | 79747e682ba3ed2bf0d3f6eb1aec4467d25a5ef5 | [] | no_license | Linter97/Algorithm | fdcc094fd7c327a3721d62bf7714f1029deccb8c | 8e3d72466da715cf0399bc748eb3d3f6fbb892b3 | refs/heads/master | 2021-04-01T07:57:09.273240 | 2020-09-28T06:13:04 | 2020-09-28T06:13:04 | 248,170,460 | 0 | 0 | null | 2020-04-08T05:57:44 | 2020-03-18T07:56:29 | C++ | UTF-8 | C++ | false | false | 514 | cpp | #include <bits/stdc++.h>
#define INF 987654321
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int c[101], dp[1000001];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, x;
cin >> n >> x;
for (int i = 0; i < n; i++) cin >> c[i];
for (int i = 1; i <= x; i++) {
dp[i] = INF;
for (int j = 0; j < n; j++) {
if (i - c[j] >= 0) dp[i] = min(dp[i], dp[i - c[j]] + 1);
}
}
cout << (dp[x] != INF ? dp[x] : -1) << "\n";
}
| [
"noreply@github.com"
] | Linter97.noreply@github.com |
d921bfc61639abbf0ea5ef515f5a472657a8150c | a3bbea953d7b999f31e15a05e5c60fdfaf6f59c5 | /C/0311/helloo.cpp | 18afc37bd3202dd7c8fdf84a7333a78e6d16ea82 | [] | no_license | YaolinGe/KTH_MSc_Matlab_Scripts_for_Beacon_Transmitter | c08d279c6b50821cd3ef1825b1267accdfcfc2ee | a2bfba9479c5e845fc5c04c17cacaf676ef85a66 | refs/heads/master | 2022-09-02T15:43:41.001247 | 2020-05-24T20:28:45 | 2020-05-24T20:28:45 | 266,617,530 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 128 | cpp | // #include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
int a = 3.9;
cout<<"the out is "<< a<<endl;
} | [
"YL@users.noreply.github.com"
] | YL@users.noreply.github.com |
b11c3aadd34f395a0e6b9c23f14133a1cd392159 | a5aaa2cf1a4f31662a9f25bdb065882189ce1b4e | /Cylcops/Cylcops.ino | 0c04ce275d8537af072bb7e1a46859daed495c53 | [] | no_license | snersnasskve/Arduino | ee56836d142a9d83ac56c127618298c958d53f1f | 21c46ef2381e99e611b5be2eed78ee39c1e4d854 | refs/heads/master | 2021-01-17T11:32:21.136164 | 2018-02-25T06:29:10 | 2018-02-25T06:29:10 | 84,039,170 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,613 | ino | #include <Adafruit_NeoPixel.h>
#include <Ultrasonic.h>
// This example drives the stepper motors directly
// It makes the robot perform the "HullPixelBot Dance"
// See if you can change the moves.
// www.robmiles.com/hullpixelbot
////////////////////////////////////////////////
//declare variables for the motor pins
int rmotorPin1 = 17; // Blue - 28BYJ48 pin 1
int rmotorPin2 = 16; // Pink - 28BYJ48 pin 2
int rmotorPin3 = 15; // Yellow - 28BYJ48 pin 3
int rmotorPin4 = 14; // Orange - 28BYJ48 pin 4
// Red - 28BYJ48 pin 5 (VCC)
int lmotorPin1 = 4; // Blue - 28BYJ48 pin 1
int lmotorPin2 = 5; // Pink - 28BYJ48 pin 2
int lmotorPin3 = 6; // Yellow - 28BYJ48 pin 3
int lmotorPin4 = 7; // Orange - 28BYJ48 pin 4
// Red - 28BYJ48 pin 5 (VCC)
// Proximity sensor
int proximityTrig = 12;
int proximityEcho = 13;
Ultrasonic ultrasonic(proximityTrig,proximityEcho); // (Trig PIN,Echo PIN)
#define PIN 3
Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, PIN, NEO_GRB + NEO_KHZ800);
int motorSpeed = 1200; //variable to set stepper speed
int count = 0; // count of steps made
int countsperrev = 512; // number of steps per full revolution
int lookup[8] = {B01000, B01100, B00100, B00110, B00010, B00011, B00001, B01001};
int photocellLeft = 4;
int photocellRight = 5;
float lengthOfRotation = 180.0f;
//////////////////////////////////////////////////////////////////////////////
void setup() {
//declare the motor pins as outputs
pinMode(lmotorPin1, OUTPUT);
pinMode(lmotorPin2, OUTPUT);
pinMode(lmotorPin3, OUTPUT);
pinMode(lmotorPin4, OUTPUT);
pinMode(rmotorPin1, OUTPUT);
pinMode(rmotorPin2, OUTPUT);
pinMode(rmotorPin3, OUTPUT);
pinMode(rmotorPin4, OUTPUT);
pinMode(proximityTrig, OUTPUT);
pinMode(proximityEcho, INPUT);
Serial.begin(9600);
strip.begin();
strip.setPixelColor(0, 00,20,20);
strip.show();
}
const int STOP = 0;
const int FORWARD = 1;
const int BACK = 2;
const int LEFT = 3;
const int RIGHT = 4;
const int SHARPLEFT = 5;
const int SHARPRIGHT = 6;
int moveState = FORWARD;
int storDistance = 0;
int storLight = 0;
void loop(){
if(count < (countsperrev / 10) ) {
moveStep();
}
else
{
Serial.print("Right = ");
int brightnessRight = analogRead(photocellRight);
Serial.println(brightnessRight); // the raw analog reading
Serial.print("Distance = ");
int distance = ultrasonic.Ranging(CM);
Serial.println(distance); // the raw analog reading
if (moveState == RIGHT || moveState == SHARPRIGHT)
{
if (distance < 10)
{
Serial.println("--- Keep on turning right");
}
else if (brightnessRight >= storLight)
{
// good decision, go straight
Serial.println("--- Good decision, go straight");
moveState = FORWARD;
}
else
{
// bad decision, go back
Serial.println("--- Bad decision, go back left");
moveState = LEFT;
}
}
else if (moveState == LEFT || moveState == SHARPLEFT)
{
if (distance < 10)
{
Serial.println("--- Keep on turning left");
}
else if (brightnessRight >= storLight)
{
// good decision, go straight
Serial.println("--- Good decision, go straight");
moveState = FORWARD;
}
else
{
// bad decision, go back
Serial.println("--- bad decision, go right now");
moveState = RIGHT;
}
}
else if (moveState == FORWARD)
{
if (distance < 10)
{
Serial.println("--- Keep on straight");
moveState = SHARPRIGHT;
}
else if (brightnessRight >= storLight)
{
// good decision, go straight
moveState = FORWARD;
Serial.println("--- Keep on straight");
}
else
{
// bad decision, go back
moveState = RIGHT;
Serial.println("--- bad decision try right");
}
}
storDistance = distance;
storLight = brightnessRight;
// We need to measure, decide, measure, decide
count=0;
}
count++;
}
void moveStep()
{
for(int i = 0; i < 8; i++)
{
switch(moveState)
{
case STOP:
return;
case FORWARD:
setOutputDir(i,7-i);
// delay(500);
// digitalWrite(pixel, LOW);
break;
case BACK:
setOutputDir(7-i,i);
break;
case LEFT:
setOutputDir(i,0);
break;
case RIGHT:
setOutputDir(0,7-i);
break;
case SHARPLEFT:
setOutputDir(7-i,7-i);
break;
case SHARPRIGHT:
setOutputDir(i,i);
break;
}
delayMicroseconds(motorSpeed);
}
}
void setOutputDir(int leftOut, int rightOut)
{
digitalWrite(lmotorPin1, bitRead(lookup[leftOut], 0));
digitalWrite(lmotorPin2, bitRead(lookup[leftOut], 1));
digitalWrite(lmotorPin3, bitRead(lookup[leftOut], 2));
digitalWrite(lmotorPin4, bitRead(lookup[leftOut], 3));
digitalWrite(rmotorPin1, bitRead(lookup[rightOut], 0));
digitalWrite(rmotorPin2, bitRead(lookup[rightOut], 1));
digitalWrite(rmotorPin3, bitRead(lookup[rightOut], 2));
digitalWrite(rmotorPin4, bitRead(lookup[rightOut], 3));
}
| [
"sners_nass@yahoo.co.uk"
] | sners_nass@yahoo.co.uk |
0b4237d4663fce11ccfb7b82522b4d7b34287cf4 | ed590edd688d0ece038a14fba91dfd718a6f002b | /Group 14 QuickSort/QuickSort.cpp | a495f98bdb3d31167b5cbf8afde1cd227714c541 | [] | no_license | humayoonrafei/structureWork | 5f9bae8fbf6e816460ac624776544b1cbba15bed | 1af56b9477b9dc52ae47b82abbed0799baeb7e4d | refs/heads/master | 2022-12-16T02:25:58.521373 | 2020-09-06T03:34:43 | 2020-09-06T03:34:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,734 | cpp | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
void quickSort(int arr[], int low, int high);
int getPartition(int arr[], int low, int high);
void addDigit(int arr[], int counter);
void countSort(int arr[], int n, int exp);
void radixSort(int arr[], int n);
int getMax(int arr[], int n);
void printArray(int arr[], int n);
void displayData();
int main()
{
displayData();
return 0;
}
int getPartition(int arr[], int low, int high)
{
int pivot = arr[high], i = (low - 1);
for (int j = low; j <= high- 1; j++)
{
if(arr[j] >= pivot)
{
swap(arr[++i], arr[j]);
}
}
swap(arr[i + 1], arr[high]);
return (i + 1);
}
void quickSort(int arr[], int low, int high)
{
if (low < high)
{
int pi = getPartition(arr, low, high);
quickSort(arr, low, pi - 1);
quickSort(arr, pi, high);
}
}
void addDigit(int arr[], int counter)
{
for(int i = 0; i < counter; i++)
{
for(int j = (to_string(arr[0]).length()); (to_string(arr[i]).length()) < j;)
{
arr[i] = stoi(to_string(arr[i])+'5');
}
}
}
void countSort(int arr[], int n, int exp)
{
int temp[n], count[10] = {0};
for (int i = 0; i < n; i++)
{
count[9-arr[i]/exp%10]++;
}
for (int i = 1; i < 10; i++)
{
count[i] += count[i - 1];
}
for (int i = n - 1; i >= 0; i--)
{
temp[--count[(9-(arr[i]/exp%10))]] = arr[i];
}
for (int i = 0; i < n; i++)
{
arr[i] = temp[i];
}
}
void radixSort(int arr[], int n)
{
for (int m = getMax(arr, n), exp = 1; m/exp>0; exp *= 10)
{
countSort(arr, n, exp);
}
}
int getMax(int arr[], int n)
{
int m = arr[0];
for (int i = 1; i < n; i++)
{
if (arr[i] > m)
{
m = arr[i];
}
}
return m;
}
void printArray(int arr[], int n)
{
for(int i = 0; i < n; i++)
{
cout << arr[i] << " ";
}
cout << endl;
}
void displayData()
{
int numA[10];
ifstream infile("input.txt");
int n = 0;
while(infile.good())
{
infile>>numA[n];
n++;
}
cout << "Original array:" << endl;
printArray(numA, n);
cout << endl;
quickSort(numA, 0, n - 1);
cout << "Decending(QuickSort): " << endl;
for (int i = 0; i < n; i++){cout << numA[i] << " ";}
cout << '\n' << endl;
addDigit(numA, n);
cout << "After adding the five's: " << endl;
for (int i = 0; i < n; i++){cout << numA[i] << " ";}
cout << '\n' << endl;
radixSort(numA, n);
cout << "Decending(RadixSort): " << endl;
for (int i = 0; i < n; i++){cout << numA[i] << " ";}
cout << endl;
}
| [
"hormoz_halimi@yahoo.com"
] | hormoz_halimi@yahoo.com |
43b7e87795844a6262b4426d132049c6518cda6c | 5add8458e6ea2af3c5ec1b87718b9e9e9f733974 | /GraphicsProject/shapes.h | f362b4a6aab2c49bddc852bd39b652544346af02 | [] | no_license | sean-h/graphics-project | cc436619e7acee87f88fecd178b59ede09d07312 | a0ca0107411bb57b1078218d8fbc179ce6c899ad | refs/heads/master | 2021-01-19T10:03:25.023018 | 2014-01-26T19:34:02 | 2014-01-26T19:34:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,091 | h | /***********
* shapes.h
***********/
#ifndef __SHAPES_H__
#define __SHAPES_H__
#include "Angel.h"
#include <vector>
class Shape {
protected:
vec2 position;
int vertexCount;
vec2 *vertices;
vec2 *transformedVertices;
vec3 *colors;
GLuint buffer;
void draw(GLenum, GLuint);
public:
Shape();
void draw(GLuint);
void move(float, float);
void move(vec2);
void rotate(float);
void setPosition(float, float);
void setPosition(vec2);
vec2 getPosition();
void setColor(vec3);
void setVertexColor(int, vec3);
void updateTransformedVertices();
};
class Circle : public Shape {
private:
float radius;
public:
Circle();
Circle(float, int, vec2, vec3);
void draw(GLuint);
float getRadius();
void changeRadius(float);
void makeJagged();
};
class Rect : public Shape {
private:
vec2 topLeft;
vec2 bottomRight;
void updateRect();
public:
Rect(vec2, float, float, vec3);
Rect(vec2, vec2, vec3);
vec2 getCenter();
vec2 getTopLeft();
vec2 getBottomRight();
float getHeight();
float getWidth();
void draw(GLuint);
void setWidth(float);
void setHeight(float);
};
#endif | [
"seanhumeniuk@gmail.com"
] | seanhumeniuk@gmail.com |
b2c60c32c917cf469e211e93410aadf0e12b7809 | 8c0c4f9f3ecb00a671b595b9e3ac0b4498ef93ac | /CellToy/Source/Genome.cpp | bcfc8cd3c49ca3befb83266eea9995b6974a6fdf | [] | no_license | nstearns96/CellToy | b1ae3967fb90362f0759298a41177af71fc458b3 | 4d0fdfdae5e7b7d919a4db11193962c72385f013 | refs/heads/master | 2020-09-16T03:42:00.748112 | 2019-12-15T19:26:21 | 2019-12-15T19:26:21 | 223,640,631 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 66 | cpp | #include "Genome.h"
Genome::Genome()
{
}
Genome::~Genome()
{
}
| [
"nstearns96@gmail.com"
] | nstearns96@gmail.com |
d07558ab14323f534eae17ace7df7c19ec74c425 | bc079fad03beef5bfbeaadcf82ac772172c27246 | /ArikaraSkinEditor/Editor/SkinDataWidget.cpp | 0ca526a91ffaae7fcad0bbd06bdd2c46c6f42f8e | [] | no_license | JonasOuellet/Arikara | 7b9dc9dd982162169bd8e77bb9101dee4a1ce961 | d2937b045c85cc7f5c9a212196acbee71857da4d | refs/heads/master | 2020-03-28T18:01:57.880720 | 2020-03-12T20:00:22 | 2020-03-12T20:00:22 | 148,846,154 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 9,411 | cpp | #include "../ArikaraMaya/command/ArikaraSkinDataCmd.h"
#include "SkinDataWidget.h"
#include "qtwidgets/qhboxlayout"
#include "qtwidgets/qVboxlayout"
#include "qtwidgets/QLabel"
#include "qtwidgets/qpushbutton"
#include <qtcore/qfileinfo>
#include <maya/MString.h>
#include <maya/MGlobal.h>
#include <maya/MStringArray.h>
#include <maya/MSelectionList.h>
SkinDataWidget::SkinDataWidget(QWidget *parent /*= 0*/) : QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout;
QLabel *lbl_file = new QLabel("File:");
le_path = new QLineEdit(ArikaraSkinDataCmd::defaultPath.asChar());
QPushButton* pb_browse = new QPushButton("...");
connect(pb_browse, SIGNAL(clicked()), this, SLOT(browseFile()));
QHBoxLayout *layout1 = new QHBoxLayout;
layout1->addWidget(lbl_file, 0);
layout1->addWidget(le_path, 1);
layout1->addWidget(pb_browse, 0);
cb_loadBindMat = new QCheckBox("Load Bind Matrix");
cb_clean = new QCheckBox("Clean Skin");
QVBoxLayout *layoutcb1 = new QVBoxLayout;
layoutcb1->addWidget(cb_loadBindMat);
layoutcb1->addWidget(cb_clean);
cb_pos = new QGroupBox("Matching Position");
cb_pos->setCheckable(true);
cb_pos->setChecked(false);
cb_worldSpace = new QCheckBox("World Space");
QHBoxLayout *layouttmp = new QHBoxLayout;
QLabel *lbl_bias = new QLabel("bias: ");
dsb_bias = new QDoubleSpinBox();
dsb_bias->setSingleStep(0.005);
dsb_bias->setDecimals(5);
dsb_bias->setValue(ArikaraSkinDataCmd::defaultBias);
layouttmp->addWidget(lbl_bias, 0);
layouttmp->addWidget(dsb_bias, 0);
QVBoxLayout *layoutcb2 = new QVBoxLayout;
layoutcb2->addWidget(cb_worldSpace);
layoutcb2->addLayout(layouttmp);
cb_pos->setLayout(layoutcb2);
QHBoxLayout *layout2 = new QHBoxLayout;
layout2->addLayout(layoutcb1);
layout2->addWidget(cb_pos);
QPushButton* pb_save = new QPushButton("Save");
connect(pb_save, SIGNAL(clicked()), this, SLOT(saveSkin()));
QPushButton* pb_load = new QPushButton("Load");
connect(pb_load, SIGNAL(clicked()), this, SLOT(loadSkin()));
QHBoxLayout *layout3 = new QHBoxLayout;
layout3->addWidget(pb_save);
layout3->addWidget(pb_load);
QSpacerItem * spacer = new QSpacerItem(100, 20, QSizePolicy::Expanding, QSizePolicy::Expanding);
mainLayout->addLayout(layout1);
mainLayout->addLayout(layout2);
mainLayout->addLayout(layout3);
mainLayout->addSpacerItem(spacer);
setLayout(mainLayout);
}
SkinDataWidget::~SkinDataWidget()
{
}
void SkinDataWidget::browseFile()
{
//MString cmd = "fileDialog2 -fileFilter \"*.ars\" -dialogStyle 2 -fm 0 -okc \"Ok\" -cap \"Chose a skin data file.\" -dir \"";
MString cmd = "fileDialog2 -dialogStyle 2 -fm 3 -okc \"Ok\" -cap \"Pick arikara skin data folder.\" -dir \"";
#ifdef WIN32
MStringArray splittedPath;
ArikaraSkinDataCmd::defaultPath.split('\\', splittedPath);
MString newPath;
for (unsigned int x = 0; x < splittedPath.length(); x++)
{
newPath += splittedPath[x];
if (x < splittedPath.length() - 1)
newPath += "\\\\";
}
cmd += newPath;
#else
cmd += ArikaraSkinDataCmd::defaultPath.asChar();
#endif // WIN32
cmd += "\"";
MStringArray result;
MStatus status = MGlobal::executeCommand(cmd, result);
if (status == MS::kSuccess)
{
if (result.length() > 0)
{
std::string tmp = result[0].asChar();
#ifdef WIN32
std::replace(tmp.begin(), tmp.end(), '/', '\\');
#endif
le_path->setText(tmp.c_str());
}
}
}
void SkinDataWidget::saveSkin()
{
MSelectionList sel;
MGlobal::getActiveSelectionList(sel);
unsigned int selLen = sel.length();
if (selLen > 0)
{
MString cmd = "arikaraSkinData -save ";
MString path;
if (isValidPath(path))
{
#ifdef WIN32
MStringArray splittedPath;
path.split('\\', splittedPath);
path = "";
for (unsigned int x = 0; x < splittedPath.length(); x++)
{
path += splittedPath[x];
if (x < splittedPath.length() - 1)
path += "\\\\";
}
#endif // WIN32
cmd += "-path ";
cmd += path;
cmd += " ";
}
for (unsigned int x = 0; x < selLen; x++)
{
MDagPath dag;
sel.getDagPath(x, dag);
MString curCmd(cmd);
curCmd += dag.partialPathName();
MGlobal::executeCommand(curCmd, true);
}
}
else
{
MGlobal::displayError("You must select at least one skinned object");
}
}
void SkinDataWidget::loadSkin()
{
MSelectionList sel;
MGlobal::getActiveSelectionList(sel);
unsigned int selLen = sel.length();
if (selLen > 0)
{
MString cmd = "arikaraSkinData -load ";
if (cb_clean->isChecked())
{
cmd += "-clean ";
}
if (cb_loadBindMat->isChecked())
{
cmd += "-loadBindMatrix ";
}
if (cb_pos->isChecked())
{
cmd += "-position ";
double bias = dsb_bias->value();
if (bias != ArikaraSkinDataCmd::defaultBias)
{
cmd += "-bias ";
cmd += bias;
cmd += " ";
}
if (cb_worldSpace->isChecked())
{
cmd += "-worldSpace ";
}
}
MString path;
MString commandPath;
bool useCmdPath = false;
if (isValidPath(path))
{
bool useCmdPath = true;
}
else
{
path = ArikaraSkinDataCmd::defaultPath;
}
#ifdef WIN32
MStringArray splittedPath;
path.split('\\', splittedPath);
for (unsigned int x = 0; x < splittedPath.length(); x++)
{
commandPath += splittedPath[x];
if (x < splittedPath.length() - 1)
commandPath += "\\\\";
}
#else
commandPath = path;
#endif // WIN32
MString bigCommand;
for (unsigned int x = 0; x < selLen; x++)
{
MDagPath dag;
sel.getDagPath(x, dag);
MString curCmd(cmd);
//Check if we can find a file for the selected object.
MString filePath = path.asChar();
#ifdef WIN32
filePath += "\\";
#else
filePath += "/";
#endif // WIN32
filePath += dag.partialPathName();
filePath += ".ars";
QFileInfo file(filePath.asChar());
if (file.exists())
{
if (useCmdPath)
{
curCmd += "-path \"";
curCmd += commandPath;
curCmd += "\" ";
}
}
else
{
MString info = "Couldn't find file: ";
info += filePath;
info += "\nPlease specify a file.";
MGlobal::displayInfo(info);
MString browseCmd = "fileDialog2 -fileFilter \"*.ars\" -dialogStyle 2 -fm 1 -cap \"Chose a skin data file for object: ";
browseCmd += dag.partialPathName();
browseCmd += "\" -dir \"";
browseCmd += commandPath;
browseCmd += "\"";
MStringArray result;
MStatus status = MGlobal::executeCommand(browseCmd, result);
if (status == MS::kSuccess)
{
if (result.length() > 0)
{
MStringArray path;
result[0].split('/', path);
MString file = path[path.length() - 1];
MString folder;
for (unsigned int x = 0; x < path.length() - 1; x++)
{
folder += path[x];
if (x < path.length() - 2)
{
#ifdef WIN32
folder += "\\\\";
#else
folder += "/";
#endif //WIN32
}
}
curCmd += "-path \"";
curCmd += folder;
curCmd += "\" -file \"";
curCmd += file;
curCmd += "\" ";
}
else
{
continue;
}
}
else
{
continue;
}
}
bigCommand += curCmd;
bigCommand += dag.partialPathName();
bigCommand += ";\n";
}
MGlobal::executeCommand(bigCommand, true, true);
}
else
{
MGlobal::displayError("You must select at least one skinned object");
}
}
bool SkinDataWidget::isValidPath(MString& path)
{
std::string tmp = le_path->text().toStdString();
if (tmp.length() > 0)
{
int comp = tmp.compare(ArikaraSkinDataCmd::defaultPath.asChar());
if (comp != 0)
{
path = tmp.c_str();
return true;
}
}
return false;
}
| [
"ouelletjonathan@hotmail.com"
] | ouelletjonathan@hotmail.com |
79dadd42d0e8f6354ba013a9d114b61c0b9be1be | 12d83468a3544af4e9d4f26711db1755d53838d6 | /cplusplus_basic/Qt/boost/icl/type_traits/is_element_container.hpp | 698fd95e1aaaf4fe940a3a09bfedb5936e1f5834 | [] | no_license | ngzHappy/cxx17 | 5e06a31d127b873355cab3a8fe0524f1223715da | 22d3f55bfe2a9ba300bbb65cfcbdd2dc58150ca4 | refs/heads/master | 2021-01-11T20:48:19.107618 | 2017-01-17T17:29:16 | 2017-01-17T17:29:16 | 79,188,658 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,801 | hpp | /*-----------------------------------------------------------------------------+
Copyright (c) 2008-2009: Joachim Faulhaber
+------------------------------------------------------------------------------+
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENCE.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
+-----------------------------------------------------------------------------*/
#ifndef BOOST_ICL_TYPE_TRAITS_IS_ELEMENT_CONTAINER_HPP_JOFA_090830
#define BOOST_ICL_TYPE_TRAITS_IS_ELEMENT_CONTAINER_HPP_JOFA_090830
#include <Qt/boost/mpl/and.hpp>
#include <Qt/boost/mpl/or.hpp>
#include <Qt/boost/mpl/not.hpp>
#include <Qt/boost/icl/type_traits/is_container.hpp>
#include <Qt/boost/icl/type_traits/is_interval_container.hpp>
#include <Qt/boost/icl/type_traits/is_set.hpp>
namespace boost{ namespace icl
{
template<class Type>
struct is_element_map
{
typedef is_element_map<Type> type;
BOOST_STATIC_CONSTANT(bool, value =
(mpl::and_<is_map<Type>, mpl::not_<is_interval_container<Type> > >::value)
);
};
template<class Type>
struct is_element_set
{
typedef is_element_set<Type> type;
BOOST_STATIC_CONSTANT(bool, value =
(mpl::or_< mpl::and_< is_set<Type>
, mpl::not_<is_interval_container<Type> > >
, is_std_set<Type>
>::value)
);
};
template <class Type>
struct is_element_container
{
typedef is_element_container<Type> type;
BOOST_STATIC_CONSTANT(bool, value =
(mpl::or_<is_element_set<Type>, is_element_map<Type> >::value)
);
};
}} // namespace boost icl
#endif
| [
"819869472@qq.com"
] | 819869472@qq.com |
527a6ee8adc2580846f7a796d5fa5993ca442ce9 | 64058e1019497fbaf0f9cbfab9de4979d130416b | /c++/include/serial/objectiter.hpp | f799755e7e47dcb07d48be5193db428cbaf2a490 | [
"MIT"
] | permissive | OpenHero/gblastn | 31e52f3a49e4d898719e9229434fe42cc3daf475 | 1f931d5910150f44e8ceab81599428027703c879 | refs/heads/master | 2022-10-26T04:21:35.123871 | 2022-10-20T02:41:06 | 2022-10-20T02:41:06 | 12,407,707 | 38 | 21 | null | 2020-12-08T07:14:32 | 2013-08-27T14:06:00 | C++ | UTF-8 | C++ | false | false | 18,648 | hpp | #ifndef OBJECTITER__HPP
#define OBJECTITER__HPP
/* $Id: objectiter.hpp 358154 2012-03-29 15:05:12Z gouriano $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
* Author: Eugene Vasilchenko
*
* File Description:
* Iterators, which work on object information data
*/
#include <corelib/ncbistd.hpp>
#include <serial/objectinfo.hpp>
/** @addtogroup ObjStreamSupport
*
* @{
*/
BEGIN_NCBI_SCOPE
/////////////////////////////////////////////////////////////////////////////
///
/// CConstObjectInfoEI --
///
/// Container iterator
/// Provides read access to elements of container
/// @sa CConstObjectInfo::BeginElements
class NCBI_XSERIAL_EXPORT CConstObjectInfoEI
{
public:
CConstObjectInfoEI(void);
CConstObjectInfoEI(const CConstObjectInfo& object);
CConstObjectInfoEI& operator=(const CConstObjectInfo& object);
/// Is iterator valid
bool Valid(void) const;
/// Is iterator valid
DECLARE_OPERATOR_BOOL(Valid());
bool operator==(const CConstObjectInfoEI& obj) const
{
return GetElement() == obj.GetElement();
}
bool operator!=(const CConstObjectInfoEI& obj) const
{
return GetElement() != obj.GetElement();
}
/// Get index of the element in the container
TMemberIndex GetIndex(void) const
{
return m_Iterator.GetIndex();
}
/// Advance to next element
void Next(void);
/// Advance to next element
CConstObjectInfoEI& operator++(void);
/// Get element data and type information
CConstObjectInfo GetElement(void) const;
/// Get element data and type information
CConstObjectInfo operator*(void) const;
bool CanGet(void) const
{
return true;
}
const CItemInfo* GetItemInfo(void) const
{
return 0;
}
protected:
bool CheckValid(void) const;
private:
CConstContainerElementIterator m_Iterator;
};
/////////////////////////////////////////////////////////////////////////////
///
/// CObjectInfoEI --
///
/// Container iterator
/// Provides read/write access to elements of container
/// @sa CObjectInfo::BeginElements
class NCBI_XSERIAL_EXPORT CObjectInfoEI
{
public:
CObjectInfoEI(void);
CObjectInfoEI(const CObjectInfo& object);
CObjectInfoEI& operator=(const CObjectInfo& object);
/// Is iterator valid
bool Valid(void) const;
/// Is iterator valid
DECLARE_OPERATOR_BOOL(Valid());
bool operator==(const CObjectInfoEI& obj) const
{
return GetElement() == obj.GetElement();
}
bool operator!=(const CObjectInfoEI& obj) const
{
return GetElement() != obj.GetElement();
}
/// Get index of the element in the container
TMemberIndex GetIndex(void) const
{
return m_Iterator.GetIndex();
}
/// Advance to next element
void Next(void);
/// Advance to next element
CObjectInfoEI& operator++(void);
/// Get element data and type information
CObjectInfo GetElement(void) const;
/// Get element data and type information
CObjectInfo operator*(void) const;
void Erase(void);
bool CanGet(void) const
{
return true;
}
const CItemInfo* GetItemInfo(void) const
{
return 0;
}
protected:
bool CheckValid(void) const;
private:
CContainerElementIterator m_Iterator;
};
/////////////////////////////////////////////////////////////////////////////
///
/// CObjectTypeInfoII --
///
/// Item iterator (either class member or choice variant)
/// provides access to the data type information.
class NCBI_XSERIAL_EXPORT CObjectTypeInfoII
{
public:
const string& GetAlias(void) const;
/// Is iterator valid
bool Valid(void) const;
/// Is iterator valid
DECLARE_OPERATOR_BOOL(Valid());
bool operator==(const CObjectTypeInfoII& iter) const;
bool operator!=(const CObjectTypeInfoII& iter) const;
/// Advance to next element
void Next(void);
const CItemInfo* GetItemInfo(void) const;
/// Get index of the element in the container (class or choice)
TMemberIndex GetIndex(void) const
{
return GetItemIndex();
}
protected:
CObjectTypeInfoII(void);
CObjectTypeInfoII(const CClassTypeInfoBase* typeInfo);
CObjectTypeInfoII(const CClassTypeInfoBase* typeInfo, TMemberIndex index);
const CObjectTypeInfo& GetOwnerType(void) const;
const CClassTypeInfoBase* GetClassTypeInfoBase(void) const;
TMemberIndex GetItemIndex(void) const;
void Init(const CClassTypeInfoBase* typeInfo);
void Init(const CClassTypeInfoBase* typeInfo, TMemberIndex index);
bool CanGet(void) const
{
return true;
}
bool CheckValid(void) const;
private:
CObjectTypeInfo m_OwnerType;
TMemberIndex m_ItemIndex;
TMemberIndex m_LastItemIndex;
};
/////////////////////////////////////////////////////////////////////////////
///
/// CObjectTypeInfoMI --
///
/// Class member iterator
/// provides access to the data type information.
class NCBI_XSERIAL_EXPORT CObjectTypeInfoMI : public CObjectTypeInfoII
{
typedef CObjectTypeInfoII CParent;
public:
CObjectTypeInfoMI(void);
CObjectTypeInfoMI(const CObjectTypeInfo& info);
CObjectTypeInfoMI(const CObjectTypeInfo& info, TMemberIndex index);
/// Get index of the member in the class
TMemberIndex GetMemberIndex(void) const;
/// Advance to next element
CObjectTypeInfoMI& operator++(void);
CObjectTypeInfoMI& operator=(const CObjectTypeInfo& info);
/// Get containing class type
CObjectTypeInfo GetClassType(void) const;
/// Get data type information
operator CObjectTypeInfo(void) const;
/// Get data type information
CObjectTypeInfo GetMemberType(void) const;
/// Get data type information
CObjectTypeInfo operator*(void) const;
void SetLocalReadHook(CObjectIStream& stream,
CReadClassMemberHook* hook) const;
void SetGlobalReadHook(CReadClassMemberHook* hook) const;
void ResetLocalReadHook(CObjectIStream& stream) const;
void ResetGlobalReadHook(void) const;
void SetPathReadHook(CObjectIStream* in, const string& path,
CReadClassMemberHook* hook) const;
void SetLocalWriteHook(CObjectOStream& stream,
CWriteClassMemberHook* hook) const;
void SetGlobalWriteHook(CWriteClassMemberHook* hook) const;
void ResetLocalWriteHook(CObjectOStream& stream) const;
void ResetGlobalWriteHook(void) const;
void SetPathWriteHook(CObjectOStream* stream, const string& path,
CWriteClassMemberHook* hook) const;
void SetLocalSkipHook(CObjectIStream& stream,
CSkipClassMemberHook* hook) const;
void ResetLocalSkipHook(CObjectIStream& stream) const;
void SetPathSkipHook(CObjectIStream* stream, const string& path,
CSkipClassMemberHook* hook) const;
void SetLocalCopyHook(CObjectStreamCopier& stream,
CCopyClassMemberHook* hook) const;
void SetGlobalCopyHook(CCopyClassMemberHook* hook) const;
void ResetLocalCopyHook(CObjectStreamCopier& stream) const;
void ResetGlobalCopyHook(void) const;
void SetPathCopyHook(CObjectStreamCopier* stream, const string& path,
CCopyClassMemberHook* hook) const;
public: // mostly for internal use
const CMemberInfo* GetMemberInfo(void) const;
protected:
void Init(const CObjectTypeInfo& info);
void Init(const CObjectTypeInfo& info, TMemberIndex index);
const CClassTypeInfo* GetClassTypeInfo(void) const;
bool IsSet(const CConstObjectInfo& object) const;
private:
CMemberInfo* GetNCMemberInfo(void) const;
};
/////////////////////////////////////////////////////////////////////////////
///
/// CObjectTypeInfoVI --
///
/// Choice variant iterator
/// provides access to the data type information.
class NCBI_XSERIAL_EXPORT CObjectTypeInfoVI : public CObjectTypeInfoII
{
typedef CObjectTypeInfoII CParent;
public:
CObjectTypeInfoVI(const CObjectTypeInfo& info);
CObjectTypeInfoVI(const CObjectTypeInfo& info, TMemberIndex index);
/// Get index of the variant in the choice
TMemberIndex GetVariantIndex(void) const;
/// Advance to next element
CObjectTypeInfoVI& operator++(void);
CObjectTypeInfoVI& operator=(const CObjectTypeInfo& info);
/// Get containing choice type
CObjectTypeInfo GetChoiceType(void) const;
/// Get data type information
CObjectTypeInfo GetVariantType(void) const;
/// Get data type information
CObjectTypeInfo operator*(void) const;
void SetLocalReadHook(CObjectIStream& stream,
CReadChoiceVariantHook* hook) const;
void SetGlobalReadHook(CReadChoiceVariantHook* hook) const;
void ResetLocalReadHook(CObjectIStream& stream) const;
void ResetGlobalReadHook(void) const;
void SetPathReadHook(CObjectIStream* stream, const string& path,
CReadChoiceVariantHook* hook) const;
void SetLocalWriteHook(CObjectOStream& stream,
CWriteChoiceVariantHook* hook) const;
void SetGlobalWriteHook(CWriteChoiceVariantHook* hook) const;
void ResetLocalWriteHook(CObjectOStream& stream) const;
void ResetGlobalWriteHook(void) const;
void SetPathWriteHook(CObjectOStream* stream, const string& path,
CWriteChoiceVariantHook* hook) const;
void SetLocalSkipHook(CObjectIStream& stream,
CSkipChoiceVariantHook* hook) const;
void ResetLocalSkipHook(CObjectIStream& stream) const;
void SetPathSkipHook(CObjectIStream* stream, const string& path,
CSkipChoiceVariantHook* hook) const;
void SetLocalCopyHook(CObjectStreamCopier& stream,
CCopyChoiceVariantHook* hook) const;
void SetGlobalCopyHook(CCopyChoiceVariantHook* hook) const;
void ResetLocalCopyHook(CObjectStreamCopier& stream) const;
void ResetGlobalCopyHook(void) const;
void SetPathCopyHook(CObjectStreamCopier* stream, const string& path,
CCopyChoiceVariantHook* hook) const;
public: // mostly for internal use
const CVariantInfo* GetVariantInfo(void) const;
protected:
void Init(const CObjectTypeInfo& info);
void Init(const CObjectTypeInfo& info, TMemberIndex index);
const CChoiceTypeInfo* GetChoiceTypeInfo(void) const;
private:
CVariantInfo* GetNCVariantInfo(void) const;
};
/////////////////////////////////////////////////////////////////////////////
///
/// CConstObjectInfoMI --
///
/// Class member iterator
/// provides read access to class member data.
class NCBI_XSERIAL_EXPORT CConstObjectInfoMI : public CObjectTypeInfoMI
{
typedef CObjectTypeInfoMI CParent;
public:
CConstObjectInfoMI(void);
CConstObjectInfoMI(const CConstObjectInfo& object);
CConstObjectInfoMI(const CConstObjectInfo& object, TMemberIndex index);
/// Get containing class data
const CConstObjectInfo& GetClassObject(void) const;
CConstObjectInfoMI& operator=(const CConstObjectInfo& object);
/// Is member assigned a value
bool IsSet(void) const;
/// Get class member data
CConstObjectInfo GetMember(void) const;
/// Get class member data
CConstObjectInfo operator*(void) const;
bool CanGet(void) const;
private:
pair<TConstObjectPtr, TTypeInfo> GetMemberPair(void) const;
CConstObjectInfo m_Object;
};
/////////////////////////////////////////////////////////////////////////////
///
/// CObjectInfoMI --
///
/// Class member iterator
/// provides read/write access to class member data.
class NCBI_XSERIAL_EXPORT CObjectInfoMI : public CObjectTypeInfoMI
{
typedef CObjectTypeInfoMI CParent;
public:
CObjectInfoMI(void);
CObjectInfoMI(const CObjectInfo& object);
CObjectInfoMI(const CObjectInfo& object, TMemberIndex index);
/// Get containing class data
const CObjectInfo& GetClassObject(void) const;
CObjectInfoMI& operator=(const CObjectInfo& object);
/// Is member assigned a value
bool IsSet(void) const;
/// Get class member data
CObjectInfo GetMember(void) const;
/// Get class member data
CObjectInfo operator*(void) const;
/// Erase types
enum EEraseFlag {
eErase_Optional, ///< default - erase optional member only
eErase_Mandatory ///< allow erasing mandatory members, may be dangerous!
};
/// Erase member value
void Erase(EEraseFlag flag = eErase_Optional);
/// Reset value of member to default state
void Reset(void);
bool CanGet(void) const;
private:
pair<TObjectPtr, TTypeInfo> GetMemberPair(void) const;
CObjectInfo m_Object;
};
/////////////////////////////////////////////////////////////////////////////
///
/// CObjectTypeInfoCV --
///
/// Choice variant
/// provides access to the data type information.
class NCBI_XSERIAL_EXPORT CObjectTypeInfoCV
{
public:
CObjectTypeInfoCV(void);
CObjectTypeInfoCV(const CObjectTypeInfo& info);
CObjectTypeInfoCV(const CObjectTypeInfo& info, TMemberIndex index);
CObjectTypeInfoCV(const CConstObjectInfo& object);
/// Get index of the variant in the choice
TMemberIndex GetVariantIndex(void) const;
const string& GetAlias(void) const;
bool Valid(void) const;
DECLARE_OPERATOR_BOOL(Valid());
bool operator==(const CObjectTypeInfoCV& iter) const;
bool operator!=(const CObjectTypeInfoCV& iter) const;
CObjectTypeInfoCV& operator=(const CObjectTypeInfo& info);
CObjectTypeInfoCV& operator=(const CConstObjectInfo& object);
/// Get containing choice
CObjectTypeInfo GetChoiceType(void) const;
/// Get variant data type
CObjectTypeInfo GetVariantType(void) const;
/// Get variant data type
CObjectTypeInfo operator*(void) const;
void SetLocalReadHook(CObjectIStream& stream,
CReadChoiceVariantHook* hook) const;
void SetGlobalReadHook(CReadChoiceVariantHook* hook) const;
void ResetLocalReadHook(CObjectIStream& stream) const;
void ResetGlobalReadHook(void) const;
void SetPathReadHook(CObjectIStream* stream, const string& path,
CReadChoiceVariantHook* hook) const;
void SetLocalWriteHook(CObjectOStream& stream,
CWriteChoiceVariantHook* hook) const;
void SetGlobalWriteHook(CWriteChoiceVariantHook* hook) const;
void ResetLocalWriteHook(CObjectOStream& stream) const;
void ResetGlobalWriteHook(void) const;
void SetPathWriteHook(CObjectOStream* stream, const string& path,
CWriteChoiceVariantHook* hook) const;
void SetLocalCopyHook(CObjectStreamCopier& stream,
CCopyChoiceVariantHook* hook) const;
void SetGlobalCopyHook(CCopyChoiceVariantHook* hook) const;
void ResetLocalCopyHook(CObjectStreamCopier& stream) const;
void ResetGlobalCopyHook(void) const;
void SetPathCopyHook(CObjectStreamCopier* stream, const string& path,
CCopyChoiceVariantHook* hook) const;
public: // mostly for internal use
const CVariantInfo* GetVariantInfo(void) const;
protected:
const CChoiceTypeInfo* GetChoiceTypeInfo(void) const;
void Init(const CObjectTypeInfo& info);
void Init(const CObjectTypeInfo& info, TMemberIndex index);
void Init(const CConstObjectInfo& object);
private:
const CChoiceTypeInfo* m_ChoiceTypeInfo;
TMemberIndex m_VariantIndex;
private:
CVariantInfo* GetNCVariantInfo(void) const;
};
/////////////////////////////////////////////////////////////////////////////
///
/// CConstObjectInfoCV --
///
/// Choice variant
/// provides read access to the variant data.
class NCBI_XSERIAL_EXPORT CConstObjectInfoCV : public CObjectTypeInfoCV
{
typedef CObjectTypeInfoCV CParent;
public:
CConstObjectInfoCV(void);
CConstObjectInfoCV(const CConstObjectInfo& object);
CConstObjectInfoCV(const CConstObjectInfo& object, TMemberIndex index);
/// Get containing choice
const CConstObjectInfo& GetChoiceObject(void) const;
CConstObjectInfoCV& operator=(const CConstObjectInfo& object);
/// Get variant data
CConstObjectInfo GetVariant(void) const;
/// Get variant data
CConstObjectInfo operator*(void) const;
private:
pair<TConstObjectPtr, TTypeInfo> GetVariantPair(void) const;
CConstObjectInfo m_Object;
TMemberIndex m_VariantIndex;
};
/////////////////////////////////////////////////////////////////////////////
///
/// CObjectInfoCV --
///
/// Choice variant
/// provides read/write access to the variant data.
class NCBI_XSERIAL_EXPORT CObjectInfoCV : public CObjectTypeInfoCV
{
typedef CObjectTypeInfoCV CParent;
public:
CObjectInfoCV(void);
CObjectInfoCV(const CObjectInfo& object);
CObjectInfoCV(const CObjectInfo& object, TMemberIndex index);
/// Get containing choice
const CObjectInfo& GetChoiceObject(void) const;
CObjectInfoCV& operator=(const CObjectInfo& object);
/// Get variant data
CObjectInfo GetVariant(void) const;
/// Get variant data
CObjectInfo operator*(void) const;
private:
pair<TObjectPtr, TTypeInfo> GetVariantPair(void) const;
CObjectInfo m_Object;
};
/* @} */
#include <serial/impl/objectiter.inl>
END_NCBI_SCOPE
#endif /* OBJECTITER__HPP */
| [
"zhao.kaiyong@gmail.com"
] | zhao.kaiyong@gmail.com |
0401b0ca7e1e016f8afecb761b08ebad586cc868 | 12b377946d78de96d4096e55874933fe9bb38619 | /ash/wm/common/wm_globals.h | 28823ef7a353b1fa32000dd0ab02e00a2b0a3bb0 | [
"BSD-3-Clause"
] | permissive | neuyang/chromium | 57c0c6ef86e933bc5de11a9754e5ef6f9752badb | afb8f54b782055923cadd711452c2448f3f7b5b4 | refs/heads/master | 2023-02-20T21:47:59.999916 | 2016-04-20T21:38:20 | 2016-04-20T21:41:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,670 | h | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_WM_COMMON_WM_GLOBALS_H_
#define ASH_WM_COMMON_WM_GLOBALS_H_
#include <stdint.h>
#include <vector>
#include "ash/ash_export.h"
namespace gfx {
class Rect;
}
namespace ash {
namespace wm {
class WmWindow;
// Used for accessing global state.
class ASH_EXPORT WmGlobals {
public:
virtual ~WmGlobals() {}
// This is necessary for a handful of places that is difficult to plumb
// through context.
static WmGlobals* Get();
virtual WmWindow* GetActiveWindow() = 0;
// Returns the root window for the specified display.
virtual WmWindow* GetRootWindowForDisplayId(int64_t display_id) = 0;
// Returns the root window that newly created windows should be added to.
// NOTE: this returns the root, newly created window should be added to the
// appropriate container in the returned window.
virtual WmWindow* GetRootWindowForNewWindows() = 0;
// returns the list of more recently used windows excluding modals.
virtual std::vector<WmWindow*> GetMruWindowListIgnoreModals() = 0;
// Returns true if the first window shown on first run should be
// unconditionally maximized, overriding the heuristic that normally chooses
// the window size.
virtual bool IsForceMaximizeOnFirstRun() = 0;
// See aura::client::CursorClient for details on these.
virtual void LockCursor() = 0;
virtual void UnlockCursor() = 0;
virtual std::vector<WmWindow*> GetAllRootWindows() = 0;
};
} // namespace wm
} // namespace ash
#endif // ASH_WM_COMMON_WM_GLOBALS_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
e22024e90544695e52c4c9ee9c3d9a5f5e6ed563 | 1bf7bfc7a7f4653fe0e956459b23d0ffd9d8e479 | /tmplanner_continuous/include/tmplanner_continuous/stats/rand/rlogis.ipp | 5e44ad82ba027e9ffed179dc4235842ee0c3a724 | [] | no_license | ajitham123/IPP-SaR | e063d9bf1bc0d4e065d8d6c1992f9e87f128cd61 | f434bfaeff7ca5e9b0e7bb34b6d5d1c63566ea53 | refs/heads/master | 2021-07-16T04:30:55.263886 | 2021-07-09T12:39:54 | 2021-07-09T12:39:54 | 121,274,735 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 2,291 | ipp | /*################################################################################
##
## Copyright (C) 2011-2018 Keith O'Hara
##
## This file is part of the StatsLib C++ library.
##
## 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.
##
################################################################################*/
/*
* Sample from a logistic distribution
*/
template<typename T>
statslib_inline
T
rlogis(const T mu_par, const T sigma_par, rand_engine_t& engine)
{
return qlogis(runif<T>(T(0.0),T(1.0),engine),mu_par,sigma_par);
}
template<typename T>
statslib_inline
T
rlogis(const T mu_par, const T sigma_par, uint_t seed_val)
{
return qlogis(runif<T>(T(0.0),T(1.0),seed_val),mu_par,sigma_par);
}
template<typename T>
statslib_inline
void
rlogis_int(const T mu_par, const T sigma_par, T* vals_out, const uint_t num_elem)
{
#ifdef STATS_USE_OPENMP
uint_t n_threads = omp_get_max_threads();
std::vector<rand_engine_t> engines;
for (uint_t k=0; k < n_threads; k++)
{
engines.push_back(rand_engine_t(std::random_device{}()));
}
#pragma omp parallel for
for (uint_t j=0U; j < num_elem; j++)
{
uint_t thread_id = omp_get_thread_num();
vals_out[j] = rlogis(mu_par,sigma_par,engines[thread_id]);
}
#else
rand_engine_t engine(std::random_device{}());
for (uint_t j=0U; j < num_elem; j++)
{
vals_out[j] = rlogis(mu_par,sigma_par,engine);
}
#endif
}
#ifdef STATS_WITH_MATRIX_LIB
template<typename mT, typename eT>
statslib_inline
mT
rlogis(const uint_t n, const uint_t k, const eT mu_par, const eT sigma_par)
{
mT mat_out(n,k);
rlogis_int(mu_par,sigma_par,mat_ops::get_mem_ptr(mat_out),n*k);
return mat_out;
}
#endif
| [
"ajitham1994@gmail.com"
] | ajitham1994@gmail.com |
b403511eed2c7dd4f534293d79691760f108a899 | 462d34de5ba1db166757b4dcf1bd54b61556fb37 | /IllegalCharException.h | e55137af94423c65bce9d7035d32c4cbbb7452bd | [] | no_license | Meyt3893/TickTackToe | 30b96698b151934c6d68ebcade7c33a9880272fa | 5927611f84744c777cd412cdf7bf9d1e81704bc2 | refs/heads/master | 2020-03-14T15:55:09.074434 | 2018-06-20T06:20:21 | 2018-06-20T06:20:21 | 131,687,198 | 0 | 1 | null | 2018-06-20T07:39:53 | 2018-05-01T07:26:20 | C++ | UTF-8 | C++ | false | false | 213 | h |
#include <string>
#include <exception>
using namespace std;
class IllegalCharException : public exception
{
public:
char c;
IllegalCharException(char c);
char IllegalChar()const;
char theChar()const;
};
| [
"noreply@github.com"
] | Meyt3893.noreply@github.com |
3c9da29f1b78e7493e9464525db1c484d20f3d1b | 0b95ece2228853e93506c9177359c7251bfacc65 | /Arduino_code/calibration/MatlabSerial_forverification/MatlabSerial_forverification.ino | fa41ef6c488c07336a435ca4b99d086240e8088c | [] | no_license | RoshanPasupathy/Smartwing_GDP1617 | 81a974f67bf30f102d7d6c2e51c036e941b937e0 | 198d2ff8297d7e053cf7434dfc2572e14e285bd3 | refs/heads/master | 2021-01-22T19:22:01.900476 | 2017-03-16T12:15:31 | 2017-03-16T12:15:31 | 85,193,825 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,198 | ino | #include "HX711.h"
//function definition
void send_routine(void);
volatile byte state = LOW;
int switchPin = 2;
int ledPin = 14;
int redledPin = 15;
HX711 l1;
HX711 l2;
HX711 l3;
HX711 d1;
HX711 d2;
//Number of loading conditions
//int N = 5;
void setup() {
// Initialise loadcells
l1.begin(11,12);
l2.begin(9,10);
l3.begin(7,8);
d1.begin(3,4);
d2.begin(5,6);
//initialise pins
pinMode(ledPin, OUTPUT);
pinMode(switchPin, INPUT);
pinMode(redledPin, OUTPUT);
//Procedure
digitalWrite(redledPin, LOW);
//Green LED stays lit while waiting
//for connection
digitalWrite(ledPin, HIGH);
Serial.begin(9600);
Serial.println('a');
char a = 'b';
while (a != 'a'){
a = Serial.read();
}
digitalWrite(ledPin, LOW);
send_routine();
}
void loop() {
// put your main code here, to run repeatedly:
}
/**
* Synchronises matlab and arduino serial
to prevent overflow
* Synchronisation done by acknowledgement chars
* Arduino prints data -> matlab reads when it detects
presence of bytes in serial buffer
* Acknowledgement procedure:
- Arduino waits for matlab acknowledgement
- When available -> read
- If unexpected char -> light Red LED
else blink green LED twice
*/
void send_routine(){
blinkled(ledPin, 3, 200);
blinkled(redledPin, 3, 200);
volatile byte runflag = LOW;
char val = 'a';
//Waits for matlab to begin request
// request char = 'c'
while (Serial.available() == 0){
}
if (Serial.available() > 0){
val = Serial.read();
if (val == 'c'){
//data received as expected
//blink green twice
runflag = HIGH;
blinkled(ledPin, 2, 300);
}
else {
//Unexpected output -> Something went wrong
digitalWrite(redledPin, HIGH);
}
}
//Green led lights up to indicate ready for next stage
digitalWrite(ledPin, HIGH);
//Send data for each loading condition
//for (int i = 0; i < N; i++){
while (runflag == HIGH){
digitalWrite(ledPin, HIGH);
state = digitalRead(switchPin);
//Halt till load is placed
while (digitalRead(switchPin) == state){
}
//Switch toggled -> load placed -> green led goes off
digitalWrite(ledPin, LOW);
//send data
Serial.println(l1.read_average(10));
Serial.println(l2.read_average(10));
Serial.println(l3.read_average(10));
Serial.println(d1.read_average(10));
Serial.println(d2.read_average(10));
//before proceeding check if data is received by matlab
while (Serial.available() == 0){
}
if (Serial.available() > 0){
val = Serial.read();
if (val == 'g'){
//blink green twice
blinkled(ledPin, 2, 300);
}
else if (val == 'e'){
runflag = LOW;
}
else {
//Received something but it's not expected
digitalWrite(redledPin, HIGH);
//abort
}
}
}
blinkled(redledPin, 3, 300);
blinkled(ledPin, 3, 300);
}
void blinkled(int pinl, int times, int milsec){
for (int i = 0; i < times; i++){
delay(milsec);
digitalWrite(pinl, LOW);
delay(milsec);
digitalWrite(pinl, HIGH);
}
digitalWrite(pinl, LOW);
}
| [
"roshan.pasupathy@gmail.com"
] | roshan.pasupathy@gmail.com |
412e29c23e0939fc655b65b98dafd6a969ac41aa | f68a5f06ad64f31e09f7b86862e9437a389dd464 | /Src/Window/Blackman.cpp | 769f02f32f23c7c28347353daacc10b5e0df043e | [] | no_license | LiuPeiqi/DSP | 68ec54bcbb20add77d4ba94ff338e2cde492aac5 | 09d3efa1713d868c7595f7eff9a9a2a67e5f8095 | refs/heads/master | 2021-01-19T07:17:50.652006 | 2016-06-21T15:43:35 | 2016-06-21T15:43:35 | 61,643,803 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 317 | cpp | #include <cmath>
#include "WindowConstNumber.h"
double BlackmanItem(size_t n, size_t N)
{
double f = n / (N - 1);
return 0.42 - 0.5 * cos(M_2_PI * f) + 0.08 * cos(M_4_PI * f);
}
void Blackman(double *blackman, size_t N)
{
for (size_t i = 0; i < N; ++i) {
blackman[i] = BlackmanItem(i, N);
}
} | [
"liu_peiqi@163.com"
] | liu_peiqi@163.com |
54c3f666cf1e686aa89142cc5e7304c6a0c77fd5 | ff7f4d1db50802fff5ef30dbc070deae61562ac2 | /RecoBTag/SecondaryVertex/src/CombinedSVSoftLeptonComputer.cc | 7e80ce45d90fefeceaa37cc85a7a22d2e221be04 | [] | no_license | chenxvan/cmssw | c76aaab6b7529ddcea32c235999207d98cdac3f7 | 5a62631dbbe35410e816ca1b35682203ceaa64f9 | refs/heads/CMSSW_7_1_X | 2021-01-09T07:33:32.267995 | 2017-06-01T20:05:26 | 2017-06-01T20:05:26 | 19,713,080 | 0 | 0 | null | 2017-06-01T20:05:27 | 2014-05-12T19:54:48 | C++ | UTF-8 | C++ | false | false | 20,599 | cc | #include <iostream>
#include <cstddef>
#include <string>
#include <cmath>
#include <vector>
#include <Math/VectorUtil.h>
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/Math/interface/Vector3D.h"
#include "DataFormats/Math/interface/LorentzVector.h"
#include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h"
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "DataFormats/GeometryVector/interface/GlobalVector.h"
#include "DataFormats/GeometryVector/interface/VectorUtil.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/BTauReco/interface/TrackIPTagInfo.h"
#include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h"
#include "DataFormats/BTauReco/interface/SoftLeptonTagInfo.h"
#include "DataFormats/BTauReco/interface/TaggingVariable.h"
#include "DataFormats/BTauReco/interface/VertexTypes.h"
#include "DataFormats/JetReco/interface/PFJet.h"
#include "DataFormats/PatCandidates/interface/Jet.h"
#include "RecoVertex/VertexPrimitives/interface/ConvertToFromReco.h"
#include "RecoBTag/SecondaryVertex/interface/ParticleMasses.h"
#include "RecoBTag/SecondaryVertex/interface/TrackSorting.h"
#include "RecoBTag/SecondaryVertex/interface/TrackSelector.h"
#include "RecoBTag/SecondaryVertex/interface/TrackKinematics.h"
#include "RecoBTag/SecondaryVertex/interface/V0Filter.h"
#include "RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h"
using namespace reco;
using namespace std;
struct CombinedSVSoftLeptonComputer::IterationRange {
int begin, end, increment;
};
#define range_for(i, x) \
for(int i = (x).begin; i != (x).end; i += (x).increment)
static edm::ParameterSet dropDeltaR(const edm::ParameterSet &pset)
{
edm::ParameterSet psetCopy(pset);
psetCopy.addParameter<double>("jetDeltaRMax", 99999.0);
return psetCopy;
}
CombinedSVSoftLeptonComputer::CombinedSVSoftLeptonComputer(const edm::ParameterSet ¶ms) :
trackFlip(params.getParameter<bool>("trackFlip")),
vertexFlip(params.getParameter<bool>("vertexFlip")),
charmCut(params.getParameter<double>("charmCut")),
sortCriterium(TrackSorting::getCriterium(params.getParameter<std::string>("trackSort"))),
trackSelector(params.getParameter<edm::ParameterSet>("trackSelection")),
trackNoDeltaRSelector(dropDeltaR(params.getParameter<edm::ParameterSet>("trackSelection"))),
trackPseudoSelector(params.getParameter<edm::ParameterSet>("trackPseudoSelection")),
pseudoMultiplicityMin(params.getParameter<unsigned int>("pseudoMultiplicityMin")),
trackMultiplicityMin(params.getParameter<unsigned int>("trackMultiplicityMin")),
minTrackWeight(params.getParameter<double>("minimumTrackWeight")),
useTrackWeights(params.getParameter<bool>("useTrackWeights")),
vertexMassCorrection(params.getParameter<bool>("correctVertexMass")),
pseudoVertexV0Filter(params.getParameter<edm::ParameterSet>("pseudoVertexV0Filter")),
trackPairV0Filter(params.getParameter<edm::ParameterSet>("trackPairV0Filter"))
{
}
inline double CombinedSVSoftLeptonComputer::flipValue(double value, bool vertex) const
{
return (vertex ? vertexFlip : trackFlip) ? -value : value;
}
inline CombinedSVSoftLeptonComputer::IterationRange CombinedSVSoftLeptonComputer::flipIterate(
int size, bool vertex) const
{
IterationRange range;
if (vertex ? vertexFlip : trackFlip) {
range.begin = size - 1;
range.end = -1;
range.increment = -1;
} else {
range.begin = 0;
range.end = size;
range.increment = +1;
}
return range;
}
const TrackIPTagInfo::TrackIPData &
CombinedSVSoftLeptonComputer::threshTrack(const TrackIPTagInfo &trackIPTagInfo,
const TrackIPTagInfo::SortCriteria sort,
const reco::Jet &jet,
const GlobalPoint &pv) const
{
const edm::RefVector<TrackCollection> &tracks =
trackIPTagInfo.selectedTracks();
const std::vector<TrackIPTagInfo::TrackIPData> &ipData =
trackIPTagInfo.impactParameterData();
std::vector<std::size_t> indices = trackIPTagInfo.sortedIndexes(sort);
IterationRange range = flipIterate(indices.size(), false);
TrackKinematics kin;
range_for(i, range) {
std::size_t idx = indices[i];
const TrackIPTagInfo::TrackIPData &data = ipData[idx];
const Track &track = *tracks[idx];
if (!trackNoDeltaRSelector(track, data, jet, pv))
continue;
kin.add(track);
if (kin.vectorSum().M() > charmCut)
return data;
}
static const TrackIPTagInfo::TrackIPData dummy = {
GlobalPoint(),
GlobalPoint(),
Measurement1D(-1.0, 1.0),
Measurement1D(-1.0, 1.0),
Measurement1D(-1.0, 1.0),
Measurement1D(-1.0, 1.0),
0.
};
return dummy;
}
static double etaRel(const math::XYZVector &dir, const math::XYZVector &track)
{
double momPar = dir.Dot(track);
double energy = std::sqrt(track.Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
return 0.5 * std::log((energy + momPar) / (energy - momPar));
}
TaggingVariableList
CombinedSVSoftLeptonComputer::operator () (const TrackIPTagInfo &ipInfo,
const SecondaryVertexTagInfo &svInfo,
const SoftLeptonTagInfo &muonInfo,
const SoftLeptonTagInfo &elecInfo
) const
{
using namespace ROOT::Math;
edm::RefToBase<Jet> jet = ipInfo.jet();
math::XYZVector jetDir = jet->momentum().Unit();
bool havePv = ipInfo.primaryVertex().isNonnull();
GlobalPoint pv;
if (havePv)
pv = GlobalPoint(ipInfo.primaryVertex()->x(), ipInfo.primaryVertex()->y(), ipInfo.primaryVertex()->z());
btag::Vertices::VertexType vtxType = btag::Vertices::NoVertex;
TaggingVariableList vars;
vars.insert(btau::jetPt, jet->pt(), true);
vars.insert(btau::jetEta, jet->eta(), true);
if (ipInfo.selectedTracks().size() < trackMultiplicityMin)
return vars;
vars.insert(btau::jetNTracks, ipInfo.selectedTracks().size(), true);
TrackKinematics allKinematics;
TrackKinematics vertexKinematics;
TrackKinematics trackJetKinematics;
double vtx_track_ptSum= 0.;
double vtx_track_ESum= 0.;
double jet_track_ESum= 0.;
int vtx = -1;
unsigned int numberofvertextracks = 0;
//IF THERE ARE SECONDARY VERTICES THE JET FALLS IN THE RECOVERTEX CATEGORY
IterationRange range = flipIterate(svInfo.nVertices(), true);
range_for(i, range) {
if (vtx < 0) vtx = i; //RecoVertex category (vtx=0) if we enter at least one time in this loop!
numberofvertextracks = numberofvertextracks + (svInfo.secondaryVertex(i)).nTracks();
const Vertex &vertex = svInfo.secondaryVertex(i);
bool hasRefittedTracks = vertex.hasRefittedTracks();
TrackRefVector tracks = svInfo.vertexTracks(i);
for(TrackRefVector::const_iterator track = tracks.begin(); track != tracks.end(); track++) {
double w = svInfo.trackWeight(i, *track);
if (w < minTrackWeight)
continue;
if (hasRefittedTracks) {
Track actualTrack = vertex.refittedTrack(*track);
vars.insert(btau::trackEtaRel, etaRel(jetDir,actualTrack.momentum()), true);
vertexKinematics.add(actualTrack, w);
if(i==0)
{
math::XYZVector vtx_trackMom = actualTrack.momentum();
vtx_track_ptSum += std::sqrt(std::pow(vtx_trackMom.X(),2) + std::pow(vtx_trackMom.Y(),2));
vtx_track_ESum += std::sqrt(vtx_trackMom.Mag2() + ROOT::Math::Square(ParticleMasses::piPlus));
}
} else { //THIS ONE IS TAKEN...
vars.insert(btau::trackEtaRel, etaRel(jetDir,(*track)->momentum()), true);
vertexKinematics.add(**track, w);
if(i==0) // calculate this only for the first vertex
{
math::XYZVector vtx_trackMom = (*track)->momentum();
vtx_track_ptSum += std::sqrt(std::pow(vtx_trackMom.X(),2) + std::pow(vtx_trackMom.Y(),2));
vtx_track_ESum += std::sqrt(vtx_trackMom.Mag2() + std::pow(ParticleMasses::piPlus,2));
}
}
}
}
if (vtx >= 0) {
vtxType = btag::Vertices::RecoVertex;
vars.insert(btau::flightDistance2dVal,flipValue(svInfo.flightDistance(vtx, true).value(),true),true);
vars.insert(btau::flightDistance2dSig,flipValue(svInfo.flightDistance(vtx, true).significance(),true),true);
vars.insert(btau::flightDistance3dVal,flipValue(svInfo.flightDistance(vtx, false).value(),true),true);
vars.insert(btau::flightDistance3dSig,flipValue(svInfo.flightDistance(vtx, false).significance(),true),true);
vars.insert(btau::vertexJetDeltaR,Geom::deltaR(svInfo.flightDirection(vtx), jetDir),true);
vars.insert(btau::jetNSecondaryVertices, svInfo.nVertices(), true);
vars.insert(btau::vertexNTracks, numberofvertextracks, true);
vars.insert(btau::vertexFitProb,(svInfo.secondaryVertex(vtx)).normalizedChi2(), true);
}
//NOW ATTEMPT TO RECONSTRUCT PSEUDOVERTEX!!!
std::vector<std::size_t> indices = ipInfo.sortedIndexes(sortCriterium);
const std::vector<TrackIPTagInfo::TrackIPData> &ipData = ipInfo.impactParameterData();
const edm::RefVector<TrackCollection> &tracks = ipInfo.selectedTracks();
std::vector<TrackRef> pseudoVertexTracks;
range = flipIterate(indices.size(), false);
range_for(i, range) {
std::size_t idx = indices[i];
const TrackIPTagInfo::TrackIPData &data = ipData[idx];
const TrackRef &trackRef = tracks[idx];
const Track &track = *trackRef;
// if no vertex was reconstructed, attempt pseudo vertex
if (vtxType == btag::Vertices::NoVertex && trackPseudoSelector(track, data, *jet, pv)) {
pseudoVertexTracks.push_back(trackRef);
vertexKinematics.add(track);
}
}
if (vtxType == btag::Vertices::NoVertex && vertexKinematics.numberOfTracks() >= pseudoMultiplicityMin && pseudoVertexV0Filter(pseudoVertexTracks))
{
vtxType = btag::Vertices::PseudoVertex;
for(std::vector<TrackRef>::const_iterator track = pseudoVertexTracks.begin(); track != pseudoVertexTracks.end(); ++track)
{
vars.insert(btau::trackEtaRel, etaRel(jetDir, (*track)->momentum()), true);
math::XYZVector vtx_trackMom = (*track)->momentum();
vtx_track_ptSum += std::sqrt(std::pow(vtx_trackMom.X(),2) + std::pow(vtx_trackMom.Y(),2));
vtx_track_ESum += std::sqrt(vtx_trackMom.Mag2() + std::pow(ParticleMasses::piPlus,2));
}
}
vars.insert(btau::vertexCategory, vtxType, true);
// do a tighter track selection to fill the variable plots...
TrackRef trackPairV0Test[2];
range = flipIterate(indices.size(), false);
range_for(i, range) {
std::size_t idx = indices[i];
const TrackIPTagInfo::TrackIPData &data = ipData[idx];
const TrackRef &trackRef = tracks[idx];
const Track &track = *trackRef;
jet_track_ESum += std::sqrt((track.momentum()).Mag2() + std::pow(ParticleMasses::piPlus,2));
// add track to kinematics for all tracks in jet
//allKinematics.add(track); //would make more sense for some variables, e.g. vertexEnergyRatio nicely between 0 and 1, but not necessarily the best option for the discriminating power...
// filter tracks -> this track selection can be more tight (used to fill the track related variables...)
if (!trackSelector(track, data, *jet, pv))
continue;
// add track to kinematics for all tracks in jet
allKinematics.add(track);
// check against all other tracks for K0 track pairs setting the track mass to pi+
trackPairV0Test[0] = tracks[idx];
bool ok = true;
range_for(j, range) {
if (i == j)
continue;
std::size_t pairIdx = indices[j];
const TrackIPTagInfo::TrackIPData &pairTrackData = ipData[pairIdx];
const TrackRef &pairTrackRef = tracks[pairIdx];
const Track &pairTrack = *pairTrackRef;
if (!trackSelector(pairTrack, pairTrackData, *jet, pv))
continue;
trackPairV0Test[1] = pairTrackRef;
if (!trackPairV0Filter(trackPairV0Test, 2)) { //V0 filter is more tight (0.03) than the one used for the RecoVertex and PseudoVertex tracks (0.05)
ok = false;
break;
}
}
if (!ok)
continue;
trackJetKinematics.add(track);
// add track variables
math::XYZVector trackMom = track.momentum();
double trackMag = std::sqrt(trackMom.Mag2());
vars.insert(btau::trackSip3dVal, flipValue(data.ip3d.value(), false), true);
vars.insert(btau::trackSip3dSig, flipValue(data.ip3d.significance(), false), true);
vars.insert(btau::trackSip2dVal, flipValue(data.ip2d.value(), false), true);
vars.insert(btau::trackSip2dSig, flipValue(data.ip2d.significance(), false), true);
vars.insert(btau::trackJetDistVal, data.distanceToJetAxis.value(), true);
vars.insert(btau::trackDecayLenVal, havePv ? (data.closestToJetAxis - pv).mag() : -1.0, true);
vars.insert(btau::trackPtRel, VectorUtil::Perp(trackMom, jetDir), true);
vars.insert(btau::trackPPar, jetDir.Dot(trackMom), true);
vars.insert(btau::trackDeltaR, VectorUtil::DeltaR(trackMom, jetDir), true);
vars.insert(btau::trackPtRatio, VectorUtil::Perp(trackMom, jetDir) / trackMag, true);
vars.insert(btau::trackPParRatio, jetDir.Dot(trackMom) / trackMag, true);
}
vars.insert(btau::trackJetPt, trackJetKinematics.vectorSum().Pt(), true);
vars.insert(btau::trackSumJetDeltaR,VectorUtil::DeltaR(allKinematics.vectorSum(), jetDir), true);
vars.insert(btau::trackSumJetEtRatio,allKinematics.vectorSum().Et() / ipInfo.jet()->et(), true);
vars.insert(btau::trackSip3dSigAboveCharm, flipValue(threshTrack(ipInfo, TrackIPTagInfo::IP3DSig, *jet, pv).ip3d.significance(),false),true);
vars.insert(btau::trackSip3dValAboveCharm, flipValue(threshTrack(ipInfo, TrackIPTagInfo::IP3DSig, *jet, pv).ip3d.value(),false),true);
vars.insert(btau::trackSip2dSigAboveCharm, flipValue(threshTrack(ipInfo, TrackIPTagInfo::IP2DSig, *jet, pv).ip2d.significance(),false),true);
vars.insert(btau::trackSip2dValAboveCharm, flipValue(threshTrack(ipInfo, TrackIPTagInfo::IP2DSig, *jet, pv).ip2d.value(),false),true);
if (vtxType != btag::Vertices::NoVertex) {
math::XYZTLorentzVector allSum = useTrackWeights ? allKinematics.weightedVectorSum() : allKinematics.vectorSum();
math::XYZTLorentzVector vertexSum = useTrackWeights ? vertexKinematics.weightedVectorSum() : vertexKinematics.vectorSum();
if (vtxType != btag::Vertices::RecoVertex) {
vars.insert(btau::vertexNTracks,vertexKinematics.numberOfTracks(), true);
vars.insert(btau::vertexJetDeltaR,VectorUtil::DeltaR(vertexSum, jetDir), true);
}
double vertexMass = vertexSum.M();
double varPi = 0;
double varB = 0;
if (vtxType == btag::Vertices::RecoVertex) {
if(vertexMassCorrection)
{
GlobalVector dir = svInfo.flightDirection(vtx);
double vertexPt2 = math::XYZVector(dir.x(), dir.y(), dir.z()).Cross(vertexSum).Mag2() / dir.mag2();
vertexMass = std::sqrt(vertexMass * vertexMass + vertexPt2) + std::sqrt(vertexPt2);
}
}
vars.insert(btau::vertexMass, vertexMass, true);
varPi = (vertexMass/5.2794) * (vtx_track_ESum /jet_track_ESum); //5.2794 should be average B meson mass of PDG! CHECK!!!
vars.insert(btau::massVertexEnergyFraction, varPi, true);
varB = (std::sqrt(5.2794) * vtx_track_ptSum) / ( vertexMass * std::sqrt(jet->pt()));
vars.insert(btau::vertexBoostOverSqrtJetPt,varB*varB/(varB*varB + 10.), true);
if (allKinematics.numberOfTracks())
vars.insert(btau::vertexEnergyRatio, vertexSum.E() / allSum.E(), true);
else
vars.insert(btau::vertexEnergyRatio, 1, true);
}
reco::PFJet const * pfJet = dynamic_cast<reco::PFJet const *>( &* jet ) ;
pat::Jet const * patJet = dynamic_cast<pat::Jet const *>( &* jet ) ;
if ( pfJet != 0 ) {
vars.insert(btau::chargedHadronEnergyFraction,pfJet->chargedHadronEnergyFraction(), true);
vars.insert(btau::neutralHadronEnergyFraction,pfJet->neutralHadronEnergyFraction(), true);
vars.insert(btau::photonEnergyFraction,pfJet->photonEnergyFraction(), true);
vars.insert(btau::electronEnergyFraction,pfJet->electronEnergyFraction(), true);
vars.insert(btau::muonEnergyFraction,pfJet->muonEnergyFraction(), true);
vars.insert(btau::chargedHadronMultiplicity,pfJet->chargedHadronMultiplicity(), true);
vars.insert(btau::neutralHadronMultiplicity,pfJet->neutralHadronMultiplicity(), true);
vars.insert(btau::photonMultiplicity,pfJet->photonMultiplicity(), true);
vars.insert(btau::electronMultiplicity,pfJet->electronMultiplicity(), true);
vars.insert(btau::muonMultiplicity,pfJet->muonMultiplicity(), true);
vars.insert(btau::hadronMultiplicity,pfJet->chargedHadronMultiplicity()+pfJet->neutralHadronMultiplicity(), true);
vars.insert(btau::hadronPhotonMultiplicity,pfJet->chargedHadronMultiplicity()+pfJet->neutralHadronMultiplicity()+pfJet->photonMultiplicity(), true);
vars.insert(btau::totalMultiplicity,pfJet->chargedHadronMultiplicity()+pfJet->neutralHadronMultiplicity()+pfJet->photonMultiplicity()+pfJet->electronMultiplicity()+pfJet->muonMultiplicity(), true);
}
else if( patJet != 0)
{
vars.insert(btau::chargedHadronEnergyFraction,patJet->chargedHadronEnergyFraction(), true);
vars.insert(btau::neutralHadronEnergyFraction,patJet->neutralHadronEnergyFraction(), true);
vars.insert(btau::photonEnergyFraction,patJet->photonEnergyFraction(), true);
vars.insert(btau::electronEnergyFraction,patJet->electronEnergyFraction(), true);
vars.insert(btau::muonEnergyFraction,patJet->muonEnergyFraction(), true);
vars.insert(btau::chargedHadronMultiplicity,patJet->chargedHadronMultiplicity(), true);
vars.insert(btau::neutralHadronMultiplicity,patJet->neutralHadronMultiplicity(), true);
vars.insert(btau::photonMultiplicity,patJet->photonMultiplicity(), true);
vars.insert(btau::electronMultiplicity,patJet->electronMultiplicity(), true);
vars.insert(btau::muonMultiplicity,patJet->muonMultiplicity(), true);
vars.insert(btau::hadronMultiplicity,patJet->chargedHadronMultiplicity()+patJet->neutralHadronMultiplicity(), true);
vars.insert(btau::hadronPhotonMultiplicity,patJet->chargedHadronMultiplicity()+patJet->neutralHadronMultiplicity()+patJet->photonMultiplicity(), true);
vars.insert(btau::totalMultiplicity,patJet->chargedHadronMultiplicity()+patJet->neutralHadronMultiplicity()+patJet->photonMultiplicity()+patJet->electronMultiplicity()+patJet->muonMultiplicity(), true);
}
else
{
throw cms::Exception("InvalidConfiguration") << "From CombinedSVSoftLeptonComputer::operator: reco::PFJet OR pat::Jet are required by this module" << std::endl;
}
int leptonCategory = 0; //0 = no lepton, 1 = muon, 2 = electron
for (unsigned int i = 0; i < muonInfo.leptons(); i++) {// loop over all muons, not optimal -> find the best or use ranking from best to worst
leptonCategory = 1; // muon category
const SoftLeptonProperties & propertiesMuon = muonInfo.properties(i);
vars.insert(btau::leptonPtRel,propertiesMuon.ptRel , true);
vars.insert(btau::leptonSip3d,propertiesMuon.sip3d , true);
vars.insert(btau::leptonDeltaR,propertiesMuon.deltaR , true);
vars.insert(btau::leptonRatioRel,propertiesMuon.ratioRel , true);
vars.insert(btau::leptonEtaRel,propertiesMuon.etaRel , true);
vars.insert(btau::leptonRatio,propertiesMuon.ratio , true);
}
if(leptonCategory != 1){ //no soft muon found, try soft electron
for (unsigned int i = 0; i < elecInfo.leptons(); i++) { // loop over all electrons, not optimal -> find the best or use ranking from best to worst
leptonCategory = 2; // electron category
const SoftLeptonProperties & propertiesElec = elecInfo.properties(i);
vars.insert(btau::leptonPtRel,propertiesElec.ptRel , true);
vars.insert(btau::leptonSip3d,propertiesElec.sip3d , true);
vars.insert(btau::leptonDeltaR,propertiesElec.deltaR , true);
vars.insert(btau::leptonRatioRel,propertiesElec.ratioRel , true);
vars.insert(btau::leptonP0Par,propertiesElec.p0Par , true);
vars.insert(btau::leptonEtaRel,propertiesElec.etaRel , true);
vars.insert(btau::leptonRatio,propertiesElec.ratio , true);
}
}
//put default value for vertexLeptonCategory on 2 = NoVertexNoSoftLepton
int vertexLepCat = 2;
if(leptonCategory == 0){ // no soft lepton
if (vtxType == btag::Vertices::RecoVertex)
vertexLepCat = 0;
else if (vtxType == btag::Vertices::PseudoVertex)
vertexLepCat = 1;
else
vertexLepCat = 2;
} else if(leptonCategory == 1){ // soft muon
if (vtxType == btag::Vertices::RecoVertex)
vertexLepCat = 3;
else if(vtxType == btag::Vertices::PseudoVertex)
vertexLepCat = 4;
else vertexLepCat = 5;
} else if(leptonCategory == 2){ // soft electron
if (vtxType == btag::Vertices::RecoVertex)
vertexLepCat = 6;
else if (vtxType == btag::Vertices::PseudoVertex)
vertexLepCat = 7;
else
vertexLepCat = 8;
}
vars.insert(btau::vertexLeptonCategory, vertexLepCat , true);
vars.finalize();
return vars;
}
| [
"pvmulder@cern.ch"
] | pvmulder@cern.ch |
eea9422c602d78b76b7f74034eeff2b3448e2925 | 11c5c16b77857f163fbb8bd6e6ba4fa79886d696 | /NameEntry.h | c96b3d668ed37c250ffc4094ad7a1c41808d7dd8 | [] | no_license | LucasLu2000/NamesDemo | 075106a18e84e3e78f3cf498b63798e23ec0ad48 | a1407c5a6eef6555eba5d49fddda4d02a8bd97da | refs/heads/master | 2022-12-09T07:13:45.226856 | 2020-09-15T03:59:38 | 2020-09-15T03:59:38 | 295,569,956 | 0 | 0 | null | 2020-09-15T00:19:55 | 2020-09-15T00:19:55 | null | UTF-8 | C++ | false | false | 888 | h | /***************************************************************************
* NameEntry.h - Object to store name data for a single name
*
* copyright : (C) 2018 by Jim Skon, Kenyon College
*
* This is part of a program create an index US Census name
* Data on the frequency of names in response to requestes.
* It then allows you to look up any name, giving the 10 closest matches
*
*
*
***************************************************************************/
#ifndef NAMEENTRY_H
#define NAMEENTRY_H
#include <string>
using namespace std;
class NameEntry {
public:
NameEntry();
string name; // Last name
string percent; // Frequency of occurrence of a given name
string cumulative; // cumulative frequency of all name up to and including this name
string rank; // Rank of this Name in terms of frequency
private:
};
#endif /* NAMEENTRY_H */
| [
"skonjp@kenyon.edu"
] | skonjp@kenyon.edu |
b3af205822e80b8955eed3a86dbd7ff82952de5e | d0e0745ca2c2fd1fd096114596cefa42498b6d59 | /vhodno_nivo/Veselin_Dechev_11a/Veselin_Dechev_4.cpp | 54f3ecda53e2b78ce13d37d1b544d59804031393 | [] | no_license | thebravoman/software_engineering_2014 | d7fde1b2a31c07bceb2b6f76f6c200379a69d04d | e63968236ff2d8ab5b4a31515223097dc8d1e486 | refs/heads/master | 2021-01-25T08:55:25.431767 | 2015-06-19T08:34:43 | 2015-06-19T08:34:43 | 24,090,881 | 5 | 0 | null | 2016-05-01T21:20:09 | 2014-09-16T08:05:57 | Ruby | UTF-8 | C++ | false | false | 383 | cpp | #include<iostream>
using namespace std;
int main(){
int x,y,first=0,second=1,next;
do{
cin>>x>>y;
}while(x>y && x<=0);
for (int a=0;a!=y+1;a++){
if (a<=1){
next=a;
}else{
next = first + second;
first = second;
second = next;
}
if(a>x-1){
cout<<next<<endl;
}
}
return 0;
}
| [
"ahhak123@gmail.com"
] | ahhak123@gmail.com |
7ba71d7740cf727cbcf08eacd2933f8381589ef7 | d829d426e100e5f204bab15661db4e1da15515f9 | /src/EnergyPlus/ChillerExhaustAbsorption.cc | 8b60e724e57e2eb958734d912682f6b098c74bb6 | [
"BSD-2-Clause"
] | permissive | VB6Hobbyst7/EnergyPlus2 | a49409343e6c19a469b93c8289545274a9855888 | 622089b57515a7b8fbb20c8e9109267a4bb37eb3 | refs/heads/main | 2023-06-08T06:47:31.276257 | 2021-06-29T04:40:23 | 2021-06-29T04:40:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 124,684 | cc | // EnergyPlus, Copyright (c) 1996-2020, The Board of Trustees of the University of Illinois,
// The Regents of the University of California, through Lawrence Berkeley National Laboratory
// (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
// National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
// contributors. All rights reserved.
//
// NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
// U.S. Government consequently retains certain rights. As such, the U.S. Government has been
// granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
// worldwide license in the Software to reproduce, distribute copies to the public, prepare
// derivative works, and perform publicly and display publicly, and to permit others to do so.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// (1) Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// (2) Redistributions in binary form must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
// the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific prior
// written permission.
//
// (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
// without changes from the version obtained under this License, or (ii) Licensee makes a
// reference solely to the software portion of its product, Licensee must refer to the
// software as "EnergyPlus version X" software, where "X" is the version number Licensee
// obtained under this License and may not use a different name for the software. Except as
// specifically required in this Section (4), Licensee shall not use in a company name, a
// product name, in advertising, publicity, or other promotional activities any name, trade
// name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
// similar designation, without the U.S. Department of Energy's prior written consent.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
// C++ Headers
#include <cassert>
#include <cmath>
// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>
// EnergyPlus Headers
#include <EnergyPlus/BranchNodeConnections.hh>
#include <EnergyPlus/ChillerExhaustAbsorption.hh>
#include <EnergyPlus/CurveManager.hh>
#include <EnergyPlus/DataBranchAirLoopPlant.hh>
#include <EnergyPlus/DataGlobalConstants.hh>
#include <EnergyPlus/DataHVACGlobals.hh>
#include <EnergyPlus/DataIPShortCuts.hh>
#include <EnergyPlus/DataLoopNode.hh>
#include <EnergyPlus/Plant/DataPlant.hh>
#include <EnergyPlus/DataSizing.hh>
#include <EnergyPlus/EMSManager.hh>
#include <EnergyPlus/FluidProperties.hh>
#include <EnergyPlus/General.hh>
#include <EnergyPlus/GlobalNames.hh>
#include <EnergyPlus/InputProcessing/InputProcessor.hh>
#include <EnergyPlus/MicroturbineElectricGenerator.hh>
#include <EnergyPlus/NodeInputManager.hh>
#include <EnergyPlus/OutAirNodeManager.hh>
#include <EnergyPlus/OutputProcessor.hh>
#include <EnergyPlus/OutputReportPredefined.hh>
#include <EnergyPlus/PlantUtilities.hh>
#include <EnergyPlus/Psychrometrics.hh>
#include <EnergyPlus/ReportSizingManager.hh>
#include <EnergyPlus/UtilityRoutines.hh>
namespace EnergyPlus {
namespace ChillerExhaustAbsorption {
// MODULE INFORMATION:
// AUTHOR Jason Glazer of GARD Analytics, Inc.
// for Gas Research Institute (Original module GasAbsoptionChiller)
// DATE WRITTEN March 2001
// MODIFIED Brent Griffith, Nov 2010 plant upgrades, generalize fluid properties
// Mahabir Bhandari, ORNL, Aug 2011, modified to accomodate Exhaust Fired Absorption Chiller
// RE-ENGINEERED na
// PURPOSE OF THIS MODULE:
// This module simulates the performance of the Exhaust fired double effect
// absorption chiller.
// METHODOLOGY EMPLOYED:
// Once the PlantLoopManager determines that the exhasut fired absorber chiller
// is available to meet a loop cooling demand, it calls SimExhaustAbsorption
// which in turn calls the appropriate Exhaut Fired Absorption Chiller model.
// REFERENCES:
// DOE-2.1e Supplement
// PG&E CoolToolsGas Mod
// Performnace curves obtained from manufcaturer
// OTHER NOTES:
// The curves on this model follow the DOE-2 approach of using
// electric and heat input ratios. In addition, the temperature
// correction curve has two independent variables for the
// chilled water temperature and either the entering or leaving
// condenser water temperature.
// The code was originally adopted from the ChillerAbsorption
// routine but has been extensively modified.
// Development of the original(GasAbsoptionChiller) module was funded by the Gas Research Institute.
// (Please see copyright and disclaimer information at end of module)
// Object Data
Array1D<ExhaustAbsorberSpecs> ExhaustAbsorber; // dimension to number of machines
bool Sim_GetInput(true); // then TRUE, calls subroutine to read input file.
PlantComponent *ExhaustAbsorberSpecs::factory(std::string const &objectName)
{
// Process the input data if it hasn't been done already
if (Sim_GetInput) {
GetExhaustAbsorberInput();
Sim_GetInput = false;
}
// Now look for this particular pipe in the list
for (auto &comp : ExhaustAbsorber) {
if (comp.Name == objectName) {
return ∁
}
}
// If we didn't find it, fatal
ShowFatalError("LocalExhaustAbsorberFactory: Error getting inputs for comp named: " + objectName); // LCOV_EXCL_LINE
// Shut up the compiler
return nullptr; // LCOV_EXCL_LINE
}
void ExhaustAbsorberSpecs::simulate(const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag)
{
// kind of a hacky way to find the location of this, but it's what plantloopequip was doing
int BranchInletNodeNum =
DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn;
// Match inlet node name of calling branch to determine if this call is for heating or cooling
if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller
this->InCoolingMode = RunFlag != 0;
this->initialize();
this->calcChiller(CurLoad);
this->updateCoolRecords(CurLoad, RunFlag);
} else if (BranchInletNodeNum == this->HeatReturnNodeNum) { // Operate as heater
this->InHeatingMode = RunFlag != 0;
this->initialize();
this->calcHeater(CurLoad, RunFlag);
this->updateHeatRecords(CurLoad, RunFlag);
} else if (BranchInletNodeNum == this->CondReturnNodeNum) { // called from condenser loop
if (this->CDLoopNum > 0) {
PlantUtilities::UpdateChillerComponentCondenserSide(this->CDLoopNum,
this->CDLoopSideNum,
DataPlant::TypeOf_Chiller_ExhFiredAbsorption,
this->CondReturnNodeNum,
this->CondSupplyNodeNum,
this->TowerLoad,
this->CondReturnTemp,
this->CondSupplyTemp,
this->CondWaterFlowRate,
FirstHVACIteration);
}
} else { // Error, nodes do not match
ShowSevereError("Invalid call to Exhaust Absorber Chiller " + this->Name);
ShowContinueError("Node connections in branch are not consistent with object nodes.");
ShowFatalError("Preceding conditions cause termination.");
}
}
void ExhaustAbsorberSpecs::getDesignCapacities(const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad)
{
// kind of a hacky way to find the location of this, but it's what plantloopequip was doing
int BranchInletNodeNum =
DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn;
// Match inlet node name of calling branch to determine if this call is for heating or cooling
if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller
MinLoad = this->NomCoolingCap * this->MinPartLoadRat;
MaxLoad = this->NomCoolingCap * this->MaxPartLoadRat;
OptLoad = this->NomCoolingCap * this->OptPartLoadRat;
} else if (BranchInletNodeNum == this->HeatReturnNodeNum) { // Operate as heater
Real64 Sim_HeatCap = this->NomCoolingCap * this->NomHeatCoolRatio; // W - nominal heating capacity
MinLoad = Sim_HeatCap * this->MinPartLoadRat;
MaxLoad = Sim_HeatCap * this->MaxPartLoadRat;
OptLoad = Sim_HeatCap * this->OptPartLoadRat;
} else if (BranchInletNodeNum == this->CondReturnNodeNum) { // called from condenser loop
MinLoad = 0.0;
MaxLoad = 0.0;
OptLoad = 0.0;
} else { // Error, nodes do not match
ShowSevereError("SimExhaustAbsorber: Invalid call to Exhaust Absorbtion Chiller-Heater " + this->Name);
ShowContinueError("Node connections in branch are not consistent with object nodes.");
ShowFatalError("Preceding conditions cause termination.");
} // Operate as Chiller or Heater
}
void ExhaustAbsorberSpecs::getSizingFactor(Real64 &_SizFac)
{
_SizFac = this->SizFac;
}
void ExhaustAbsorberSpecs::onInitLoopEquip(const PlantLocation &calledFromLocation)
{
this->initialize();
// kind of a hacky way to find the location of this, but it's what plantloopequip was doing
int BranchInletNodeNum =
DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn;
if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller
this->size(); // only call from chilled water loop
} else {
// don't do anything here
}
}
void ExhaustAbsorberSpecs::getDesignTemperatures(Real64 &TempDesCondIn, Real64 &TempDesEvapOut)
{
TempDesEvapOut = this->TempDesCHWSupply;
TempDesCondIn = this->TempDesCondReturn;
}
void GetExhaustAbsorberInput()
{
// SUBROUTINE INFORMATION:
// AUTHOR: Jason Glazer
// DATE WRITTEN: March 2001
// MODIFIED Mahabir Bhandari, ORNL, Aug 2011, modified to accomodate Exhaust Fired Double Effect Absorption Chiller
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// This routine will get the input
// required by the Exhaust Fired Absorption chiller model in the object ChillerHeater:Absorption:DoubleEffect
// METHODOLOGY EMPLOYED:
// EnergyPlus input processor
// Using/Aliasing
using namespace DataIPShortCuts; // Data for field names, blank numerics
using BranchNodeConnections::TestCompSet;
using CurveManager::GetCurveCheck;
using DataSizing::AutoSize;
using GlobalNames::VerifyUniqueChillerName;
using NodeInputManager::GetOnlySingleNode;
using OutAirNodeManager::CheckAndAddAirNodeNumber;
// LOCAL VARIABLES
int AbsorberNum; // Absorber counter
int NumAlphas; // Number of elements in the alpha array
int NumNums; // Number of elements in the numeric array
int IOStat; // IO Status when calling get input subroutine
std::string ChillerName;
bool Okay;
bool Get_ErrorsFound(false);
// FLOW
cCurrentModuleObject = "ChillerHeater:Absorption:DoubleEffect";
int NumExhaustAbsorbers = inputProcessor->getNumObjectsFound(cCurrentModuleObject);
if (NumExhaustAbsorbers <= 0) {
ShowSevereError("No " + cCurrentModuleObject + " equipment found in input file");
Get_ErrorsFound = true;
}
if (allocated(ExhaustAbsorber)) return;
// ALLOCATE ARRAYS
ExhaustAbsorber.allocate(NumExhaustAbsorbers);
// LOAD ARRAYS
for (AbsorberNum = 1; AbsorberNum <= NumExhaustAbsorbers; ++AbsorberNum) {
inputProcessor->getObjectItem(cCurrentModuleObject,
AbsorberNum,
cAlphaArgs,
NumAlphas,
rNumericArgs,
NumNums,
IOStat,
_,
lAlphaFieldBlanks,
cAlphaFieldNames,
cNumericFieldNames);
UtilityRoutines::IsNameEmpty(cAlphaArgs(1), cCurrentModuleObject, Get_ErrorsFound);
// Get_ErrorsFound will be set to True if problem was found, left untouched otherwise
VerifyUniqueChillerName(cCurrentModuleObject, cAlphaArgs(1), Get_ErrorsFound, cCurrentModuleObject + " Name");
ExhaustAbsorber(AbsorberNum).Name = cAlphaArgs(1);
ChillerName = cCurrentModuleObject + " Named " + ExhaustAbsorber(AbsorberNum).Name;
// Assign capacities
ExhaustAbsorber(AbsorberNum).NomCoolingCap = rNumericArgs(1);
if (ExhaustAbsorber(AbsorberNum).NomCoolingCap == AutoSize) {
ExhaustAbsorber(AbsorberNum).NomCoolingCapWasAutoSized = true;
}
ExhaustAbsorber(AbsorberNum).NomHeatCoolRatio = rNumericArgs(2);
// Assign efficiencies
ExhaustAbsorber(AbsorberNum).ThermalEnergyCoolRatio = rNumericArgs(3);
ExhaustAbsorber(AbsorberNum).ThermalEnergyHeatRatio = rNumericArgs(4);
ExhaustAbsorber(AbsorberNum).ElecCoolRatio = rNumericArgs(5);
ExhaustAbsorber(AbsorberNum).ElecHeatRatio = rNumericArgs(6);
// Assign Node Numbers to specified nodes
ExhaustAbsorber(AbsorberNum).ChillReturnNodeNum = GetOnlySingleNode(cAlphaArgs(2),
Get_ErrorsFound,
cCurrentModuleObject,
cAlphaArgs(1),
DataLoopNode::NodeType_Water,
DataLoopNode::NodeConnectionType_Inlet,
1,
DataLoopNode::ObjectIsNotParent);
ExhaustAbsorber(AbsorberNum).ChillSupplyNodeNum = GetOnlySingleNode(cAlphaArgs(3),
Get_ErrorsFound,
cCurrentModuleObject,
cAlphaArgs(1),
DataLoopNode::NodeType_Water,
DataLoopNode::NodeConnectionType_Outlet,
1,
DataLoopNode::ObjectIsNotParent);
TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(2), cAlphaArgs(3), "Chilled Water Nodes");
// Condenser node processing depends on condenser type, see below
ExhaustAbsorber(AbsorberNum).HeatReturnNodeNum = GetOnlySingleNode(cAlphaArgs(6),
Get_ErrorsFound,
cCurrentModuleObject,
cAlphaArgs(1),
DataLoopNode::NodeType_Water,
DataLoopNode::NodeConnectionType_Inlet,
3,
DataLoopNode::ObjectIsNotParent);
ExhaustAbsorber(AbsorberNum).HeatSupplyNodeNum = GetOnlySingleNode(cAlphaArgs(7),
Get_ErrorsFound,
cCurrentModuleObject,
cAlphaArgs(1),
DataLoopNode::NodeType_Water,
DataLoopNode::NodeConnectionType_Outlet,
3,
DataLoopNode::ObjectIsNotParent);
TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(6), cAlphaArgs(7), "Hot Water Nodes");
if (Get_ErrorsFound) {
ShowFatalError("Errors found in processing node input for " + cCurrentModuleObject + '=' + cAlphaArgs(1));
Get_ErrorsFound = false;
}
// Assign Part Load Ratios
ExhaustAbsorber(AbsorberNum).MinPartLoadRat = rNumericArgs(7);
ExhaustAbsorber(AbsorberNum).MaxPartLoadRat = rNumericArgs(8);
ExhaustAbsorber(AbsorberNum).OptPartLoadRat = rNumericArgs(9);
// Assign Design Conditions
ExhaustAbsorber(AbsorberNum).TempDesCondReturn = rNumericArgs(10);
ExhaustAbsorber(AbsorberNum).TempDesCHWSupply = rNumericArgs(11);
ExhaustAbsorber(AbsorberNum).EvapVolFlowRate = rNumericArgs(12);
if (ExhaustAbsorber(AbsorberNum).EvapVolFlowRate == AutoSize) {
ExhaustAbsorber(AbsorberNum).EvapVolFlowRateWasAutoSized = true;
}
if (UtilityRoutines::SameString(cAlphaArgs(16), "AirCooled")) {
ExhaustAbsorber(AbsorberNum).CondVolFlowRate = 0.0011; // Condenser flow rate not used for this cond type
} else {
ExhaustAbsorber(AbsorberNum).CondVolFlowRate = rNumericArgs(13);
if (ExhaustAbsorber(AbsorberNum).CondVolFlowRate == AutoSize) {
ExhaustAbsorber(AbsorberNum).CondVolFlowRateWasAutoSized = true;
}
}
ExhaustAbsorber(AbsorberNum).HeatVolFlowRate = rNumericArgs(14);
if (ExhaustAbsorber(AbsorberNum).HeatVolFlowRate == AutoSize) {
ExhaustAbsorber(AbsorberNum).HeatVolFlowRateWasAutoSized = true;
}
// Assign Curve Numbers
ExhaustAbsorber(AbsorberNum).CoolCapFTCurve = GetCurveCheck(cAlphaArgs(8), Get_ErrorsFound, ChillerName);
ExhaustAbsorber(AbsorberNum).ThermalEnergyCoolFTCurve = GetCurveCheck(cAlphaArgs(9), Get_ErrorsFound, ChillerName);
ExhaustAbsorber(AbsorberNum).ThermalEnergyCoolFPLRCurve = GetCurveCheck(cAlphaArgs(10), Get_ErrorsFound, ChillerName);
ExhaustAbsorber(AbsorberNum).ElecCoolFTCurve = GetCurveCheck(cAlphaArgs(11), Get_ErrorsFound, ChillerName);
ExhaustAbsorber(AbsorberNum).ElecCoolFPLRCurve = GetCurveCheck(cAlphaArgs(12), Get_ErrorsFound, ChillerName);
ExhaustAbsorber(AbsorberNum).HeatCapFCoolCurve = GetCurveCheck(cAlphaArgs(13), Get_ErrorsFound, ChillerName);
ExhaustAbsorber(AbsorberNum).ThermalEnergyHeatFHPLRCurve = GetCurveCheck(cAlphaArgs(14), Get_ErrorsFound, ChillerName);
if (Get_ErrorsFound) {
ShowFatalError("Errors found in processing curve input for " + cCurrentModuleObject + '=' + cAlphaArgs(1));
Get_ErrorsFound = false;
}
if (UtilityRoutines::SameString(cAlphaArgs(15), "LeavingCondenser")) {
ExhaustAbsorber(AbsorberNum).isEnterCondensTemp = false;
} else if (UtilityRoutines::SameString(cAlphaArgs(15), "EnteringCondenser")) {
ExhaustAbsorber(AbsorberNum).isEnterCondensTemp = true;
} else {
ExhaustAbsorber(AbsorberNum).isEnterCondensTemp = true;
ShowWarningError("Invalid " + cAlphaFieldNames(15) + '=' + cAlphaArgs(15));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
ShowContinueError("resetting to ENTERING-CONDENSER, simulation continues");
}
// Assign Other Paramters
if (UtilityRoutines::SameString(cAlphaArgs(16), "AirCooled")) {
ExhaustAbsorber(AbsorberNum).isWaterCooled = false;
} else if (UtilityRoutines::SameString(cAlphaArgs(16), "WaterCooled")) {
ExhaustAbsorber(AbsorberNum).isWaterCooled = true;
} else {
ExhaustAbsorber(AbsorberNum).isWaterCooled = true;
ShowWarningError("Invalid " + cAlphaFieldNames(16) + '=' + cAlphaArgs(16));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
ShowContinueError("resetting to WATER-COOLED, simulation continues");
}
if (!ExhaustAbsorber(AbsorberNum).isEnterCondensTemp && !ExhaustAbsorber(AbsorberNum).isWaterCooled) {
ExhaustAbsorber(AbsorberNum).isEnterCondensTemp = true;
ShowWarningError(cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid value");
ShowContinueError("Invalid to have both LeavingCondenser and AirCooled.");
ShowContinueError("resetting to EnteringCondenser, simulation continues");
}
if (ExhaustAbsorber(AbsorberNum).isWaterCooled) {
if (lAlphaFieldBlanks(5)) {
ShowSevereError(cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", invalid value");
ShowContinueError("For WaterCooled chiller the condenser outlet node is required.");
Get_ErrorsFound = true;
}
ExhaustAbsorber(AbsorberNum).CondReturnNodeNum = GetOnlySingleNode(cAlphaArgs(4),
Get_ErrorsFound,
cCurrentModuleObject,
cAlphaArgs(1),
DataLoopNode::NodeType_Water,
DataLoopNode::NodeConnectionType_Inlet,
2,
DataLoopNode::ObjectIsNotParent);
ExhaustAbsorber(AbsorberNum).CondSupplyNodeNum = GetOnlySingleNode(cAlphaArgs(5),
Get_ErrorsFound,
cCurrentModuleObject,
cAlphaArgs(1),
DataLoopNode::NodeType_Water,
DataLoopNode::NodeConnectionType_Outlet,
2,
DataLoopNode::ObjectIsNotParent);
TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(4), cAlphaArgs(5), "Condenser Water Nodes");
} else {
ExhaustAbsorber(AbsorberNum).CondReturnNodeNum = GetOnlySingleNode(cAlphaArgs(4),
Get_ErrorsFound,
cCurrentModuleObject,
cAlphaArgs(1),
DataLoopNode::NodeType_Air,
DataLoopNode::NodeConnectionType_OutsideAirReference,
2,
DataLoopNode::ObjectIsNotParent);
// Condenser outlet node not used for air or evap cooled condenser so ingore cAlphaArgs( 5 )
// Connection not required for air or evap cooled condenser so no call to TestCompSet here
CheckAndAddAirNodeNumber(ExhaustAbsorber(AbsorberNum).CondReturnNodeNum, Okay);
if (!Okay) {
ShowWarningError(cCurrentModuleObject + ", Adding OutdoorAir:Node=" + cAlphaArgs(4));
}
}
ExhaustAbsorber(AbsorberNum).CHWLowLimitTemp = rNumericArgs(15);
ExhaustAbsorber(AbsorberNum).SizFac = rNumericArgs(16);
ExhaustAbsorber(AbsorberNum).TypeOf = cAlphaArgs(17);
if (UtilityRoutines::SameString(cAlphaArgs(17), "Generator:MicroTurbine")) {
ExhaustAbsorber(AbsorberNum).CompType_Num = DataGlobalConstants::iGeneratorMicroturbine;
ExhaustAbsorber(AbsorberNum).ExhuastSourceName = cAlphaArgs(18);
auto thisMTG = MicroturbineElectricGenerator::MTGeneratorSpecs::factory(ExhaustAbsorber(AbsorberNum).ExhuastSourceName);
ExhaustAbsorber(AbsorberNum).ExhaustAirInletNodeNum =
dynamic_cast<MicroturbineElectricGenerator::MTGeneratorSpecs *>(thisMTG)->CombustionAirOutletNodeNum;
}
}
if (Get_ErrorsFound) {
ShowFatalError("Errors found in processing input for " + cCurrentModuleObject);
}
}
void ExhaustAbsorberSpecs::setupOutputVariables()
{
std::string const ChillerName = this->Name;
SetupOutputVariable("Chiller Heater Evaporator Cooling Rate", OutputProcessor::Unit::W, this->CoolingLoad, "System", "Average", ChillerName);
SetupOutputVariable("Chiller Heater Evaporator Cooling Energy",
OutputProcessor::Unit::J,
this->CoolingEnergy,
"System",
"Sum",
ChillerName,
_,
"ENERGYTRANSFER",
"CHILLERS",
_,
"Plant");
SetupOutputVariable("Chiller Heater Heating Rate", OutputProcessor::Unit::W, this->HeatingLoad, "System", "Average", ChillerName);
SetupOutputVariable("Chiller Heater Heating Energy",
OutputProcessor::Unit::J,
this->HeatingEnergy,
"System",
"Sum",
ChillerName,
_,
"ENERGYTRANSFER",
"BOILERS",
_,
"Plant");
SetupOutputVariable(
"Chiller Heater Condenser Heat Transfer Rate", OutputProcessor::Unit::W, this->TowerLoad, "System", "Average", ChillerName);
SetupOutputVariable("Chiller Heater Condenser Heat Transfer Energy",
OutputProcessor::Unit::J,
this->TowerEnergy,
"System",
"Sum",
ChillerName,
_,
"ENERGYTRANSFER",
"HEATREJECTION",
_,
"Plant");
SetupOutputVariable(
"Chiller Heater Cooling Source Heat COP", OutputProcessor::Unit::W_W, this->ThermalEnergyCOP, "System", "Average", ChillerName);
SetupOutputVariable("Chiller Heater Electric Power", OutputProcessor::Unit::W, this->ElectricPower, "System", "Average", ChillerName);
// Do not include this on meters, this would duplicate the cool electric and heat electric
SetupOutputVariable("Chiller Heater Electric Energy", OutputProcessor::Unit::J, this->ElectricEnergy, "System", "Sum", ChillerName);
SetupOutputVariable(
"Chiller Heater Cooling Electric Power", OutputProcessor::Unit::W, this->CoolElectricPower, "System", "Average", ChillerName);
SetupOutputVariable("Chiller Heater Cooling Electric Energy",
OutputProcessor::Unit::J,
this->CoolElectricEnergy,
"System",
"Sum",
ChillerName,
_,
"Electricity",
"Cooling",
_,
"Plant");
SetupOutputVariable(
"Chiller Heater Heating Electric Power", OutputProcessor::Unit::W, this->HeatElectricPower, "System", "Average", ChillerName);
SetupOutputVariable("Chiller Heater Heating Electric Energy",
OutputProcessor::Unit::J,
this->HeatElectricEnergy,
"System",
"Sum",
ChillerName,
_,
"Electricity",
"Heating",
_,
"Plant");
SetupOutputVariable(
"Chiller Heater Evaporator Inlet Temperature", OutputProcessor::Unit::C, this->ChillReturnTemp, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Evaporator Outlet Temperature", OutputProcessor::Unit::C, this->ChillSupplyTemp, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Evaporator Mass Flow Rate", OutputProcessor::Unit::kg_s, this->ChillWaterFlowRate, "System", "Average", ChillerName);
if (this->isWaterCooled) {
SetupOutputVariable(
"Chiller Heater Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondReturnTemp, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Condenser Outlet Temperature", OutputProcessor::Unit::C, this->CondSupplyTemp, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, this->CondWaterFlowRate, "System", "Average", ChillerName);
} else {
SetupOutputVariable(
"Chiller Heater Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondReturnTemp, "System", "Average", ChillerName);
}
SetupOutputVariable(
"Chiller Heater Heating Inlet Temperature", OutputProcessor::Unit::C, this->HotWaterReturnTemp, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Heating Outlet Temperature", OutputProcessor::Unit::C, this->HotWaterSupplyTemp, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Heating Mass Flow Rate", OutputProcessor::Unit::kg_s, this->HotWaterFlowRate, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Cooling Part Load Ratio", OutputProcessor::Unit::None, this->CoolPartLoadRatio, "System", "Average", ChillerName);
SetupOutputVariable("Chiller Heater Maximum Cooling Rate", OutputProcessor::Unit::W, this->CoolingCapacity, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Heating Part Load Ratio", OutputProcessor::Unit::None, this->HeatPartLoadRatio, "System", "Average", ChillerName);
SetupOutputVariable("Chiller Heater Maximum Heating Rate", OutputProcessor::Unit::W, this->HeatingCapacity, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Runtime Fraction", OutputProcessor::Unit::None, this->FractionOfPeriodRunning, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Source Exhaust Inlet Temperature", OutputProcessor::Unit::C, this->ExhaustInTemp, "System", "Average", ChillerName);
SetupOutputVariable(
"Chiller Heater Source Exhaust Inlet Mass Flow Rate", OutputProcessor::Unit::kg_s, this->ExhaustInFlow, "System", "Average", ChillerName);
SetupOutputVariable("Chiller Heater Heating Heat Recovery Potential Rate",
OutputProcessor::Unit::W,
this->ExhHeatRecPotentialHeat,
"System",
"Average",
ChillerName);
SetupOutputVariable("Chiller Heater Cooling Heat Recovery Potential Rate",
OutputProcessor::Unit::W,
this->ExhHeatRecPotentialCool,
"System",
"Average",
ChillerName);
SetupOutputVariable("Chiller Heater Cooling Source Heat Transfer Rate",
OutputProcessor::Unit::W,
this->CoolThermalEnergyUseRate,
"System",
"Average",
ChillerName);
SetupOutputVariable("Chiller Heater Heating Source Heat Transfer Rate",
OutputProcessor::Unit::W,
this->HeatThermalEnergyUseRate,
"System",
"Average",
ChillerName);
}
void ExhaustAbsorberSpecs::initialize()
{
// SUBROUTINE INFORMATION:
// AUTHOR Fred Buhl
// DATE WRITTEN June 2003
// MODIFIED na
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// This subroutine is for initializations of Exhaust Fired absorption chiller
// components.
// METHODOLOGY EMPLOYED:
// Uses the status flags to trigger initializations.
// SUBROUTINE PARAMETER DEFINITIONS:
std::string const RoutineName("InitExhaustAbsorber");
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int CondInletNode; // node number of water inlet node to the condenser
int CondOutletNode; // node number of water outlet node from the condenser
int HeatInletNode; // node number of hot water inlet node
int HeatOutletNode; // node number of hot water outlet node
bool errFlag;
Real64 rho; // local fluid density
Real64 mdot; // lcoal fluid mass flow rate
if (this->oneTimeInit) {
this->setupOutputVariables();
this->oneTimeInit = false;
}
// Init more variables
if (this->plantScanInit) {
// Locate the chillers on the plant loops for later usage
errFlag = false;
PlantUtilities::ScanPlantLoopsForObject(this->Name,
DataPlant::TypeOf_Chiller_ExhFiredAbsorption,
this->CWLoopNum,
this->CWLoopSideNum,
this->CWBranchNum,
this->CWCompNum,
errFlag,
this->CHWLowLimitTemp,
_,
_,
this->ChillReturnNodeNum,
_);
if (errFlag) {
ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s).");
}
PlantUtilities::ScanPlantLoopsForObject(this->Name,
DataPlant::TypeOf_Chiller_ExhFiredAbsorption,
this->HWLoopNum,
this->HWLoopSideNum,
this->HWBranchNum,
this->HWCompNum,
errFlag,
_,
_,
_,
this->HeatReturnNodeNum,
_);
if (errFlag) {
ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s).");
}
if (this->isWaterCooled) {
PlantUtilities::ScanPlantLoopsForObject(this->Name,
DataPlant::TypeOf_Chiller_ExhFiredAbsorption,
this->CDLoopNum,
this->CDLoopSideNum,
this->CDBranchNum,
this->CDCompNum,
errFlag,
_,
_,
_,
this->CondReturnNodeNum,
_);
if (errFlag) {
ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s).");
}
PlantUtilities::InterConnectTwoPlantLoopSides(
this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true);
PlantUtilities::InterConnectTwoPlantLoopSides(
this->HWLoopNum, this->HWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true);
}
PlantUtilities::InterConnectTwoPlantLoopSides(
this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true);
// check if outlet node of chilled water side has a setpoint.
if ((DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) &&
(DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) {
if (!DataGlobals::AnyEnergyManagementSystemInModel) {
if (!this->ChillSetPointErrDone) {
ShowWarningError("Missing temperature setpoint on cool side for chiller heater named " + this->Name);
ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager");
ShowContinueError(" The overall loop setpoint will be assumed for chiller. The simulation continues ... ");
this->ChillSetPointErrDone = true;
}
} else {
// need call to EMS to check node
errFlag = false; // but not really fatal yet, but should be.
EMSManager::CheckIfNodeSetPointManagedByEMS(this->ChillSupplyNodeNum, EMSManager::iTemperatureSetPoint, errFlag);
if (errFlag) {
if (!this->ChillSetPointErrDone) {
ShowWarningError("Missing temperature setpoint on cool side for chiller heater named " + this->Name);
ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller evaporator ");
ShowContinueError(" use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node ");
ShowContinueError(" or use an EMS actuator to establish a setpoint at the outlet node ");
ShowContinueError(" The overall loop setpoint will be assumed for chiller. The simulation continues ... ");
this->ChillSetPointErrDone = true;
}
}
}
this->ChillSetPointSetToLoop = true;
DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint =
DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint;
DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi =
DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi;
}
// check if outlet node of hot water side has a setpoint.
if ((DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) &&
(DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo == DataLoopNode::SensedNodeFlagValue)) {
if (!DataGlobals::AnyEnergyManagementSystemInModel) {
if (!this->HeatSetPointErrDone) {
ShowWarningError("Missing temperature setpoint on heat side for chiller heater named " + this->Name);
ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager");
ShowContinueError(" The overall loop setpoint will be assumed for chiller. The simulation continues ... ");
this->HeatSetPointErrDone = true;
}
} else {
// need call to EMS to check node
errFlag = false; // but not really fatal yet, but should be.
EMSManager::CheckIfNodeSetPointManagedByEMS(this->HeatSupplyNodeNum, EMSManager::iTemperatureSetPoint, errFlag);
if (errFlag) {
if (!this->HeatSetPointErrDone) {
ShowWarningError("Missing temperature setpoint on heat side for chiller heater named " + this->Name);
ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller heater ");
ShowContinueError(" use a Setpoint Manager to establish a setpoint at the heater side outlet node ");
ShowContinueError(" or use an EMS actuator to establish a setpoint at the outlet node ");
ShowContinueError(" The overall loop setpoint will be assumed for heater side. The simulation continues ... ");
this->HeatSetPointErrDone = true;
}
}
}
this->HeatSetPointSetToLoop = true;
DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint =
DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint;
DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo =
DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo;
}
this->plantScanInit = false;
}
CondInletNode = this->CondReturnNodeNum;
CondOutletNode = this->CondSupplyNodeNum;
HeatInletNode = this->HeatReturnNodeNum;
HeatOutletNode = this->HeatSupplyNodeNum;
if (this->envrnInit && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) {
if (this->isWaterCooled) {
// init max available condenser water flow rate
if (this->CDLoopNum > 0) {
rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName,
DataGlobals::CWInitConvTemp,
DataPlant::PlantLoop(this->CDLoopNum).FluidIndex,
RoutineName);
} else {
rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp);
}
this->DesCondMassFlowRate = rho * this->CondVolFlowRate;
PlantUtilities::InitComponentNodes(0.0,
this->DesCondMassFlowRate,
CondInletNode,
CondOutletNode,
this->CDLoopNum,
this->CDLoopSideNum,
this->CDBranchNum,
this->CDCompNum);
}
if (this->HWLoopNum > 0) {
rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->HWLoopNum).FluidName,
DataGlobals::HWInitConvTemp,
DataPlant::PlantLoop(this->HWLoopNum).FluidIndex,
RoutineName);
} else {
rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp);
}
this->DesHeatMassFlowRate = rho * this->HeatVolFlowRate;
// init available hot water flow rate
PlantUtilities::InitComponentNodes(0.0,
this->DesHeatMassFlowRate,
HeatInletNode,
HeatOutletNode,
this->HWLoopNum,
this->HWLoopSideNum,
this->HWBranchNum,
this->HWCompNum);
if (this->CWLoopNum > 0) {
rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName,
DataGlobals::CWInitConvTemp,
DataPlant::PlantLoop(this->CWLoopNum).FluidIndex,
RoutineName);
} else {
rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp);
}
this->DesEvapMassFlowRate = rho * this->EvapVolFlowRate;
// init available hot water flow rate
PlantUtilities::InitComponentNodes(0.0,
this->DesEvapMassFlowRate,
this->ChillReturnNodeNum,
this->ChillSupplyNodeNum,
this->CWLoopNum,
this->CWLoopSideNum,
this->CWBranchNum,
this->CWCompNum);
this->envrnInit = false;
}
if (!DataGlobals::BeginEnvrnFlag) {
this->envrnInit = true;
}
// this component model works off setpoints on the leaving node
// fill from plant if needed
if (this->ChillSetPointSetToLoop) {
DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint =
DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint;
DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi =
DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi;
}
if (this->HeatSetPointSetToLoop) {
DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint =
DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint;
DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo =
DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo;
}
if ((this->isWaterCooled) && ((this->InHeatingMode) || (this->InCoolingMode)) && (!this->plantScanInit)) {
mdot = this->DesCondMassFlowRate;
PlantUtilities::SetComponentFlowRate(
mdot, this->CondReturnNodeNum, this->CondSupplyNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum);
} else {
mdot = 0.0;
if (this->CDLoopNum > 0) {
PlantUtilities::SetComponentFlowRate(
mdot, this->CondReturnNodeNum, this->CondSupplyNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum);
}
}
}
void ExhaustAbsorberSpecs::size()
{
// SUBROUTINE INFORMATION:
// AUTHOR Fred Buhl
// DATE WRITTEN June 2003
// MODIFIED November 2013 Daeho Kang, add component sizing table entries
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// This subroutine is for sizing Exhaust Fired absorption chiller components for which
// capacities and flow rates have not been specified in the input.
// METHODOLOGY EMPLOYED:
// Obtains evaporator flow rate from the plant sizing array. Calculates nominal capacity from
// the evaporator flow rate and the chilled water loop design delta T. The condenser flow rate
// is calculated from the nominal capacity, the COP, and the condenser loop design delta T.
// SUBROUTINE PARAMETER DEFINITIONS:
std::string const RoutineName("SizeExhaustAbsorber");
bool ErrorsFound; // If errors detected in input
std::string equipName;
Real64 Cp; // local fluid specific heat
Real64 rho; // local fluid density
Real64 tmpNomCap; // local nominal capacity cooling power
Real64 tmpEvapVolFlowRate; // local evaporator design volume flow rate
Real64 tmpCondVolFlowRate; // local condenser design volume flow rate
Real64 tmpHeatRecVolFlowRate; // local heat recovery design volume flow rate
Real64 NomCapUser; // Hardsized nominal capacity for reporting
Real64 EvapVolFlowRateUser; // Hardsized evaporator volume flow rate for reporting
Real64 CondVolFlowRateUser; // Hardsized condenser flow rate for reporting
Real64 HeatRecVolFlowRateUser; // Hardsized generator flow rate for reporting
ErrorsFound = false;
tmpNomCap = this->NomCoolingCap;
tmpEvapVolFlowRate = this->EvapVolFlowRate;
tmpCondVolFlowRate = this->CondVolFlowRate;
tmpHeatRecVolFlowRate = this->HeatVolFlowRate;
int PltSizCondNum = 0; // Plant Sizing index for condenser loop
if (this->isWaterCooled) PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum;
int PltSizHeatNum = DataPlant::PlantLoop(this->HWLoopNum).PlantSizNum;
int PltSizCoolNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum;
if (PltSizCoolNum > 0) {
if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) {
Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName,
DataGlobals::CWInitConvTemp,
DataPlant::PlantLoop(this->CWLoopNum).FluidIndex,
RoutineName);
rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName,
DataGlobals::CWInitConvTemp,
DataPlant::PlantLoop(this->CWLoopNum).FluidIndex,
RoutineName);
tmpNomCap =
Cp * rho * DataSizing::PlantSizData(PltSizCoolNum).DeltaT * DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * this->SizFac;
if (!this->NomCoolingCapWasAutoSized) tmpNomCap = this->NomCoolingCap;
} else {
if (this->NomCoolingCapWasAutoSized) tmpNomCap = 0.0;
}
if (DataPlant::PlantFirstSizesOkayToFinalize) {
if (this->NomCoolingCapWasAutoSized) {
this->NomCoolingCap = tmpNomCap;
if (DataPlant::PlantFinalSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput(
"ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Nominal Cooling Capacity [W]", tmpNomCap);
}
if (DataPlant::PlantFirstSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput(
"ChillerHeater:Absorption:DoubleEffect", this->Name, "Initial Design Size Nominal Cooling Capacity [W]", tmpNomCap);
}
} else {
if (this->NomCoolingCap > 0.0 && tmpNomCap > 0.0) {
NomCapUser = this->NomCoolingCap;
if (DataPlant::PlantFinalSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Design Size Nominal Cooling Capacity [W]",
tmpNomCap,
"User-Specified Nominal Cooling Capacity [W]",
NomCapUser);
if (DataGlobals::DisplayExtraWarnings) {
if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) {
ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name);
ShowContinueError("User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]");
ShowContinueError("differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) +
" [W]");
ShowContinueError("This may, or may not, indicate mismatched component sizes.");
ShowContinueError("Verify that the value entered is intended and is consistent with other components.");
}
}
}
tmpNomCap = NomCapUser;
}
}
}
} else {
if (this->NomCoolingCapWasAutoSized) {
if (DataPlant::PlantFirstSizesOkayToFinalize) {
ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error.");
ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller nominal cooling capacity requires");
ShowContinueError("a cooling loop Sizing:Plant object.");
ErrorsFound = true;
}
} else {
if (DataPlant::PlantFinalSizesOkayToReport) {
if (this->NomCoolingCap > 0.0) {
ReportSizingManager::ReportSizingOutput(
"Chiller:Absorption:DoubleEffect", this->Name, "User-Specified Nominal Capacity [W]", this->NomCoolingCap);
}
}
}
}
if (PltSizCoolNum > 0) {
if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) {
tmpEvapVolFlowRate = DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * this->SizFac;
if (!this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = this->EvapVolFlowRate;
} else {
if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0;
}
if (DataPlant::PlantFirstSizesOkayToFinalize) {
if (this->EvapVolFlowRateWasAutoSized) {
this->EvapVolFlowRate = tmpEvapVolFlowRate;
if (DataPlant::PlantFinalSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Design Size Design Chilled Water Flow Rate [m3/s]",
tmpEvapVolFlowRate);
}
if (DataPlant::PlantFirstSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Initial Design Size Design Chilled Water Flow Rate [m3/s]",
tmpEvapVolFlowRate);
}
} else {
if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) {
EvapVolFlowRateUser = this->EvapVolFlowRate;
if (DataPlant::PlantFinalSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Design Size Design Chilled Water Flow Rate [m3/s]",
tmpEvapVolFlowRate,
"User-Specified Design Chilled Water Flow Rate [m3/s]",
EvapVolFlowRateUser);
if (DataGlobals::DisplayExtraWarnings) {
if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) >
DataSizing::AutoVsHardSizingThreshold) {
ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name);
ShowContinueError("User-Specified Design Chilled Water Flow Rate of " +
General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]");
ShowContinueError("differs from Design Size Design Chilled Water Flow Rate of " +
General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]");
ShowContinueError("This may, or may not, indicate mismatched component sizes.");
ShowContinueError("Verify that the value entered is intended and is consistent with other components.");
}
}
}
tmpEvapVolFlowRate = EvapVolFlowRateUser;
}
}
}
} else {
if (this->EvapVolFlowRateWasAutoSized) {
if (DataPlant::PlantFirstSizesOkayToFinalize) {
ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error.");
ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller evap flow rate requires");
ShowContinueError("a cooling loop Sizing:Plant object.");
ErrorsFound = true;
}
} else {
if (DataPlant::PlantFinalSizesOkayToReport) {
if (this->EvapVolFlowRate > 0.0) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"User-Specified Design Chilled Water Flow Rate [m3/s]",
this->EvapVolFlowRate);
}
}
}
}
PlantUtilities::RegisterPlantCompDesignFlow(this->ChillReturnNodeNum, tmpEvapVolFlowRate);
if (PltSizHeatNum > 0) {
if (DataSizing::PlantSizData(PltSizHeatNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) {
tmpHeatRecVolFlowRate = DataSizing::PlantSizData(PltSizHeatNum).DesVolFlowRate * this->SizFac;
if (!this->HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = this->HeatVolFlowRate;
} else {
if (this->HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = 0.0;
}
if (DataPlant::PlantFirstSizesOkayToFinalize) {
if (this->HeatVolFlowRateWasAutoSized) {
this->HeatVolFlowRate = tmpHeatRecVolFlowRate;
if (DataPlant::PlantFinalSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Design Size Design Hot Water Flow Rate [m3/s]",
tmpHeatRecVolFlowRate);
}
if (DataPlant::PlantFirstSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Initial Design Size Design Hot Water Flow Rate [m3/s]",
tmpHeatRecVolFlowRate);
}
} else {
if (this->HeatVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) {
HeatRecVolFlowRateUser = this->HeatVolFlowRate;
if (DataPlant::PlantFinalSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Design Size Design Hot Water Flow Rate [m3/s]",
tmpHeatRecVolFlowRate,
"User-Specified Design Hot Water Flow Rate [m3/s]",
HeatRecVolFlowRateUser);
if (DataGlobals::DisplayExtraWarnings) {
if ((std::abs(tmpHeatRecVolFlowRate - HeatRecVolFlowRateUser) / HeatRecVolFlowRateUser) >
DataSizing::AutoVsHardSizingThreshold) {
ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name);
ShowContinueError("User-Specified Design Hot Water Flow Rate of " +
General::RoundSigDigits(HeatRecVolFlowRateUser, 5) + " [m3/s]");
ShowContinueError("differs from Design Size Design Hot Water Flow Rate of " +
General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]");
ShowContinueError("This may, or may not, indicate mismatched component sizes.");
ShowContinueError("Verify that the value entered is intended and is consistent with other components.");
}
}
}
tmpHeatRecVolFlowRate = HeatRecVolFlowRateUser;
}
}
}
} else {
if (this->HeatVolFlowRateWasAutoSized) {
if (DataPlant::PlantFirstSizesOkayToFinalize) {
ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error.");
ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller hot water flow rate requires");
ShowContinueError("a heating loop Sizing:Plant object.");
ErrorsFound = true;
}
} else {
if (DataPlant::PlantFinalSizesOkayToReport) {
if (this->HeatVolFlowRate > 0.0) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"User-Specified Design Hot Water Flow Rate [m3/s]",
this->HeatVolFlowRate);
}
}
}
}
PlantUtilities::RegisterPlantCompDesignFlow(this->HeatReturnNodeNum, tmpHeatRecVolFlowRate);
if (PltSizCondNum > 0 && PltSizCoolNum > 0) {
if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) {
Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName,
this->TempDesCondReturn,
DataPlant::PlantLoop(this->CDLoopNum).FluidIndex,
RoutineName);
rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName,
this->TempDesCondReturn,
DataPlant::PlantLoop(this->CDLoopNum).FluidIndex,
RoutineName);
tmpCondVolFlowRate = tmpNomCap * (1.0 + this->ThermalEnergyCoolRatio) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho);
if (!this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = this->CondVolFlowRate;
} else {
if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0;
}
if (DataPlant::PlantFirstSizesOkayToFinalize) {
if (this->CondVolFlowRateWasAutoSized) {
this->CondVolFlowRate = tmpCondVolFlowRate;
if (DataPlant::PlantFinalSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Design Size Design Condenser Water Flow Rate [m3/s]",
tmpCondVolFlowRate);
}
if (DataPlant::PlantFirstSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Initial Design Size Design Condenser Water Flow Rate [m3/s]",
tmpCondVolFlowRate);
}
} else {
if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) {
CondVolFlowRateUser = this->CondVolFlowRate;
if (DataPlant::PlantFinalSizesOkayToReport) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"Design Size Design Condenser Water Flow Rate [m3/s]",
tmpCondVolFlowRate,
"User-Specified Design Condenser Water Flow Rate [m3/s]",
CondVolFlowRateUser);
if (DataGlobals::DisplayExtraWarnings) {
if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) >
DataSizing::AutoVsHardSizingThreshold) {
ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name);
ShowContinueError("User-Specified Design Condenser Water Flow Rate of " +
General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]");
ShowContinueError("differs from Design Size Design Condenser Water Flow Rate of " +
General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]");
ShowContinueError("This may, or may not, indicate mismatched component sizes.");
ShowContinueError("Verify that the value entered is intended and is consistent with other components.");
}
}
}
tmpCondVolFlowRate = CondVolFlowRateUser;
}
}
}
} else {
if (this->CondVolFlowRateWasAutoSized) {
if (DataPlant::PlantFirstSizesOkayToFinalize) {
ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error.");
ShowSevereError("Autosizing of Exhaust Fired Absorption Chiller condenser flow rate requires a condenser");
ShowContinueError("loop Sizing:Plant object.");
ErrorsFound = true;
}
} else {
if (DataPlant::PlantFinalSizesOkayToReport) {
if (this->CondVolFlowRate > 0.0) {
ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect",
this->Name,
"User-Specified Design Condenser Water Flow Rate [m3/s]",
this->CondVolFlowRate);
}
}
}
}
// save the design condenser water volumetric flow rate for use by the condenser water loop sizing algorithms
if (this->isWaterCooled) PlantUtilities::RegisterPlantCompDesignFlow(this->CondReturnNodeNum, tmpCondVolFlowRate);
if (ErrorsFound) {
ShowFatalError("Preceding sizing errors cause program termination");
}
if (DataPlant::PlantFinalSizesOkayToReport) {
// create predefined report
equipName = this->Name;
OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechType, equipName, "ChillerHeater:Absorption:DoubleEffect");
OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomEff, equipName, this->ThermalEnergyCoolRatio);
OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomCap, equipName, this->NomCoolingCap);
}
}
void ExhaustAbsorberSpecs::calcChiller(Real64 &MyLoad)
{
// SUBROUTINE INFORMATION:
// AUTHOR Jason Glazer
// DATE WRITTEN March 2001
// MODIFIED Mahabir Bhandari, ORNL, Aug 2011, modified to accomodate exhaust fired chiller
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// Simulate a Exhaust fired (Exhaust consuming) absorption chiller using
// curves and inputs similar to DOE-2.1e
// METHODOLOGY EMPLOYED:
// Curve fit of performance data
// REFERENCES:
// 1. DOE-2.1e Supplement and source code
// 2. CoolTools GasMod work
// FlowLock = 0 if mass flow rates may be changed by loop components
// FlowLock = 1 if mass flow rates may not be changed by loop components
// SUBROUTINE PARAMETER DEFINITIONS:
Real64 const AbsLeavingTemp(176.667); // C - Minimum temperature leaving the Chiller absorber (350 F)
std::string const RoutineName("CalcExhaustAbsorberChillerModel");
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
// Local copies of ExhaustAbsorberSpecs Type
// all variables that are local copies of data structure
// variables are prefaced with an "l" for local.
Real64 lNomCoolingCap; // W - design nominal capacity of Absorber
Real64 lThermalEnergyCoolRatio; // ratio of ThermalEnergy input to cooling output
Real64 lThermalEnergyHeatRatio; // ratio of ThermalEnergy input to heating output
Real64 lElecCoolRatio; // ratio of electricity input to cooling output
int lChillReturnNodeNum; // Node number on the inlet side of the plant
int lChillSupplyNodeNum; // Node number on the outlet side of the plant
int lCondReturnNodeNum; // Node number on the inlet side of the condenser
Real64 lMinPartLoadRat; // min allowed operating frac full load
Real64 lMaxPartLoadRat; // max allowed operating frac full load
int lCoolCapFTCurve; // cooling capacity as a function of temperature curve
int lThermalEnergyCoolFTCurve; // ThermalEnergy-Input-to cooling output Ratio Function of Temperature Curve
int lThermalEnergyCoolFPLRCurve; // ThermalEnergy-Input-to cooling output Ratio Function of Part Load Ratio Curve
int lElecCoolFTCurve; // Electric-Input-to cooling output Ratio Function of Temperature Curve
int lElecCoolFPLRCurve; // Electric-Input-to cooling output Ratio Function of Part Load Ratio Curve
bool lIsEnterCondensTemp; // if using entering conderser water temperature is TRUE, exiting is FALSE
bool lIsWaterCooled; // if water cooled it is TRUE
Real64 lCHWLowLimitTemp; // Chilled Water Lower Limit Temperature
int lExhaustAirInletNodeNum; // Combustion Air Inlet Node number
// Local copies of ExhaustAbsorberReportVars Type
Real64 lCoolingLoad(0.0); // cooling load on the chiller (previously called QEvap)
// Real64 lCoolingEnergy( 0.0 ); // variable to track total cooling load for period (was EvapEnergy)
Real64 lTowerLoad(0.0); // load on the cooling tower/condenser (previously called QCond)
// Real64 lTowerEnergy( 0.0 ); // variable to track total tower load for a period (was CondEnergy)
// Real64 lThermalEnergyUseRate( 0.0 ); // instantaneous use of exhaust for period
// Real64 lThermalEnergy( 0.0 ); // variable to track total ThermalEnergy used for a period
Real64 lCoolThermalEnergyUseRate(0.0); // instantaneous use of exhaust for period for cooling
// Real64 lCoolThermalEnergy( 0.0 ); // variable to track total ThermalEnergy used for a period for cooling
Real64 lHeatThermalEnergyUseRate(0.0); // instantaneous use of exhaust for period for heating
// Real64 lElectricPower( 0.0 ); // parasitic electric power used (was PumpingPower)
// Real64 lElectricEnergy( 0.0 ); // track the total electricity used for a period (was PumpingEnergy)
Real64 lCoolElectricPower(0.0); // parasitic electric power used for cooling
// Real64 lCoolElectricEnergy( 0.0 ); // track the total electricity used for a period for cooling
Real64 lHeatElectricPower(0.0); // parasitic electric power used for heating
Real64 lChillReturnTemp(0.0); // reporting: evaporator inlet temperature (was EvapInletTemp)
Real64 lChillSupplyTemp(0.0); // reporting: evaporator outlet temperature (was EvapOutletTemp)
Real64 lChillWaterMassFlowRate(0.0); // reporting: evaporator mass flow rate (was Evapmdot)
Real64 lCondReturnTemp(0.0); // reporting: condenser inlet temperature (was CondInletTemp)
Real64 lCondSupplyTemp(0.0); // reporting: condenser outlet temperature (was CondOutletTemp)
Real64 lCondWaterMassFlowRate(0.0); // reporting: condenser mass flow rate (was Condmdot)
Real64 lCoolPartLoadRatio(0.0); // operating part load ratio (load/capacity for cooling)
Real64 lHeatPartLoadRatio(0.0); // operating part load ratio (load/capacity for heating)
Real64 lAvailableCoolingCapacity(0.0); // current capacity after temperature adjustment
Real64 lFractionOfPeriodRunning(0.0);
Real64 PartLoadRat(0.0); // actual operating part load ratio of unit (ranges from minplr to 1)
Real64 lChillWaterMassflowratemax(0.0); // Maximum flow rate through the evaporator
Real64 lExhaustInTemp(0.0); // Exhaust inlet temperature
Real64 lExhaustInFlow(0.0); // Exhaust inlet flow rate
Real64 lExhHeatRecPotentialCool(0.0); // Exhaust heat recovery potential during cooling
Real64 lExhaustAirHumRat(0.0);
// other local variables
Real64 ChillDeltaTemp; // chilled water temperature difference
Real64 ChillSupplySetPointTemp(0.0);
Real64 calcCondTemp; // the condenser temperature used for curve calculation
// either return or supply depending on user input
Real64 revisedEstimateAvailCap; // final estimate of available capacity if using leaving
// condenser water temperature
Real64 errorAvailCap; // error fraction on final estimate of AvailableCoolingCapacity
int LoopNum;
int LoopSideNum;
Real64 Cp_CW; // local fluid specific heat for chilled water
Real64 Cp_CD = -1; // local fluid specific heat for condenser water -- initializing to negative to ensure it isn't used uninitialized
Real64 CpAir; // specific heat of exhaust air
// define constant values
// set node values to data structure values for nodes
lChillReturnNodeNum = this->ChillReturnNodeNum;
lChillSupplyNodeNum = this->ChillSupplyNodeNum;
lCondReturnNodeNum = this->CondReturnNodeNum;
lExhaustAirInletNodeNum = this->ExhaustAirInletNodeNum;
// set local copies of data from rest of input structure
lNomCoolingCap = this->NomCoolingCap;
lThermalEnergyCoolRatio = this->ThermalEnergyCoolRatio;
lThermalEnergyHeatRatio = this->ThermalEnergyHeatRatio;
lElecCoolRatio = this->ElecCoolRatio;
lMinPartLoadRat = this->MinPartLoadRat;
lMaxPartLoadRat = this->MaxPartLoadRat;
lCoolCapFTCurve = this->CoolCapFTCurve;
lThermalEnergyCoolFTCurve = this->ThermalEnergyCoolFTCurve;
lThermalEnergyCoolFPLRCurve = this->ThermalEnergyCoolFPLRCurve;
lElecCoolFTCurve = this->ElecCoolFTCurve;
lElecCoolFPLRCurve = this->ElecCoolFPLRCurve;
lIsEnterCondensTemp = this->isEnterCondensTemp;
lIsWaterCooled = this->isWaterCooled;
lCHWLowLimitTemp = this->CHWLowLimitTemp;
lHeatElectricPower = this->HeatElectricPower;
lHeatThermalEnergyUseRate = this->HeatThermalEnergyUseRate;
lHeatPartLoadRatio = this->HeatPartLoadRatio;
// initialize entering conditions
lChillReturnTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp;
lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate;
lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp;
{
auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme);
if (SELECT_CASE_var == DataPlant::SingleSetPoint) {
ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPoint;
} else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) {
ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPointHi;
} else {
assert(false);
}
}
ChillDeltaTemp = std::abs(lChillReturnTemp - ChillSupplySetPointTemp);
lExhaustInTemp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp;
lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate;
lExhaustAirHumRat = DataLoopNode::Node(lExhaustAirInletNodeNum).HumRat;
Cp_CW = FluidProperties::GetSpecificHeatGlycol(
DataPlant::PlantLoop(this->CWLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName);
if (this->CDLoopNum > 0) {
Cp_CD = FluidProperties::GetSpecificHeatGlycol(
DataPlant::PlantLoop(this->CDLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName);
}
// If no loop demand or Absorber OFF, return
// will need to modify when absorber can act as a boiler
if (MyLoad >= 0 || !((this->InHeatingMode) || (this->InCoolingMode))) {
// set node temperatures
lChillSupplyTemp = lChillReturnTemp;
lCondSupplyTemp = lCondReturnTemp;
lCondWaterMassFlowRate = 0.0;
if (lIsWaterCooled) {
PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate,
this->CondReturnNodeNum,
this->CondSupplyNodeNum,
this->CDLoopNum,
this->CDLoopSideNum,
this->CDBranchNum,
this->CDCompNum);
}
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat);
} else {
// if water cooled use the input node otherwise just use outside air temperature
if (lIsWaterCooled) {
// most manufacturers rate have tables of entering condenser water temperature
// but a few use leaving condenser water temperature so we have a flag
// when leaving is used it uses the previous iterations value of the value
lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp;
if (lIsEnterCondensTemp) {
calcCondTemp = lCondReturnTemp;
} else {
if (this->oldCondSupplyTemp == 0) {
this->oldCondSupplyTemp = lCondReturnTemp + 8.0; // if not previously estimated assume 8C greater than return
}
calcCondTemp = this->oldCondSupplyTemp;
}
// Set mass flow rates
lCondWaterMassFlowRate = this->DesCondMassFlowRate;
PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate,
this->CondReturnNodeNum,
this->CondSupplyNodeNum,
this->CDLoopNum,
this->CDLoopSideNum,
this->CDBranchNum,
this->CDCompNum);
} else {
// air cooled
DataLoopNode::Node(lCondReturnNodeNum).Temp = DataLoopNode::Node(lCondReturnNodeNum).OutAirDryBulb;
calcCondTemp = DataLoopNode::Node(lCondReturnNodeNum).OutAirDryBulb;
lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp;
lCondWaterMassFlowRate = 0.0;
if (this->CDLoopNum > 0) {
PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate,
this->CondReturnNodeNum,
this->CondSupplyNodeNum,
this->CDLoopNum,
this->CDLoopSideNum,
this->CDBranchNum,
this->CDCompNum);
}
}
// Determine available cooling capacity using the setpoint temperature
lAvailableCoolingCapacity = lNomCoolingCap * CurveManager::CurveValue(lCoolCapFTCurve, ChillSupplySetPointTemp, calcCondTemp);
// Calculate current load for cooling
MyLoad = sign(max(std::abs(MyLoad), lAvailableCoolingCapacity * lMinPartLoadRat), MyLoad);
MyLoad = sign(min(std::abs(MyLoad), lAvailableCoolingCapacity * lMaxPartLoadRat), MyLoad);
// Determine the following variables depending on if the flow has been set in
// the nodes (flowlock=1 to 2) or if the amount of load is still be determined (flowlock=0)
// chilled water flow,
// cooling load taken by the chiller, and
// supply temperature
lChillWaterMassflowratemax = this->DesEvapMassFlowRate;
LoopNum = this->CWLoopNum;
LoopSideNum = this->CWLoopSideNum;
{
auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock);
if (SELECT_CASE_var == 0) { // mass flow rates may be changed by loop components
this->PossibleSubcooling = false;
lCoolingLoad = std::abs(MyLoad);
if (ChillDeltaTemp != 0.0) {
lChillWaterMassFlowRate = std::abs(lCoolingLoad / (Cp_CW * ChillDeltaTemp));
if (lChillWaterMassFlowRate - lChillWaterMassflowratemax > DataBranchAirLoopPlant::MassFlowTolerance)
this->PossibleSubcooling = true;
PlantUtilities::SetComponentFlowRate(lChillWaterMassFlowRate,
this->ChillReturnNodeNum,
this->ChillSupplyNodeNum,
this->CWLoopNum,
this->CWLoopSideNum,
this->CWBranchNum,
this->CWCompNum);
} else {
lChillWaterMassFlowRate = 0.0;
ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:Cooling\"" + this->Name +
"\", DeltaTemp = 0 in mass flow calculation",
this->DeltaTempCoolErrCount);
}
lChillSupplyTemp = ChillSupplySetPointTemp;
} else if (SELECT_CASE_var == 1) { // mass flow rates may not be changed by loop components
lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate;
if (this->PossibleSubcooling) {
lCoolingLoad = std::abs(MyLoad);
ChillDeltaTemp = lCoolingLoad / lChillWaterMassFlowRate / Cp_CW;
lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - ChillDeltaTemp;
} else {
ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - ChillSupplySetPointTemp;
lCoolingLoad = std::abs(lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp);
lChillSupplyTemp = ChillSupplySetPointTemp;
}
// Check that the Chiller Supply outlet temp honors both plant loop temp low limit and also the chiller low limit
if (lChillSupplyTemp < lCHWLowLimitTemp) {
if ((DataLoopNode::Node(lChillReturnNodeNum).Temp - lCHWLowLimitTemp) > DataPlant::DeltaTempTol) {
lChillSupplyTemp = lCHWLowLimitTemp;
ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp;
lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp;
} else {
lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp;
ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp;
lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp;
}
}
if (lChillSupplyTemp < DataLoopNode::Node(lChillSupplyNodeNum).TempMin) {
if ((DataLoopNode::Node(lChillReturnNodeNum).Temp - DataLoopNode::Node(lChillSupplyNodeNum).TempMin) >
DataPlant::DeltaTempTol) {
lChillSupplyTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempMin;
ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp;
lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp;
} else {
lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp;
ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp;
lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp;
}
}
// Checks Coolingload on the basis of the machine limits.
if (lCoolingLoad > std::abs(MyLoad)) {
if (lChillWaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) {
lCoolingLoad = std::abs(MyLoad);
ChillDeltaTemp = lCoolingLoad / lChillWaterMassFlowRate / Cp_CW;
lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - ChillDeltaTemp;
} else {
lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp;
ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp;
lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp;
}
}
}
}
// Calculate operating part load ratio for cooling
PartLoadRat = min(std::abs(MyLoad) / lAvailableCoolingCapacity, lMaxPartLoadRat);
PartLoadRat = max(lMinPartLoadRat, PartLoadRat);
if (lAvailableCoolingCapacity > 0.0) {
if (std::abs(MyLoad) / lAvailableCoolingCapacity < lMinPartLoadRat) {
lCoolPartLoadRatio = MyLoad / lAvailableCoolingCapacity;
} else {
lCoolPartLoadRatio = PartLoadRat;
}
} else { // Else if AvailableCoolingCapacity < 0.0
lCoolPartLoadRatio = 0.0;
}
// calculate the fraction of the time period that the chiller would be running
// use maximum from heating and cooling sides
if (lCoolPartLoadRatio < lMinPartLoadRat || lHeatPartLoadRatio < lMinPartLoadRat) {
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat);
} else {
lFractionOfPeriodRunning = 1.0;
}
// Calculate thermal energy consumption for cooling
// Thermal Energy used for cooling availCap * TeFIR * TeFIR-FT * TeFIR-FPLR
lCoolThermalEnergyUseRate = lAvailableCoolingCapacity * lThermalEnergyCoolRatio *
CurveManager::CurveValue(lThermalEnergyCoolFTCurve, lChillSupplyTemp, calcCondTemp) *
CurveManager::CurveValue(lThermalEnergyCoolFPLRCurve, lCoolPartLoadRatio) * lFractionOfPeriodRunning;
// Calculate electric parasitics used
// based on nominal capacity, not available capacity,
// electric used for cooling nomCap * %OP * EIR * EIR-FT * EIR-FPLR
lCoolElectricPower = lNomCoolingCap * lElecCoolRatio * lFractionOfPeriodRunning *
CurveManager::CurveValue(lElecCoolFTCurve, lChillSupplyTemp, calcCondTemp) *
CurveManager::CurveValue(lElecCoolFPLRCurve, lCoolPartLoadRatio);
// determine conderser load which is cooling load plus the
// ThermalEnergy used for cooling plus
// the electricity used
lTowerLoad = lCoolingLoad + lCoolThermalEnergyUseRate / lThermalEnergyHeatRatio + lCoolElectricPower;
lExhaustInTemp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp;
lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate;
CpAir = Psychrometrics::PsyCpAirFnW(lExhaustAirHumRat);
lExhHeatRecPotentialCool = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp);
// If Microturbine Exhaust temperature and flow rate is not sufficient to run the chiller, then chiller will not run
// lCoolThermalEnergyUseRate , lTowerLoad and lCoolElectricPower will be set to 0.0
if (lExhHeatRecPotentialCool < lCoolThermalEnergyUseRate) {
if (this->ExhTempLTAbsLeavingTempIndex == 0) {
ShowWarningError("ChillerHeater:Absorption:DoubleEffect \"" + this->Name + "\"");
ShowContinueError(
"...Exhaust temperature and flow input from Micro Turbine is not sufficient during cooling to run the chiller ");
ShowContinueError("...Value of Exhaust air inlet temp =" + General::TrimSigDigits(lExhaustInTemp, 4) + " C.");
ShowContinueError("... and Exhaust air flow rate of " + General::TrimSigDigits(lExhaustInFlow, 2) + " kg/s.");
ShowContinueError("...Value of minimum absorber leaving temp =" + General::TrimSigDigits(AbsLeavingTemp, 4) + " C.");
ShowContinueError("...Either increase the Exhaust temperature (min required = 350 C ) or flow or both of Micro Turbine to meet "
"the min available potential criteria.");
ShowContinueErrorTimeStamp("... Simulation will continue.");
}
ShowRecurringWarningErrorAtEnd(
"ChillerHeater:Absorption:DoubleEffect \"" + this->Name +
"\": Exhaust temperature from Micro Turbine is not sufficient to run the chiller during cooling warning continues...",
this->ExhTempLTAbsLeavingTempIndex,
lExhaustInTemp,
AbsLeavingTemp);
// If exhaust is not available, it means the avilable thermal energy is 0.0 and Chiller is not available
lCoolThermalEnergyUseRate = 0.0;
lTowerLoad = 0.0;
lCoolElectricPower = 0.0;
lChillSupplyTemp = lChillReturnTemp;
lCondSupplyTemp = lCondReturnTemp;
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat);
}
// for water cooled condenser make sure enough flow rate
// for air cooled condenser just set supply to return temperature
if (lIsWaterCooled) {
if (lCondWaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) {
lCondSupplyTemp = lCondReturnTemp + lTowerLoad / (lCondWaterMassFlowRate * Cp_CD);
} else {
ShowSevereError("CalcExhaustAbsorberChillerModel: Condenser flow = 0, for Exhaust Absorber Chiller=" + this->Name);
ShowContinueErrorTimeStamp("");
ShowFatalError("Program Terminates due to previous error condition.");
}
} else {
lCondSupplyTemp = lCondReturnTemp; // if air cooled condenser just set supply and return to same temperature
}
// save the condenser water supply temperature for next iteration if that is used in lookup
// and if capacity is large enough error than report problem
this->oldCondSupplyTemp = lCondSupplyTemp;
if (!lIsEnterCondensTemp) {
// calculate the fraction of the estimated error between the capacity based on the previous
// iteration's value of condenser supply temperature and the actual calculated condenser supply
// temperature. If this becomes too common then may need to iterate a solution instead of
// relying on previous iteration method.
revisedEstimateAvailCap = lNomCoolingCap * CurveManager::CurveValue(lCoolCapFTCurve, ChillSupplySetPointTemp, lCondSupplyTemp);
if (revisedEstimateAvailCap > 0.0) {
errorAvailCap = std::abs((revisedEstimateAvailCap - lAvailableCoolingCapacity) / revisedEstimateAvailCap);
if (errorAvailCap > 0.05) { // if more than 5% error in estimate
ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:\"" + this->Name + "\", poor Condenser Supply Estimate",
this->CondErrCount,
errorAvailCap,
errorAvailCap);
}
}
}
} // IF(MyLoad>=0 .OR. .NOT. RunFlag)
// Write into the Report Variables except for nodes
this->CoolingLoad = lCoolingLoad;
this->TowerLoad = lTowerLoad;
this->CoolThermalEnergyUseRate = lCoolThermalEnergyUseRate;
this->CoolElectricPower = lCoolElectricPower;
this->CondReturnTemp = lCondReturnTemp;
this->ChillReturnTemp = lChillReturnTemp;
this->CondSupplyTemp = lCondSupplyTemp;
this->ChillSupplyTemp = lChillSupplyTemp;
this->ChillWaterFlowRate = lChillWaterMassFlowRate;
this->CondWaterFlowRate = lCondWaterMassFlowRate;
this->CoolPartLoadRatio = lCoolPartLoadRatio;
this->CoolingCapacity = lAvailableCoolingCapacity;
this->FractionOfPeriodRunning = lFractionOfPeriodRunning;
this->ExhaustInTemp = lExhaustInTemp;
this->ExhaustInFlow = lExhaustInFlow;
this->ExhHeatRecPotentialCool = lExhHeatRecPotentialCool;
// write the combined heating and cooling ThermalEnergy used and electric used
this->ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate;
this->ElectricPower = lCoolElectricPower + lHeatElectricPower;
}
void ExhaustAbsorberSpecs::calcHeater(Real64 &MyLoad, bool RunFlag)
{
// SUBROUTINE INFORMATION:
// AUTHOR Jason Glazer and Michael J. Witte
// DATE WRITTEN March 2001
// MODIFIED Mahabir Bhandari, ORNL, Aug 2011, modified to accomodate exhaust fired double effect absorption chiller
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// Simulate a Exhaust fired (Exhaust consuming) absorption chiller using
// curves and inputs similar to DOE-2.1e
// METHODOLOGY EMPLOYED:
// Curve fit of performance data
// REFERENCES:
// 1. DOE-2.1e Supplement and source code
// 2. CoolTools GasMod work
// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:
// FlowLock = 0 if mass flow rates may be changed by loop components
// FlowLock = 1 if mass flow rates may not be changed by loop components
// FlowLock = 2 if overloaded and mass flow rates has changed to a small amount and Tout drops
// below Setpoint
// SUBROUTINE PARAMETER DEFINITIONS:
Real64 const AbsLeavingTemp(176.667); // C - Minimum temperature leaving the Chiller absorber (350 F)
static std::string const RoutineName("CalcExhaustAbsorberHeaterModel");
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
// Local copies of ExhaustAbsorberSpecs Type
// all variables that are local copies of data structure
// variables are prefaced with an "l" for local.
Real64 lNomCoolingCap; // W - design nominal capacity of Absorber
Real64 lNomHeatCoolRatio; // ratio of heating to cooling capacity
Real64 lThermalEnergyHeatRatio; // ratio of ThermalEnergy input to heating output
Real64 lElecHeatRatio; // ratio of electricity input to heating output
int lHeatReturnNodeNum; // absorber hot water inlet node number, water side
int lHeatSupplyNodeNum; // absorber hot water outlet node number, water side
Real64 lMinPartLoadRat; // min allowed operating frac full load
Real64 lMaxPartLoadRat; // max allowed operating frac full load
int lHeatCapFCoolCurve; // Heating Capacity Function of Cooling Capacity Curve
int lThermalEnergyHeatFHPLRCurve; // ThermalEnergy Input to heat output ratio during heating only function
// Local copies of ExhaustAbsorberReportVars Type
Real64 lHeatingLoad(0.0); // heating load on the chiller
// Real64 lHeatingEnergy( 0.0 ); // heating energy
// Real64 lThermalEnergyUseRate( 0.0 ); // instantaneous use of Thermal Energy for period
// Real64 lThermalEnergy( 0.0 ); // variable to track total Thermal Energy used for a period (reference only)
Real64 lCoolThermalEnergyUseRate(0.0); // instantaneous use of thermal energy for period for cooling
Real64 lHeatThermalEnergyUseRate(0.0); // instantaneous use of thermal energy for period for heating
Real64 lCoolElectricPower(0.0); // parasitic electric power used for cooling
Real64 lHeatElectricPower(0.0); // parasitic electric power used for heating
Real64 lHotWaterReturnTemp(0.0); // reporting: hot water return (inlet) temperature
Real64 lHotWaterSupplyTemp(0.0); // reporting: hot water supply (outlet) temperature
Real64 lHotWaterMassFlowRate(0.0); // reporting: hot water mass flow rate
Real64 lCoolPartLoadRatio(0.0); // operating part load ratio (load/capacity for cooling)
Real64 lHeatPartLoadRatio(0.0); // operating part load ratio (load/capacity for heating)
Real64 lAvailableHeatingCapacity(0.0); // current heating capacity
Real64 lFractionOfPeriodRunning(0.0);
Real64 lExhaustInTemp(0.0); // Exhaust inlet temperature
Real64 lExhaustInFlow(0.0); // Exhaust inlet flow rate
Real64 lExhHeatRecPotentialHeat(0.0); // Exhaust heat recovery potential
Real64 lExhaustAirHumRat(0.0);
// other local variables
Real64 HeatDeltaTemp(0.0); // hot water temperature difference
Real64 HeatSupplySetPointTemp(0.0);
int LoopNum;
int LoopSideNum;
Real64 Cp_HW; // local fluid specific heat for hot water
Real64 CpAir;
int lExhaustAirInletNodeNum; // Combustion Air Inlet Node number
// set node values to data structure values for nodes
lHeatReturnNodeNum = this->HeatReturnNodeNum;
lHeatSupplyNodeNum = this->HeatSupplyNodeNum;
lExhaustAirInletNodeNum = this->ExhaustAirInletNodeNum;
// set local copies of data from rest of input structure
lNomCoolingCap = this->NomCoolingCap;
lNomHeatCoolRatio = this->NomHeatCoolRatio;
lThermalEnergyHeatRatio = this->ThermalEnergyHeatRatio;
lElecHeatRatio = this->ElecHeatRatio;
lMinPartLoadRat = this->MinPartLoadRat;
lMaxPartLoadRat = this->MaxPartLoadRat;
lHeatCapFCoolCurve = this->HeatCapFCoolCurve;
lThermalEnergyHeatFHPLRCurve = this->ThermalEnergyHeatFHPLRCurve;
LoopNum = this->HWLoopNum;
LoopSideNum = this->HWLoopSideNum;
Cp_HW = FluidProperties::GetSpecificHeatGlycol(
DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName);
lCoolElectricPower = this->CoolElectricPower;
lCoolThermalEnergyUseRate = this->CoolThermalEnergyUseRate;
lCoolPartLoadRatio = this->CoolPartLoadRatio;
// initialize entering conditions
lHotWaterReturnTemp = DataLoopNode::Node(lHeatReturnNodeNum).Temp;
lHotWaterMassFlowRate = DataLoopNode::Node(lHeatReturnNodeNum).MassFlowRate;
{
auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme);
if (SELECT_CASE_var == DataPlant::SingleSetPoint) {
HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPoint;
} else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) {
HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPointLo;
} else {
assert(false);
}
}
HeatDeltaTemp = std::abs(lHotWaterReturnTemp - HeatSupplySetPointTemp);
// If no loop demand or Absorber OFF, return
// will need to modify when absorber can act as a boiler
if (MyLoad <= 0 || !RunFlag) {
// set node temperatures
lHotWaterSupplyTemp = lHotWaterReturnTemp;
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat);
} else {
// Determine available heating capacity using the current cooling load
lAvailableHeatingCapacity = this->NomHeatCoolRatio * this->NomCoolingCap *
CurveManager::CurveValue(lHeatCapFCoolCurve, (this->CoolingLoad / this->NomCoolingCap));
// Calculate current load for heating
MyLoad = sign(max(std::abs(MyLoad), this->HeatingCapacity * lMinPartLoadRat), MyLoad);
MyLoad = sign(min(std::abs(MyLoad), this->HeatingCapacity * lMaxPartLoadRat), MyLoad);
// Determine the following variables depending on if the flow has been set in
// the nodes (flowlock=1 to 2) or if the amount of load is still be determined (flowlock=0)
// chilled water flow,
// cooling load taken by the chiller, and
// supply temperature
{
auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock);
if (SELECT_CASE_var == 0) { // mass flow rates may be changed by loop components
lHeatingLoad = std::abs(MyLoad);
if (HeatDeltaTemp != 0) {
lHotWaterMassFlowRate = std::abs(lHeatingLoad / (Cp_HW * HeatDeltaTemp));
PlantUtilities::SetComponentFlowRate(lHotWaterMassFlowRate,
this->HeatReturnNodeNum,
this->HeatSupplyNodeNum,
this->HWLoopNum,
this->HWLoopSideNum,
this->HWBranchNum,
this->HWCompNum);
} else {
lHotWaterMassFlowRate = 0.0;
ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:Heating\"" + this->Name +
"\", DeltaTemp = 0 in mass flow calculation",
this->DeltaTempHeatErrCount);
}
lHotWaterSupplyTemp = HeatSupplySetPointTemp;
} else if (SELECT_CASE_var == 1) { // mass flow rates may not be changed by loop components
lHotWaterSupplyTemp = HeatSupplySetPointTemp;
lHeatingLoad = std::abs(lHotWaterMassFlowRate * Cp_HW * HeatDeltaTemp);
// DSU this "2" is not a real state for flowLock
} else if (SELECT_CASE_var ==
2) { // chiller is underloaded and mass flow rates has changed to a small amount and Tout drops below Setpoint
// MJW 07MAR01 Borrow logic from steam absorption module
// The following conditional statements are made to avoid extremely small EvapMdot
// & unreasonable EvapOutletTemp due to overloading.
// Avoid 'divide by zero' due to small EvapMdot
if (lHotWaterMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) {
HeatDeltaTemp = 0.0;
} else {
HeatDeltaTemp = std::abs(MyLoad) / (Cp_HW * lHotWaterMassFlowRate);
}
lHotWaterSupplyTemp = lHotWaterReturnTemp + HeatDeltaTemp;
lHeatingLoad = std::abs(lHotWaterMassFlowRate * Cp_HW * HeatDeltaTemp);
}
}
// Calculate operating part load ratio for cooling
lHeatPartLoadRatio = lHeatingLoad / lAvailableHeatingCapacity;
// Calculate ThermalEnergy consumption for heating
// ThermalEnergy used for heating availCap * HIR * HIR-FT * HIR-FPLR
lHeatThermalEnergyUseRate =
lAvailableHeatingCapacity * lThermalEnergyHeatRatio * CurveManager::CurveValue(lThermalEnergyHeatFHPLRCurve, lHeatPartLoadRatio);
// calculate the fraction of the time period that the chiller would be running
// use maximum from heating and cooling sides
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat);
// Calculate electric parasitics used
// for heating based on nominal capacity not available capacity
lHeatElectricPower = lNomCoolingCap * lNomHeatCoolRatio * lElecHeatRatio * lFractionOfPeriodRunning;
// Coodinate electric parasitics for heating and cooling to avoid double counting
// Total electric is the max of heating electric or cooling electric
// If heating electric is greater, leave cooling electric and subtract if off of heating elec
// If cooling electric is greater, set heating electric to zero
lExhaustInTemp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp;
lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate;
CpAir = Psychrometrics::PsyCpAirFnW(lExhaustAirHumRat);
lExhHeatRecPotentialHeat = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp);
if (lExhHeatRecPotentialHeat < lHeatThermalEnergyUseRate) {
if (this->ExhTempLTAbsLeavingHeatingTempIndex == 0) {
ShowWarningError("ChillerHeater:Absorption:DoubleEffect \"" + this->Name + "\"");
ShowContinueError(
"...Exhaust temperature and flow input from Micro Turbine is not sufficient to run the chiller during heating .");
ShowContinueError("...Value of Exhaust air inlet temp =" + General::TrimSigDigits(lExhaustInTemp, 4) + " C.");
ShowContinueError("... and Exhaust air flow rate of " + General::TrimSigDigits(lExhaustInFlow, 2) + " kg/s.");
ShowContinueError("...Value of minimum absorber leaving temp =" + General::TrimSigDigits(AbsLeavingTemp, 4) + " C.");
ShowContinueError("...Either increase the Exhaust temperature (min required = 350 C ) or flow or both of Micro Turbine to meet "
"the min available potential criteria.");
ShowContinueErrorTimeStamp("... Simulation will continue.");
}
ShowRecurringWarningErrorAtEnd(
"ChillerHeater:Absorption:DoubleEffect \"" + this->Name +
"\": Exhaust temperature from Micro Turbine is not sufficient to run the chiller during heating warning continues...",
this->ExhTempLTAbsLeavingHeatingTempIndex,
lExhaustInTemp,
AbsLeavingTemp);
// If exhaust is not available, it means the avilable thermal energy is 0.0 and Chiller is not available
lHeatThermalEnergyUseRate = 0.0;
lHeatElectricPower = 0.0;
lHotWaterSupplyTemp = lHotWaterReturnTemp;
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat);
}
if (lHeatElectricPower <= lCoolElectricPower) {
lHeatElectricPower = 0.0;
} else {
lHeatElectricPower -= lCoolElectricPower;
}
} // IF(MyLoad==0 .OR. .NOT. RunFlag)
// Write into the Report Variables except for nodes
this->HeatingLoad = lHeatingLoad;
this->HeatThermalEnergyUseRate = lHeatThermalEnergyUseRate;
this->HeatElectricPower = lHeatElectricPower;
this->HotWaterReturnTemp = lHotWaterReturnTemp;
this->HotWaterSupplyTemp = lHotWaterSupplyTemp;
this->HotWaterFlowRate = lHotWaterMassFlowRate;
this->HeatPartLoadRatio = lHeatPartLoadRatio;
this->HeatingCapacity = lAvailableHeatingCapacity;
this->FractionOfPeriodRunning = lFractionOfPeriodRunning;
// write the combined heating and cooling ThermalEnergy used and electric used
this->ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate;
this->ElectricPower = lCoolElectricPower + lHeatElectricPower;
this->ExhaustInTemp = lExhaustInTemp;
this->ExhaustInFlow = lExhaustInFlow;
this->ExhHeatRecPotentialHeat = lExhHeatRecPotentialHeat;
}
void ExhaustAbsorberSpecs::updateCoolRecords(Real64 MyLoad, bool RunFlag)
{
// SUBROUTINE INFORMATION:
// AUTHOR Jason Glazer
// DATE WRITTEN March 2001
// PURPOSE OF THIS SUBROUTINE:
// reporting
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int lChillReturnNodeNum; // Node number on the inlet side of the plant
int lChillSupplyNodeNum; // Node number on the outlet side of the plant
int lCondReturnNodeNum; // Node number on the inlet side of the condenser
int lCondSupplyNodeNum; // Node number on the outlet side of the condenser
int lExhaustAirInletNodeNum; // Node number on the inlet side of the plant
Real64 RptConstant;
lChillReturnNodeNum = this->ChillReturnNodeNum;
lChillSupplyNodeNum = this->ChillSupplyNodeNum;
lCondReturnNodeNum = this->CondReturnNodeNum;
lCondSupplyNodeNum = this->CondSupplyNodeNum;
lExhaustAirInletNodeNum = this->ExhaustAirInletNodeNum;
if (MyLoad == 0 || !RunFlag) {
DataLoopNode::Node(lChillSupplyNodeNum).Temp = DataLoopNode::Node(lChillReturnNodeNum).Temp;
if (this->isWaterCooled) {
DataLoopNode::Node(lCondSupplyNodeNum).Temp = DataLoopNode::Node(lCondReturnNodeNum).Temp;
}
DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp;
DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = this->ExhaustInFlow;
} else {
DataLoopNode::Node(lChillSupplyNodeNum).Temp = this->ChillSupplyTemp;
if (this->isWaterCooled) {
DataLoopNode::Node(lCondSupplyNodeNum).Temp = this->CondSupplyTemp;
}
DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = this->ExhaustInTemp;
DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = this->ExhaustInFlow;
}
// convert power to energy and instantaneous use to use over the time step
RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour;
this->CoolingEnergy = this->CoolingLoad * RptConstant;
this->TowerEnergy = this->TowerLoad * RptConstant;
this->ThermalEnergy = this->ThermalEnergyUseRate * RptConstant;
this->CoolThermalEnergy = this->CoolThermalEnergyUseRate * RptConstant;
this->ElectricEnergy = this->ElectricPower * RptConstant;
this->CoolElectricEnergy = this->CoolElectricPower * RptConstant;
if (this->CoolThermalEnergyUseRate != 0.0) {
this->ThermalEnergyCOP = this->CoolingLoad / this->CoolThermalEnergyUseRate;
} else {
this->ThermalEnergyCOP = 0.0;
}
}
void ExhaustAbsorberSpecs::updateHeatRecords(Real64 MyLoad, bool RunFlag)
{
// SUBROUTINE INFORMATION:
// AUTHOR Jason Glazer
// DATE WRITTEN March 2001
// PURPOSE OF THIS SUBROUTINE:
// reporting
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int lHeatReturnNodeNum; // absorber steam inlet node number, water side
int lHeatSupplyNodeNum; // absorber steam outlet node number, water side
Real64 RptConstant;
lHeatReturnNodeNum = this->HeatReturnNodeNum;
lHeatSupplyNodeNum = this->HeatSupplyNodeNum;
if (MyLoad == 0 || !RunFlag) {
DataLoopNode::Node(lHeatSupplyNodeNum).Temp = DataLoopNode::Node(lHeatReturnNodeNum).Temp;
} else {
DataLoopNode::Node(lHeatSupplyNodeNum).Temp = this->HotWaterSupplyTemp;
}
// convert power to energy and instantaneous use to use over the time step
RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour;
this->HeatingEnergy = this->HeatingLoad * RptConstant;
this->ThermalEnergy = this->ThermalEnergyUseRate * RptConstant;
this->HeatThermalEnergy = this->HeatThermalEnergyUseRate * RptConstant;
this->ElectricEnergy = this->ElectricPower * RptConstant;
this->HeatElectricEnergy = this->HeatElectricPower * RptConstant;
}
void clear_state()
{
ExhaustAbsorber.deallocate();
Sim_GetInput = true;
}
} // namespace ChillerExhaustAbsorption
} // namespace EnergyPlus
| [
"ffeng@tamu.edu"
] | ffeng@tamu.edu |
702b20b69c3ee60389cf28284cc5e4ff5bd2a9c5 | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_1482492_0/C++/dkorduban/B.cpp | 5aa2199fb40cfbc965e2fd75778d21a4415490c2 | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 1,072 | cpp | // MS Visual Studio
#include<cstdio>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<iostream>
#include<map>
#include<vector>
using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,s,n) for(int i=(s); i<(n); ++i)
#define sz(X) int((X).size())
#define pb push_back
#define X first
#define Y second
typedef long long lint;
double T[1000], x[1000];
int main() {
freopen("B-small-attempt0.in", "r", stdin);
freopen("B.out", "w", stdout);
int tc;
scanf("%d", &tc);
FOR(t, 1, tc+1) {
//cerr << t << endl;
printf("Case #%d:\n", t);
int n, a;
double X;
cin >> X >> n >> a;
REP(i, n) {
cin >> T[i] >> x[i];
}
double to;
if(n == 1) {
to = 0;
} else {
to = ((X - x[0]) / (x[1] - x[0])) * T[1];
}
REP(i, a) {
double g;
cin >> g;
double t_our = sqrt(2 * X / g);
printf("%.10lf\n", max(to, t_our));
}
}
} | [
"eewestman@gmail.com"
] | eewestman@gmail.com |
c08db733302eeede19438e16b701641ac7b4b750 | 84491309d9aa15f1da13e7cbbc2486dd95b2e5a1 | /Data Structures Implementation/Stack/stack.cpp | 95a8df587974f6a453e11870052f4367387adfc7 | [] | no_license | iksanov/algorithms_data-structures_OOP | d8befe4df618994ff505a0e44f73601ccd69ccb5 | 0967c7179699fbb888e1cc22b6497951fc53342b | refs/heads/master | 2021-08-20T02:53:24.387581 | 2017-11-28T02:26:31 | 2017-11-28T02:26:31 | 111,935,555 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,090 | cpp | #include "stack.h"
#include <new>
#include <stdexcept>
#include <iostream>
using std::runtime_error;
using std::cout;
using std::endl;
Stack::Stack(int init_size)
{
cout << "I'm inside the constructor\n";
arr = new int[init_size];
capacity = init_size;
count = 0;
}
Stack::Stack(const Stack &stack)
{
cout << "I'm inside the copy-constructor\n";
arr = new int[stack.capacity];
memcpy(arr, stack.arr, sizeof(int) * stack.size());
count = stack.count;
capacity = stack.capacity;
}
Stack::~Stack()
{
cout << "I'm inside the destructor" << endl;
delete[] arr;
}
void Stack::push(int number)
{
if (count < capacity)
{
arr[count] = number;
++count;
}
else
throw runtime_error("Stack::push - no memory");
}
int Stack::top()
{
if (count > 0)
return arr[count - 1];
else
throw runtime_error("Stack::top - no elements");
}
int Stack::pop()
{
if (count > 0){
int tmp = top();
arr[--count] = 0;
return tmp;
}
else
throw runtime_error("Stack::pop - no elements");
}
int Stack::size() const
{
return count;
} | [
"iksanov@yahoo.com"
] | iksanov@yahoo.com |
ff4b323fa550e8e80ee150d8cab5eff75eaf8090 | bd836081502105e472df1d0a99881deed61ce048 | /marketlink/MKLrmdsRecordHandler.cpp | 7a79094ed070f321f6e2db050170512476431b86 | [] | no_license | mitkatch/BPE | 9f34064778c25cc8dcb8225ed9f2252a3d431fb3 | 27985cb5da5045b797e67ec8c2a93e0f50ee6c09 | refs/heads/master | 2020-03-30T22:18:51.194908 | 2018-10-05T02:48:32 | 2018-10-05T02:48:32 | 151,662,346 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,440 | cpp |
/************************************************************************
||
|| DATE: $Date:$
|| SOURCE: $Source:$
|| STATE: $State:$
|| ID: $Id:$
|| REVISION: $Revision:$
|| LOG: $Log:$
|| LOG:
************************************************************************/
// System includes
#include <string>
// Application includes
#include "MKLrmdsRecordHandler.hpp"
#include "DataGraph.hpp"
#include "DataCache.hpp"
// RFA includes
#include "TIBMsg/TibMsg.h"
// Namespace resolution
using namespace std;
using namespace rfa::sessionLayer;
using namespace rfa::common;
MKLrmdsRecordHandler::MKLrmdsRecordHandler(const ConfigMap &configMap) : rmdsRecordHandler(configMap)
{
}
MKLrmdsRecordHandler::~MKLrmdsRecordHandler()
{
}
void MKLrmdsRecordHandler::processStatus(const MarketDataItemEvent& event)
{
const string& service = event.getServiceName();
const string& item = event.getItemName();
string address = event.getServiceName() + "." + event.getItemName();
DataGraph* data = (DataGraph *)DataCache::getCache()->getData(address, Datum::GRAPH);
if ( data != NULL )
{
// Notify of change
data->updated();
}
Logger::getLogger()->log(Logger::TYPE_INFO, "MKL RMDS item status for service: %s, Item: %s [%s]",
service.c_str(), item.c_str(),
event.getStatus().getStatusText().c_str());
}
| [
"mikhail_tkatchenko@yahoo.com"
] | mikhail_tkatchenko@yahoo.com |
bbe68f9c3beaf69a463ad6cdd31f93e1e8781bd9 | 4015f8bd0d1bd8306f6ec80524a891df369544c0 | /11/11/11.cpp | 8399b2a042dd6a06cb01604e7087b0c7b3002532 | [] | no_license | andyyin15/forthrepository | b18834c46d81c565e0d932cba70a1d260c9325cb | 85c3c4fad188ce5391eed1aa880117098e51cc90 | refs/heads/master | 2020-11-27T16:41:14.621627 | 2020-06-30T13:17:25 | 2020-06-30T13:17:25 | 229,530,174 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 262 | cpp | // 11.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<stdio.h>
#include"iostream"
int main(void)
{
int a[5] = { 1,2,3,4,5 };
int *ptr = (int *)(a + 1);
printf("%d,%d", *(a + 1), *(ptr - 1));
system("pause");
return 0;
} | [
"3223939902@qq.com"
] | 3223939902@qq.com |
b4ec4973a91c039ff99aee9c5c045c954dc0994f | 3dd41434dbf7f11f4ef99aa55c72607ac78dd3b2 | /server/server/src/im/db_proxy_server/business/AudioModel.cpp | c5ba404f2b8d0d77d57779c70857db51147b6b16 | [] | no_license | JCGit/ttchat | 963561885546702d9468282702004dcf032bb8c1 | e4bb2e631ac2cba4542674f406be74f144b11889 | refs/heads/master | 2020-03-09T04:49:39.966293 | 2018-07-20T10:51:31 | 2018-07-20T10:51:31 | 128,596,746 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,690 | cpp | /*================================================================
* Copyright (C) 2014 All rights reserved.
*
* 文件名称:AudioModel.cpp
* 创 建 者:Zhang Yuanhao
* 邮 箱:bluefoxah@gmail.com
* 创建日期:2014年12月15日
* 描 述:
*
================================================================*/
#include "../DBPool.h"
#include "../HttpClient.h"
#include "AudioModel.h"
using namespace std;
//AudioModel
CAudioModel* CAudioModel::m_pInstance = NULL;
/**
* 构造函数
*/
CAudioModel::CAudioModel()
{
}
/**
* 析构函数
*/
CAudioModel::~CAudioModel()
{
}
/**
* 单例
*
* @return 单例的指针
*/
CAudioModel* CAudioModel::getInstance()
{
if (!m_pInstance) {
m_pInstance = new CAudioModel();
}
return m_pInstance;
}
/**
* 这只语音存储的url地址
*
* @param strFileSite 上传的url
*/
void CAudioModel::setUrl(string& strFileSite)
{
m_strFileSite = strFileSite;
if(m_strFileSite[m_strFileSite.length()] != '/')
{
m_strFileSite += "/";
}
}
/**
* 读取语音消息
*
* @param nAudioId 语音的Id
* @param cMsg 语音消息,引用
*
* @return bool 成功返回true,失败返回false
*/
bool CAudioModel::readAudios(list<IM::BaseDefine::MsgInfo>& lsMsg)
{
if(lsMsg.empty())
{
return true;
}
bool bRet = false;
auto const pDBConn = CDBManager::getInstance()->getdbconn("teamtalk_slave");
if (pDBConn)
{
for (auto it=lsMsg.begin(); it!=lsMsg.end(); )
{
IM::BaseDefine::MsgType nType = it->msg_type();
if((IM::BaseDefine::MSG_TYPE_GROUP_AUDIO == nType) || (IM::BaseDefine::MSG_TYPE_SINGLE_AUDIO == nType))
{
string strSql = "select * from IMAudio where id=" + it->msg_data();
CResultSet* pResultSet = pDBConn->ExecuteQuery(strSql.c_str());
if (pResultSet)
{
while (pResultSet->Next()) {
uint32_t nCostTime = pResultSet->GetInt("duration");
uint32_t nSize = pResultSet->GetInt("size");
string strPath = pResultSet->GetString("path");
readAudioContent(nCostTime, nSize, strPath, *it);
}
++it;
delete pResultSet;
}
else
{
log("no result for sql:%s", strSql.c_str());
it = lsMsg.erase(it);
}
}
else
{
++it;
}
}
bRet = true;
}
else
{
log("no connection for teamtalk_slave");
}
return bRet;
}
/**
* 存储语音消息
*
* @param nFromId 发送者Id
* @param nToId 接收者Id
* @param nCreateTime 发送时间
* @param pAudioData 指向语音消息的指针
* @param nAudioLen 语音消息的长度
*
* @return 成功返回语音id,失败返回-1
*/
int CAudioModel::saveAudioInfo(uint32_t nFromId, uint32_t nToId, uint32_t nCreateTime, const char* pAudioData, uint32_t nAudioLen)
{
// parse audio data
uint32_t nCostTime = CByteStream::ReadUint32((uchar_t*)pAudioData);
uchar_t* pRealData = (uchar_t*)pAudioData + 4;
uint32_t nRealLen = nAudioLen - 4;
int nAudioId = -1;
CHttpClient httpClient;
string strPath = httpClient.UploadByteFile(m_strFileSite, pRealData, nRealLen);
if (!strPath.empty())
{
auto const pDBConn = CDBManager::getInstance()->getdbconn("teamtalk_master");
if (pDBConn)
{
uint32_t nStartPos = 0;
string strSql = "insert into IMAudio(`fromId`, `toId`, `path`, `size`, `duration`, `created`) "\
"values(?, ?, ?, ?, ?, ?)";
replace_mark(strSql, nFromId, nStartPos);
replace_mark(strSql, nToId, nStartPos);
replace_mark(strSql, strPath, nStartPos);
replace_mark(strSql, nRealLen, nStartPos);
replace_mark(strSql, nCostTime, nStartPos);
replace_mark(strSql, nCreateTime, nStartPos);
if (pDBConn->ExecuteUpdate(strSql.c_str()))
{
nAudioId = pDBConn->GetInsertId();
log("audioId=%d", nAudioId);
} else
{
log("sql failed: %s", strSql.c_str());
}
}
else
{
log("no db connection for teamtalk_master");
}
}
else
{
log("upload file failed");
}
return nAudioId;
}
/**
* 读取语音的具体内容
*
* @param nCostTime 语音时长
* @param nSize 语音大小
* @param strPath 语音存储的url
* @param cMsg msg结构体
*
* @return 成功返回true,失败返回false
*/
bool CAudioModel::readAudioContent(uint32_t nCostTime, uint32_t nSize, const string& strPath, IM::BaseDefine::MsgInfo& cMsg)
{
if (strPath.empty() || nCostTime == 0 || nSize == 0) {
return false;
}
// 分配内存,写入音频时长
AudioMsgInfo cAudioMsg;
uchar_t* pData = new uchar_t [4 + nSize];
cAudioMsg.data = pData;
CByteStream::WriteUint32(cAudioMsg.data, nCostTime);
cAudioMsg.data_len = 4;
cAudioMsg.fileSize = nSize;
// 获取音频数据,写入上面分配的内存
CHttpClient httpClient;
if(!httpClient.DownloadByteFile(strPath, &cAudioMsg))
{
delete [] pData;
return false;
}
log("download_path=%s, data_len=%d", strPath.c_str(), cAudioMsg.data_len);
cMsg.set_msg_data((const char*)cAudioMsg.data, cAudioMsg.data_len);
delete [] pData;
return true;
}
| [
"1027718562@qq.com"
] | 1027718562@qq.com |
1367b5a4e1fa6a10389b4082c8c9f332abe9f205 | 24213b3dd8e38426c9f8d7c86847c674a8874730 | /src/test/blockencodings_tests.cpp | 38ac06fe4b1d80c24de9506b9454465e047b8e70 | [
"MIT"
] | permissive | bitcoinrent/Source-code | cf0b3fafc745d62617801a32e9d0b2282b6b81ae | 53d70089aaf86b71eafc62bae35959485931e896 | refs/heads/master | 2020-04-02T09:14:09.032844 | 2019-02-16T23:57:12 | 2019-02-16T23:57:12 | 154,283,010 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 12,949 | cpp | // Copyright (c) 2011-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <blockencodings.h>
#include <consensus/merkle.h>
#include <chainparams.h>
#include <pow.h>
#include <random.h>
#include <test/test_bitcoinrent.h>
#include <boost/test/unit_test.hpp>
std::vector<std::pair<uint256, CTransactionRef>> extra_txn;
struct RegtestingSetup : public TestingSetup {
RegtestingSetup() : TestingSetup(CBaseChainParams::REGTEST) {}
};
BOOST_FIXTURE_TEST_SUITE(blockencodings_tests, RegtestingSetup)
static CBlock BuildBlockTestCase()
{
CBlock block;
CMutableTransaction tx;
tx.vin.resize(1);
tx.vin[0].scriptSig.resize(10);
tx.vout.resize(1);
tx.vout[0].nValue = 42;
block.vtx.resize(3);
block.vtx[0] = MakeTransactionRef(tx);
block.nVersion = 42;
block.hashPrevBlock = InsecureRand256();
block.nBits = 0x207fffff;
tx.vin[0].prevout.hash = InsecureRand256();
tx.vin[0].prevout.n = 0;
block.vtx[1] = MakeTransactionRef(tx);
tx.vin.resize(10);
for (size_t i = 0; i < tx.vin.size(); i++) {
tx.vin[i].prevout.hash = InsecureRand256();
tx.vin[i].prevout.n = 0;
}
block.vtx[2] = MakeTransactionRef(tx);
bool mutated;
block.hashMerkleRoot = BlockMerkleRoot(block, &mutated);
assert(!mutated);
while (!CheckProofOfWork(block.GetHash(), block.nBits, Params().GetConsensus()))
++block.nNonce;
return block;
}
// Number of shared use_counts we expect for a tx we haven't touched
// (block + mempool + our copy from the GetSharedTx call)
constexpr long SHARED_TX_OFFSET{3};
BOOST_AUTO_TEST_CASE(SimpleRoundTripTest)
{
CTxMemPool pool;
TestMemPoolEntryHelper entry;
CBlock block(BuildBlockTestCase());
LOCK(pool.cs);
pool.addUnchecked(block.vtx[2]->GetHash(), entry.FromTx(block.vtx[2]));
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);
// Do a simple ShortTxIDs RT
{
CBlockHeaderAndShortTxIDs shortIDs(block, true);
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
stream << shortIDs;
CBlockHeaderAndShortTxIDs shortIDs2;
stream >> shortIDs2;
PartiallyDownloadedBlock partialBlock(&pool);
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
BOOST_CHECK(partialBlock.IsTxAvailable(0));
BOOST_CHECK(!partialBlock.IsTxAvailable(1));
BOOST_CHECK(partialBlock.IsTxAvailable(2));
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1);
size_t poolSize = pool.size();
pool.removeRecursive(*block.vtx[2]);
BOOST_CHECK_EQUAL(pool.size(), poolSize - 1);
CBlock block2;
{
PartiallyDownloadedBlock tmp = partialBlock;
BOOST_CHECK(partialBlock.FillBlock(block2, {}) == READ_STATUS_INVALID); // No transactions
partialBlock = tmp;
}
// Wrong transaction
{
PartiallyDownloadedBlock tmp = partialBlock;
partialBlock.FillBlock(block2, {block.vtx[2]}); // Current implementation doesn't check txn here, but don't require that
partialBlock = tmp;
}
bool mutated;
BOOST_CHECK(block.hashMerkleRoot != BlockMerkleRoot(block2, &mutated));
CBlock block3;
BOOST_CHECK(partialBlock.FillBlock(block3, {block.vtx[1]}) == READ_STATUS_OK);
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block3.GetHash().ToString());
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block3, &mutated).ToString());
BOOST_CHECK(!mutated);
}
}
class TestHeaderAndShortIDs
{
// Utility to encode custom CBlockHeaderAndShortTxIDs
public:
CBlockHeader header;
uint64_t nonce;
std::vector<uint64_t> shorttxids;
std::vector<PrefilledTransaction> prefilledtxn;
explicit TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs& orig)
{
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
stream << orig;
stream >> *this;
}
explicit TestHeaderAndShortIDs(const CBlock& block) : TestHeaderAndShortIDs(CBlockHeaderAndShortTxIDs(block, true)) {}
uint64_t GetShortID(const uint256& txhash) const
{
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
stream << *this;
CBlockHeaderAndShortTxIDs base;
stream >> base;
return base.GetShortID(txhash);
}
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action)
{
READWRITE(header);
READWRITE(nonce);
size_t shorttxids_size = shorttxids.size();
READWRITE(VARINT(shorttxids_size));
shorttxids.resize(shorttxids_size);
for (size_t i = 0; i < shorttxids.size(); i++) {
uint32_t lsb = shorttxids[i] & 0xffffffff;
uint16_t msb = (shorttxids[i] >> 32) & 0xffff;
READWRITE(lsb);
READWRITE(msb);
shorttxids[i] = (uint64_t(msb) << 32) | uint64_t(lsb);
}
READWRITE(prefilledtxn);
}
};
BOOST_AUTO_TEST_CASE(NonCoinbasePreforwardRTTest)
{
CTxMemPool pool;
TestMemPoolEntryHelper entry;
CBlock block(BuildBlockTestCase());
LOCK(pool.cs);
pool.addUnchecked(block.vtx[2]->GetHash(), entry.FromTx(block.vtx[2]));
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);
uint256 txhash;
// Test with pre-forwarding tx 1, but not coinbase
{
TestHeaderAndShortIDs shortIDs(block);
shortIDs.prefilledtxn.resize(1);
shortIDs.prefilledtxn[0] = {1, block.vtx[1]};
shortIDs.shorttxids.resize(2);
shortIDs.shorttxids[0] = shortIDs.GetShortID(block.vtx[0]->GetHash());
shortIDs.shorttxids[1] = shortIDs.GetShortID(block.vtx[2]->GetHash());
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
stream << shortIDs;
CBlockHeaderAndShortTxIDs shortIDs2;
stream >> shortIDs2;
PartiallyDownloadedBlock partialBlock(&pool);
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
BOOST_CHECK(!partialBlock.IsTxAvailable(0));
BOOST_CHECK(partialBlock.IsTxAvailable(1));
BOOST_CHECK(partialBlock.IsTxAvailable(2));
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1); // +1 because of partialBlock
CBlock block2;
{
PartiallyDownloadedBlock tmp = partialBlock;
BOOST_CHECK(partialBlock.FillBlock(block2, {}) == READ_STATUS_INVALID); // No transactions
partialBlock = tmp;
}
// Wrong transaction
{
PartiallyDownloadedBlock tmp = partialBlock;
partialBlock.FillBlock(block2, {block.vtx[1]}); // Current implementation doesn't check txn here, but don't require that
partialBlock = tmp;
}
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 2); // +2 because of partialBlock and block2
bool mutated;
BOOST_CHECK(block.hashMerkleRoot != BlockMerkleRoot(block2, &mutated));
CBlock block3;
PartiallyDownloadedBlock partialBlockCopy = partialBlock;
BOOST_CHECK(partialBlock.FillBlock(block3, {block.vtx[0]}) == READ_STATUS_OK);
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block3.GetHash().ToString());
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block3, &mutated).ToString());
BOOST_CHECK(!mutated);
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 3); // +2 because of partialBlock and block2 and block3
txhash = block.vtx[2]->GetHash();
block.vtx.clear();
block2.vtx.clear();
block3.vtx.clear();
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1 - 1); // + 1 because of partialBlock; -1 because of block.
}
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET - 1); // -1 because of block
}
BOOST_AUTO_TEST_CASE(SufficientPreforwardRTTest)
{
CTxMemPool pool;
TestMemPoolEntryHelper entry;
CBlock block(BuildBlockTestCase());
LOCK(pool.cs);
pool.addUnchecked(block.vtx[1]->GetHash(), entry.FromTx(block.vtx[1]));
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[1]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);
uint256 txhash;
// Test with pre-forwarding coinbase + tx 2 with tx 1 in mempool
{
TestHeaderAndShortIDs shortIDs(block);
shortIDs.prefilledtxn.resize(2);
shortIDs.prefilledtxn[0] = {0, block.vtx[0]};
shortIDs.prefilledtxn[1] = {1, block.vtx[2]}; // id == 1 as it is 1 after index 1
shortIDs.shorttxids.resize(1);
shortIDs.shorttxids[0] = shortIDs.GetShortID(block.vtx[1]->GetHash());
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
stream << shortIDs;
CBlockHeaderAndShortTxIDs shortIDs2;
stream >> shortIDs2;
PartiallyDownloadedBlock partialBlock(&pool);
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
BOOST_CHECK(partialBlock.IsTxAvailable(0));
BOOST_CHECK(partialBlock.IsTxAvailable(1));
BOOST_CHECK(partialBlock.IsTxAvailable(2));
BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[1]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1);
CBlock block2;
PartiallyDownloadedBlock partialBlockCopy = partialBlock;
BOOST_CHECK(partialBlock.FillBlock(block2, {}) == READ_STATUS_OK);
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block2.GetHash().ToString());
bool mutated;
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());
BOOST_CHECK(!mutated);
txhash = block.vtx[1]->GetHash();
block.vtx.clear();
block2.vtx.clear();
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1 - 1); // + 1 because of partialBlock; -1 because of block.
}
BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET - 1); // -1 because of block
}
BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
{
CTxMemPool pool;
CMutableTransaction coinbase;
coinbase.vin.resize(1);
coinbase.vin[0].scriptSig.resize(10);
coinbase.vout.resize(1);
coinbase.vout[0].nValue = 42;
CBlock block;
block.vtx.resize(1);
block.vtx[0] = MakeTransactionRef(std::move(coinbase));
block.nVersion = 42;
block.hashPrevBlock = InsecureRand256();
block.nBits = 0x207fffff;
bool mutated;
block.hashMerkleRoot = BlockMerkleRoot(block, &mutated);
assert(!mutated);
while (!CheckProofOfWork(block.GetHash(), block.nBits, Params().GetConsensus()))
++block.nNonce;
// Test simple header round-trip with only coinbase
{
CBlockHeaderAndShortTxIDs shortIDs(block, false);
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
stream << shortIDs;
CBlockHeaderAndShortTxIDs shortIDs2;
stream >> shortIDs2;
PartiallyDownloadedBlock partialBlock(&pool);
BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);
BOOST_CHECK(partialBlock.IsTxAvailable(0));
CBlock block2;
std::vector<CTransactionRef> vtx_missing;
BOOST_CHECK(partialBlock.FillBlock(block2, vtx_missing) == READ_STATUS_OK);
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block2.GetHash().ToString());
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());
BOOST_CHECK(!mutated);
}
}
BOOST_AUTO_TEST_CASE(TransactionsRequestSerializationTest)
{
BlockTransactionsRequest req1;
req1.blockhash = InsecureRand256();
req1.indexes.resize(4);
req1.indexes[0] = 0;
req1.indexes[1] = 1;
req1.indexes[2] = 3;
req1.indexes[3] = 4;
CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
stream << req1;
BlockTransactionsRequest req2;
stream >> req2;
BOOST_CHECK_EQUAL(req1.blockhash.ToString(), req2.blockhash.ToString());
BOOST_CHECK_EQUAL(req1.indexes.size(), req2.indexes.size());
BOOST_CHECK_EQUAL(req1.indexes[0], req2.indexes[0]);
BOOST_CHECK_EQUAL(req1.indexes[1], req2.indexes[1]);
BOOST_CHECK_EQUAL(req1.indexes[2], req2.indexes[2]);
BOOST_CHECK_EQUAL(req1.indexes[3], req2.indexes[3]);
}
BOOST_AUTO_TEST_SUITE_END()
| [
"noreply@github.com"
] | bitcoinrent.noreply@github.com |
e219e2f2618a14e11cc7156a0aa4a05d004bbc58 | 6c4f73b08cd78cd45245ae8f32cf05ecd45a4f08 | /src/align.cc | 9a48e338c963ce6979aa72518f5621b19e09af35 | [
"MIT"
] | permissive | alexeden/realsense-node | 14b69feae201afd427d07e1a162ea54806a91efc | a4060c8fdcc091d933fb4c895f04e72f44328e63 | refs/heads/develop | 2023-01-08T23:08:26.214863 | 2020-08-04T04:01:16 | 2020-08-04T04:01:16 | 200,130,817 | 0 | 0 | MIT | 2023-01-06T00:50:27 | 2019-08-01T23:18:33 | C++ | UTF-8 | C++ | false | false | 3,100 | cc | #ifndef ALIGN_H
#define ALIGN_H
#include "frame_callbacks.cc"
#include "frameset.cc"
#include <librealsense2/hpp/rs_types.hpp>
#include <napi.h>
using namespace Napi;
class RSAlign : public ObjectWrap<RSAlign> {
public:
static Object Init(Napi::Env env, Object exports) {
Napi::Function func = DefineClass(
env,
"RSAlign",
{
InstanceMethod("destroy", &RSAlign::Destroy),
InstanceMethod("process", &RSAlign::Process),
InstanceMethod("waitForFrames", &RSAlign::WaitForFrames),
});
constructor = Napi::Persistent(func);
constructor.SuppressDestruct();
exports.Set("RSAlign", func);
return exports;
}
RSAlign(const CallbackInfo& info)
: ObjectWrap<RSAlign>(info)
, align_(nullptr)
, frame_queue_(nullptr)
, error_(nullptr) {
auto stream = static_cast<rs2_stream>(info[0].ToNumber().Int32Value());
this->align_ = GetNativeResult<rs2_processing_block*>(rs2_create_align, &this->error_, stream, &this->error_);
this->frame_queue_ = GetNativeResult<rs2_frame_queue*>(rs2_create_frame_queue, &this->error_, 1, &this->error_);
if (!this->frame_queue_) return;
auto callback = new FrameCallbackForFrameQueue(this->frame_queue_);
CallNativeFunc(rs2_start_processing, &this->error_, this->align_, callback, &this->error_);
}
~RSAlign() {
DestroyMe();
}
private:
friend class RSPipeline;
static FunctionReference constructor;
rs2_processing_block* align_;
rs2_frame_queue* frame_queue_;
rs2_error* error_;
void DestroyMe() {
if (error_) rs2_free_error(error_);
error_ = nullptr;
if (align_) rs2_delete_processing_block(align_);
align_ = nullptr;
if (frame_queue_) rs2_delete_frame_queue(frame_queue_);
frame_queue_ = nullptr;
}
Napi::Value Destroy(const CallbackInfo& info) {
this->DestroyMe();
return info.This();
}
Napi::Value Process(const CallbackInfo& info) {
auto frameset = ObjectWrap<RSFrameSet>::Unwrap(info[0].ToObject());
auto target_fs = ObjectWrap<RSFrameSet>::Unwrap(info[1].ToObject());
if (!frameset || !target_fs) return Boolean::New(info.Env(), false);
// rs2_process_frame will release the input frame, so we need to addref
CallNativeFunc(rs2_frame_add_ref, &this->error_, frameset->GetFrames(), &this->error_);
if (this->error_) return Boolean::New(info.Env(), false);
CallNativeFunc(rs2_process_frame, &this->error_, this->align_, frameset->GetFrames(), &this->error_);
if (this->error_) return Boolean::New(info.Env(), false);
rs2_frame* frame = nullptr;
auto ret_code
= GetNativeResult<int>(rs2_poll_for_frame, &this->error_, this->frame_queue_, &frame, &this->error_);
if (!ret_code) return Boolean::New(info.Env(), false);
target_fs->Replace(frame);
return Boolean::New(info.Env(), true);
}
Napi::Value WaitForFrames(const CallbackInfo& info) {
rs2_frame* result
= GetNativeResult<rs2_frame*>(rs2_wait_for_frame, &this->error_, this->frame_queue_, 5000, &this->error_);
if (!result) return info.Env().Undefined();
return RSFrameSet::NewInstance(info.Env(), result);
}
};
Napi::FunctionReference RSAlign::constructor;
#endif
| [
"alexandereden91@gmail.com"
] | alexandereden91@gmail.com |
32dabf2ee39da9d74c615b92c49120440752c85b | 36e453a9ec047e38b54690b7c3a50d00d1c042e6 | /src/RE/ExtraTextDisplayData.cpp | ed02b6be2da8dbc3c3928190126641bc87947262 | [
"MIT"
] | permissive | powerof3/CommonLibVR | 9200ca84d4866eaf18a92f23ef5dd375b5c69db8 | c84cd2c63ccba0cc88a212fe9cf86b5470b10a4f | refs/heads/master | 2023-07-12T04:56:36.970046 | 2021-08-21T18:08:34 | 2021-08-21T18:08:34 | 398,626,573 | 2 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 2,256 | cpp | #include "RE/ExtraTextDisplayData.h"
#include "REL/Relocation.h"
namespace RE
{
ExtraTextDisplayData::ExtraTextDisplayData() :
BSExtraData(),
displayName(""),
displayNameText(nullptr),
ownerQuest(nullptr),
ownerInstance(DisplayDataType::kUninitialized),
temperFactor(1.0F),
customNameLength(0),
pad32(0),
pad34(0)
{
//REL::Offset<std::uintptr_t> vtbl = REL::ID(229625);
REL::Offset<std::uintptr_t> vtbl = 0x15A3E30;
((std::uintptr_t*)this)[0] = vtbl.GetAddress();
}
ExtraTextDisplayData::ExtraTextDisplayData(const char* a_name) :
BSExtraData(),
displayName(""),
displayNameText(nullptr),
ownerQuest(nullptr),
ownerInstance(DisplayDataType::kUninitialized),
temperFactor(1.0F),
customNameLength(0),
pad32(0),
pad34(0)
{
//REL::Offset<std::uintptr_t> vtbl = REL::ID(229625);
REL::Offset<std::uintptr_t> vtbl = 0x15A3E30;
((std::uintptr_t*)this)[0] = vtbl.GetAddress();
SetName(a_name);
}
ExtraTextDisplayData::ExtraTextDisplayData(TESBoundObject* a_baseObject, float a_temperFactor) :
BSExtraData(),
displayName(""),
displayNameText(nullptr),
ownerQuest(nullptr),
ownerInstance(DisplayDataType::kUninitialized),
temperFactor(1.0F),
customNameLength(0),
pad32(0),
pad34(0)
{
//REL::Offset<std::uintptr_t> vtbl = REL::ID(229625);
REL::Offset<std::uintptr_t> vtbl = 0x15A3E30;
((std::uintptr_t*)this)[0] = vtbl.GetAddress();
GetDisplayName(a_baseObject, a_temperFactor);
}
ExtraDataType ExtraTextDisplayData::GetType() const
{
return ExtraDataType::kTextDisplayData;
}
const char* ExtraTextDisplayData::GetDisplayName(TESBoundObject* a_baseObject, float a_temperFactor)
{
using func_t = decltype(&ExtraTextDisplayData::GetDisplayName);
//REL::Offset<func_t> func = REL::ID(12626);
REL::Offset<func_t> func = 0x014D130;
return func(this, a_baseObject, a_temperFactor);
}
bool ExtraTextDisplayData::IsPlayerSet() const
{
return ownerInstance == DisplayDataType::kCustomName;
}
void ExtraTextDisplayData::SetName(const char* a_name)
{
if (displayNameText) {
return;
}
displayName = a_name;
customNameLength = static_cast<UInt16>(displayName.length());
ownerInstance = DisplayDataType::kCustomName;
temperFactor = 1.0F;
}
}
| [
"32599957+powerof3@users.noreply.github.com"
] | 32599957+powerof3@users.noreply.github.com |
89c7b18dd07bb4c63dd253b046e64a943211191e | e94e8d8c7ae6be06c82d7e8abdef7f0260ff9ad5 | /234tree/234tree/node.cpp | 288e4e92beff53ec940c503928ba92f5a2cf99db | [] | no_license | KookHoiKim/Sorting | 32c6a1f5ffb98915514ba0b25020d47496967d66 | cb43856bad344855801de99e8110a7b885416413 | refs/heads/master | 2020-04-03T15:43:29.646618 | 2018-11-21T01:53:27 | 2018-11-21T01:53:27 | 155,374,378 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 4,146 | cpp | #include "node.h"
node::node() {}
node::node(int val) {
value[1] = val;
value[SIZE] = 1;
}
node::node(int* val, node** cd) {
value[SIZE] = val[SIZE];
for (int i = 1; i <= val[SIZE]; i++) {
value[i] = val[i];
}
for (int j = 0; j <= val[SIZE]; j++) {
child[j] = cd[j];
}
}
node::~node() {}
void node::getNode(int* val, node** cd) {
for (int i = 0; i < 5; i++) {
value[i] = val[i];
child[i] = cd[i];
}
}
int node::getSize() {
return value[SIZE];
}
int node::getValue(int idx) {
return value[idx];
}
int* node::getValueAll() {
return value;
}
int node::getSizeSilbling() {
return getSibling()->getSize();
/*
if (parent == NULL) {
cout << "parent node doesn't exist" << endl;
return 0;
}
int idx;
for (idx = 0; idx <= parent->value[SIZE]; idx++) {
if (parent->child[idx]->value == value&&idx < parent->value[SIZE])
return parent->child[idx + 1]->getSize();
else
return parent->child[idx - 1]->getSize();
}
return -1;
*/
}
int node::searchValue(int val) {
int idx = 1;
for (; idx <= value[SIZE]; idx++)
if (value[idx] == val) return idx;
return 0;
}
int node::insertValue(int val) {
if (value[SIZE] == 4) {
cout << "no more space to insert" << endl;
return 0;
}
int idx = 1;
for (; idx <= value[SIZE]; idx++)
if (value[idx] >= val) break;
for (int j = value[SIZE]; j >= idx; j--) {
value[j + 1] = value[j];
}
value[idx] = val;
return ++value[SIZE];
}
int node::deleteValue(int val) {
int idx = searchValue(val);
if (!idx) {
cout << "no value in this node" << endl;
return -1;
}
else if (idx == value[SIZE]) {
value[idx] = 0;
return --value[SIZE];
}
else {
for (int i = idx + 1; i <= value[SIZE]; i++)
value[i - 1] = value[i];
value[value[SIZE]] = 0;
return --value[SIZE];
}
return -1;
}
int node::deleteValueIdx(int idx) {
if (idx > value[SIZE] || idx < 0) {
cout << "wrong index" << endl;
return -1;
}
int size = deleteValue(value[idx]);
return size;
}
node* node::split() {
// size property 가 만족하면 split하지 않는다
if (value[SIZE] < 4) {
cout << "this node doesn't violate size property" << endl;
return this;
}
int leftval[5] = { 2, value[1], value[2], };
int rightval[5] = { 1, value[4], };
node* cd1[5] = { child[0], child[1],child[2], };
node* cd2[5] = { child[3],child[4], };
// split 하고 3node와 2node로 분리된 두 자식
node* leftnode = new node;
node* rightnode = new node;
leftnode->getNode(leftval, cd1);
rightnode->getNode(rightval, cd2);
// 부모 노드가 존재한다면
if (parent) {
// 부모 노드가 5노드일 경우 먼저 split을 한다
// propagation이 아님
// 값을 올리기 전부터 5노드인 예외 케이스를 처리하기 위함
if (parent->value[0] == 4)
parent->split();
node* pr = parent;
int idx = pr->insertValue(value[3]);
for (int i = pr->value[SIZE]; i > idx; i--) {
pr->child[i] = pr->child[i - 1];
}
pr->child[idx - 1] = leftnode;
pr->child[idx] = rightnode;
leftnode->parent = pr;
rightnode->parent = pr;
return pr;
}
// 부모 노드가 없을 때
// 즉 이 노드가 root인 상황
for (int i = 4; i > 0; i--) {
if (i == 3) continue;
deleteValueIdx(i);
}
for (int i = 2; i < 5; i++)
child[i] = 0;
child[0] = leftnode;
child[1] = rightnode;
leftnode->parent = this;
rightnode->parent = this;
// split하고 위로 올라간 부모 노드를 반환한다
return this;
}
node* node::getSibling() {
if (parent == NULL) {
cout << "parent node doesn't exist" << endl;
return NULL;
}
int idx;
for (idx = 0; idx <= parent->value[SIZE]; idx++) {
if (parent->child[idx]->value == value && idx < parent->value[SIZE])
return parent->child[idx + 1];
else
return parent->child[idx - 1];
}
return NULL;
}
node* node::getParent() {
return parent;
}
node* node::getChild(int idx) {
return child[idx];
}
node** node::getChildAll() {
return child;
}
node* node::getPredecessor(int val) {
if (getChild(0) == NULL)
return NULL;
node* nd = child[searchValue(val) - 1];
while (1) {
if (nd->getChild(0) == NULL) break;
nd = nd->getChild(nd->getSize());
}
return nd;
} | [
"rlarnrghlapz@gmail.com"
] | rlarnrghlapz@gmail.com |
322462cfca9134c90fd7923c21992ad6c8d56b45 | 75c952df608927b957f7969383d1e7f0f5e71d4e | /Busca/include/Griffon.h | 7ba7f16db74e5d7dddfe9647156e968225912992 | [] | no_license | igmsantos/AIcutter | b281b77d8f28f5172e0bbfa76cad2b349117a2d0 | 4d614c8779a21ccf3831f6da27c4ac97625dfdf6 | refs/heads/master | 2021-01-10T20:49:31.208887 | 2015-08-25T15:35:01 | 2015-08-25T15:35:01 | 41,368,391 | 1 | 1 | null | null | null | null | ISO-8859-1 | C++ | false | false | 1,250 | h | #ifndef GRIFFON_H_
#define GRIFFON_H_
/** TODO
*
* buscaCadernos
* leCadernos
* leCaderno
* analisaLayout
* identificaLinhas
* separaRecortes
* IdentificaRecortes
*
*/
/**
*
* A classe Griffon é responsavel por englobar as funções do ator (usuário) ao realizar as tarefas necessárias
* de identificação de cabeçalhos e recortes (artigos), e identificação dos clientes em que o recorte se refere.
* As tarefas foram divididas em subtarefas de acordo com o fluxo de entrada e saida dos processos nos quais o
* usuário interage com o documento até a obtenção dos recortes identificados:
*
* - Procurar documentos PDF
* - Analisar inicialmente
* - Identificar inicialmente as linhas
* - Aguardar a verificação
* - Separar recortes
* - Identificar recortes
*
*/
class CGriffon;
#include "Cerebro.h"
#include "DocumentoIA.h"
class CGriffon{
public:
CCerebro *cerebro;
CDocumentoIA *documentos;
CGriffon();
CDocumentoIA *buscaDocumentos();
CDocumentoIA *pegaDocumento(char*);
int analisaLayout();
int generalizaLayout();
int identificaLinhas();
CBloco *separaRecortes();
int identificaRecortes();
int Work(char*);
int Work();
};
#endif /*GRIFFON_H_*/
| [
"ivanmunix@gmail.com"
] | ivanmunix@gmail.com |
7fbb6b91b8277188815990b954070751907ddf09 | d9169bed9c9ecad89932b0e05f979f9bb1922c37 | /Part-2/include/file_system_interface.h | 0854b6b6dd9367d604c272519b4665e873454c1c | [] | no_license | Moridi/AP-Spring-98-CA-6-Inheritance | 7d15cb1005a353401c360028e2bdfa2bf3fda7df | 1922206b4c63595f80ae865ca7696560e69249b7 | refs/heads/master | 2020-05-15T03:13:04.869687 | 2019-05-14T11:25:23 | 2019-05-14T11:25:23 | 182,064,437 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 917 | h | #ifndef FILE_SYSTEM_H_
#define FILE_SYSTEM_H_
#include <string>
#include <vector>
#include <memory>
class Element;
class FileSystemInterface
{
public:
typedef std::shared_ptr<Element> ElementSharedPointer;
inline FileSystemInterface();
void add_directory(int id, std::string title, int parent_id);
void add_file(int id, std::string title, std::string content, int parent_id);
void add_link(int id, std::string title, int element_id, int parent_id);
void view(int id);
void add_element(ElementSharedPointer new_element, int parent_id);
inline ElementSharedPointer get_element(int id) const;
inline void check_id_validity(int id) const;
inline void check_parent_id_validity(int id) const;
inline ElementSharedPointer get_linked_element(int element_id) const;
private:
std::vector<ElementSharedPointer> elements;
};
#include "file_system_interface-inl.h"
#endif | [
"m.moridi.2009@gmail.com"
] | m.moridi.2009@gmail.com |
755371f7155df1fe5940933b1e2b2f32a54d626a | 2c642ac5e22d15055ebf54936898a8f542e24f14 | /Example/Pods/Headers/Public/boost/boost/container/flat_map.hpp | 8e441b3d3439ee1422da0f7fa696fd2cfb772e6f | [
"Apache-2.0"
] | permissive | TheClimateCorporation/geofeatures-ios | 488d95084806f69fb6e42d7d0da73bb2f818f19e | cf6a5c4eb2918bb5f3dcd0898501d52d92de7b1f | refs/heads/master | 2020-04-15T05:34:06.491186 | 2015-08-14T20:28:31 | 2015-08-14T20:28:31 | 40,622,132 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 61 | hpp | ../../../../../boost/Pod/Classes/boost/container/flat_map.hpp | [
"tony@mobilegridinc.com"
] | tony@mobilegridinc.com |
0aa8d2d589ee89357104b9cb63600e370bf3e445 | dd07992b73261436174e493ba6bf9cdd46d3297a | /src/nxdraw/NxDIBImageSaver.cpp | 19dc8e43ddfb1c00339c83a2538cc6be02dd1c9d | [
"Apache-2.0"
] | permissive | doyaGu/nxlib | d898473ef5c9357cdbcf1acc3c400dcfe7c179ff | bfb07fc7357e80e40f0a4678fd295e3ef9de1c0a | refs/heads/master | 2022-04-08T14:05:00.387618 | 2020-03-05T02:39:37 | 2020-03-05T02:39:37 | null | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 2,227 | cpp | // NxDIBImageSaver.cpp: CNxDIBImageSaver クラスのインプリメンテーション
// Copyright(c) 2000 S.Ainoguchi
//
// 概要: 画像(CNxDIBImage) の保存を行う為のプロトコルクラス
//
//////////////////////////////////////////////////////////////////////
#include "NxDraw.h"
#include <NxStorage/NxStorage.h>
#include <NxStorage/NxFile.h>
#include "NxDIBImageSaver.h"
#include "NxDIBImage.h"
//////////////////////////////////////////////////////////////////////
// public:
// CNxDIBImageSaver::CNxDIBImageSaver()
// 概要: CNxDIBImageSaver クラスのデフォルトコンストラクタ
// 引数: なし
// 戻値: なし
//////////////////////////////////////////////////////////////////////
CNxDIBImageSaver::CNxDIBImageSaver()
{
}
//////////////////////////////////////////////////////////////////////
// public:
// virtual CNxDIBImageSaver::~CNxDIBImageSaver()
// 概要: CNxDIBImageSaver クラスのデストラクタ
// 引数: なし
// 戻値: なし
//////////////////////////////////////////////////////////////////////
CNxDIBImageSaver::~CNxDIBImageSaver()
{
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// public:
// virtual BOOL CNxImageHandler::SaveDIBImage(CNxFile& nxfile, const CNxDIBImage& srcDIBImage,
// const RECT* lpRect = NULL) const = 0
// 概要: CNxDIBImage オブジェクトの内容をファイルへ保存
// 引数: CNxFile& nxfile ... 保存先 CNxFile オブジェクトへの参照
// const CNxDIBImage& srcDIBImage ... 保存される CNxDIBImage オブジェクトへの参照
// const RECT* lpRect ... 保存矩形(NULL ならば全体)
// 戻値: 成功ならば TRUE
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
BOOL CNxDIBImageSaver::SaveDIBImage(CNxFile& nxfile, const CNxDIBImage& /*srcDIBImage*/, const RECT* /*lpRect*/) const
{
if (!nxfile.IsOpen())
{
_RPTF0(_CRT_ASSERT, "CNxSurface::SaveBitmapFile() : ファイルは開かれていません.\n");
return FALSE;
}
return TRUE;
}
| [
"noreply@github.com"
] | doyaGu.noreply@github.com |
96cb419b2c776ee59933338c05d72172917d09ce | 914a83057719d6b9276b1a0ec4f9c66fea064276 | /test/cpp/accumulator/accum_lazy0.cpp | 52750f426feb2e461de7f8746989baa2e2b16701 | [
"BSD-2-Clause"
] | permissive | jjwilke/hclib | e8970675bf49f89c1e5e2120b06387d0b14b6645 | 5c57408ac009386702e9b96ec2401da0e8369dbe | refs/heads/master | 2020-03-31T19:38:28.239603 | 2018-12-21T20:29:44 | 2018-12-21T20:29:44 | 152,505,070 | 0 | 0 | Apache-2.0 | 2018-10-11T00:02:52 | 2018-10-11T00:02:51 | null | UTF-8 | C++ | false | false | 2,683 | cpp | /* Copyright (c) 2013, Rice University
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
3. Neither the name of Rice University
nor the names of its contributors may be used to endorse or
promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* DESC: Recursive accumulator
*/
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "hclib_cpp.h"
int ran = 0;
void async_fct(void * arg) {
printf("Running Async\n");
ran = 1;
}
void accum_create_n(accum_t ** accums, int n) {
int i = 0;
while(i < n) {
accums[i] = accum_create_int(ACCUM_OP_PLUS, ACCUM_MODE_LAZY, 0);
i++;
}
}
void accum_destroy_n(accum_t ** accums, int n) {
int i = 0;
while(i < n) {
accum_destroy(accums[i]);
i++;
}
}
void accum_print_n(accum_t ** accums, int n) {
int i = 0;
while(i < n) {
int res = accum_get_int(accums[i]);
printf("Hello[%d] = %d\n", i, res);
i++;
}
}
int main (int argc, char ** argv) {
hclib_init(&argc, argv);
int n = 10;
accum_t * accums_s[n];
accum_t ** accums = (accum_t **) accums_s;
accum_create_n(accums, n);
start_finish();
accum_register(accums, n);
accum_put_int(accums[3], 2);
accum_put_int(accums[4], 2);
accum_put_int(accums[5], 2);
end_finish();
accum_print_n(accums, n);
accum_destroy_n(accums, n);
hclib_finalize();
return 0;
}
| [
"jmaxg3@gmail.com"
] | jmaxg3@gmail.com |
1432004e909b981c63d8660a4c74696ec914f0eb | a495da70ed1f0450059f83e6163b9c011f3e3798 | /csUtil/src-Core/include/cs/Core/Endian.h | 44444c62e4ff111d7654747cefbf74835ba601fc | [] | no_license | CaSchmidt/csUtil | 20e58545edb09d5fdab55eb097d4b4c9e254ca53 | 9b8f1d5bbfd578f1f11d2e34eb94ddde2b3f3ae8 | refs/heads/master | 2023-08-18T06:35:21.274808 | 2023-08-09T18:50:54 | 2023-08-09T18:50:54 | 151,853,593 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,751 | h | /****************************************************************************
** Copyright (c) 2016, Carsten Schmidt. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
**
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
**
** 3. Neither the name of the copyright holder nor the names of its
** contributors may be used to endorse or promote products derived from
** this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#pragma once
#ifdef _MSC_VER
# include <cstdlib>
#endif
#include <bit>
#include <cs/Core/TypeTraits.h>
namespace cs {
template<typename T>
using is_swappable = std::bool_constant<
is_char_v<T> ||
is_integral_v<T> ||
is_real_v<T>
>;
template<typename T>
inline constexpr bool is_swappable_v = is_swappable<T>::value;
template<typename T>
concept IsSwappable = is_swappable_v<T>;
// Implementation //////////////////////////////////////////////////////////
namespace impl_endian {
#if defined(_MSC_VER)
inline uint16_t impl_swap(const uint16_t& value)
{
return _byteswap_ushort(value);
}
inline uint32_t impl_swap(const uint32_t& value)
{
return _byteswap_ulong(value);
}
inline uint64_t impl_swap(const uint64_t& value)
{
return _byteswap_uint64(value);
}
#elif defined(__GNUC__)
inline uint16_t impl_swap(const uint16_t& value)
{
return __builtin_bswap16(value);
}
inline uint32_t impl_swap(const uint32_t& value)
{
return __builtin_bswap32(value);
}
inline uint64_t impl_swap(const uint64_t& value)
{
return __builtin_bswap64(value);
}
#else
# error Compiler not supported!
#endif
template<typename T>
inline T do_swap(const T& value)
{
using S = typename IntegralOfSize<sizeof(T)>::unsigned_type;
const S swapped = impl_swap(*reinterpret_cast<const S*>(&value));
return *reinterpret_cast<const T*>(&swapped);
}
template<bool SWAP, typename T>
constexpr std::enable_if_t<SWAP,T> dispatch(const T& value)
{
return do_swap<T>(value);
}
template<bool SWAP, typename T>
constexpr std::enable_if_t<!SWAP,T> dispatch(const T& value)
{
return value;
}
} // namespace impl_endian
// User Interface //////////////////////////////////////////////////////////
template<bool SWAP, typename T> requires IsSwappable<T>
constexpr T copy(const T& value)
{
return impl_endian::dispatch<SWAP && sizeof(T) >= 2,T>(value);
}
template<typename T> requires IsSwappable<T>
constexpr T swap(const T& value)
{
return impl_endian::dispatch<sizeof(T) >= 2,T>(value);
}
/*
* Convert endianness between host byte order and 'peer' byte order.
*/
template<typename T> requires IsSwappable<T>
constexpr T fromBigEndian(const T& peerValue)
{
return copy<std::endian::native != std::endian::big>(peerValue);
}
template<typename T> requires IsSwappable<T>
constexpr T fromLittleEndian(const T& peerValue)
{
return copy<std::endian::native != std::endian::little>(peerValue);
}
template<typename T> requires IsSwappable<T>
constexpr T toBigEndian(const T& hostValue)
{
return copy<std::endian::native != std::endian::big>(hostValue);
}
template<typename T> requires IsSwappable<T>
constexpr T toLittleEndian(const T& hostValue)
{
return copy<std::endian::native != std::endian::little>(hostValue);
}
} // namespace cs
| [
"CaSchmidt@users.noreply.github.com"
] | CaSchmidt@users.noreply.github.com |
afa27aac4fe5729d7addff9efcc6f44c5d70ec75 | b82d54e98101e2cd6278ef014fe97b2b2e10a181 | /grid.h | b08704a13e498e4c2d5ae2a8cdf97e98f2c8730f | [
"MIT"
] | permissive | binarydream01/reversAI | ebf192e219b4e1a5ce5f431a7d723226e8c8646e | 1e990605aa99c0596910e227625ad418f06e497d | refs/heads/master | 2021-01-18T21:42:42.067287 | 2017-04-03T01:40:28 | 2017-04-03T01:40:28 | 87,020,094 | 0 | 0 | null | 2017-04-02T22:23:26 | 2017-04-02T22:23:26 | null | UTF-8 | C++ | false | false | 839 | h | //Name: Tobias Hughes
//Purpose: An abstract representation of the reversi game board. Is an 8x8 grid
//that can be one of three states, E, W, B which represent 'empty',
//'white', and 'black'
//Date: 3/22/17
#ifndef GRID_H
#define GRID_H
#include <string>
using namespace std;
#define GRID_SIZE 64
class grid{
private:
char board[GRID_SIZE];
char turn;
char turn_char[2];
bool checkRight(int);
bool checkLeft(int);
bool checkUp(int);
bool checkDown(int);
bool checkNE(int);
bool checkNW(int);
bool checkSE(int);
bool checkSW(int);
public:
grid();
grid(const grid&);
char getState(string);
void setState(string);
void setTurn(char);
int boardIndex(string);
unsigned char checkBound(int);
bool goalState();
};
#endif
| [
"tobywhughes@gmail.com"
] | tobywhughes@gmail.com |
6b4f39fca4ae3bd2667ce60c26ddd692b5235f66 | 4432c7fad4af2925a0b3dd26c5236d1c22997551 | /src/main/interpreted_vm.h | 78590199bf3143a281540a9ee2e1d6622cf0bfda | [] | no_license | gitter-badger/otherside | 53025be2b0c985451ec5977641375aebc1c49283 | 5178b934a110a41bcdddfb74a154e1eff44e34e6 | refs/heads/master | 2021-01-16T20:51:35.674343 | 2015-08-03T12:47:00 | 2015-08-03T12:47:00 | 40,125,819 | 0 | 0 | null | 2015-08-03T13:19:52 | 2015-08-03T13:19:51 | null | UTF-8 | C++ | false | false | 1,524 | h | #pragma once
#include "vm.h"
#include <memory>
#include <vector>
#include "parser_definitions.h"
struct Function;
class InterpretedVM : public VM {
private:
Program& prog;
Environment& env;
std::map<uint32, uint32> TypeByteSizes;
std::vector<std::unique_ptr<byte>> VmMemory;
byte* VmAlloc(uint32 typeId) override;
Value TextureSample(Value sampler, Value coord, Value bias, uint32 resultTypeId);
uint32 Execute(Function* func);
void * ReadVariable(uint32 id) const;
bool SetVariable(uint32 id, void * value);
bool InitializeConstants();
void ImportExt(SExtInstImport import);
public:
InterpretedVM(Program& prog, Environment& env) : prog(prog), env(env) {
for (auto& ext : prog.ExtensionImports) {
ImportExt(ext.second);
}
}
virtual bool Run() override;
bool SetVariable(std::string name, void * value) override;
void * ReadVariable(std::string name) const override;
Value VmInit(uint32 typeId, void * val) override;
Value Dereference(Value val) const override;
Value IndexMemberValue(Value val, uint32 index) const override;
Value IndexMemberValue(uint32 typeId, byte * val, uint32 index) const override;
uint32 GetTypeByteSize(uint32 typeId) const override;
byte * GetPointerInComposite(uint32 typeId, byte * composite, uint32 indexCount, uint32 * indices, uint32 currLevel) const override;
SOp GetType(uint32 typeId) const override;
bool IsVectorType(uint32 typeId) const override;
uint32 ElementCount(uint32 typeId) const override;
}; | [
"dario.seyb@gmail.com"
] | dario.seyb@gmail.com |
837d4550a31dc6aeb97aa44a29c00ba4ddc2427a | 74c1a55594ac409d505a96eb57a3ce02c2dd7d93 | /leetcode/remove-duplicates-from-sorted-array/Accepted/5-11-2021, 9:16:37 PM/Solution.cpp | f89776ca8d6eb86f4c19ee78ee13850342ddb1db | [] | no_license | jungsu-kwon/ps-records | f9f201791c7a56b012d370569aba9eb1c5cb03a5 | cc909a871a0a72ce0a1c31586e9e65f969900a7b | refs/heads/master | 2023-06-28T20:52:43.492100 | 2021-08-06T04:45:21 | 2021-08-06T04:45:21 | 392,259,235 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 563 | cpp | // https://leetcode.com/problems/remove-duplicates-from-sorted-array
class Solution {
public:
int removeDuplicates(vector<int>& nums)
{
if (nums.size()<=1) return nums.size();
int write_ind = 0, read_ind = 0;
int cur = nums[0] - 1;
while (read_ind != nums.size())
{
cur = nums[read_ind];
nums[write_ind] = cur;
while (read_ind != nums.size() && cur == nums[read_ind])
read_ind++;
write_ind++;
}
return write_ind;
}
}; | [
"git@jungsu.io"
] | git@jungsu.io |
70f0e2dfac6172c3de53b93b6adca04cebb030d6 | d4faf4a70781a661ef6a1ef35f106dfee5f60bb0 | /ConsoleApplication1/src/game_object.h | b710ab4990c8696ae5aff79437ff16942b19b813 | [] | no_license | zqztxdi/Opengl_game | ee9b3da084b18ce7330d30dbc8f7a1a01520fac8 | b7131937d41bc5396d5014fb0d777fcd00c0f979 | refs/heads/master | 2022-11-16T19:50:33.288653 | 2020-07-11T10:28:11 | 2020-07-11T10:28:11 | 278,837,677 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 791 | h | #pragma once
#ifndef GAMEOBJECT_H
#define GAMEOBJECT_H
#include <GL/glew.h>
#include <glm/glm.hpp>
#include "texture.h"
#include "sprite_renderer.h"
// Container object for holding all state relevant for a single
// game object entity. Each object in the game likely needs the
// minimal of state as described within GameObject.
class GameObject
{
public:
// Object state
glm::vec2 Position, Size, Velocity;
glm::vec3 Color;
GLfloat Rotation;
GLboolean IsSolid;
GLboolean Destroyed;
// Render state
Texture2D Sprite;
// Constructor(s)
GameObject();
GameObject(glm::vec2 pos, glm::vec2 size, Texture2D sprite, glm::vec3 color = glm::vec3(1.0f), glm::vec2 velocity = glm::vec2(0.0f, 0.0f));
// Draw sprite
virtual void Draw(SpriteRenderer &renderer);
};
#endif | [
"1139266767@qq.com"
] | 1139266767@qq.com |
cb2e6879706cf1c56bc33ee8877ed809dae40206 | f776316d0a7c44e887feaa675f030f27da2d022b | /4490/proj2/Parser.h | 25f8ad9de98c1a07a86cf3fbff4ebaa0578dabb0 | [] | no_license | taxilian/old_cs_vm | 647246e16e7d695833c5dc69b2c06eb9af24a739 | a83142afa8d52eb07c0a6d30ff57ffa7dbbc30de | refs/heads/master | 2016-09-06T16:45:12.267205 | 2011-04-27T19:03:20 | 2011-04-27T19:03:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,674 | h | /**
* Parser.h
*
* Richard Bateman
* Virtual Machine Assembly parser
*/
#pragma once
#ifndef H_PARSER
#define H_PARSER
#include <string>
#include <vector>
#include <fstream>
#include <deque>
#include <boost/shared_ptr.hpp>
#include <boost/tokenizer.hpp>
#include "VMConfig.h"
typedef boost::tokenizer< boost::escaped_list_separator<char> > Tokenizer;
struct ParserException : std::exception
{
ParserException(const std::string& error)
: m_error(error)
{ }
~ParserException() throw() { }
virtual const char* what() const throw() {
return m_error.c_str();
}
std::string m_error;
};
class Parser
{
public:
struct Line {
virtual ~Line() { };
std::string label;
};
struct Byte : public Line {
unsigned char value;
};
struct Int : public Line {
int value;
};
struct Instruction : public Line {
std::string name;
std::vector<std::string> args;
};
typedef boost::shared_ptr<Line> LinePtr;
typedef boost::shared_ptr<Byte> BytePtr;
typedef boost::shared_ptr<Int> IntPtr;
typedef boost::shared_ptr<Instruction> InstructionPtr;
public:
Parser(std::string filename, VMConfigPtr config);
~Parser(void);
protected:
std::string sanitizeString(const std::string &str);
std::vector<std::string> split(const std::string &str, const char *tokens);
public:
void processFile();
LinePtr getNextLine();
std::streamsize getLineNumber() { return m_lineNumber; }
protected:
std::streamsize m_lineNumber;
std::ifstream m_file;
std::deque<LinePtr> m_queue;
VMConfigPtr m_config;
bool end;
};
#endif
| [
"taxilian@gmail.com"
] | taxilian@gmail.com |
323a8905e4929c45c8844048e65e5d53c80afaa3 | 09c19d3cc73fc8040451ea395d127009016041e2 | /check.cpp | 62ad1371b978fe62afff00046188f562bc0a2dcb | [] | no_license | imkalyan/KthSmallestelement | 5b722e9c046ecf1afd6fef7032396065ebd7091f | db563f0e9510b9267858f14eafb4108f56d52407 | refs/heads/master | 2021-07-18T21:23:01.889601 | 2017-10-29T10:06:30 | 2017-10-29T10:06:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,583 | cpp | #include<iostream>
#include<algorithm>
#include<climits>
#include<stdio.h>
void swap(int *a,int *b)
{
int l=*a;
*a=*b;
*b=l;
}
int partition(int arr[], int l, int r, int k);
int findMedian(int arr[], int n)
{
sort(arr, arr+n);
return arr[n/2];
}
int kthSmallest(int arr[], int l, int r, int k)
{
if (k > 0 && k <= r - l + 1)
{
int n = r-l+1;
int i, median[(n+4)/5];
for (i=0; i<n/5; i++)
median[i] = findMedian(arr+l+i*5, 5);
if (i*5 < n)
{
median[i] = findMedian(arr+l+i*5, n%5);
i++;
}
int medOfMed = (i == 1)? median[i-1]: kthSmallest(median, 0, i-1, i/2);
int pos = partition(arr, l, r, medOfMed);
if (pos-l == k-1)
return arr[pos];
if (pos-l > k-1)
return kthSmallest(arr, l, pos-1, k);
return kthSmallest(arr, pos+1, r, k-pos+l-1);
}
return INT_MAX;
}
int partition(int arr[], int l, int r, int x)
{
int i;
for (i=l; i<r; i++)
if (arr[i] == x)
break;
swap(&arr[i], &arr[r]);
i = l;
for (int j = l; j <= r - 1; j++)
{
if (arr[j] <= x)
{
swap(&arr[i], &arr[j]);
i++;
}
}
swap(&arr[i], &arr[r]);
return i;
}
int main()
{
int a[100][100],n,t[100],k;
//t[100] = {1,5,2,6,8,9,4,7,3,10,13,11,14};
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&t[i]);
scanf("%d",&k);
int z=kthSmallest(t,0,n-1,k-1);
printf("%d",z);
return 0;
}
| [
"noreply@github.com"
] | imkalyan.noreply@github.com |
95bd8196713248910ebb7a4be055fb36d21b554e | de0b00d9d18c7b7776ceee1163ab1b07b9e80ec8 | /Level 5_Inheritance_Generalisation_Specialisation/Section 3_5/Exercise 1/Exercise1/Point.cpp | a45dd4c808d5da47d454a2b01e961d37b3f72efd | [] | no_license | FinancialEngineerLab/quantnet-baruch-certificate-cpp | e4187dcc74d1c0521f5f071f980b4be274448f35 | 4f555a76f196fb392189574be23223350a317960 | refs/heads/master | 2023-03-15T16:13:07.671250 | 2016-10-20T05:19:58 | 2016-10-20T05:19:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,267 | cpp | // Point.cpp
// Function implementation for the functions in the header file Point.hpp(Point classs with x- and y- coordinates.)
// Implementation of added operators to the Point class.
#include "Point.hpp"
#include <cmath>
#include <sstream>
#
using namespace std;
namespace Shihan {
namespace CAD {
// Default constructor
Point::Point(): Shape(), m_x(0), m_y(0) // Initializing data members and calling base class at the same time.
{
}
// Initialize using newx and newy ; Calling the base class
Point::Point(double newx, double newy) : Shape(), m_x(newx),m_y(newy)
{
}
// Copy constructor
Point::Point(const Point& source) :Shape(source), m_x(source.m_x),m_y(source.m_y)
{
}
// Destructor
Point::~Point()
{
}
// Getter function for coordinate x.
double Point::X() const
{
return m_x;
}
//Setter function for coordinate x.
void Point::X(double newX)
{
m_x = newX;
}
// Getter function for coordinate y.
double Point::Y() const
{
return m_y;
}
//Setter function for coordinate y.
void Point::Y(double newY)
{
m_y = newY;
}
// Returns a string description of the point.
std::string Point::ToString() const
{
std::stringstream sm_x, sm_y;
sm_x << m_x;
sm_y << m_y;
std::string str;
str = "\"Point("+sm_x.str()+","+sm_y.str()+")\"";
return str;
}
//Calculate the distance to the origin (0,0).
double Point::Distance() const // DistanceOrigin() is changed to Distance().
{
double dist_to_origin;
dist_to_origin = sqrt(pow((m_x- 0),2) + pow((m_y- 0),2)); //sqrt returns only positive sqrt value. I didn't consider abs value.
return dist_to_origin;
}
// Calculate the distance between two given points.
// Distance function will be implemented by passing the argument as a "const reference". Therefore at this occasion copy constructor will not be
//called.
double Point::Distance(const Point& p) const
{
double dist_to_point;
dist_to_point = sqrt(pow((m_x- p.X()),2) + pow((m_y- p.Y()),2));//sqrt returns only positive sqrt value. I didn't consider abs value.
return dist_to_point;
}
/* Implementation of added operators to the Point class. */
//Negate the coordinates operator
Point Point::operator - () const
{
return Point(-m_x,-m_y);
}
//Scale the coordinates operator
Point Point::operator * (double factor) const
{
return Point(factor*m_x, factor*m_y);
}
//Add coordinates operator
Point Point::operator + (const Point& p) const
{
return Point(m_x + p.m_x, m_y + p.m_y);
}
//Equally compare operator
bool Point::operator== (const Point& P) const
{
return (m_x == P.m_x && m_y == P.m_y );
}
//Assignment operator
Point& Point::operator = (const Point& source)
{
// Avoid doing assign to myself
if (this == &source)
return *this;
Shape::operator =(source);
m_x = source.m_x;
m_y = source.m_y;
//std:: cout <<"I am the Assignment operator for the Point class \n "<< endl;
return *this;
}
//Scale the coordinates and assign
Point& Point::operator *= (double factor)
{
(*this).m_x= (*this).m_x * factor;
(*this).m_y= (*this).m_y * factor;
return *this;
}
}
}
// Global function to send a point directlry to the cout object.
std::ostream& operator << (ostream& os_P, const Shihan::CAD::Point& P)
{
os_P << P.ToString()<<endl;
return os_P;
}
| [
"shihanutb@gmail.com"
] | shihanutb@gmail.com |
37607c873e8f01e35a33a9d53472d130ddd8f6d5 | 6059ef7bc48ab49c938f075dc5210a19ec08538e | /src/plugins/poshuku/plugins/webkitview/settingsglobalhandler.cpp | 023c6b2f77f26edbeed138271583ff391d2779ff | [
"BSL-1.0"
] | permissive | Laura-lc/leechcraft | 92b40aff06af9667aca9edd0489407ffc22db116 | 8cd066ad6a6ae5ee947919a97b2a4dc96ff00742 | refs/heads/master | 2021-01-13T19:34:09.767365 | 2020-01-11T15:25:31 | 2020-01-11T15:25:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,011 | cpp | /**********************************************************************
* LeechCraft - modular cross-platform feature rich internet client.
* Copyright (C) 2006-2014 Georg Rudoy
*
* Boost Software License - Version 1.0 - August 17th, 2003
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
**********************************************************************/
#include "settingsglobalhandler.h"
#include <QtDebug>
#include <qwebsettings.h>
#include "xmlsettingsmanager.h"
namespace LC
{
namespace Poshuku
{
namespace WebKitView
{
SettingsGlobalHandler::SettingsGlobalHandler (QObject *parent)
: QObject { parent }
{
XmlSettingsManager::Instance ().RegisterObject ({
"MaximumPagesInCache",
"MinDeadCapacity",
"MaxDeadCapacity",
"TotalCapacity",
"OfflineStorageQuota"
},
this, "cacheSettingsChanged");
cacheSettingsChanged ();
}
void SettingsGlobalHandler::cacheSettingsChanged ()
{
auto& xsm = XmlSettingsManager::Instance ();
QWebSettings::setMaximumPagesInCache (xsm.property ("MaximumPagesInCache").toInt ());
auto megs = [&xsm] (const char *prop) { return xsm.property (prop).toDouble () * 1024 * 1024; };
QWebSettings::setObjectCacheCapacities (megs ("MinDeadCapacity"),
megs ("MaxDeadCapacity"),
megs ("TotalCapacity"));
QWebSettings::setOfflineStorageDefaultQuota (xsm.property ("OfflineStorageQuota").toInt () * 1024);
}
void SettingsGlobalHandler::handleSettingsClicked (const QString& name)
{
if (name == "ClearIconDatabase")
QWebSettings::clearIconDatabase ();
else if (name == "ClearMemoryCaches")
QWebSettings::clearMemoryCaches ();
else
qWarning () << Q_FUNC_INFO
<< "unknown button"
<< name;
}
}
}
}
| [
"0xd34df00d@gmail.com"
] | 0xd34df00d@gmail.com |
97ac5d0a0df6c589fc5552cf2c7f44baad4dcf25 | 14ce01a6f9199d39e28d036e066d99cfb3e3f211 | /Cpp/SDK/BP_USCG_MediumSkiff_Debris_LeftRear_Minion_classes.h | 711e67a9bfeb828ca98286884b5155be4f3c385b | [] | no_license | zH4x-SDK/zManEater-SDK | 73f14dd8f758bb7eac649f0c66ce29f9974189b7 | d040c05a93c0935d8052dd3827c2ef91c128bce7 | refs/heads/main | 2023-07-19T04:54:51.672951 | 2021-08-27T13:47:27 | 2021-08-27T13:47:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 922 | h | #pragma once
// Name: ManEater, Version: 1.0.0
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass BP_USCG_MediumSkiff_Debris_LeftRear_Minion.BP_USCG_MediumSkiff_Debris_LeftRear_Minion_C
// 0x0000 (FullSize[0x0230] - InheritedSize[0x0230])
class ABP_USCG_MediumSkiff_Debris_LeftRear_Minion_C : public ABP_VehicleDebris_C
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass BP_USCG_MediumSkiff_Debris_LeftRear_Minion.BP_USCG_MediumSkiff_Debris_LeftRear_Minion_C");
return ptr;
}
int GetSizeLevel(class AME_AnimalCharacter* GrabbingAnimal);
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"zp2kshield@gmail.com"
] | zp2kshield@gmail.com |
48ffa973b301c5db19996611da5709082d75230f | cbb120e86051a2ffa2368f4fa147d9172a3d7a05 | /src/miner.cpp | 85aac1480ec5445f46b56ee6e1d9511b830435f7 | [
"MIT"
] | permissive | forexcoins/Forexcoin | f08249d699b3a0e3a5ab00e820bd1c73f7bea0ce | bce90c0f4cf392b54400a58c93bde29b2741e97d | refs/heads/master | 2021-01-10T11:46:12.311526 | 2016-02-26T09:56:59 | 2016-02-26T09:56:59 | 52,595,250 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 19,937 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2013 The NovaCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "txdb.h"
#include "miner.h"
#include "kernel.h"
using namespace std;
//////////////////////////////////////////////////////////////////////////////
//
// BitcoinMiner
//
extern unsigned int nMinerSleep;
int static FormatHashBlocks(void* pbuffer, unsigned int len)
{
unsigned char* pdata = (unsigned char*)pbuffer;
unsigned int blocks = 1 + ((len + 8) / 64);
unsigned char* pend = pdata + 64 * blocks;
memset(pdata + len, 0, 64 * blocks - len);
pdata[len] = 0x80;
unsigned int bits = len * 8;
pend[-1] = (bits >> 0) & 0xff;
pend[-2] = (bits >> 8) & 0xff;
pend[-3] = (bits >> 16) & 0xff;
pend[-4] = (bits >> 24) & 0xff;
return blocks;
}
static const unsigned int pSHA256InitState[8] =
{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
void SHA256Transform(void* pstate, void* pinput, const void* pinit)
{
SHA256_CTX ctx;
unsigned char data[64];
SHA256_Init(&ctx);
for (int i = 0; i < 16; i++)
((uint32_t*)data)[i] = ByteReverse(((uint32_t*)pinput)[i]);
for (int i = 0; i < 8; i++)
ctx.h[i] = ((uint32_t*)pinit)[i];
SHA256_Update(&ctx, data, sizeof(data));
for (int i = 0; i < 8; i++)
((uint32_t*)pstate)[i] = ctx.h[i];
}
// Some explaining would be appreciated
class COrphan
{
public:
CTransaction* ptx;
set<uint256> setDependsOn;
double dPriority;
double dFeePerKb;
COrphan(CTransaction* ptxIn)
{
ptx = ptxIn;
dPriority = dFeePerKb = 0;
}
void print() const
{
printf("COrphan(hash=%s, dPriority=%.1f, dFeePerKb=%.1f)\n",
ptx->GetHash().ToString().substr(0,10).c_str(), dPriority, dFeePerKb);
BOOST_FOREACH(uint256 hash, setDependsOn)
printf(" setDependsOn %s\n", hash.ToString().substr(0,10).c_str());
}
};
uint64_t nLastBlockTx = 0;
uint64_t nLastBlockSize = 0;
int64_t nLastCoinStakeSearchInterval = 0;
// We want to sort transactions by priority and fee, so:
typedef boost::tuple<double, double, CTransaction*> TxPriority;
class TxPriorityCompare
{
bool byFee;
public:
TxPriorityCompare(bool _byFee) : byFee(_byFee) { }
bool operator()(const TxPriority& a, const TxPriority& b)
{
if (byFee)
{
if (a.get<1>() == b.get<1>())
return a.get<0>() < b.get<0>();
return a.get<1>() < b.get<1>();
}
else
{
if (a.get<0>() == b.get<0>())
return a.get<1>() < b.get<1>();
return a.get<0>() < b.get<0>();
}
}
};
// CreateNewBlock: create new block (without proof-of-work/proof-of-stake)
CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake, int64_t* pFees)
{
// Create new block
auto_ptr<CBlock> pblock(new CBlock());
if (!pblock.get())
return NULL;
CBlockIndex* pindexPrev = pindexBest;
// Create coinbase tx
CTransaction txNew;
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
txNew.vout.resize(1);
if (!fProofOfStake)
{
CReserveKey reservekey(pwallet);
CPubKey pubkey;
if (!reservekey.GetReservedKey(pubkey))
return NULL;
txNew.vout[0].scriptPubKey.SetDestination(pubkey.GetID());
}
else
{
// Height first in coinbase required for block.version=2
txNew.vin[0].scriptSig = (CScript() << pindexPrev->nHeight+1) + COINBASE_FLAGS;
assert(txNew.vin[0].scriptSig.size() <= 100);
txNew.vout[0].SetEmpty();
}
// Add our coinbase tx as first transaction
pblock->vtx.push_back(txNew);
// Largest block you're willing to create:
unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE_GEN/2);
// Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity:
nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize));
// How much of the block should be dedicated to high-priority transactions,
// included regardless of the fees they pay
unsigned int nBlockPrioritySize = GetArg("-blockprioritysize", 27000);
nBlockPrioritySize = std::min(nBlockMaxSize, nBlockPrioritySize);
// Minimum block size you want to create; block will be filled with free transactions
// until there are no more or the block reaches this size:
unsigned int nBlockMinSize = GetArg("-blockminsize", 0);
nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize);
// Fee-per-kilobyte amount considered the same as "free"
// Be careful setting this: if you set it to zero then
// a transaction spammer can cheaply fill blocks using
// 1-satoshi-fee transactions. It should be set above the real
// cost to you of processing a transaction.
int64_t nMinTxFee = MIN_TX_FEE;
if (mapArgs.count("-mintxfee"))
ParseMoney(mapArgs["-mintxfee"], nMinTxFee);
pblock->nBits = GetNextTargetRequired(pindexPrev, fProofOfStake);
// Collect memory pool transactions into the block
int64_t nFees = 0;
{
LOCK2(cs_main, mempool.cs);
CTxDB txdb("r");
// Priority order to process transactions
list<COrphan> vOrphan; // list memory doesn't move
map<uint256, vector<COrphan*> > mapDependers;
// This vector will be sorted into a priority queue:
vector<TxPriority> vecPriority;
vecPriority.reserve(mempool.mapTx.size());
for (map<uint256, CTransaction>::iterator mi = mempool.mapTx.begin(); mi != mempool.mapTx.end(); ++mi)
{
CTransaction& tx = (*mi).second;
if (tx.IsCoinBase() || tx.IsCoinStake() || !tx.IsFinal())
continue;
COrphan* porphan = NULL;
double dPriority = 0;
int64_t nTotalIn = 0;
bool fMissingInputs = false;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
// Read prev transaction
CTransaction txPrev;
CTxIndex txindex;
if (!txPrev.ReadFromDisk(txdb, txin.prevout, txindex))
{
// This should never happen; all transactions in the memory
// pool should connect to either transactions in the chain
// or other transactions in the memory pool.
if (!mempool.mapTx.count(txin.prevout.hash))
{
printf("ERROR: mempool transaction missing input\n");
if (fDebug) assert("mempool transaction missing input" == 0);
fMissingInputs = true;
if (porphan)
vOrphan.pop_back();
break;
}
// Has to wait for dependencies
if (!porphan)
{
// Use list for automatic deletion
vOrphan.push_back(COrphan(&tx));
porphan = &vOrphan.back();
}
mapDependers[txin.prevout.hash].push_back(porphan);
porphan->setDependsOn.insert(txin.prevout.hash);
nTotalIn += mempool.mapTx[txin.prevout.hash].vout[txin.prevout.n].nValue;
continue;
}
int64_t nValueIn = txPrev.vout[txin.prevout.n].nValue;
nTotalIn += nValueIn;
int nConf = txindex.GetDepthInMainChain();
dPriority += (double)nValueIn * nConf;
}
if (fMissingInputs) continue;
// Priority is sum(valuein * age) / txsize
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
dPriority /= nTxSize;
// This is a more accurate fee-per-kilobyte than is used by the client code, because the
// client code rounds up the size to the nearest 1K. That's good, because it gives an
// incentive to create smaller transactions.
double dFeePerKb = double(nTotalIn-tx.GetValueOut()) / (double(nTxSize)/1000.0);
if (porphan)
{
porphan->dPriority = dPriority;
porphan->dFeePerKb = dFeePerKb;
}
else
vecPriority.push_back(TxPriority(dPriority, dFeePerKb, &(*mi).second));
}
// Collect transactions into block
map<uint256, CTxIndex> mapTestPool;
uint64_t nBlockSize = 1000;
uint64_t nBlockTx = 0;
int nBlockSigOps = 100;
bool fSortedByFee = (nBlockPrioritySize <= 0);
TxPriorityCompare comparer(fSortedByFee);
std::make_heap(vecPriority.begin(), vecPriority.end(), comparer);
while (!vecPriority.empty())
{
// Take highest priority transaction off the priority queue:
double dPriority = vecPriority.front().get<0>();
double dFeePerKb = vecPriority.front().get<1>();
CTransaction& tx = *(vecPriority.front().get<2>());
std::pop_heap(vecPriority.begin(), vecPriority.end(), comparer);
vecPriority.pop_back();
// Size limits
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
if (nBlockSize + nTxSize >= nBlockMaxSize)
continue;
// Legacy limits on sigOps:
unsigned int nTxSigOps = tx.GetLegacySigOpCount();
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
// Timestamp limit
if (tx.nTime > GetAdjustedTime() || (fProofOfStake && tx.nTime > pblock->vtx[0].nTime))
continue;
// Transaction fee
int64_t nMinFee = tx.GetMinFee(nBlockSize, GMF_BLOCK);
// Skip free transactions if we're past the minimum block size:
if (fSortedByFee && (dFeePerKb < nMinTxFee) && (nBlockSize + nTxSize >= nBlockMinSize))
continue;
// Prioritize by fee once past the priority size or we run out of high-priority
// transactions:
if (!fSortedByFee &&
((nBlockSize + nTxSize >= nBlockPrioritySize) || (dPriority < COIN * 144 / 250)))
{
fSortedByFee = true;
comparer = TxPriorityCompare(fSortedByFee);
std::make_heap(vecPriority.begin(), vecPriority.end(), comparer);
}
// Connecting shouldn't fail due to dependency on other memory pool transactions
// because we're already processing them in order of dependency
map<uint256, CTxIndex> mapTestPoolTmp(mapTestPool);
MapPrevTx mapInputs;
bool fInvalid;
if (!tx.FetchInputs(txdb, mapTestPoolTmp, false, true, mapInputs, fInvalid))
continue;
int64_t nTxFees = tx.GetValueIn(mapInputs)-tx.GetValueOut();
if (nTxFees < nMinFee)
continue;
nTxSigOps += tx.GetP2SHSigOpCount(mapInputs);
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
continue;
if (!tx.ConnectInputs(txdb, mapInputs, mapTestPoolTmp, CDiskTxPos(1,1,1), pindexPrev, false, true))
continue;
mapTestPoolTmp[tx.GetHash()] = CTxIndex(CDiskTxPos(1,1,1), tx.vout.size());
swap(mapTestPool, mapTestPoolTmp);
// Added
pblock->vtx.push_back(tx);
nBlockSize += nTxSize;
++nBlockTx;
nBlockSigOps += nTxSigOps;
nFees += nTxFees;
if (fDebug && GetBoolArg("-printpriority"))
{
printf("priority %.1f feeperkb %.1f txid %s\n",
dPriority, dFeePerKb, tx.GetHash().ToString().c_str());
}
// Add transactions that depend on this one to the priority queue
uint256 hash = tx.GetHash();
if (mapDependers.count(hash))
{
BOOST_FOREACH(COrphan* porphan, mapDependers[hash])
{
if (!porphan->setDependsOn.empty())
{
porphan->setDependsOn.erase(hash);
if (porphan->setDependsOn.empty())
{
vecPriority.push_back(TxPriority(porphan->dPriority, porphan->dFeePerKb, porphan->ptx));
std::push_heap(vecPriority.begin(), vecPriority.end(), comparer);
}
}
}
}
}
nLastBlockTx = nBlockTx;
nLastBlockSize = nBlockSize;
if (fDebug && GetBoolArg("-printpriority"))
printf("CreateNewBlock(): total size %"PRIu64"\n", nBlockSize);
if (!fProofOfStake)
pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(nFees);
if (pFees)
*pFees = nFees;
// Fill in header
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
pblock->nTime = max(pindexPrev->GetPastTimeLimit()+1, pblock->GetMaxTransactionTime());
pblock->nTime = max(pblock->GetBlockTime(), PastDrift(pindexPrev->GetBlockTime()));
if (!fProofOfStake)
pblock->UpdateTime(pindexPrev);
pblock->nNonce = 0;
}
return pblock.release();
}
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce)
{
// Update nExtraNonce
static uint256 hashPrevBlock;
if (hashPrevBlock != pblock->hashPrevBlock)
{
nExtraNonce = 0;
hashPrevBlock = pblock->hashPrevBlock;
}
++nExtraNonce;
unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2
pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CBigNum(nExtraNonce)) + COINBASE_FLAGS;
assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
}
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1)
{
//
// Pre-build hash buffers
//
struct
{
struct unnamed2
{
int nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
unsigned int nTime;
unsigned int nBits;
unsigned int nNonce;
}
block;
unsigned char pchPadding0[64];
uint256 hash1;
unsigned char pchPadding1[64];
}
tmp;
memset(&tmp, 0, sizeof(tmp));
tmp.block.nVersion = pblock->nVersion;
tmp.block.hashPrevBlock = pblock->hashPrevBlock;
tmp.block.hashMerkleRoot = pblock->hashMerkleRoot;
tmp.block.nTime = pblock->nTime;
tmp.block.nBits = pblock->nBits;
tmp.block.nNonce = pblock->nNonce;
FormatHashBlocks(&tmp.block, sizeof(tmp.block));
FormatHashBlocks(&tmp.hash1, sizeof(tmp.hash1));
// Byte swap all the input buffer
for (unsigned int i = 0; i < sizeof(tmp)/4; i++)
((unsigned int*)&tmp)[i] = ByteReverse(((unsigned int*)&tmp)[i]);
// Precalc the first half of the first hash, which stays constant
SHA256Transform(pmidstate, &tmp.block, pSHA256InitState);
memcpy(pdata, &tmp.block, 128);
memcpy(phash1, &tmp.hash1, 64);
}
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
{
uint256 hashBlock = pblock->GetHash();
uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();
if(!pblock->IsProofOfWork())
return error("CheckWork() : %s is not a proof-of-work block", hashBlock.GetHex().c_str());
if (hashBlock > hashTarget)
return error("CheckWork() : proof-of-work not meeting target");
//// debug print
printf("CheckWork() : new proof-of-work block found \n hash: %s \ntarget: %s\n", hashBlock.GetHex().c_str(), hashTarget.GetHex().c_str());
pblock->print();
printf("generated %s\n", FormatMoney(pblock->vtx[0].vout[0].nValue).c_str());
// Found a solution
{
LOCK(cs_main);
if (pblock->hashPrevBlock != hashBestChain)
return error("CheckWork() : generated block is stale");
// Remove key from key pool
reservekey.KeepKey();
// Track how many getdata requests this block gets
{
LOCK(wallet.cs_wallet);
wallet.mapRequestCount[hashBlock] = 0;
}
// Process this block the same as if we had received it from another node
if (!ProcessBlock(NULL, pblock))
return error("CheckWork() : ProcessBlock, block not accepted");
}
return true;
}
bool CheckStake(CBlock* pblock, CWallet& wallet)
{
uint256 proofHash = 0, hashTarget = 0;
uint256 hashBlock = pblock->GetHash();
if(!pblock->IsProofOfStake())
return error("CheckStake() : %s is not a proof-of-stake block", hashBlock.GetHex().c_str());
// verify hash target and signature of coinstake tx
if (!CheckProofOfStake(pblock->vtx[1], pblock->nBits, proofHash, hashTarget))
return error("CheckStake() : proof-of-stake checking failed");
//// debug print
printf("CheckStake() : new proof-of-stake block found \n hash: %s \nproofhash: %s \ntarget: %s\n", hashBlock.GetHex().c_str(), proofHash.GetHex().c_str(), hashTarget.GetHex().c_str());
pblock->print();
printf("out %s\n", FormatMoney(pblock->vtx[1].GetValueOut()).c_str());
// Found a solution
{
LOCK(cs_main);
if (pblock->hashPrevBlock != hashBestChain)
return error("CheckStake() : generated block is stale");
// Track how many getdata requests this block gets
{
LOCK(wallet.cs_wallet);
wallet.mapRequestCount[hashBlock] = 0;
}
// Process this block the same as if we had received it from another node
if (!ProcessBlock(NULL, pblock))
return error("CheckStake() : ProcessBlock, block not accepted");
}
return true;
}
void StakeMiner(CWallet *pwallet)
{
SetThreadPriority(THREAD_PRIORITY_LOWEST);
// Make this thread recognisable as the mining thread
RenameThread("Forexcoin-miner");
bool fTryToSync = true;
while (true)
{
if (fShutdown)
return;
while (pwallet->IsLocked())
{
nLastCoinStakeSearchInterval = 0;
MilliSleep(1000);
if (fShutdown)
return;
}
while (vNodes.empty() || IsInitialBlockDownload())
{
nLastCoinStakeSearchInterval = 0;
fTryToSync = true;
MilliSleep(1000);
if (fShutdown)
return;
}
if (fTryToSync)
{
fTryToSync = false;
if (vNodes.size() < 3 || nBestHeight < GetNumBlocksOfPeers())
{
MilliSleep(60000);
continue;
}
}
//
// Create new block
//
int64_t nFees;
auto_ptr<CBlock> pblock(CreateNewBlock(pwallet, true, &nFees));
if (!pblock.get())
return;
// Trying to sign a block
if (pblock->SignBlock(*pwallet, nFees))
{
SetThreadPriority(THREAD_PRIORITY_NORMAL);
CheckStake(pblock.get(), *pwallet);
SetThreadPriority(THREAD_PRIORITY_LOWEST);
MilliSleep(500);
}
else
MilliSleep(nMinerSleep);
}
}
| [
"Adika.michael@hotmail.com"
] | Adika.michael@hotmail.com |
cced036998b4bbabb24f5a34f195574a9a25cdfc | 3abe45130d4f614f68c6551b59014a20d3470b58 | /src/primitives/deterministicmint.h | a2b03d4b5f596a6b86656af5394c0ef83383e4be | [
"MIT"
] | permissive | dre060/YAADI | faab94150263848ef16fe6a865cff7d2a7893e00 | cdb07c723f559ce883e33d64bce55b6ee5539142 | refs/heads/main | 2023-05-17T15:01:43.672809 | 2021-06-06T04:23:41 | 2021-06-06T04:23:41 | 374,243,648 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,473 | h | // Copyright (c) 2018 The PIVX developers
// Copyright (c) 2018 The yaadi developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef yaadi_DETERMINISTICMINT_H
#define yaadi_DETERMINISTICMINT_H
#include <libzerocoin/Denominations.h>
#include <uint256.h>
#include <serialize.h>
//struct that is safe to store essential mint data, without holding any information that allows for actual spending (serial, randomness, private key)
class CDeterministicMint
{
private:
uint8_t nVersion;
uint32_t nCount;
uint256 hashSeed;
uint256 hashSerial;
uint256 hashStake;
uint256 hashPubcoin;
uint256 txid;
int nHeight;
libzerocoin::CoinDenomination denom;
bool isUsed;
public:
CDeterministicMint();
CDeterministicMint(uint8_t nVersion, const uint32_t& nCount, const uint256& hashSeed, const uint256& hashSerial, const uint256& hashPubcoin, const uint256& hashStake);
libzerocoin::CoinDenomination GetDenomination() const { return denom; }
uint32_t GetCount() const { return nCount; }
int GetHeight() const { return nHeight; }
uint256 GetSeedHash() const { return hashSeed; }
uint256 GetSerialHash() const { return hashSerial; }
uint256 GetStakeHash() const { return hashStake; }
uint256 GetPubcoinHash() const { return hashPubcoin; }
uint256 GetTxHash() const { return txid; }
uint8_t GetVersion() const { return nVersion; }
bool IsUsed() const { return isUsed; }
void SetDenomination(const libzerocoin::CoinDenomination denom) { this->denom = denom; }
void SetHeight(const int& nHeight) { this->nHeight = nHeight; }
void SetNull();
void SetStakeHash(const uint256& hashStake) { this->hashStake = hashStake; }
void SetTxHash(const uint256& txid) { this->txid = txid; }
void SetUsed(const bool isUsed) { this->isUsed = isUsed; }
std::string ToString() const;
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
{
READWRITE(this->nVersion);
READWRITE(nCount);
READWRITE(hashSeed);
READWRITE(hashSerial);
READWRITE(hashStake);
READWRITE(hashPubcoin);
READWRITE(txid);
READWRITE(nHeight);
READWRITE(denom);
READWRITE(isUsed);
};
};
#endif //yaadi_DETERMINISTICMINT_H
| [
"ipedrero84@gmail.com"
] | ipedrero84@gmail.com |
c04e2ae16f44fc11e3e9c69c81331416f8243b9d | ddad5e9ee062d18c33b9192e3db95b58a4a67f77 | /util/math/float2decimal.cc | afe0af6e4440f94d1819902e6bfb96eae54f0bf8 | [
"BSD-2-Clause"
] | permissive | romange/gaia | c7115acf55e4b4939f8111f08e5331dff964fd02 | 8ef14627a4bf42eba83bb6df4d180beca305b307 | refs/heads/master | 2022-01-11T13:35:22.352252 | 2021-12-28T16:11:13 | 2021-12-28T16:11:13 | 114,404,005 | 84 | 17 | BSD-2-Clause | 2021-12-28T16:11:14 | 2017-12-15T19:20:34 | C++ | UTF-8 | C++ | false | false | 23,547 | cc | // Copyright 2017, Beeri 15. All rights reserved.
// Author: Roman Gershman (romange@gmail.com)
//
#include "util/math/float2decimal.h"
#include "base/logging.h"
#define FAST_DTOA_UNREACHABLE() __builtin_unreachable();
namespace util {
namespace dtoa {
namespace {
//
// Given a (normalized) floating-point number v and its neighbors m- and m+
//
// ---+---------------------------+---------------------------+---
// m- v m+
//
// Grisu first scales the input number w, and its boundaries w- and w+, by an
// approximate power-of-ten c ~= 10^-k (which needs to be precomputed using
// high-precision arithmetic and stored in a table) such that the exponent of
// the products lies within a certain range [alpha, gamma]. It then remains to
// produce the decimal digits of a DiyFp number M = f * 2^e, where
// alpha <= e <= gamma.
//
// The choice of alpha and gamma determines the digit generation procedure and
// the size of the look-up table (or vice versa...) and depends on the
// extended precision q.
//
// In other words, given normalized w, Grisu needs to find a (normalized) cached
// power-of-ten c, such that the exponent of the product c * w = f * 2^e
// satisfies (Definition 3.2)
//
// alpha <= e = e_c + e_w + q <= gamma
//
// or
//
// f_c * f_w * 2^alpha <= f_c 2^(e_c) * f_w 2^(e_w) * 2^q
// <= f_c * f_w * 2^gamma
//
// Since c and w are normalized, i.e. 2^(q-1) <= f < 2^q, this implies
//
// 2^(q-1) * 2^(q-1) * 2^alpha <= c * w * 2^q < 2^q * 2^q * 2^gamma
//
// or
//
// 2^(q - 2 + alpha) <= c * w < 2^(q + gamma)
//
// The distance (gamma - alpha) should be as large as possible in order to make
// the table as small as possible, but the digit generation procedure should
// still be efficient.
//
// Assume q = 64 and e < 0. The idea is to cut the number c * w = f * 2^e into
// two parts, which can be processed independently: An integral part p1, and a
// fractional part p2:
//
// f * 2^e = ( (f div 2^-e) * 2^-e + (f mod 2^-e) ) * 2^e
// = (f div 2^-e) + (f mod 2^-e) * 2^e
// = p1 + p2 * 2^e
//
// The conversion of p1 into decimal form requires some divisions and modulos by
// a power-of-ten. These operations are faster for 32-bit than for 64-bit
// integers, so p1 should ideally fit into a 32-bit integer. This be achieved by
// choosing
//
// -e >= 32 or e <= -32 := gamma
//
// In order to convert the fractional part
//
// p2 * 2^e = d[-1] / 10^1 + d[-2] / 10^2 + ... + d[-k] / 10^k
//
// into decimal form, the fraction is repeatedly multiplied by 10 and the digits
// d[-i] are extracted in order:
//
// (10 * p2) div 2^-e = d[-1]
// (10 * p2) mod 2^-e = d[-2] / 10^1 + ... + d[-k] / 10^(k-1)
//
// The multiplication by 10 must not overflow. For this it is sufficient to have
//
// 10 * p2 < 16 * p2 = 2^4 * p2 <= 2^64.
//
// Since p2 = f mod 2^-e < 2^-e one may choose
//
// -e <= 60 or e >= -60 := alpha
//
// Different considerations may lead to different digit generation procedures
// and different values of alpha and gamma...
//
constexpr int const kAlpha = -60;
constexpr int const kGamma = -32;
// Grisu needs to find a(normalized) cached power-of-ten c, such that the
// exponent of the product c * w = f * 2^e satisfies (Definition 3.2)
//
// alpha <= e = e_c + e_w + q <= gamma
//
// For IEEE double precision floating-point numbers v converted into a DiyFp's
// w = f * 2^e,
//
// e >= -1022 (min IEEE exponent)
// -52 (IEEE significand size)
// -52 (possibly normalize denormal IEEE numbers)
// -11 (normalize the DiyFp)
// = -1137
//
// and
//
// e <= +1023 (max IEEE exponent)
// -52 (IEEE significand size)
// -11 (normalize the DiyFp)
// = 960
//
// (For IEEE single precision the exponent range is [-196, 80].)
//
// Now
//
// alpha <= e_c + e + q <= gamma
// ==> f_c * 2^alpha <= c * 2^e * 2^q
//
// and since the c's are normalized, 2^(q-1) <= f_c,
//
// ==> 2^(q - 1 + alpha) <= c * 2^(e + q)
// ==> 2^(alpha - e - 1) <= c
//
// If c were an exakt power of ten, i.e. c = 10^k, one may determine k as
//
// k = ceil( log_10( 2^(alpha - e - 1) ) )
// = ceil( (alpha - e - 1) * log_10(2) )
//
// (From the paper)
// "In theory the result of the procedure could be wrong since c is rounded, and
// the computation itself is approximated [...]. In practice, however, this
// simple function is sufficient."
//
// The difference of the decimal exponents of adjacent table entries must be
// <= floor( (gamma - alpha) * log_10(2) ) = 8.
struct CachedPower { // c = f * 2^e ~= 10^k
uint64_t f;
int e;
int k;
};
// Returns a cached power-of-ten c, such that alpha <= e_c + e + q <= gamma.
CachedPower GetCachedPowerForBinaryExponent(int e) {
// NB:
// Actually this function returns c, such that -60 <= e_c + e + 64 <= -34.
static constexpr CachedPower const kCachedPowers[] = {
{0xAB70FE17C79AC6CA, -1060, -300}, // -1060 + 960 + 64 = -36
{0xFF77B1FCBEBCDC4F, -1034, -292}, {0xBE5691EF416BD60C, -1007, -284},
{0x8DD01FAD907FFC3C, -980, -276}, {0xD3515C2831559A83, -954, -268},
{0x9D71AC8FADA6C9B5, -927, -260}, {0xEA9C227723EE8BCB, -901, -252},
{0xAECC49914078536D, -874, -244}, {0x823C12795DB6CE57, -847, -236},
{0xC21094364DFB5637, -821, -228}, {0x9096EA6F3848984F, -794, -220},
{0xD77485CB25823AC7, -768, -212}, {0xA086CFCD97BF97F4, -741, -204},
{0xEF340A98172AACE5, -715, -196}, {0xB23867FB2A35B28E, -688, -188},
{0x84C8D4DFD2C63F3B, -661, -180}, {0xC5DD44271AD3CDBA, -635, -172},
{0x936B9FCEBB25C996, -608, -164}, {0xDBAC6C247D62A584, -582, -156},
{0xA3AB66580D5FDAF6, -555, -148}, {0xF3E2F893DEC3F126, -529, -140},
{0xB5B5ADA8AAFF80B8, -502, -132}, {0x87625F056C7C4A8B, -475, -124},
{0xC9BCFF6034C13053, -449, -116}, {0x964E858C91BA2655, -422, -108},
{0xDFF9772470297EBD, -396, -100}, {0xA6DFBD9FB8E5B88F, -369, -92},
{0xF8A95FCF88747D94, -343, -84}, {0xB94470938FA89BCF, -316, -76},
{0x8A08F0F8BF0F156B, -289, -68}, {0xCDB02555653131B6, -263, -60},
{0x993FE2C6D07B7FAC, -236, -52}, {0xE45C10C42A2B3B06, -210, -44},
{0xAA242499697392D3, -183, -36}, // -183 + 80 + 64 = -39
{0xFD87B5F28300CA0E, -157, -28}, //
{0xBCE5086492111AEB, -130, -20}, //
{0x8CBCCC096F5088CC, -103, -12}, //
{0xD1B71758E219652C, -77, -4}, //
{0x9C40000000000000, -50, 4}, //
{0xE8D4A51000000000, -24, 12}, //
{0xAD78EBC5AC620000, 3, 20}, //
{0x813F3978F8940984, 30, 28}, //
{0xC097CE7BC90715B3, 56, 36}, //
{0x8F7E32CE7BEA5C70, 83, 44}, // 83 - 196 + 64 = -49
{0xD5D238A4ABE98068, 109, 52}, {0x9F4F2726179A2245, 136, 60},
{0xED63A231D4C4FB27, 162, 68}, {0xB0DE65388CC8ADA8, 189, 76},
{0x83C7088E1AAB65DB, 216, 84}, {0xC45D1DF942711D9A, 242, 92},
{0x924D692CA61BE758, 269, 100}, {0xDA01EE641A708DEA, 295, 108},
{0xA26DA3999AEF774A, 322, 116}, {0xF209787BB47D6B85, 348, 124},
{0xB454E4A179DD1877, 375, 132}, {0x865B86925B9BC5C2, 402, 140},
{0xC83553C5C8965D3D, 428, 148}, {0x952AB45CFA97A0B3, 455, 156},
{0xDE469FBD99A05FE3, 481, 164}, {0xA59BC234DB398C25, 508, 172},
{0xF6C69A72A3989F5C, 534, 180}, {0xB7DCBF5354E9BECE, 561, 188},
{0x88FCF317F22241E2, 588, 196}, {0xCC20CE9BD35C78A5, 614, 204},
{0x98165AF37B2153DF, 641, 212}, {0xE2A0B5DC971F303A, 667, 220},
{0xA8D9D1535CE3B396, 694, 228}, {0xFB9B7CD9A4A7443C, 720, 236},
{0xBB764C4CA7A44410, 747, 244}, {0x8BAB8EEFB6409C1A, 774, 252},
{0xD01FEF10A657842C, 800, 260}, {0x9B10A4E5E9913129, 827, 268},
{0xE7109BFBA19C0C9D, 853, 276}, {0xAC2820D9623BF429, 880, 284},
{0x80444B5E7AA7CF85, 907, 292}, {0xBF21E44003ACDD2D, 933, 300},
{0x8E679C2F5E44FF8F, 960, 308}, {0xD433179D9C8CB841, 986, 316},
{0x9E19DB92B4E31BA9, 1013, 324}, // 1013 - 1137 + 64 = -60
};
constexpr int const kCachedPowersSize = 79;
constexpr int const kCachedPowersMinDecExp = -300;
// This computation gives exactly the same results for k as
//
// k = ceil((kAlpha - e - 1) * 0.30102999566398114)
//
// for |e| <= 1500, but doesn't require floating-point operations.
// NB: log_10(2) ~= 78913 / 2^18
assert(e >= -1500);
assert(e <= 1500);
int const f = kAlpha - e - 1;
int const k = (f * 78913) / (1 << 18) + (f > 0);
int const index = (-kCachedPowersMinDecExp + k + (8 - 1)) / 8;
assert(index >= 0);
assert(index < kCachedPowersSize);
static_cast<void>(kCachedPowersSize); // Fix warning.
CachedPower const cached = kCachedPowers[index];
assert(kAlpha <= cached.e + e + 64);
assert(kGamma >= cached.e + e + 64);
// XXX:
// cached.k = kCachedPowersMinDecExp + 8*index
return cached;
}
// For n != 0, returns k, such that 10^(k-1) <= n < 10^k.
// For n == 0, returns 1.
inline unsigned InitKappa(uint32_t n) {
return base::CountDecimalDigit32(n);
}
inline void Grisu2Round(char& digit, uint64_t dist, uint64_t delta, uint64_t rest,
uint64_t ten_k) {
// dist, delta, rest and ten_k all are the significands of
// floating-point numbers with an exponent e.
assert(dist <= delta);
assert(rest <= delta);
assert(ten_k > 0);
//
// <--------------------------- delta ---->
// <---- dist --------->
// --------------[------------------+-------------------]--------------
// w- w w+
//
// 10^k
// <------>
// <---- rest ---->
// --------------[------------------+----+--------------]--------------
// w V
// = buf * 10^k
//
// ten_k represents a unit-in-the-last-place in the decimal representation
// stored in buf.
// Decrement buf by ten_k while this takes buf closer to w.
//
while (rest < dist && delta - rest >= ten_k &&
(rest + ten_k < dist || dist - rest > rest + ten_k - dist)) {
DCHECK_NE('0', digit);
digit--;
rest += ten_k;
}
}
void SetDigits(uint32_t value, unsigned num_digits, char* buffer) {
const char DIGITS[] =
"0001020304050607080910111213141516171819"
"2021222324252627282930313233343536373839"
"4041424344454647484950515253545556575859"
"6061626364656667686970717273747576777879"
"8081828384858687888990919293949596979899";
buffer += num_digits;
while (value >= 100) {
// Integer division is slow so do it for a group of two digits instead
// of for every digit. The idea comes from the talk by Alexandrescu
// "Three Optimization Tips for C++".
unsigned index = static_cast<unsigned>((value % 100) * 2);
value /= 100;
*--buffer = DIGITS[index + 1];
*--buffer = DIGITS[index];
}
if (value < 10) {
*--buffer = static_cast<char>('0' + value);
return;
}
unsigned index = static_cast<unsigned>(value * 2);
*--buffer = DIGITS[index + 1];
*--buffer = DIGITS[index];
}
std::pair<unsigned, int> Grisu2DigitGen(char* buffer, int decimal_exponent,
const Fp& M_minus, const Fp& w, const Fp& M_plus) {
static constexpr char const* const kDigits = "0123456789";
static_assert(kAlpha >= -60, "invalid parameter");
static_assert(kGamma <= -32, "invalid parameter");
assert(M_plus.e >= kAlpha);
assert(M_plus.e <= kGamma);
uint64_t delta = M_plus.f - M_minus.f; // (significand of (w+ - w-), implicit exponent is e)
uint64_t dist = M_plus.f - w.f; // (significand of (w+ - w ), implicit exponent is e)
// <--------------------------- delta ---->
// <---- dist --------->
// --------------[------------------+-------------------]--------------
// w- w w+
//
// Split w+ = f * 2^e into two parts p1 and p2 (note: e < 0):
//
// w+ = f * 2^e
// = ((f div 2^-e) * 2^-e + (f mod 2^-e)) * 2^e
// = ((p1 ) * 2^-e + (p2 )) * 2^e
// = p1 + p2 * 2^e
// p1 = f div 2^-e (Since -e >= 32, p1 fits into a 32-bit int.)
const uint64_t e_shift = -M_plus.e;
const uint64_t e_mask = (1ULL << e_shift) - 1;
uint32_t p1 = M_plus.f >> e_shift;
uint64_t p2 = M_plus.f & e_mask; // p2 = f mod 2^-e
DCHECK_GT(p1, 0);
//
// 1.
// Generate the digits of the integral part p1 = d[n-1]...d[1]d[0]
//
unsigned kappa = InitKappa(p1);
// We now have
// (B = buffer, L = length = k - n)
//
// 10^(k-1) <= p1 < 10^k
//
// p1 = (p1 div 10^(k-1)) * 10^(k-1) + (p1 mod 10^(k-1))
// = (B[0] ) * 10^(k-1) + (p1 mod 10^(k-1))
//
// w+ = p1 + p2 * 2^e
// = B[0] * 10^(k-1) + (p1 mod 10^(k-1)) + p2 * 2^e
// = B[0] * 10^(k-1) + ((p1 mod 10^(k-1)) * 2^-e + p2) * 2^e
// = B[0] * 10^(k-1) + ( rest) * 2^e
//
// and generate the digits d of p1 from left to right:
//
// p1 = (B[0]B[1]...B[L -1]B[L]B[L+1] ...B[k-2]B[k-1])_10
// = (B[0]B[1]...B[L -1])_10 * 10^(k-L) + (B[L ]...B[k-2]B[k-1])_10 (L = 1...k)
// = (B[0]B[1]...B[k-n-1])_10 * 10^(n ) + (B[k-n ]...B[k-2]B[k-1])_10 (n = k...1)
bool cut_early = delta >= p2;
uint32_t length = kappa;
if (cut_early) {
uint32_t p1_remainder = 0;
uint32_t ten_n = 1;
unsigned power = 0;
uint32_t delta_shifted = (delta - p2) >> e_shift; // valid due to cut_early
bool check_increase_power = true;
if (delta_shifted > 0) {
power = base::CountDecimalDigit32(delta_shifted);
ten_n = base::Power10(power);
p1_remainder = p1 % ten_n;
if (p1_remainder > delta_shifted) {
--power;
ten_n /= 10;
p1_remainder %= ten_n;
check_increase_power = false;
}
DCHECK_LE(p1_remainder, delta_shifted);
p1 /= ten_n;
length -= power;
}
if (check_increase_power) {
while (p1 % 10 == 0) {
++power;
ten_n *= 10;
p1 /= 10;
--length;
}
}
SetDigits(p1, length, buffer);
// Found V = buffer * 10^n, with w- <= V <= w+.
// And V is correctly rounded.
//
decimal_exponent += power;
if (dist > p2) {
// We may now just stop. But instead look if the buffer could be
// decremented to bring V closer to w.
//
// 10^n is now 1 ulp in the decimal representation V.
//
// The rounding procedure works with DiyFp's with an implicit
// exponent e.
//
// 10^n = ten_n * 2^e = (10^n * 2^-e) * 2^e
//
// Note:
// n has been decremented above, i.e. pow10 = 10^n
//
uint64_t rest = (uint64_t(p1_remainder) << e_shift) + p2;
uint64_t ten_n64 = uint64_t(ten_n) << e_shift;
while (rest < dist && delta - rest >= ten_n64 &&
ten_n64 / 2 < (dist - rest)) {
DCHECK_NE('0', buffer[length-1]);
buffer[length-1]--;
rest += ten_n64;
}
}
return std::pair<unsigned, int>(length, decimal_exponent);
}
SetDigits(p1, length, buffer);
assert(p2 != 0);
// (otherwise the loop above would have been exited with rest <= delta)
//
// 2.
// The digits of the integral part have been generated:
//
// w+ = d[k-1]...d[1]d[0] + p2 * 2^e = buffer + p2 * 2^e
//
// Now generate the digits of the fractional part p2 * 2^e.
//
// Note:
// No decimal point is generated: the exponent is adjusted instead.
//
// p2 actually represents the fraction
//
// p2 * 2^e
// = p2 / 2^-e
// = d[-1] / 10^1 + d[-2] / 10^2 + d[-3] / 10^3 + ... + d[-m] / 10^m
//
// or
//
// 10 * p2 / 2^-e = d[-1] + (d[-2] / 10^1 + ... + d[-m] / 10^(m-1))
//
// and the digits can be obtained from left to right by
//
// (10 * p2) div 2^-e = d[-1]
// (10 * p2) mod 2^-e = d[-2] / 10^1 + ... + d[-m] / 10^(m-1)
//
DCHECK_GT(p2, delta);
int m = 0;
for (;;) {
// Invariant:
// 1. w+ = buffer * 10^m + 10^m * p2 * 2^e (Note: m <= 0)
// p2 * 10 < 2^60 * 10 < 2^60 * 2^4 = 2^64,
// so the multiplication by 10 does not overflow.
DCHECK_LE(p2, e_mask);
p2 *= 10;
uint64_t const d = p2 >> e_shift; // = p2 div 2^-e
uint64_t const r = p2 & e_mask; // = p2 mod 2^-e
// w+ = buffer * 10^m + 10^m * p2 * 2^e
// = buffer * 10^m + 10^(m-1) * (10 * p2 ) * 2^e
// = buffer * 10^m + 10^(m-1) * (d * 2^-e + r) * 2^e
// = buffer * 10^m + 10^(m-1) * d + 10^(m-1) * r * 2^e
// = (buffer * 10 + d) * 10^(m-1) + 10^(m-1) * r * 2^e
assert(d <= 9);
buffer[length++] = kDigits[d]; // buffer := buffer * 10 + d
// w+ = buffer * 10^(m-1) + 10^(m-1) * r * 2^e
p2 = r;
m -= 1;
// w+ = buffer * 10^m + 10^m * p2 * 2^e
//
// Invariant (1) restored.
// p2 is now scaled by 10^(-m) since it repeatedly is multiplied by 10.
// To keep the units in sync, delta and dist need to be scaled too.
delta *= 10;
dist *= 10;
uint64_t const rest = p2;
// Check if enough digits have been generated.
if (rest <= delta) {
decimal_exponent += m;
// ten_m represents 10^m as a Fp with an exponent e.
//
// Note: m < 0
//
// Note:
// delta and dist are now scaled by 10^(-m) (they are repeatedly
// multiplied by 10) and we need to do the same with ten_m.
//
// 10^(-m) * 10^m = 10^(-m) * ten_m * 2^e
// = (10^(-m) * 10^m * 2^-e) * 2^e
// = 2^-e * 2^e
//
// one.f = 2^-e and the exponent e is implicit.
//
uint64_t const ten_m = 1ULL << e_shift;
Grisu2Round(buffer[length-1], dist, delta, rest, ten_m);
return std::pair<unsigned, int>(length, decimal_exponent);
}
}
// By construction this algorithm generates the shortest possible decimal
// number (Loitsch, Theorem 6.2) which rounds back to w.
// For an input number of precision p, at least
//
// N = 1 + ceil(p * log_10(2))
//
// decimal digits are sufficient to identify all binary floating-point
// numbers (Matula, "In-and-Out conversions").
// This implies that the algorithm does not produce more than N decimal
// digits.
//
// N = 17 for p = 53 (IEEE double precision)
// N = 9 for p = 24 (IEEE single precision)
}
} // namespace
// v = buf * 10^decimal_exponent
// len is the length of the buffer (number of decimal digits)
std::pair<unsigned, int> Grisu2(Fp m_minus, Fp v, Fp m_plus, char* buf) {
assert(v.e == m_minus.e);
assert(v.e == m_plus.e);
//
// --------(-----------------------+-----------------------)-------- (A)
// m- v m+
//
// --------------------(-----------+-----------------------)-------- (B)
// m- v m+
//
// First scale v (and m- and m+) such that the exponent is in the range
// [alpha, beta].
//
CachedPower const cached = GetCachedPowerForBinaryExponent(m_plus.e);
Fp const c_minus_k(cached.f, cached.e); // = c ~= 10^k
Fp const w = v.Mul(c_minus_k); // Exponent of the products is v.e + c_minus_k.e + q
Fp const w_minus = m_minus.Mul(c_minus_k);
Fp const w_plus = m_plus.Mul(c_minus_k);
//
// ----(---+---)---------------(---+---)---------------(---+---)----
// w- w w+
// = c*m- = c*v = c*m+
//
// Fp::Mul rounds its result and c_minus_k is approximated too. w (as well
// as w- and w+) are now off by a small amount.
// In fact:
//
// w - v * 10^k < 1 ulp
//
// To account for this inaccuracy, add resp. subtract 1 ulp.
//
// --------+---[---------------(---+---)---------------]---+--------
// w- M- w M+ w+
//
// Now any number in [M-, M+] (bounds included) will round to w when input,
// regardless of how the input rounding algorithm breaks ties.
//
// And DigitGen generates the shortest possible such number in [M-, M+].
// This does not mean that Grisu2 always generates the shortest possible
// number in the interval (m-, m+).
//
Fp const M_minus = Fp(w_minus.f + 1, w_minus.e);
Fp const M_plus = Fp(w_plus.f - 1, w_plus.e);
return Grisu2DigitGen(buf, -cached.k, M_minus, w, M_plus);
}
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
// Returns a pointer to the element following the exponent
char* AppendExponent(char* buf, int e) {
static constexpr char const* const kDigits = "0123456789";
static constexpr char const* const kDigits100 =
"00010203040506070809"
"10111213141516171819"
"20212223242526272829"
"30313233343536373839"
"40414243444546474849"
"50515253545556575859"
"60616263646566676869"
"70717273747576777879"
"80818283848586878889"
"90919293949596979899";
assert(e > -1000);
assert(e < 1000);
if (e < 0)
*buf++ = '-', e = -e;
else
*buf++ = '+';
uint32_t const k = static_cast<uint32_t>(e);
if (k < 10) {
// *buf++ = kDigits[0];
*buf++ = kDigits[k];
} else if (k < 100) {
*buf++ = kDigits100[2 * k + 0];
*buf++ = kDigits100[2 * k + 1];
} else {
uint32_t const q = k / 100;
uint32_t const r = k % 100;
*buf++ = kDigits[q];
*buf++ = kDigits100[2 * r + 0];
*buf++ = kDigits100[2 * r + 1];
}
return buf;
}
char* FormatBuffer(char* buf, int k, int n) {
// v = digits * 10^(n-k)
// k is the length of the buffer (number of decimal digits)
// n is the position of the decimal point relative to the start of the buffer.
//
// Format the decimal floating-number v in the same way as JavaScript's ToString
// applied to number type.
//
// See:
// https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type
if (k <= n && n <= 21) {
// digits[000]
std::memset(buf + k, '0', static_cast<size_t>(n - k));
// if (trailing_dot_zero)
//{
// buf[n++] = '.';
// buf[n++] = '0';
//}
return buf + n; // (len <= 21 + 2 = 23)
}
if (0 < n && n <= 21) {
// dig.its
assert(k > n);
std::memmove(buf + (n + 1), buf + n, static_cast<size_t>(k - n));
buf[n] = '.';
return buf + (k + 1); // (len == k + 1 <= 18)
}
if (-6 < n && n <= 0) {
// 0.[000]digits
std::memmove(buf + (2 + -n), buf, static_cast<size_t>(k));
buf[0] = '0';
buf[1] = '.';
std::memset(buf + 2, '0', static_cast<size_t>(-n));
return buf + (2 + (-n) + k); // (len <= k + 7 <= 24)
}
if (k == 1) {
// dE+123
buf += 1; // (len <= 1 + 5 = 6)
} else {
// d.igitsE+123
std::memmove(buf + 2, buf + 1, static_cast<size_t>(k - 1));
buf[1] = '.';
buf += 1 + k; // (len <= k + 6 = 23)
}
*buf++ = 'e';
return AppendExponent(buf, n - 1);
}
} // namespace dtoa
} // namespace util
| [
"roman@ubimo.com"
] | roman@ubimo.com |
15b24c8e73d1dc44bface0376f6f70e8a601f40b | dcfe1699c1f93cd1f6817f1ecd9886e568dad770 | /engine/core/memory/memory_manager.h | 68a0caecf322fa558f656a7b2a36249e8ef5d114 | [
"MIT"
] | permissive | RikoOphorst/Tremble-OLD | c96f8143a99eaa7467cf3f87398ad82e65ca5022 | 650fa53402f9c6114642e0cc8515b2ed517d40d6 | refs/heads/master | 2021-06-08T04:35:25.395741 | 2016-11-05T17:40:39 | 2016-11-05T17:40:39 | 72,647,196 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,123 | h | #pragma once
//#include "allocators/allocator.h"
#include "allocators/free_list_allocator.h"
//#include "allocators/linear_allocator.h"
//#include "allocators/pool_allocator.h"
//#include "allocators/proxy_allocator.h"
//#include "allocators/stack_allocator.h"
#include "pch.h"
namespace engine
{
/**
* @brief An overall memory manager class. Handles allocation of allocators in our game.
*
* A single memory manager is meant to exist in a process. Different systems can allocate an allocator with a big chunk of memory for itself.
* That allocator then manages the memory for each system.
* @author Anton Gavrilov
*/
class MemoryManager
{
public:
MemoryManager(size_t memory); //!< @param memory Amount of memory, that you want this memory manager to have.
~MemoryManager(); //!< Frees all the memory in the memory manager
/**
* @brief Get a new allocator to manage a piece of memory for a subsystem of a game.
* @param size Size, that you wish the allocator to have
* @tparam AllocatorClass Class of the allocator that you want to get. Has to be a derived class from engine::Allocator
* @return A pointer tio the initialized allocator
*/
template<typename AllocatorClass>
AllocatorClass* GetNewAllocator(size_t size)
{
if (std::is_base_of<Allocator, AllocatorClass>() == true)
{
void* p = all_allocators_->Allocate(sizeof(AllocatorClass) + size, alignof(AllocatorClass));
return new (p) AllocatorClass(size, pointer_math::Add(p, sizeof(AllocatorClass)));
}
return nullptr;
}
/**
* @brief Remove an allocator from the memory manager
* @param p A pointer to the alocator that you want to deallocate
*/
template<typename AllocatorClass>
void DeleteAllocator(AllocatorClass* p)
{
p->~AllocatorClass();
all_allocators_->Deallocate(p);
}
private:
FreeListAllocator* all_allocators_; //!< A pointer to the free list allocator that manages all the allocators
void* memory_; //!< A pointer to the memory, that is allocated for the memory manager
size_t memory_size_; //!< The size of the memory, that is in use by the memory manager
};
} | [
"riko_ophorst@hotmail.com"
] | riko_ophorst@hotmail.com |
12a8dc8b21bf5a6be9512e13ba9475a311df092d | ef3a7391b0a5c5d8e276355e97cbe4de621d500c | /venv/Lib/site-packages/torch/include/ATen/core/LegacyDeviceTypeInit.h | dd3a5529a488994bf65ba816c4e25b31a5f13322 | [
"Apache-2.0"
] | permissive | countBMB/BenjiRepo | 143f6da5d198ea6f06404b4559e1f4528b71b3eb | 79d882263baaf2a11654ca67d2e5593074d36dfa | refs/heads/master | 2022-12-11T07:37:04.807143 | 2019-12-25T11:26:29 | 2019-12-25T11:26:29 | 230,090,428 | 1 | 1 | Apache-2.0 | 2022-12-08T03:21:09 | 2019-12-25T11:05:59 | Python | UTF-8 | C++ | false | false | 1,015 | h | #pragma once
// The legacy mechanism for initializing device types; this is used by
// LegacyTypeDispatch.
#include <c10/core/DeviceType.h>
#include <c10/macros/Macros.h>
#include <c10/util/Registry.h>
#include <ATen/core/ScalarType.h>
namespace at {
struct CAFFE2_API LegacyDeviceTypeInitInterface {
virtual ~LegacyDeviceTypeInitInterface() {}
virtual void initCPU() const {
AT_ERROR("cannot use CPU without ATen library");
}
virtual void initCUDA() const {
AT_ERROR("cannot use CUDA without ATen CUDA library");
}
virtual void initHIP() const {
AT_ERROR("cannot use HIP without ATen HIP library");
}
};
struct CAFFE2_API LegacyDeviceTypeInitArgs {};
C10_DECLARE_REGISTRY(
LegacyDeviceTypeInitRegistry,
LegacyDeviceTypeInitInterface,
LegacyDeviceTypeInitArgs);
#define REGISTER_LEGACY_TYPE_INIT(clsname) \
C10_REGISTER_CLASS(LegacyDeviceTypeInitRegistry, clsname, clsname)
CAFFE2_API const LegacyDeviceTypeInitInterface& getLegacyDeviceTypeInit();
} // namespace at
| [
"bengmen92@gmail.com"
] | bengmen92@gmail.com |
ecebfc74e19004d0eec21147d3968103330a8091 | 70022f7e5ac4c229e412b51db248fdd08a0a5b28 | /src/tests/frontend/Linux-g++_(GCC)_4.8.1/cpp/spec-smithwa/getUserParameters.c.pre.transformed.cpp | 32c5d74b78a32895a2d2704ccbff545434cd59a5 | [] | no_license | agrippa/chimes | 6465fc48f118154e9d42fbd26d6b87a7dce7c5e9 | 695bb5bb54efbcd61469acda79b6ba6532e2d1d9 | refs/heads/master | 2020-12-25T14:02:17.752481 | 2016-07-04T02:20:59 | 2016-07-04T02:20:59 | 23,259,130 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 57,949 | cpp | # 1 "getUserParameters.c.pre.transformed.cpp"
# 1 "<command-line>"
# 1 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 1 3 4
# 147 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 212 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 1 "<command-line>" 2
# 1 "getUserParameters.c.pre.transformed.cpp"
static int ____chimes_does_checkpoint_getUserParameters_npm = 1;
static int ____must_manage_getUserParameters = 2;
# 1 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 1 "/tmp/chimes-frontend//"
# 1 "<command-line>"
# 1 "/home/jmg3/chimes/src/libchimes/libchimes.h" 1
# 1 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 1 3 4
# 147 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 212 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 5 "/home/jmg3/chimes/src/libchimes/libchimes.h" 2
extern void init_chimes(int argc, char **argv);
extern void checkpoint_transformed(int lbl, unsigned loc_id);
extern void *translate_fptr(void *fptr, int lbl, unsigned loc_id,
size_t return_alias, int n_params, ...);
extern void calling_npm(const char *name, unsigned loc_id);
extern void calling(void *func_ptr, int lbl, unsigned loc_id,
size_t set_return_alias, unsigned naliases, ...);
extern int get_next_call();
extern int new_stack(void *func_ptr, const char *funcname, int *conditional,
unsigned n_local_arg_aliases, unsigned nargs, ...);
extern void init_module(size_t module_id, int n_contains_mappings, int nfunctions,
int nvars, int n_change_locs, int n_provided_npm_functions,
int n_external_npm_functions, int n_npm_conditionals,
int n_static_merges, int n_dynamic_merges, int nstructs, ...);
extern void rm_stack(bool has_return_alias, size_t returned_alias,
const char *funcname, int *conditional, unsigned loc_id, int disabled,
bool is_allocator);
extern void register_stack_var(const char *mangled_name, int *cond_registration,
const char *full_type, void *ptr, size_t size, int is_ptr,
int is_struct, int n_ptr_fields, ...);
extern void register_stack_vars(int nvars, ...);
extern void register_global_var(const char *mangled_name, const char *full_type,
void *ptr, size_t size, int is_ptr, int is_struct, size_t group, int n_ptr_fields,
...);
extern void register_constant(size_t const_id, void *address,
size_t length);
extern int alias_group_changed(unsigned loc_id);
extern void malloc_helper(const void *ptr, size_t nbytes, size_t group, int is_ptr,
int is_struct, ...);
extern void calloc_helper(const void *ptr, size_t num, size_t size, size_t group, int is_ptr,
int is_struct, ...);
extern void realloc_helper(const void *new_ptr, const void *old_ptr,
void *header, size_t nbytes, size_t group, int is_ptr, int is_struct,
...);
extern void free_helper(const void *ptr, size_t group);
extern bool disable_current_thread();
extern void reenable_current_thread(bool was_disabled);
extern void thread_leaving();
extern void *get_thread_ctx();
extern unsigned entering_omp_parallel(unsigned lbl, size_t *region_id,
unsigned nlocals, ...);
extern void register_thread_local_stack_vars(unsigned relation,
unsigned parent, void *parent_ctx_ptr, unsigned threads_in_region,
unsigned parent_stack_depth,
size_t region_id, unsigned nlocals, ...);
extern void leaving_omp_parallel(unsigned expected_parent_stack_depth,
size_t region_id, int is_parallel_for);
extern unsigned get_parent_vars_stack_depth();
extern unsigned get_thread_stack_depth();
extern void chimes_error();
# 76 "/home/jmg3/chimes/src/libchimes/libchimes.h"
inline unsigned LIBCHIMES_THREAD_NUM() { return 0; }
inline unsigned LIBCHIMES_NUM_THREADS() { return 1; }
extern int ____chimes_replaying;
# 1 "<command-line>" 2
# 1 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 11 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 1 "/usr/include/stdio.h" 1 3 4
# 28 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 361 "/usr/include/features.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 365 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 366 "/usr/include/sys/cdefs.h" 2 3 4
# 362 "/usr/include/features.h" 2 3 4
# 385 "/usr/include/features.h" 3 4
# 1 "/usr/include/gnu/stubs.h" 1 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 5 "/usr/include/gnu/stubs.h" 2 3 4
# 1 "/usr/include/gnu/stubs-64.h" 1 3 4
# 10 "/usr/include/gnu/stubs.h" 2 3 4
# 386 "/usr/include/features.h" 2 3 4
# 29 "/usr/include/stdio.h" 2 3 4
extern "C" {
# 1 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 1 3 4
# 35 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/bits/types.h" 1 3 4
# 28 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 29 "/usr/include/bits/types.h" 2 3 4
typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;
typedef long int __quad_t;
typedef unsigned long int __u_quad_t;
# 131 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/typesizes.h" 1 3 4
# 132 "/usr/include/bits/types.h" 2 3 4
typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef int __daddr_t;
typedef long int __swblk_t;
typedef int __key_t;
typedef int __clockid_t;
typedef void * __timer_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;
typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;
typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;
typedef long int __ssize_t;
typedef __off64_t __loff_t;
typedef __quad_t *__qaddr_t;
typedef char *__caddr_t;
typedef long int __intptr_t;
typedef unsigned int __socklen_t;
# 37 "/usr/include/stdio.h" 2 3 4
# 45 "/usr/include/stdio.h" 3 4
struct _IO_FILE;
typedef struct _IO_FILE FILE;
# 65 "/usr/include/stdio.h" 3 4
typedef struct _IO_FILE __FILE;
# 75 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/libio.h" 1 3 4
# 32 "/usr/include/libio.h" 3 4
# 1 "/usr/include/_G_config.h" 1 3 4
# 15 "/usr/include/_G_config.h" 3 4
# 1 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 1 3 4
# 16 "/usr/include/_G_config.h" 2 3 4
# 1 "/usr/include/wchar.h" 1 3 4
# 83 "/usr/include/wchar.h" 3 4
typedef struct
{
int __count;
union
{
unsigned int __wch;
char __wchb[4];
} __value;
} __mbstate_t;
# 21 "/usr/include/_G_config.h" 2 3 4
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
typedef struct
{
__off64_t __pos;
__mbstate_t __state;
} _G_fpos64_t;
# 53 "/usr/include/_G_config.h" 3 4
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
# 33 "/usr/include/libio.h" 2 3 4
# 53 "/usr/include/libio.h" 3 4
# 1 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stdarg.h" 1 3 4
# 40 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 54 "/usr/include/libio.h" 2 3 4
# 170 "/usr/include/libio.h" 3 4
struct _IO_jump_t; struct _IO_FILE;
# 180 "/usr/include/libio.h" 3 4
typedef void _IO_lock_t;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
# 203 "/usr/include/libio.h" 3 4
};
enum __codecvt_result
{
__codecvt_ok,
__codecvt_partial,
__codecvt_error,
__codecvt_noconv
};
# 271 "/usr/include/libio.h" 3 4
struct _IO_FILE {
int _flags;
char* _IO_read_ptr;
char* _IO_read_end;
char* _IO_read_base;
char* _IO_write_base;
char* _IO_write_ptr;
char* _IO_write_end;
char* _IO_buf_base;
char* _IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _flags2;
__off_t _old_offset;
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
# 319 "/usr/include/libio.h" 3 4
__off64_t _offset;
# 328 "/usr/include/libio.h" 3 4
void *__pad1;
void *__pad2;
void *__pad3;
void *__pad4;
size_t __pad5;
int _mode;
char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
# 364 "/usr/include/libio.h" 3 4
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
size_t __n);
typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
typedef int __io_close_fn (void *__cookie);
typedef __io_read_fn cookie_read_function_t;
typedef __io_write_fn cookie_write_function_t;
typedef __io_seek_fn cookie_seek_function_t;
typedef __io_close_fn cookie_close_function_t;
typedef struct
{
__io_read_fn *read;
__io_write_fn *write;
__io_seek_fn *seek;
__io_close_fn *close;
} _IO_cookie_io_functions_t;
typedef _IO_cookie_io_functions_t cookie_io_functions_t;
struct _IO_cookie_file;
extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
void *__cookie, _IO_cookie_io_functions_t __fns);
extern "C" {
extern int __underflow (_IO_FILE *);
extern int __uflow (_IO_FILE *);
extern int __overflow (_IO_FILE *, int);
# 460 "/usr/include/libio.h" 3 4
extern int _IO_getc (_IO_FILE *__fp);
extern int _IO_putc (int __c, _IO_FILE *__fp);
extern int _IO_feof (_IO_FILE *__fp) throw ();
extern int _IO_ferror (_IO_FILE *__fp) throw ();
extern int _IO_peekc_locked (_IO_FILE *__fp);
extern void _IO_flockfile (_IO_FILE *) throw ();
extern void _IO_funlockfile (_IO_FILE *) throw ();
extern int _IO_ftrylockfile (_IO_FILE *) throw ();
# 490 "/usr/include/libio.h" 3 4
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
__gnuc_va_list, int *__restrict);
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
__gnuc_va_list);
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
extern void _IO_free_backup_area (_IO_FILE *) throw ();
# 552 "/usr/include/libio.h" 3 4
}
# 76 "/usr/include/stdio.h" 2 3 4
typedef __gnuc_va_list va_list;
# 91 "/usr/include/stdio.h" 3 4
typedef __off_t off_t;
typedef __off64_t off64_t;
typedef __ssize_t ssize_t;
typedef _G_fpos_t fpos_t;
typedef _G_fpos64_t fpos64_t;
# 161 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
# 162 "/usr/include/stdio.h" 2 3 4
extern struct _IO_FILE *stdin;
extern struct _IO_FILE *stdout;
extern struct _IO_FILE *stderr;
# 177 "/usr/include/stdio.h" 3 4
extern int remove (__const char *__filename) throw ();
extern int rename (__const char *__old, __const char *__new) throw ();
extern int renameat (int __oldfd, __const char *__old, int __newfd,
__const char *__new) throw ();
# 194 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) ;
# 204 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile64 (void) ;
extern char *tmpnam (char *__s) throw () ;
extern char *tmpnam_r (char *__s) throw () ;
# 226 "/usr/include/stdio.h" 3 4
extern char *tempnam (__const char *__dir, __const char *__pfx)
throw () __attribute__ ((__malloc__)) ;
# 236 "/usr/include/stdio.h" 3 4
extern int fclose (FILE *__stream);
extern int fflush (FILE *__stream);
# 251 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 261 "/usr/include/stdio.h" 3 4
extern int fcloseall (void);
# 271 "/usr/include/stdio.h" 3 4
extern FILE *fopen (__const char *__restrict __filename,
__const char *__restrict __modes) ;
extern FILE *freopen (__const char *__restrict __filename,
__const char *__restrict __modes,
FILE *__restrict __stream) ;
# 294 "/usr/include/stdio.h" 3 4
extern FILE *fopen64 (__const char *__restrict __filename,
__const char *__restrict __modes) ;
extern FILE *freopen64 (__const char *__restrict __filename,
__const char *__restrict __modes,
FILE *__restrict __stream) ;
extern FILE *fdopen (int __fd, __const char *__modes) throw () ;
extern FILE *fopencookie (void *__restrict __magic_cookie,
__const char *__restrict __modes,
_IO_cookie_io_functions_t __io_funcs) throw () ;
extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
throw () ;
extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) throw () ;
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw ();
extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
int __modes, size_t __n) throw ();
extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
size_t __size) throw ();
extern void setlinebuf (FILE *__stream) throw ();
# 355 "/usr/include/stdio.h" 3 4
extern int fprintf (FILE *__restrict __stream,
__const char *__restrict __format, ...);
extern int printf (__const char *__restrict __format, ...);
extern int sprintf (char *__restrict __s,
__const char *__restrict __format, ...) throw ();
extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
__gnuc_va_list __arg);
extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
__gnuc_va_list __arg) throw ();
extern int snprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format, ...)
throw () __attribute__ ((__format__ (__printf__, 3, 4)));
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
__const char *__restrict __format, __gnuc_va_list __arg)
throw () __attribute__ ((__format__ (__printf__, 3, 0)));
extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
__gnuc_va_list __arg)
throw () __attribute__ ((__format__ (__printf__, 2, 0))) ;
extern int __asprintf (char **__restrict __ptr,
__const char *__restrict __fmt, ...)
throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
extern int asprintf (char **__restrict __ptr,
__const char *__restrict __fmt, ...)
throw () __attribute__ ((__format__ (__printf__, 2, 3))) ;
# 416 "/usr/include/stdio.h" 3 4
extern int vdprintf (int __fd, __const char *__restrict __fmt,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__printf__, 2, 0)));
extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
# 429 "/usr/include/stdio.h" 3 4
extern int fscanf (FILE *__restrict __stream,
__const char *__restrict __format, ...) ;
extern int scanf (__const char *__restrict __format, ...) ;
extern int sscanf (__const char *__restrict __s,
__const char *__restrict __format, ...) throw ();
# 467 "/usr/include/stdio.h" 3 4
# 475 "/usr/include/stdio.h" 3 4
extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 2, 0))) ;
extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 1, 0))) ;
extern int vsscanf (__const char *__restrict __s,
__const char *__restrict __format, __gnuc_va_list __arg)
throw () __attribute__ ((__format__ (__scanf__, 2, 0)));
# 526 "/usr/include/stdio.h" 3 4
# 535 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);
extern int getchar (void);
# 554 "/usr/include/stdio.h" 3 4
extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 565 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 577 "/usr/include/stdio.h" 3 4
extern int fputc (int __c, FILE *__stream);
extern int putc (int __c, FILE *__stream);
extern int putchar (int __c);
# 598 "/usr/include/stdio.h" 3 4
extern int fputc_unlocked (int __c, FILE *__stream);
extern int putc_unlocked (int __c, FILE *__stream);
extern int putchar_unlocked (int __c);
extern int getw (FILE *__stream);
extern int putw (int __w, FILE *__stream);
# 626 "/usr/include/stdio.h" 3 4
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
;
extern char *gets (char *__s) ;
# 644 "/usr/include/stdio.h" 3 4
extern char *fgets_unlocked (char *__restrict __s, int __n,
FILE *__restrict __stream) ;
# 660 "/usr/include/stdio.h" 3 4
extern __ssize_t __getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) ;
# 684 "/usr/include/stdio.h" 3 4
extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
extern int puts (__const char *__s);
extern int ungetc (int __c, FILE *__stream);
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s) ;
# 721 "/usr/include/stdio.h" 3 4
extern int fputs_unlocked (__const char *__restrict __s,
FILE *__restrict __stream);
# 732 "/usr/include/stdio.h" 3 4
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
# 744 "/usr/include/stdio.h" 3 4
extern int fseek (FILE *__stream, long int __off, int __whence);
extern long int ftell (FILE *__stream) ;
extern void rewind (FILE *__stream);
# 768 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off_t __off, int __whence);
extern __off_t ftello (FILE *__stream) ;
# 787 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
# 810 "/usr/include/stdio.h" 3 4
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
extern void clearerr (FILE *__stream) throw ();
extern int feof (FILE *__stream) throw () ;
extern int ferror (FILE *__stream) throw () ;
extern void clearerr_unlocked (FILE *__stream) throw ();
extern int feof_unlocked (FILE *__stream) throw () ;
extern int ferror_unlocked (FILE *__stream) throw () ;
# 841 "/usr/include/stdio.h" 3 4
extern void perror (__const char *__s);
# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
# 27 "/usr/include/bits/sys_errlist.h" 3 4
extern int sys_nerr;
extern __const char *__const sys_errlist[];
extern int _sys_nerr;
extern __const char *__const _sys_errlist[];
# 849 "/usr/include/stdio.h" 2 3 4
extern int fileno (FILE *__stream) throw () ;
extern int fileno_unlocked (FILE *__stream) throw () ;
# 868 "/usr/include/stdio.h" 3 4
extern FILE *popen (__const char *__command, __const char *__modes) ;
extern int pclose (FILE *__stream);
extern char *ctermid (char *__s) throw ();
extern char *cuserid (char *__s);
struct obstack;
extern int obstack_printf (struct obstack *__restrict __obstack,
__const char *__restrict __format, ...)
throw () __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
__const char *__restrict __format,
__gnuc_va_list __args)
throw () __attribute__ ((__format__ (__printf__, 2, 0)));
extern void flockfile (FILE *__stream) throw ();
extern int ftrylockfile (FILE *__stream) throw () ;
extern void funlockfile (FILE *__stream) throw ();
# 929 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/stdio.h" 1 3 4
# 36 "/usr/include/bits/stdio.h" 3 4
extern __inline __attribute__ ((__gnu_inline__)) int
vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg)
{
return vfprintf (stdout, __fmt, __arg);
}
extern __inline __attribute__ ((__gnu_inline__)) int
getchar (void)
{
return _IO_getc (stdin);
}
extern __inline __attribute__ ((__gnu_inline__)) int
fgetc_unlocked (FILE *__fp)
{
return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
}
extern __inline __attribute__ ((__gnu_inline__)) int
getc_unlocked (FILE *__fp)
{
return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
}
extern __inline __attribute__ ((__gnu_inline__)) int
getchar_unlocked (void)
{
return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
}
extern __inline __attribute__ ((__gnu_inline__)) int
putchar (int __c)
{
return _IO_putc (__c, stdout);
}
extern __inline __attribute__ ((__gnu_inline__)) int
fputc_unlocked (int __c, FILE *__stream)
{
return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}
extern __inline __attribute__ ((__gnu_inline__)) int
putc_unlocked (int __c, FILE *__stream)
{
return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
}
extern __inline __attribute__ ((__gnu_inline__)) int
putchar_unlocked (int __c)
{
return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
}
extern __inline __attribute__ ((__gnu_inline__)) __ssize_t
getline (char **__lineptr, size_t *__n, FILE *__stream)
{
return __getdelim (__lineptr, __n, '\n', __stream);
}
extern __inline __attribute__ ((__gnu_inline__)) int
feof_unlocked (FILE *__stream) throw ()
{
return (((__stream)->_flags & 0x10) != 0);
}
extern __inline __attribute__ ((__gnu_inline__)) int
ferror_unlocked (FILE *__stream) throw ()
{
return (((__stream)->_flags & 0x20) != 0);
}
# 930 "/usr/include/stdio.h" 2 3 4
# 938 "/usr/include/stdio.h" 3 4
}
# 12 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 33 "/usr/include/stdlib.h" 3 4
# 1 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 1 3 4
# 34 "/usr/include/stdlib.h" 2 3 4
extern "C" {
# 1 "/usr/include/bits/waitflags.h" 1 3 4
# 43 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/bits/waitstatus.h" 1 3 4
# 65 "/usr/include/bits/waitstatus.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 37 "/usr/include/endian.h" 3 4
# 1 "/usr/include/bits/endian.h" 1 3 4
# 38 "/usr/include/endian.h" 2 3 4
# 61 "/usr/include/endian.h" 3 4
# 1 "/usr/include/bits/byteswap.h" 1 3 4
# 62 "/usr/include/endian.h" 2 3 4
# 66 "/usr/include/bits/waitstatus.h" 2 3 4
union wait
{
int w_status;
struct
{
unsigned int:16;
unsigned int __w_retcode:8;
unsigned int __w_coredump:1;
unsigned int __w_termsig:7;
} __wait_terminated;
struct
{
unsigned int:16;
unsigned int __w_stopsig:8;
unsigned int __w_stopval:8;
} __wait_stopped;
};
# 44 "/usr/include/stdlib.h" 2 3 4
# 96 "/usr/include/stdlib.h" 3 4
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
__extension__ typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
# 140 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) throw () ;
extern double atof (__const char *__nptr)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern int atoi (__const char *__nptr)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern long int atol (__const char *__nptr)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
__extension__ extern long long int atoll (__const char *__nptr)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern double strtod (__const char *__restrict __nptr,
char **__restrict __endptr)
throw () __attribute__ ((__nonnull__ (1))) ;
extern float strtof (__const char *__restrict __nptr,
char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))) ;
extern long double strtold (__const char *__restrict __nptr,
char **__restrict __endptr)
throw () __attribute__ ((__nonnull__ (1))) ;
extern long int strtol (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1))) ;
extern unsigned long int strtoul (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1))) ;
__extension__
extern long long int strtoq (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1))) ;
__extension__
extern unsigned long long int strtouq (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1))) ;
__extension__
extern long long int strtoll (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1))) ;
__extension__
extern unsigned long long int strtoull (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
throw () __attribute__ ((__nonnull__ (1))) ;
# 236 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/xlocale.h" 1 3 4
# 28 "/usr/include/xlocale.h" 3 4
typedef struct __locale_struct
{
struct __locale_data *__locales[13];
const unsigned short int *__ctype_b;
const int *__ctype_tolower;
const int *__ctype_toupper;
const char *__names[13];
} *__locale_t;
typedef __locale_t locale_t;
# 237 "/usr/include/stdlib.h" 2 3 4
extern long int strtol_l (__const char *__restrict __nptr,
char **__restrict __endptr, int __base,
__locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4))) ;
extern unsigned long int strtoul_l (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, __locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 4))) ;
__extension__
extern long long int strtoll_l (__const char *__restrict __nptr,
char **__restrict __endptr, int __base,
__locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 4))) ;
__extension__
extern unsigned long long int strtoull_l (__const char *__restrict __nptr,
char **__restrict __endptr,
int __base, __locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 4))) ;
extern double strtod_l (__const char *__restrict __nptr,
char **__restrict __endptr, __locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3))) ;
extern float strtof_l (__const char *__restrict __nptr,
char **__restrict __endptr, __locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3))) ;
extern long double strtold_l (__const char *__restrict __nptr,
char **__restrict __endptr,
__locale_t __loc)
throw () __attribute__ ((__nonnull__ (1, 3))) ;
extern __inline __attribute__ ((__gnu_inline__)) double
atof (__const char *__nptr) throw ()
{
return strtod (__nptr, (char **) __null);
}
extern __inline __attribute__ ((__gnu_inline__)) int
atoi (__const char *__nptr) throw ()
{
return (int) strtol (__nptr, (char **) __null, 10);
}
extern __inline __attribute__ ((__gnu_inline__)) long int
atol (__const char *__nptr) throw ()
{
return strtol (__nptr, (char **) __null, 10);
}
__extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int
atoll (__const char *__nptr) throw ()
{
return strtoll (__nptr, (char **) __null, 10);
}
# 311 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) throw () ;
extern long int a64l (__const char *__s)
throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 1 "/usr/include/sys/types.h" 1 3 4
# 28 "/usr/include/sys/types.h" 3 4
extern "C" {
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
typedef __ino64_t ino64_t;
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
# 99 "/usr/include/sys/types.h" 3 4
typedef __pid_t pid_t;
typedef __id_t id_t;
# 116 "/usr/include/sys/types.h" 3 4
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
# 133 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/time.h" 1 3 4
# 58 "/usr/include/time.h" 3 4
typedef __clock_t clock_t;
# 74 "/usr/include/time.h" 3 4
typedef __time_t time_t;
# 92 "/usr/include/time.h" 3 4
typedef __clockid_t clockid_t;
# 104 "/usr/include/time.h" 3 4
typedef __timer_t timer_t;
# 134 "/usr/include/sys/types.h" 2 3 4
typedef __useconds_t useconds_t;
typedef __suseconds_t suseconds_t;
# 1 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 1 3 4
# 148 "/usr/include/sys/types.h" 2 3 4
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
# 195 "/usr/include/sys/types.h" 3 4
typedef int int8_t __attribute__ ((__mode__ (__QI__)));
typedef int int16_t __attribute__ ((__mode__ (__HI__)));
typedef int int32_t __attribute__ ((__mode__ (__SI__)));
typedef int int64_t __attribute__ ((__mode__ (__DI__)));
typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
typedef int register_t __attribute__ ((__mode__ (__word__)));
# 220 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/select.h" 1 3 4
# 31 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/bits/select.h" 1 3 4
# 32 "/usr/include/sys/select.h" 2 3 4
# 1 "/usr/include/bits/sigset.h" 1 3 4
# 24 "/usr/include/bits/sigset.h" 3 4
typedef int __sig_atomic_t;
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 35 "/usr/include/sys/select.h" 2 3 4
typedef __sigset_t sigset_t;
# 1 "/usr/include/time.h" 1 3 4
# 120 "/usr/include/time.h" 3 4
struct timespec
{
__time_t tv_sec;
long int tv_nsec;
};
# 45 "/usr/include/sys/select.h" 2 3 4
# 1 "/usr/include/bits/time.h" 1 3 4
# 75 "/usr/include/bits/time.h" 3 4
struct timeval
{
__time_t tv_sec;
__suseconds_t tv_usec;
};
# 47 "/usr/include/sys/select.h" 2 3 4
# 55 "/usr/include/sys/select.h" 3 4
typedef long int __fd_mask;
# 67 "/usr/include/sys/select.h" 3 4
typedef struct
{
__fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
} fd_set;
typedef __fd_mask fd_mask;
# 99 "/usr/include/sys/select.h" 3 4
extern "C" {
# 109 "/usr/include/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
struct timeval *__restrict __timeout);
# 121 "/usr/include/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
const struct timespec *__restrict __timeout,
const __sigset_t *__restrict __sigmask);
}
# 221 "/usr/include/sys/types.h" 2 3 4
# 1 "/usr/include/sys/sysmacros.h" 1 3 4
# 30 "/usr/include/sys/sysmacros.h" 3 4
__extension__
extern unsigned int gnu_dev_major (unsigned long long int __dev)
throw ();
__extension__
extern unsigned int gnu_dev_minor (unsigned long long int __dev)
throw ();
__extension__
extern unsigned long long int gnu_dev_makedev (unsigned int __major,
unsigned int __minor)
throw ();
__extension__ extern __inline __attribute__ ((__gnu_inline__)) unsigned int
gnu_dev_major (unsigned long long int __dev) throw ()
{
return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}
__extension__ extern __inline __attribute__ ((__gnu_inline__)) unsigned int
gnu_dev_minor (unsigned long long int __dev) throw ()
{
return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}
__extension__ extern __inline __attribute__ ((__gnu_inline__)) unsigned long long int
gnu_dev_makedev (unsigned int __major, unsigned int __minor) throw ()
{
return ((__minor & 0xff) | ((__major & 0xfff) << 8)
| (((unsigned long long int) (__minor & ~0xff)) << 12)
| (((unsigned long long int) (__major & ~0xfff)) << 32));
}
# 224 "/usr/include/sys/types.h" 2 3 4
typedef __blksize_t blksize_t;
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
# 263 "/usr/include/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;
# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
# 24 "/usr/include/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 25 "/usr/include/bits/pthreadtypes.h" 2 3 4
# 51 "/usr/include/bits/pthreadtypes.h" 3 4
typedef unsigned long int pthread_t;
typedef union
{
char __size[56];
long int __align;
} pthread_attr_t;
typedef struct __pthread_internal_list
{
struct __pthread_internal_list *__prev;
struct __pthread_internal_list *__next;
} __pthread_list_t;
# 77 "/usr/include/bits/pthreadtypes.h" 3 4
typedef union
{
struct __pthread_mutex_s
{
int __lock;
unsigned int __count;
int __owner;
unsigned int __nusers;
int __kind;
int __spins;
__pthread_list_t __list;
# 102 "/usr/include/bits/pthreadtypes.h" 3 4
} __data;
char __size[40];
long int __align;
} pthread_mutex_t;
typedef union
{
char __size[4];
int __align;
} pthread_mutexattr_t;
typedef union
{
struct
{
int __lock;
unsigned int __futex;
__extension__ unsigned long long int __total_seq;
__extension__ unsigned long long int __wakeup_seq;
__extension__ unsigned long long int __woken_seq;
void *__mutex;
unsigned int __nwaiters;
unsigned int __broadcast_seq;
} __data;
char __size[48];
__extension__ long long int __align;
} pthread_cond_t;
typedef union
{
char __size[4];
int __align;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef int pthread_once_t;
typedef union
{
struct
{
int __lock;
unsigned int __nr_readers;
unsigned int __readers_wakeup;
unsigned int __writer_wakeup;
unsigned int __nr_readers_queued;
unsigned int __nr_writers_queued;
int __writer;
int __shared;
unsigned long int __pad1;
unsigned long int __pad2;
unsigned int __flags;
} __data;
# 188 "/usr/include/bits/pthreadtypes.h" 3 4
char __size[56];
long int __align;
} pthread_rwlock_t;
typedef union
{
char __size[8];
long int __align;
} pthread_rwlockattr_t;
typedef volatile int pthread_spinlock_t;
typedef union
{
char __size[32];
long int __align;
} pthread_barrier_t;
typedef union
{
char __size[4];
int __align;
} pthread_barrierattr_t;
# 272 "/usr/include/sys/types.h" 2 3 4
}
# 321 "/usr/include/stdlib.h" 2 3 4
extern long int random (void) throw ();
extern void srandom (unsigned int __seed) throw ();
extern char *initstate (unsigned int __seed, char *__statebuf,
size_t __statelen) throw () __attribute__ ((__nonnull__ (2)));
extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1)));
struct random_data
{
int32_t *fptr;
int32_t *rptr;
int32_t *state;
int rand_type;
int rand_deg;
int rand_sep;
int32_t *end_ptr;
};
extern int random_r (struct random_data *__restrict __buf,
int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int srandom_r (unsigned int __seed, struct random_data *__buf)
throw () __attribute__ ((__nonnull__ (2)));
extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
size_t __statelen,
struct random_data *__restrict __buf)
throw () __attribute__ ((__nonnull__ (2, 4)));
extern int setstate_r (char *__restrict __statebuf,
struct random_data *__restrict __buf)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int rand (void) throw ();
extern void srand (unsigned int __seed) throw ();
extern int rand_r (unsigned int *__seed) throw ();
extern double drand48 (void) throw ();
extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1)));
extern long int lrand48 (void) throw ();
extern long int nrand48 (unsigned short int __xsubi[3])
throw () __attribute__ ((__nonnull__ (1)));
extern long int mrand48 (void) throw ();
extern long int jrand48 (unsigned short int __xsubi[3])
throw () __attribute__ ((__nonnull__ (1)));
extern void srand48 (long int __seedval) throw ();
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
throw () __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1)));
struct drand48_data
{
unsigned short int __x[3];
unsigned short int __old_x[3];
unsigned short int __c;
unsigned short int __init;
unsigned long long int __a;
};
extern int drand48_r (struct drand48_data *__restrict __buffer,
double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int lrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int mrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
throw () __attribute__ ((__nonnull__ (1, 2)));
extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
throw () __attribute__ ((__nonnull__ (2)));
extern int seed48_r (unsigned short int __seed16v[3],
struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2)));
extern int lcong48_r (unsigned short int __param[7],
struct drand48_data *__buffer)
throw () __attribute__ ((__nonnull__ (1, 2)));
# 471 "/usr/include/stdlib.h" 3 4
extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
extern void *calloc (size_t __nmemb, size_t __size)
throw () __attribute__ ((__malloc__)) ;
# 485 "/usr/include/stdlib.h" 3 4
extern void *realloc (void *__ptr, size_t __size)
throw () __attribute__ ((__warn_unused_result__));
extern void free (void *__ptr) throw ();
extern void cfree (void *__ptr) throw ();
# 1 "/usr/include/alloca.h" 1 3 4
# 25 "/usr/include/alloca.h" 3 4
# 1 "/gpfs-biou/jmg3/gcc-install/lib/gcc/powerpc64-unknown-linux-gnu/4.8.1/include/stddef.h" 1 3 4
# 26 "/usr/include/alloca.h" 2 3 4
extern "C" {
extern void *alloca (size_t __size) throw ();
}
# 498 "/usr/include/stdlib.h" 2 3 4
extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)) ;
extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
throw () __attribute__ ((__nonnull__ (1))) ;
extern void abort (void) throw () __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1)));
extern "C++" int at_quick_exit (void (*__func) (void))
throw () __asm ("at_quick_exit") __attribute__ ((__nonnull__ (1)));
# 536 "/usr/include/stdlib.h" 3 4
extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
throw () __attribute__ ((__nonnull__ (1)));
extern void exit (int __status) throw () __attribute__ ((__noreturn__));
extern void quick_exit (int __status) throw () __attribute__ ((__noreturn__));
extern void _Exit (int __status) throw () __attribute__ ((__noreturn__));
extern char *getenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1))) ;
extern char *__secure_getenv (__const char *__name)
throw () __attribute__ ((__nonnull__ (1))) ;
extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1)));
extern int setenv (__const char *__name, __const char *__value, int __replace)
throw () __attribute__ ((__nonnull__ (2)));
extern int unsetenv (__const char *__name) throw () __attribute__ ((__nonnull__ (1)));
extern int clearenv (void) throw ();
# 606 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ;
# 620 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 630 "/usr/include/stdlib.h" 3 4
extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 642 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
# 652 "/usr/include/stdlib.h" 3 4
extern int mkstemps64 (char *__template, int __suffixlen)
__attribute__ ((__nonnull__ (1))) ;
# 663 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ;
# 674 "/usr/include/stdlib.h" 3 4
extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 684 "/usr/include/stdlib.h" 3 4
extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ;
# 694 "/usr/include/stdlib.h" 3 4
extern int mkostemps (char *__template, int __suffixlen, int __flags)
__attribute__ ((__nonnull__ (1))) ;
# 706 "/usr/include/stdlib.h" 3 4
extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
__attribute__ ((__nonnull__ (1))) ;
# 717 "/usr/include/stdlib.h" 3 4
extern int system (__const char *__command) ;
extern char *canonicalize_file_name (__const char *__name)
throw () __attribute__ ((__nonnull__ (1))) ;
# 734 "/usr/include/stdlib.h" 3 4
extern char *realpath (__const char *__restrict __name,
char *__restrict __resolved) throw () ;
typedef int (*__compar_fn_t) (__const void *, __const void *);
typedef __compar_fn_t comparison_fn_t;
typedef int (*__compar_d_fn_t) (__const void *, __const void *, void *);
extern void *bsearch (__const void *__key, __const void *__base,
size_t __nmemb, size_t __size, __compar_fn_t __compar)
__attribute__ ((__nonnull__ (1, 2, 5))) ;
extern void qsort (void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
__compar_d_fn_t __compar, void *__arg)
__attribute__ ((__nonnull__ (1, 4)));
extern int abs (int __x) throw () __attribute__ ((__const__)) ;
extern long int labs (long int __x) throw () __attribute__ ((__const__)) ;
__extension__ extern long long int llabs (long long int __x)
throw () __attribute__ ((__const__)) ;
extern div_t div (int __numer, int __denom)
throw () __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
throw () __attribute__ ((__const__)) ;
__extension__ extern lldiv_t lldiv (long long int __numer,
long long int __denom)
throw () __attribute__ ((__const__)) ;
# 808 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ;
extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ;
extern char *gcvt (double __value, int __ndigit, char *__buf)
throw () __attribute__ ((__nonnull__ (3))) ;
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
throw () __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
throw () __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
throw () __attribute__ ((__nonnull__ (3))) ;
extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qecvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
throw () __attribute__ ((__nonnull__ (3, 4, 5)));
extern int mblen (__const char *__s, size_t __n) throw () ;
extern int mbtowc (wchar_t *__restrict __pwc,
__const char *__restrict __s, size_t __n) throw () ;
extern int wctomb (char *__s, wchar_t __wchar) throw () ;
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
__const char *__restrict __s, size_t __n) throw ();
extern size_t wcstombs (char *__restrict __s,
__const wchar_t *__restrict __pwcs, size_t __n)
throw ();
# 885 "/usr/include/stdlib.h" 3 4
extern int rpmatch (__const char *__response) throw () __attribute__ ((__nonnull__ (1))) ;
# 896 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
char *__const *__restrict __tokens,
char **__restrict __valuep)
throw () __attribute__ ((__nonnull__ (1, 2, 3))) ;
extern void setkey (__const char *__key) throw () __attribute__ ((__nonnull__ (1)));
extern int posix_openpt (int __oflag) ;
extern int grantpt (int __fd) throw ();
extern int unlockpt (int __fd) throw ();
extern char *ptsname (int __fd) throw () ;
extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
throw () __attribute__ ((__nonnull__ (2)));
extern int getpt (void);
extern int getloadavg (double __loadavg[], int __nelem)
throw () __attribute__ ((__nonnull__ (1)));
# 964 "/usr/include/stdlib.h" 3 4
}
# 13 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c" 2
# 13 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 1 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/sequenceAlignment.h" 1
# 91 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/sequenceAlignment.h"
typedef struct simmat {
char similarity[((64) + 1)][((64) + 1)];
char aminoAcid[(((64) + 1) + 1)];
char *bases;
char *codon[(((64) + 1) + 1)];
unsigned char encode[((64) + ((64) + 1))];
unsigned char encode_first[((64) + ((64) + 1))];
char hyphen, star;
int exact, similar, dissimilar, gapStart, gapExtend, matchLimit;
} SIMMATRIX_T;
typedef struct seqdat {
unsigned char *main, *match;
int mainLen, matchLen, maxValidation;
} SEQDATA_T;
typedef struct astr {
SEQDATA_T *seqData;
SIMMATRIX_T *simMatrix;
long long **goodScores;
int numThreads, *numReports, **goodEndsI, **goodEndsJ;
} ASTR_T;
typedef struct bstr {
long long **bestScores;
int numThreads, *numReports;
int **bestStartsI, **bestStartsJ, **bestEndsI, **bestEndsJ;
unsigned char ***bestSeqsI, ***bestSeqsJ;
} BSTR_T;
typedef struct cstr {
long long *finalScores;
int numReports;
int *finalStartsI, *finalStartsJ, *finalEndsI, *finalEndsJ;
unsigned char **finalSeqsI, **finalSeqsJ;
} CSTR_T;
# 207 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/sequenceAlignment.h"
void getUserParameters(void);
SEQDATA_T *genScalData(unsigned int, SIMMATRIX_T*, int, int, int);
SEQDATA_T *freeSeqData(SEQDATA_T*);
SIMMATRIX_T *genSimMatrix(int, int, int, int, int, int, int);
SIMMATRIX_T *freeSimMatrix(SIMMATRIX_T*);
void verifyData(SIMMATRIX_T*, SEQDATA_T*, int, int);
int gridInfo(int*, int*, int*, int*);
void qSort(int*, const int*, const int, const int);
void qSort_both(long long*, int*, const long long*, const int);
ASTR_T *pairwiseAlign(SEQDATA_T*, SIMMATRIX_T*, int, int, int);
ASTR_T *freeA(ASTR_T*);
BSTR_T *scanBackward(ASTR_T*, int, int, int);
BSTR_T *freeB(BSTR_T*);
void verifyAlignment(SIMMATRIX_T*, BSTR_T*, int);
CSTR_T *mergeAlignment(BSTR_T*, int, int);
CSTR_T *freeC(CSTR_T*);
void verifyMergeAlignment(SIMMATRIX_T*, CSTR_T*, int);
double getSeconds(void);
void dispElapsedTime(double);
# 15 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c" 2
# 15 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 16 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 17 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 18 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 19 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 20 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
void getUserParameters_npm(void);
void getUserParameters_quick(void); void getUserParameters(void);
void getUserParameters_resumable(void) {const int ____chimes_did_disable0 = new_stack((void *)(&getUserParameters), "getUserParameters", &____must_manage_getUserParameters, 0, 0) ; if (____chimes_replaying) { switch(get_next_call()) { default: { chimes_error(); } } } ; ;
# 21 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 22 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
if ((5) <= 0 || (-3) >= 0 || (8) < 0 || (1) <= 0) {
# 23 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
fprintf(stderr,"Similarity parameters set in userParameters are invalid\n");
# 24 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
exit(1);
# 25 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
# 26 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
if ((200) <= 0) {
# 27 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
fprintf(stderr,"Kernel 1 parameters set in userParameters are invalid\n");
# 28 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
# 29 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
if (((200)/2) <= 0) {
# 30 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
fprintf(stderr,"Kernel 2 parameters set in userParameters are invalid\n");
# 31 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
# 32 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
rm_stack(false, 0UL, "getUserParameters", &____must_manage_getUserParameters, 0, ____chimes_did_disable0, false); }
# 20 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
void getUserParameters_quick(void) {const int ____chimes_did_disable0 = new_stack((void *)(&getUserParameters), "getUserParameters", &____must_manage_getUserParameters, 0, 0) ; ; ;
# 21 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 22 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
if ((5) <= 0 || (-3) >= 0 || (8) < 0 || (1) <= 0) {
# 23 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
fprintf(stderr,"Similarity parameters set in userParameters are invalid\n");
# 24 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
exit(1);
# 25 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
# 26 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
if ((200) <= 0) {
# 27 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
fprintf(stderr,"Kernel 1 parameters set in userParameters are invalid\n");
# 28 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
# 29 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
if (((200)/2) <= 0) {
# 30 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
fprintf(stderr,"Kernel 2 parameters set in userParameters are invalid\n");
# 31 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
# 32 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
rm_stack(false, 0UL, "getUserParameters", &____must_manage_getUserParameters, 0, ____chimes_did_disable0, false); }
void getUserParameters(void) { (____chimes_replaying ? getUserParameters_resumable() : getUserParameters_quick()); }
# 20 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
void getUserParameters_npm(void) {
# 21 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
# 22 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
if ((5) <= 0 || (-3) >= 0 || (8) < 0 || (1) <= 0) {
# 23 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
fprintf(stderr,"Similarity parameters set in userParameters are invalid\n");
# 24 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
exit(1);
# 25 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
# 26 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
if ((200) <= 0) {
# 27 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
fprintf(stderr,"Kernel 1 parameters set in userParameters are invalid\n");
# 28 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
# 29 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
if (((200)/2) <= 0) {
# 30 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
fprintf(stderr,"Kernel 2 parameters set in userParameters are invalid\n");
# 31 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
# 32 "/gpfs-biou/jmg3/spec/benchspec/OMP2012/372.smithwa/src/getUserParameters.c"
}
static int module_init() {
init_module(3803651465693704543UL, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0,
"getUserParameters", 0, "_Z17getUserParametersv", "_Z21getUserParameters_npmv", 0, 0, 0UL, 0,
"getUserParameters", &(____chimes_does_checkpoint_getUserParameters_npm),
"getUserParameters", "_Z17getUserParametersv", 0, 0);
return 0;
}
static const int __libchimes_module_init = module_init();
| [
"jmaxg3@gmail.com"
] | jmaxg3@gmail.com |
96a460d878a94ab50b6cf78fade83ccc3f946e86 | e1230a4aba63635e6bc2371e97f1d9a2ac069921 | /Server/SinBaram/sinSOD2.cpp | d9cacee443edc55ea50ec701ed867ac6d817e212 | [] | no_license | tobiasquinteiro/HonorPT | d900c80c2a92e0af792a1ea77e54f6bcd737d941 | 4845c7a03b12157f9de0040443a91e45b38e8ca0 | refs/heads/master | 2021-12-09T08:14:33.777333 | 2016-05-04T03:32:23 | 2016-05-04T03:32:23 | null | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 87,806 | cpp | /*----------------------------------------------------------------------------*
* 파일명 : sinSOD2.cpp
* 하는일 : 현재 Test 용으로 쓰이고 있따
* 작성일 : 최종업데이트 4월
* 적성자 : 박상열
*-----------------------------------------------------------------------------*/
#include "sinLinkHeader.h"
#include "..\\tjboy\\clanmenu\\tjclan.h"
#include "..\\tjboy\\clanmenu\\clan_Enti.h"
#include "..\\tjboy\\isaocheck\\auth.h"
#include "..\\FontImage.h"
#include "..\\bellatraFontEffect.h" //폰트 이펙트
#include "..\\field.h"
#include "..\\SrcServer\\onserver.h"
cSINSOD2 cSinSod2;
cSINSIEGE cSinSiege;
sinMESSAGEBOX_NEW sinMessageBox_New;
LPDIRECTDRAWSURFACE4 lpbltr_clanN;
LPDIRECTDRAWSURFACE4 lpbltr_clanB;
int Matbltr_Paper291;
int Matbltr_Paper291_Text;
LPDIRECTDRAWSURFACE4 lpbltr_ButtonBox;
LPDIRECTDRAWSURFACE4 lpbltr_Button_Clan;
LPDIRECTDRAWSURFACE4 lpbltr_Button_Clan_G;
LPDIRECTDRAWSURFACE4 lpbltr_Button_Prize;
LPDIRECTDRAWSURFACE4 lpbltr_Button_Prize_G;
LPDIRECTDRAWSURFACE4 lpbltr_Button_OK;
LPDIRECTDRAWSURFACE4 lpbltr_Button_OK_G;
int Matbltr_Logo;
LPDIRECTDRAWSURFACE4 lpbltr_ClanRank_Title;
int Matbltr_ClanRank_KindBar;
LPDIRECTDRAWSURFACE4 Matbltr_ClanRank_ListLine;
RECT SodButtonRect[3] = {
{111,393,111+68,393+23},
{189,393,189+68,393+23},
{267,393,267+68,393+23},
};
int MatSod2Box[10]; //박스 Mat
/*----------------------------------------------------------------------------*
* Init
*-----------------------------------------------------------------------------*/
void cSINSOD2::Init()
{
char szBuff[128];
for(int i = 0 ; i < 9 ; i++){
wsprintf(szBuff,"Image\\SinImage\\Help\\box%d.tga",i+1);
MatSod2Box[i] = CreateTextureMaterial( szBuff , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
}
MatSod2Box[9] = CreateTextureMaterial( "Image\\SinImage\\Help\\Box_Line.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
Matbltr_Paper291 = CreateTextureMaterial( "Image\\SinImage\\Help\\bltr_paper291_145.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
Matbltr_Paper291_Text = CreateTextureMaterial( "Image\\SinImage\\Help\\bltr_paper_txt.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
Matbltr_Logo = CreateTextureMaterial( "Image\\SinImage\\Help\\bltr.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
Matbltr_ClanRank_KindBar = CreateTextureMaterial( "Image\\SinImage\\Help\\bltr_list-title.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
Load();
}
/*----------------------------------------------------------------------------*
* Load
*-----------------------------------------------------------------------------*/
void cSINSOD2::Load()
{
//벨라트라 운영클랜
lpbltr_clanN = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_clanN.bmp" );
lpbltr_clanB = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_clanB.bmp" );
lpbltr_ButtonBox = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_box.bmp" );
lpbltr_Button_Clan = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_bt1.bmp" );
lpbltr_Button_Clan_G = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_bt1_.bmp" );
lpbltr_Button_Prize = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_bt2.bmp" );
lpbltr_Button_Prize_G = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_bt2_.bmp" );
lpbltr_Button_OK = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_bt3.bmp" );
lpbltr_Button_OK_G = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_bt3_.bmp" );
lpbltr_ClanRank_Title = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_list-title.bmp" );
Matbltr_ClanRank_ListLine = LoadDibSurfaceOffscreen( "Image\\SinImage\\Help\\bltr_list-line.bmp" );
}
/*----------------------------------------------------------------------------*
* Release
*-----------------------------------------------------------------------------*/
void cSINSOD2::Release()
{
}
/*----------------------------------------------------------------------------*
* Draw
*-----------------------------------------------------------------------------*/
void cSINSOD2::Draw()
{
int i = 0, j =0 , t = 0;
//박스를 그린다
if(sinMessageBox_New.Flag){
for(i = 0 ; i < 9 ; i++){
switch(i){
case 0: //상단 왼쪽 귀퉁이
dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX, sinMessageBox_New.PosiY
, 64, 32 , 255 ); //인터페이스 메인
break;
case 1: //상단 중간
dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX+64, sinMessageBox_New.PosiY
, sinMessageBox_New.SizeW-(64*2), 32 , 255 ); //인터페이스 메인
break;
case 2: //상단 오른쪽
dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX+sinMessageBox_New.SizeW-64, sinMessageBox_New.PosiY
, 64, 32 , 255 ); //인터페이스 메인
break;
case 3: //중단 왼쪽
dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX-1, sinMessageBox_New.PosiY+32
, 64, sinMessageBox_New.SizeH-(64+32), 255 ); //인터페이스 메인
break;
case 4: //중단 가운데
dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX+64-1, sinMessageBox_New.PosiY+32
, sinMessageBox_New.SizeW-(64*2)+1, sinMessageBox_New.SizeH-(64+32) , 255 ); //인터페이스 메인
break;
case 5: //중단 오른쪽
dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX+sinMessageBox_New.SizeW-64, sinMessageBox_New.PosiY+32
, 64, sinMessageBox_New.SizeH-(64+32) , 255 ); //인터페이스 메인
break;
case 6: //하단 왼쪽
dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX, sinMessageBox_New.PosiY+sinMessageBox_New.SizeH-64
, 64, 64 , 255 ); //인터페이스 메인
break;
case 7: //하단 중간
for(t = 0 ; t < 6; t++){ //귀찮아서 살짝땜빵 하핫
dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX+64+(t*(32)), sinMessageBox_New.PosiY+sinMessageBox_New.SizeH-64
, 32, 64 , 255 ); //인터페이스 메인
// dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX+64, sinMessageBox_New.PosiY+sinMessageBox_New.SizeH-64
// , sinMessageBox_New.SizeW-(64*2), 64 , 255 ); //인터페이스 메인
}
break;
case 8: //하단 오른쪽
dsDrawTexImage( MatSod2Box[i] , sinMessageBox_New.PosiX+sinMessageBox_New.SizeW-64, sinMessageBox_New.PosiY+sinMessageBox_New.SizeH-64
, 64, 64 , 255 ); //인터페이스 메인
break;
}
}
//라인
dsDrawTexImage( MatSod2Box[9] , sinMessageBox_New.PosiX+7, sinMessageBox_New.PosiY+50
, sinMessageBox_New.SizeW-(7*2), 16 , 255 ); //인터페이스 메인
}
if(BoxIndex == 1 ){ //첫페이지의 일반유저
//벨라트라 로고
dsDrawTexImage( Matbltr_Logo , 152, 97 , 128, 64 , 255 );
//벨라트라 운영클랜
DrawSprite(97,156 , lpbltr_clanN,0,0,116,12);
//벨라트라 운영클랜 페이퍼
dsDrawTexImage( Matbltr_Paper291 , 78, 241 , 291, 145 , 255 );
switch(UserType){
case 1: //일반유저
//운영클랜 클랜마크 박스
DrawSprite(97,284 , lpbltr_clanB,0,0,49,49);
DrawSprite(105,292 , ClanMark_32,0,0,32,32);
break;
case 2:
dsDrawTexImage( Matbltr_Paper291_Text , 95, 255 , 256, 128 , 255 );
break;
case 3:
dsDrawTexImage( Matbltr_Paper291_Text , 95, 255 , 256, 128 , 255 );
//상금찾기 박스
DrawSprite(189,393 , lpbltr_ButtonBox,0,0,68,23);
//상금찾기 (그레이
DrawSprite(199,399 , lpbltr_Button_Prize_G,0,0,47,12);
break;
case 4:
//운영클랜 클랜마크 박스
DrawSprite(97,284 , lpbltr_clanB,0,0,49,49);
DrawSprite(105,292 , ClanMark_32,0,0,32,32);
//상금찾기 박스
DrawSprite(189,393 , lpbltr_ButtonBox,0,0,68,23);
//상금찾기 (그레이
DrawSprite(199,399 , lpbltr_Button_Prize_G,0,0,47,12);
break;
case 6:
//상금찾기 박스
DrawSprite(189,393 , lpbltr_ButtonBox,0,0,68,23);
//상금찾기 (그레이
DrawSprite(199,399 , lpbltr_Button_Prize_G,0,0,47,12);
break;
}
/////////////////////////////버튼
//클랜순위 박스
DrawSprite(111,393 , lpbltr_ButtonBox,0,0,68,23);
//확인 박스
DrawSprite(267,393 , lpbltr_ButtonBox,0,0,68,23);
//클랜순위 버튼 (그레이)
DrawSprite(121,399 , lpbltr_Button_Clan_G,0,0,47,12);
//확인 버튼 (그레이)
DrawSprite(277,399 , lpbltr_Button_OK_G,0,0,47,12);
}
vector<string>::size_type k = 0;
if(BoxIndex == 2 ){ //클랜순위 페이지
//클랜순위 타이틀
DrawSprite(152,97 , lpbltr_ClanRank_Title,0,0,143,19);
//No . 클랜 . 포인트 . 기록일시 Bar
dsDrawTexImage( Matbltr_ClanRank_KindBar , 78, 147 , 512, 32 , 255 );
//List Line
for(j = 0; j < 10 ; j++){
DrawSprite(78,173+(j*20) , Matbltr_ClanRank_ListLine,0,0,287,20);
}
//확인 박스
DrawSprite(189,393 , lpbltr_ButtonBox,0,0,68,23);
//확인 (그레이)
DrawSprite(199,399 , lpbltr_Button_OK_G,0,0,47,12);
for(int t = 0; t < 10 ; t++){
if(ClanMarkIndex[t] >= 0){
DrawSprite(103,174+(t*20) , ClanMark[t],0,0,16,16);
}
}
}
if(sinMessageBox_New.ButtonIndex){
if(BoxIndex == 1){
switch(sinMessageBox_New.ButtonIndex){
case 1:
//클랜순위 버튼 (활성)
DrawSprite(121,399 , lpbltr_Button_Clan,0,0,47,12);
break;
case 2:
//상금찾기 (활성)
DrawSprite(199,399 , lpbltr_Button_Prize,0,0,47,12);
break;
case 3:
//확인 버튼 (활성)
DrawSprite(277,399 , lpbltr_Button_OK,0,0,47,12);
break;
}
}
if(BoxIndex == 2){
if(sinMessageBox_New.ButtonIndex == 2){
//상금찾기 (활성)
DrawSprite(199,399 , lpbltr_Button_OK,0,0,47,12);
}
}
}
}
/*----------------------------------------------------------------------------*
* DrawText
*-----------------------------------------------------------------------------*/
void cSINSOD2::DrawText()
{
int Posi[] = {103,120,230,296};
int i = 0, k=0;
vector<string>::size_type j = 0;
HDC hdc;
lpDDSBack->GetDC( &hdc );
SelectObject( hdc, sinFont);
SetBkMode( hdc, TRANSPARENT );
SetTextColor( hdc, RGB(255,244,201) );
char szTempBuff[128];
//문구
if(BoxIndex == 1){
switch(UserType){
case 1: //일반유저
for( i = 0 ; i < 3; i++){
if(i ==2){
wsprintf(szTempBuff,SodMessage_Etc[i],Tax,"%");
dsTextLineOut(hdc,97,182+(14*i), szTempBuff, lstrlen(szTempBuff));
}
else{
dsTextLineOut(hdc,97,182+(14*i), SodMessage_Etc[i], lstrlen(SodMessage_Etc[i]));
}
}
//클랜 메세지가 들어간다
while(j != sinClanMessage.size()){
dsTextLineOut(hdc,154,281+(j*20),sinClanMessage[j].c_str() , lstrlen(sinClanMessage[j].c_str()));
j++;
}
//클랜 장
wsprintf(szTempBuff,"%s : %s",sinClanMaster7,szClanMaster);
dsTextLineOut(hdc,230,355, szTempBuff, lstrlen(szTempBuff));
//운영클랜
SelectObject( hdc, sinBoldFont);
SetTextColor( hdc, RGB(255,244,201) );
dsTextLineOut(hdc,185,255, szClanName, lstrlen(szClanName));
break;
case 2: //클랜 유저
for( i = 0 ; i < 2; i++){
dsTextLineOut(hdc,97,182+(14*i), SodMessage_Clan[i], lstrlen(SodMessage_Clan[i]));
}
memset(&szTempBuff,0,sizeof(szTempBuff));
NumLineComa(TotalEMoney,szTempBuff);
dsTextLineOut(hdc,170,283, szTempBuff, lstrlen(szTempBuff));
wsprintf(szTempBuff,"%d%s",Tax,"%");
dsTextLineOut(hdc,170,301, szTempBuff, lstrlen(szTempBuff));
memset(&szTempBuff,0,sizeof(szTempBuff));
NumLineComa(TotalMoney,szTempBuff);
dsTextLineOut(hdc,170,320, szTempBuff, lstrlen(szTempBuff));
break;
case 3: //클랜 마스터
for( i = 0 ; i < 3; i++){
dsTextLineOut(hdc,97,182+(14*i), SodMessage_Master[i], lstrlen(SodMessage_Master[i]));
}
memset(&szTempBuff,0,sizeof(szTempBuff));
NumLineComa(TotalEMoney,szTempBuff);
dsTextLineOut(hdc,170,283, szTempBuff, lstrlen(szTempBuff));
wsprintf(szTempBuff,"%d%s",Tax,"%");
dsTextLineOut(hdc,170,301, szTempBuff, lstrlen(szTempBuff));
memset(&szTempBuff,0,sizeof(szTempBuff));
NumLineComa(TotalMoney,szTempBuff);
dsTextLineOut(hdc,170,320, szTempBuff, lstrlen(szTempBuff));
break;
case 4: //찾을돈이 있는 클랜
for( i = 0 ; i < 3; i++){
if(i ==2){
wsprintf(szTempBuff,SodMessage_Etc[i],Tax,"%");
dsTextLineOut(hdc,97,182+(14*i), szTempBuff, lstrlen(szTempBuff));
}
else{
dsTextLineOut(hdc,97,182+(14*i), SodMessage_Etc[i], lstrlen(SodMessage_Etc[i]));
}
}
//클랜 메세지가 들어간다
while(j != sinClanMessage.size()){
dsTextLineOut(hdc,154,281+(j*20),sinClanMessage[j].c_str() , lstrlen(sinClanMessage[j].c_str()));
j++;
}
//클랜 장
wsprintf(szTempBuff,"%s : %s",sinClanMaster7,szClanMaster);
dsTextLineOut(hdc,230,355, szTempBuff, lstrlen(szTempBuff));
//운영클랜
SelectObject( hdc, sinBoldFont);
SetTextColor( hdc, RGB(255,244,201) );
dsTextLineOut(hdc,185,255, szClanName, lstrlen(szClanName));
break;
case 6:
for( i = 0 ; i < 3; i++){
if(i ==2){
wsprintf(szTempBuff,SodMessage_Etc[i],Tax,"%");
dsTextLineOut(hdc,97,182+(14*i), szTempBuff, lstrlen(szTempBuff));
}
else{
dsTextLineOut(hdc,97,182+(14*i), SodMessage_Etc[i], lstrlen(SodMessage_Etc[i]));
}
}
SelectObject( hdc, sinBoldFont);
SetTextColor( hdc, RGB(255,244,201) );
dsTextLineOut(hdc,185,255, cldata.name, lstrlen(cldata.name));
SelectObject( hdc, sinFont);
wsprintf(szTempBuff,"%s : ",sinPrize7);
dsTextLineOut(hdc,110,283, szTempBuff, lstrlen(szTempBuff));
memset(&szTempBuff,0,sizeof(szTempBuff));
NumLineComa(ClanMoney,szTempBuff);
dsTextLineOut(hdc,152,283, szTempBuff, lstrlen(szTempBuff));
dsTextLineOut(hdc,110,301, OtherClanMaster[0], lstrlen(OtherClanMaster[0]));
dsTextLineOut(hdc,110,320, OtherClanMaster[1], lstrlen(OtherClanMaster[1]));
break;
}
//운영클랜
SelectObject( hdc, sinBoldFont);
SetTextColor( hdc, RGB(255,205,4) );
dsTextLineOut(hdc,223,157, szClanName, lstrlen(szClanName));
}
char szTempNum[16];
int TempNum;
char szTempBuff2[128];
memset(&szTempBuff2,0,sizeof(szTempBuff2));
if(BoxIndex == 2){
while(j != sinClanRank.size()){
if((j%4)!=0){
SelectObject( hdc, sinBoldFont);
SetTextColor( hdc, RGB(255,205,4) ); //순번
wsprintf(szTempNum,"%d",k+1);
if(k+1 == 10){
dsTextLineOut(hdc,82,177+(k*20),szTempNum , lstrlen(szTempNum));
}
else{
dsTextLineOut(hdc,86,177+(k*20),szTempNum , lstrlen(szTempNum));
}
SelectObject( hdc, sinFont);
SetTextColor( hdc, RGB(255,255,255) );
if((j%4)== 2){
memset(&szTempBuff2,0,sizeof(szTempBuff2));
TempNum = atoi(sinClanRank[j].c_str());
NumLineComa(TempNum,szTempBuff2);
dsTextLineOut(hdc,5+Posi[j%4],177+(k*20),szTempBuff2 , lstrlen(szTempBuff2));
}
else{
dsTextLineOut(hdc,5+Posi[j%4],177+(k*20),sinClanRank[j].c_str() , lstrlen(sinClanRank[j].c_str()));
}
}
j++;
if((j%4)==0){
k++;
}
}
}
lpDDSBack->ReleaseDC( hdc );
}
/*----------------------------------------------------------------------------*
* Main
*-----------------------------------------------------------------------------*/
DWORD ClanRankFlagTime = 0;
void cSINSOD2::Main()
{
if(sinMessageBox_New.Flag){
sinMessageBoxShowFlag = 1; //메세지 박스때문에 일케한다
sinMessageBox_New.ButtonIndex = 0;
for(int i = 0 ; i < 3 ; i++){
if ( sinMessageBox_New.ButtonRect[i].left< pCursorPos.x && sinMessageBox_New.ButtonRect[i].right > pCursorPos.x &&
sinMessageBox_New.ButtonRect[i].top < pCursorPos.y && sinMessageBox_New.ButtonRect[i].bottom > pCursorPos.y ){
if(ClanMasterMessageBoxFlag)break;
if(BoxIndex == 1){
if((UserType == 3 || UserType == 4 || UserType == 6)){
sinMessageBox_New.ButtonIndex = i+1;
}
else{
if(i ==1)continue;
sinMessageBox_New.ButtonIndex = i+1;
}
}
if(BoxIndex == 2){
if(i != 1)continue;
sinMessageBox_New.ButtonIndex = i+1;
}
}
}
if(BoxIndex == 1){
if(!ClanMark_32){
ClanMark_32Time++;
if(ClanMark_32Time >= 70*3){
ClanMark_32Time = 0;
ClanMark_32Index = ReadClanInfo_32X32(ClanImageNum);
ClanMark_32 = ClanInfo[ClanMark_32Index].hClanMark32;
}
}
if(ClanRankFlag){
ClanRankFlagTime++;
if(ClanRankFlagTime >= 70*2){
ClanRankFlag = 0;
}
}
}
if(BoxIndex == 2){
for(int t = 0; t < 10 ; t++){
if(!ClanMark[t] ){
ClanMarkLoadTime[t]++;
if(ClanMarkLoadTime[t] >= 70*3){
ClanMarkLoadTime[t] = 0;
ClanMarkIndex[t] = ReadClanInfo( ClanMarkNum[t]);
if(ClanInfo[ClanMarkIndex[t]].hClanMark){
ClanMark[t] = ClanInfo[ClanMarkIndex[t]].hClanMark;
}
}
}
}
}
}
}
/*----------------------------------------------------------------------------*
* Close
*-----------------------------------------------------------------------------*/
void cSINSOD2::Close()
{
}
/*----------------------------------------------------------------------------*
* LbuttonDown
*-----------------------------------------------------------------------------*/
void cSINSOD2::LButtonDown(int x , int y)
{
if(sinMessageBox_New.Flag){
if(sinMessageBox_New.ButtonIndex){
if(BoxIndex == 1){
switch(sinMessageBox_New.ButtonIndex){
case 1:
//클랜순위 버튼 (활성)
if(!ClanRankFlag){
sod2INFOindex(UserAccount, sinChar->szName,szConnServerName,3);
ClanRankFlag = 1;
}
//sod2INFOindex("inouess", "아처2002","아웰",3);
//RecvClanRank(szTemp);
break;
case 2:
if(UserType != 6 ){
SendClanMoneyToServer(0,0);
}
if(UserType == 6){
if(ClanMoney){
cMessageBox.ShowMessage2(MESSAGE_SOD2_GET_MONEY);
ClanMasterMessageBoxFlag = 1;
}
else{
cMessageBox.ShowMessage(MESSAGE_DONT_HAVE_CLANMONEY);
}
}
break;
case 3:
//확인 버튼 (활성)
CloseSod2MessageBox();
break;
}
}
if(BoxIndex == 2){
if(sinMessageBox_New.ButtonIndex == 2){
//확인 버튼 (활성)
CloseSod2MessageBox();
}
}
}
}
}
/*----------------------------------------------------------------------------*
* LbuttonUp
*-----------------------------------------------------------------------------*/
void cSINSOD2::LButtonUp(int x , int y)
{
}
/*----------------------------------------------------------------------------*
* RbuttonDown
*-----------------------------------------------------------------------------*/
void cSINSOD2::RButtonDown(int x , int y)
{
}
/*----------------------------------------------------------------------------*
* RbuttonUp
*-----------------------------------------------------------------------------*/
void cSINSOD2::RButtonUp(int x, int y)
{
}
/*----------------------------------------------------------------------------*
* KeyDown
*-----------------------------------------------------------------------------*/
void cSINSOD2::KeyDown()
{
}
/*----------------------------------------------------------------------------*
* Sod2박스를 닫는다
*-----------------------------------------------------------------------------*/
void cSINSOD2::CloseSod2MessageBox()
{
memset(&sinMessageBox_New,0,sizeof(sinMESSAGEBOX_NEW));
BoxIndex = 0;
UserType = 0;
sinMessageBoxShowFlag = 0;
ClanRankFlag = 0;
}
/*----------------------------------------------------------------------------*
* Sod2박스를 보여준다
*-----------------------------------------------------------------------------*/
void cSINSOD2::ShowSod2MessageBox()
{
//웹 DB에 접속해서 데이타를 가져온다
//sod2INFOindex("inouess", "아처2002","아웰", 1);
sod2INFOindex(UserAccount, sinChar->szName,szConnServerName,1);
}
//새로운 메세지 박스를 띄운다
int ShowSinMessageBox_New(int PosiX , int PosiY , int SizeW , int SizeH , RECT *rect ,int ButtonNum)
{
if(sinMessageBox_New.Flag)return FALSE; //메세지 박스를 닫고와야한다 안그럼 즐~
sinMessageBox_New.ButtonRect[0] = rect[0]; //3개까지만된다
sinMessageBox_New.ButtonRect[1] = rect[1];
sinMessageBox_New.ButtonRect[2] = rect[2];
sinMessageBox_New.PosiX = PosiX;
sinMessageBox_New.PosiY = PosiY;
sinMessageBox_New.SizeW = SizeW;
sinMessageBox_New.SizeH = SizeH;
sinMessageBox_New.ButtonNum = ButtonNum;
sinMessageBox_New.Flag = 1;
sinMessageBoxShowFlag = 1;
return TRUE;
}
/*----------------------------------------------------------------------------*
* Web Data 클라이언트로 파싱
*-----------------------------------------------------------------------------*/
void cSINSOD2::RecvWebDaTa() //현재는 테스트로 쓴다
{
}
void cSINSOD2::RecvClanRank(char *szBuff)
{
//115001132 -아마게돈- 1329660 2004-05-07
//string Test ="1 호동프린스클랜 10010020 2004/05/05 2 신바람클랜 553340 2004/2332/1 3 펭귄클랜 12131001 2003/05/23";
//string Test = "Code=2 CIMG=121000196 CName=BS-ClaN_아웰 CPoint=591260 CRegistDay=2004/05/04 CIMG=103001219 CName=별난온달 CPoint=546943 CRegistDay=2004/05/04 CIMG=104000979 CName=[NEO]오메가 CPoint=479030 CRegistDay=2004/05/05 CIMG=112000075 CName=도깨비 CPoint=454562 CRegistDay=2004/05/04 CIMG=115001132 CName=-아마게돈- CPoint=451679 CRegistDay=2004/05/04 CIMG=102001120 CName=[희진사랑] CPoint=438589 CRegistDay=2004/05/05 CIMG=109000660 CName=GladiaTor CPoint=364726 CRegistDay=2004/05/04 CIMG=118000957 CName=pUrplEviShop CPoint=357253 CRegistDay=2004/05/04 CIMG=111001179 CName=엽긔호러가족 CPoint=302324 CRegistDay=2004/05/04";
//sinClanRank = Split_ClanRankDaTa(Test);
}
// Space를 키값으로 스트링을 분리한다
vector<string> cSINSOD2::Split_ClanRankDaTa(const string& s)
{
vector<string> ret;
typedef string::size_type string_size;
string_size i = 0;
while(i != s.size()){
while(i != s.size()){
if(s[i] & 0x80)break; //한글이면 건너뛰자
if(isspace(s[i])){
++i;
}
else break;
}
string_size j =i;
while(j != s.size()){
if((j-i) > 200 ){
i = s.size();
j = i;
break;
}
if(s[j] & 0x80){ //한글이면 인덱스 2칸을지나 다시체크 (0x80을 이진수로하면 128 )
j +=2; // 0000 0000 중에 뒷부분을 다채우고 옆으로 넘어가게되면 2Byte를 사용하는 한글이란뜻임
continue;
}
if(!isspace(s[j])){
++j;
}
else break;
}
if(i != j ){
ret.push_back(s.substr(i,j-i));
i = j;
}
}
//Code별로 다시 파싱한다
vector<string> ret2;
string_size k = 0;
string_size e = 0;
string STempNum;
string CodeTemp;
int TempNumCnt = 0;
//요기서 초기화
for(int p = 0; p < 10 ; p++){
ClanMarkNum[p] = -1;
}
i = 0; //앞부분에는 CODE가 있다
while(i < ret.size()){
while(k != ret[i].size()){
if(ret[i][k] == '='){
CodeTemp.clear();
CodeTemp = ret[i].substr(0,k);
if( i ==0 && CodeTemp == "Code"){
STempNum.clear(); //이거안해주고 atoi하다가 뻑날때있다 어찌나 까다로운 string인지
STempNum = ret[i].substr(k+1,ret[i].size()-(k+1));
if(atoi(STempNum.c_str()) == 2){
ret2.clear();
return ret2;
}
else break;
}
ret2.push_back(ret[i].substr(k+1,ret[i].size()-(k+1)));
if(CodeTemp == "CIMG"){
STempNum.clear(); //이거안해주고 atoi하다가 뻑날때있다 어찌나 까다로운 string인지
STempNum = ret[i].substr(k+1,ret[i].size()-(k+1));
ClanMarkNum[TempNumCnt] = atoi(STempNum.c_str());
ClanMarkIndex[TempNumCnt] = ReadClanInfo( ClanMarkNum[TempNumCnt] );
TempNumCnt++;
}
k = 0;
break;
}
k++;
}
i++;
}
//클랜마크를 로드한다
for(int t = 0 ;t < TempNumCnt ; t++){
if(ClanMarkIndex[t] >= 0){
if(ClanInfo[ClanMarkIndex[t]].hClanMark){ //TempNumCnt이 한개라도 있어야 로드할이미지가있는거다
ClanMark[t] = ClanInfo[ClanMarkIndex[t]].hClanMark;
}
}
}
return ret2;
}
// 분할될 스트링의 길이를 기준으로 분할한다
vector<string> cSINSOD2::Split_ClanMessage(const string& s , const int Len[])
{
vector<string> ret;
typedef string::size_type string_size;
string_size i = 0;
string_size j = 0;
int LenCnt = 0;
while(i < s.size()){
if(s[i] & 0x80)i += 2; //한글
else i++;
if( (int)i-(int)j >= Len[LenCnt]){
if(Len[LenCnt+1] == 0){
ret.push_back(s.substr(j,i-j));
break;
}
ret.push_back(s.substr(j,i-j));
j = i;
LenCnt++;
}
if(s[i] == '|'){
ret.push_back(s.substr(j,i-j));
break;
}
}
/*
int LenCnt = 0;
vector<string> ret;
typedef string::size_type string_size;
string_size i = 0;
string_size j = 0;
string_size k = 0;
while(i < s.size()){
if(s[i] & 0x80){
i +=2;
if(i == s.size()){
ret.push_back(s.substr(j,i-j));
break;
}
continue;
}
else{
if( (int)i-(int)j >= Len[LenCnt]){
if(isspace(s[i])){
if(Len[LenCnt+1] == 0){
i = s.size(); //짜투리 글씨는 다찍어준다
ret.push_back(s.substr(j,i-j));
break;
}
ret.push_back(s.substr(j,i-j));
++i;
j = i;
LenCnt++;
}
}
++i;
if(i == s.size()){
ret.push_back(s.substr(j,i-j));
break;
}
}
}
*/
return ret;
}
// 웹 DB에서 받은 데이타를 구분한다
vector<string> cSINSOD2::Split_Sod2DaTa(const string& s)
{
string Temp33;
vector<string> ret;
typedef string::size_type string_size;
string_size i = 0;
while(i < s.size()){
while(i < s.size()){
if(s[i] == '|'){
++i;
}
else break;
}
string_size j = i;
while(j < s.size()){
if((j - i) > 200){
i = s.size(); //while루프를 끝낸다
j = i;
break;
}
if(s[j] != '|'){
++j;
}
else break;
}
if(i != j ){
Temp33 = s.substr(i,j-i);
ret.push_back(s.substr(i,j-i));
i = j;
}
}
//Code별로 다시 파싱한다
string Temp;
string Temp2;
string_size k = 0;
string_size e = 0;
int NumTemp = 0;
int TempArray[] = {28,22,26,0};
i = 0;
while(i < ret.size()){
while(k < ret[i].size()){
if(ret[i][k] == '='){
Temp.clear();
Temp = ret[i].substr(0,k);
Temp2.clear();
Temp2 = ret[i].substr(k+1,ret[i].size()-(k+1));
/*
if(k+1 == ret[i].size()){
if(i+1 != ret.size()){
if(ret[i+1][0] != 'C'){ //또땜빵 -_- 바쁘다보니 할수없다
Temp2.clear();
Temp2 = ret[i+1].c_str();
}
}
}
*/
if(Temp == "Code"){
NumTemp = atoi(Temp2.c_str());
switch(NumTemp){
case 0:
case 5:
case 6:
UserType = 1;
break;
case 1:
UserType = 3;
break;
case 2:
case 3:
UserType = 2;
break;
case 4:
UserType = 4;
break;
}
}
if(Temp == "CName"){
lstrcpy(szClanName,Temp2.c_str());
}
if(Temp == "CNote"){
//Temp2 ="한글한글한글한글한글한글한글한글한글한글한글한글한글한글한글한글한글한글한글한글";
Temp2.push_back('|');
sinClanMessage = Split_ClanMessage(Temp2 , TempArray);
}
if(Temp == "CZang"){
lstrcpy(szClanMaster,Temp2.c_str());
}
if(Temp == "CIMG"){
ClanImageNum = atoi(Temp2.c_str());
ClanMark_32Index = ReadClanInfo_32X32(ClanImageNum);
ClanMark_32 = ClanInfo[ClanMark_32Index].hClanMark32;
}
if(Temp == "TotalEMoney"){
TotalEMoney = atoi(Temp2.c_str());
}
if(Temp == "CTax"){
Tax = atoi(Temp2.c_str());
}
if(Temp == "TotalMoney"){
TotalMoney = atoi(Temp2.c_str());
}
if(Temp == "CClanMoney"){
ClanMoney = atoi(Temp2.c_str());
}
k = 0;
break;
}
k++;
}
i++;
}
return ret;
}
//웹 DB에서 메세지를 받는다
int cSINSOD2::RecvWebData(int Index , const string& s)
{
vector<string> Temp_V;
if(bip_port_error)return FALSE;
if(Index){
//Init();
if(Index == 1){
Temp_V = Split_Sod2DaTa(s);
if(Temp_V.size() <= 0)return FALSE;
BoxIndex = 1;
ShowSinMessageBox_New(62,78,381-62,426-78 ,SodButtonRect );
//UserType = 2; //1 일반유저 , 2 클랜원 ,3 클랜마스터 ,4 돈찾을거 있는 클랜마스터
//if(UserType == 4 || UserType == 3){
// SendClanMoneyToServer(0,0);
//}
}
else if(Index == 3){
//ClanRankFlag = 1;
sinClanRank = Split_ClanRankDaTa(s);
if(sinClanRank.size() <= 0)return FALSE;
BoxIndex = 2;
//ShowSinMessageBox_New(62,78,381-62,426-78 ,SodButtonRect );
}
//여기서 Clan 마스터인지 Clan 원인지 일반 유저인지를 가려서 메뉴를 보여준다
}
return TRUE;
}
//클랜칩이 금액을 찾는다
int sinRecvClanMoney(int RemainMoney , int GetMoney)
{
//공성전 세금총액을 세팅한다.
if(haSiegeMenuFlag){
if(RemainMoney){
cSinSiege.TotalTax = RemainMoney;
cSinSiege.ExpectedTotalTax = RemainMoney; //해외세금
}
if(GetMoney){
CheckCharForm();//인증
sinPlusMoney2(GetMoney);
sinPlaySound(SIN_SOUND_COIN);
ReformCharForm();//재인증
SendSaveMoney(); //금액 조작을 못하게하기위해 호출한다
cSinSiege.TotalTax = RemainMoney;
cSinSiege.ExpectedTotalTax = RemainMoney; //해외세금
}
return TRUE;
}
if(cSinSod2.UserType == 4 || cSinSod2.UserType ==3){
cSinSod2.ClanMoney = RemainMoney;
if(RemainMoney){
cMessageBox.ShowMessage2(MESSAGE_SOD2_GET_MONEY);
cSinSod2.ClanMasterMessageBoxFlag = 1;
cSinSod2.UserType = 6;
}
else{
if(cSinSod2.UserType == 4){
cSinSod2.UserType = 1; //찾을 돈없는 클랜장은 일반회원으로 강등 -0-
}
else
cMessageBox.ShowMessage(MESSAGE_DONT_HAVE_CLANMONEY);
}
}
if(GetMoney){
CheckCharForm();//인증
sinPlusMoney2(GetMoney);
sinPlaySound(SIN_SOUND_COIN);
ReformCharForm();//재인증
SendSaveMoney(); //금액 조작을 못하게하기위해 호출한다
cSinSod2.ClanMoney = RemainMoney;
}
return TRUE;
}
/*----------------------------------------------------------------------------*
*
* ( 공 성 전 )
*
*-----------------------------------------------------------------------------*/
int sinShowSeigeMessageBox()
{
//SeigeINFOindex(UserAccount, sinChar->szName,szConnServerName,1);
return TRUE;
}
int RecvSeigeWebData(int Index , char *string)
{
//char szTemp[65000];
//lstrcpy(szTemp,string);
return TRUE;
}
/*----------------------------------------------------------------------------*
* 테스트 <ha>공성전 메뉴박스
*-----------------------------------------------------------------------------*/
//임시객체
cHASIEGE chaSiege;
/*---사용돼는 각종 플래그----*/
int haSiegeMenuFlag=0; //공성전 메뉴플랙
int haSiegeMenuKind=0; //공성전 메뉴종류
int ScrollButtonFlag=0; //스크롤 사용시 필요한 플랙
int GraphLineFlag=0;
int haSiegeBoardFlag=0; //공성 클랜 점수창 플랙
int haSiegeMerFlag=0; //용병 설정 플랙
/*---정보박스 관련 위치정보---*/
POINT ClanSkillBoxSize={0,0}; //클랜스킬 정보 박스 사이즈
POINT ClanSkillBoxPosi={0,0}; //클랜스킬 정보 박스 포지션
/*---수성설정 관련 인덱스들---*/
int CastleKindIndex = 0; //성의 종류 관련 인덱스
int TowerIconIndex = 0; //타워 종류
int haSendTowerIndex = 0;
int MenuButtonIndex = 0; //메뉴 버튼 관련 인덱스
/*--저장돼고 세팅될때 사용될 임시함수들---*/
int HaTestMoney =0; //임시세금 금액
int HaTaxRate =0;
/*----클랜 보드 설정-----*/
sHACLANDATA sHaClanData[HACLAN_MAX]; //임의 클랜 개수
int haAlpha = 0; //보드의 알파값
int BoardTime = 0;
int haClanSkillTime=0;
int haTotalDamage = 0; //토탈 데미지를 찍어줄때 사용한다.
int haPlayTime[3] = {0}; //보드타임
/*---용병 설정 가격----*/
//임시
int haMercenrayMoney[3] = {50000,100000,300000}; //용병 가격
int haMercenrayIndex = 0; //용병 설정 인덱스
int haTowerMoney =500000;
//크리스탈 카운트를 받는다.
short haCrystalTowerCount[4]; //크리스탈 카운트
char *haC_CastleWinFilePath = "image\\Sinimage\\help\\CastleWin.sin" ;
char *haC_CastleLoseFilePath = "image\\Sinimage\\help\\CastleLose.sin";
char *haC_CastleWin_FilePath = "image\\Sinimage\\help\\CastleWining.sin" ;
char *haC_CastleLose_FilePath = "image\\Sinimage\\help\\CastleLoseing.sin";
/*---보드 클랜 이름위치-----*/
char *ScoreBoardName[] = {
"Battle Point", //플레이어 스킬 점수
"Con Rate", //자신에 클랜 점수 기여도
"B.P",
"PlayTime", //타임
"Hit Rate", //자기 클랜의 점수
"BLESS CASTLE", //문구
};
//버튼 위치
int SiegeButtonPosi[][4]={
{70 ,70 ,268,302}, //메인
{29+70 ,269+70 ,68 ,23}, //재정/방어 설정
{144+70,269+70 ,48 ,23}, //확인
{197+70,269+70 ,48 ,23}, //취소
{270 ,236+70 ,48 ,23}, //돈찾기 확인
{77+70 ,21+70 ,49 ,11}, //타워 설정버튼
{179+70-3,21+70,49 ,11}, //용병 설정버튼
};
//공성전 아이콘 위치
int SiegeIconPosi[][4]={
{26+70,83+70 ,16,16}, //스크롤
{36+70,94+70 ,30,30}, //타워속성
{36+70,216+70,30,30}, //클랜스킬 위치
{8+70 ,45+70 ,51,22}, //성타입
{10+70 ,63+70 ,12,13}, //타워 테두리
{26+70,59+70,16,16}, //실제 세율 스크롤
};
///동영상 플레이어
int haMatPlayMenu[8]={0};
int haMovieFlag = 0;
int haMovieKind = 0;
char haMovieName[64];
int haPlayerPosi[4][4] = {
{64+68+8,359,32,32},//상중하버튼
{270 ,363,48,23},//
};
cHASIEGE::cHASIEGE()
{
int i;
for(i=0;i<6;i++){
cSinSiege.TowerTypeDraw[i][1]=0;
}
for(i=0;i<4;i++){
cSinSiege.MercenaryNum[i] = 0;
}
}
cHASIEGE::~cHASIEGE()
{
}
void cHASIEGE::init()
{
}
void cHASIEGE::ImageLoad()
{
lpSiegeTax = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_tax.bmp"); //재정메인
lpSiegeDefense = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_menu.bmp"); //방어메인
lpCastleButton = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_button.bmp"); //성메인
lpMercenary = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_box.bmp");//용병메인
lpDefenseButton[0] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_soldier_text.bmp");//방어/용병 설정
lpDefenseButton[1] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_tower_text.bmp");
lpTax_Ok[0] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_button_ok01_.bmp"); //돈찾기 확인버튼
//lpTax_Ok[1] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_button_ok01.bmp");
lpSiegeMercenaryIcon[0] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_soldier_ricaM.bmp");
lpSiegeMercenaryIcon[1] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_soldier_ricaY.bmp");
lpSiegeMercenaryIcon[2] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_soldier_bress.bmp");
lpSiegeMercenaryIcon_[0] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_soldier_ricaM_01.bmp");
lpSiegeMercenaryIcon_[1] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_soldier_ricaY_01.bmp");
lpSiegeMercenaryIcon_[2] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_soldier_bress_01.bmp");
lpSiegeDefeseIcon[0] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_ice.bmp");
lpSiegeDefeseIcon[1] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_ele.bmp");
lpSiegeDefeseIcon[2] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_fire.bmp");
lpSiegeDefeseIcon_[0] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_ice01.bmp");
lpSiegeDefeseIcon_[1] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_ele01.bmp");
lpSiegeDefeseIcon_[2] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_fire01.bmp");
lpSiegeClanskillIcon[0] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_hp.bmp");
lpSiegeClanskillIcon[1] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_attack.bmp");
lpSiegeClanskillIcon[2] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_eva.bmp");
lpSiegeTaxButton = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_button_creat.bmp");
lpSiegeDefenseButton = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_tax_button_defense.bmp");
lpSiegeOkButton = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_button_ok.bmp");
lpSiegeCancelButton = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_button_cancel.bmp");
lpCastleIcon[0] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_castle_outa.bmp");
lpCastleIcon[1] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_castle_outb.bmp");
lpCastleIcon[2] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_castle_ina.bmp");
lpCastleIcon[3] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_castle_inb.bmp");
lpCastleIcon[4] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_castle_inc.bmp");
lpCastleIcon[5] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_castle_ind.bmp");
lpTaxScroll[0] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_arrow01.bmp");
lpTaxScroll[1] = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_arrow02.bmp");
lpTaxGraph = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\war_tax_graph.bmp");
}
/*----------------------------------------------------------------------------*
* Release
*-----------------------------------------------------------------------------*/
void cHASIEGE::Release()
{
halpRelease(lpSiegeTaxButton);
halpRelease(lpSiegeDefenseButton);
halpRelease(lpSiegeOkButton);
halpRelease(lpSiegeCancelButton);
halpRelease(lpTaxScroll[0]);
halpRelease(lpTaxScroll[1]);
halpRelease(lpTaxGraph);
for(int i=0;i<6;i++){
halpRelease(lpCastleIcon[i]);
}
for(int i=0;i<3;i++){
halpRelease(lpSiegeDefeseIcon[i]);
halpRelease(lpSiegeClanskillIcon[i]);
halpRelease(haPlayerButton_G[i]);
halpRelease(haPlayerButton[i]);
halpRelease(haPlayerButtonBox[i]);
halpRelease(haPlayerButtonDown[i]);
}
halpRelease(lpTwoerImage);
}
//폰트 x좌표
/*----------------------------------------------------------------------------*
* 메인
*-----------------------------------------------------------------------------*/
void cHASIEGE::Main()
{
int i;
//==================================================================//
// 성주가 바뀌면 클랜스킬을 없애준다.
//==================================================================//
if(haClanSkillTime < 70*60*10){
if(haClanSkillTime > 70*60*7){
cSkill.CancelContinueSkill(CLANSKILL_ATTACK);
cSkill.CancelContinueSkill(CLANSKILL_EVASION);
cSkill.CancelContinueSkill(CLANSKILL_ABSORB);
haClanSkillTime =70*60*10;
}
else{
haClanSkillTime++;
}
}
//==================================================================//
// 공성전 메뉴 설정
//==================================================================//
if(haSiegeMenuFlag){
switch(haSiegeMenuKind){
case HASIEGE_TAXRATES: //세율 조정
if(96 < pCursorPos.x &&96+218 > pCursorPos.x && SiegeIconPosi[0][1] < pCursorPos.y && SiegeIconPosi[0][1] +16 > pCursorPos.y ){
GraphLineFlag = 1;
}
else{
GraphLineFlag = 0;
}
//확인버튼 관련 플랙
for(i=1;i<4;i++){
if(SiegeButtonPosi[i+1][0] < pCursorPos.x && SiegeButtonPosi[i+1][0]+SiegeButtonPosi[i+1][2]> pCursorPos.x
&& SiegeButtonPosi[i+1][1]< pCursorPos.y && SiegeButtonPosi[i+1][1]+SiegeButtonPosi[i+1][3] > pCursorPos.y ){
MenuButtonIndex=i+1;
break;
}
//방어설정 버튼
else if(SiegeButtonPosi[1][0] < pCursorPos.x && SiegeButtonPosi[1][0]+SiegeButtonPosi[1][2]> pCursorPos.x
&& SiegeButtonPosi[1][1]< pCursorPos.y && SiegeButtonPosi[1][1]+SiegeButtonPosi[1][3] > pCursorPos.y ){
MenuButtonIndex=7;
break;
}
else{
MenuButtonIndex=0;
}
}
break;
case HASIEGE_DEFENSE: //방어 설정
//확인버튼 관련 인덱스
for(i=1;i<6;i++){
if(SiegeButtonPosi[i+1][0] < pCursorPos.x && SiegeButtonPosi[i+1][0]+SiegeButtonPosi[i+1][2]> pCursorPos.x
&& SiegeButtonPosi[i+1][1]< pCursorPos.y && SiegeButtonPosi[i+1][1]+SiegeButtonPosi[i+1][3] > pCursorPos.y ){
MenuButtonIndex=i+1;
break;
}
//재정설정 버튼
else if(SiegeButtonPosi[1][0] < pCursorPos.x && SiegeButtonPosi[1][0]+SiegeButtonPosi[1][2]> pCursorPos.x
&& SiegeButtonPosi[1][1]< pCursorPos.y && SiegeButtonPosi[1][1]+SiegeButtonPosi[1][3]> pCursorPos.y ){
MenuButtonIndex=8;
break;
}
else{
MenuButtonIndex=0;
}
}
//타워버튼 관련 인덱스
for(i=0;i<3;i++){
if(SiegeIconPosi[1][0]+i*84 < pCursorPos.x && SiegeIconPosi[1][0]+SiegeIconPosi[1][2]+i*84 > pCursorPos.x &&
SiegeIconPosi[1][1] < pCursorPos.y && SiegeIconPosi[1][1]+SiegeIconPosi[1][3] > pCursorPos.y ){
TowerIconIndex = i+1;
break;
}
else if(SiegeIconPosi[2][0]+i*84 < pCursorPos.x && SiegeIconPosi[2][0]+SiegeIconPosi[2][2]+i*84 > pCursorPos.x &&
SiegeIconPosi[2][1] < pCursorPos.y && SiegeIconPosi[2][1]+SiegeIconPosi[2][3] > pCursorPos.y ){
TowerIconIndex = i+4;
break;
}
else{
TowerIconIndex=0;
}
}
//성의 현재 타입
for(i=0;i<6;i++){
if(SiegeIconPosi[3][0]+i*40 < pCursorPos.x && SiegeIconPosi[3][0]+ SiegeIconPosi[3][2]+i*40 > pCursorPos.x &&
SiegeIconPosi[3][1] < pCursorPos.y && SiegeIconPosi[3][1]+ SiegeIconPosi[3][3]> pCursorPos.y ){
CastleKindIndex=i+1;
break;
}
else{
CastleKindIndex=0;
}
}
break;
}
//스크롤 움직인다.
if(ScrollButtonFlag==1){
if(SiegeIconPosi[0][0]<96){
SiegeIconPosi[0][0]=96;
ScrollButtonFlag=0;
}
else if(SiegeIconPosi[0][0]>315){
SiegeIconPosi[0][0]=314;
ScrollButtonFlag=0;
}
else{
if(95<SiegeIconPosi[0][0]&&SiegeIconPosi[0][0]<316)
SiegeIconPosi[0][0] =pCursorPos.x;
}
}
}
//==================================================================//
// 공성전 보드 설정
//==================================================================//
//공성전 점수 보드를 띠운다.
if(haSiegeBoardFlag){
BoardTime++;
if(BoardTime>60*30){
haSiegeBoardFlag = 0;
SetCastleInit();
}
}
//==================================================================//
// 동영상 재생 메뉴
//==================================================================//
if(haMovieFlag){
for(i=0;i<3;i++){
if(haPlayerPosi[0][0]+i*34 < pCursorPos.x && haPlayerPosi[0][0]+haPlayerPosi[0][2]+i*34 > pCursorPos.x &&
haPlayerPosi[0][1] < pCursorPos.y && haPlayerPosi[0][1]+haPlayerPosi[0][3] > pCursorPos.y ){
haMovieKind = i+1;
break;
}
else if(haPlayerPosi[1][0] < pCursorPos.x && haPlayerPosi[1][0]+haPlayerPosi[1][2] > pCursorPos.x &&
haPlayerPosi[1][1] < pCursorPos.y&& haPlayerPosi[1][1]+haPlayerPosi[1][3] > pCursorPos.y ){
haMovieKind = 4;
break;
}
else{
haMovieKind = 0;
}
}
}
}
/*----------------------------------------------------------------------------*
* 그림을 그리다.
*-----------------------------------------------------------------------------*/
int haStartTga=0; //보드 그림시 사용돼는 임시 변수들
int haTempScore[2]={0};
int haStartPosiX=0,haStartPosiY=100;
void cHASIEGE::Draw()
{
int i,j;
//==================================================================//
// 공성전 메뉴 설정
//==================================================================//
if(haSiegeMenuFlag){
switch(haSiegeMenuKind){
case HASIEGE_TAXRATES: //세율 조정
DrawSprite(SiegeButtonPosi[0][0],SiegeButtonPosi[0][1],lpSiegeTax ,0, 0, SiegeButtonPosi[0][2], SiegeButtonPosi[0][3], 1); //세율 설정 메인
DrawSprite(SiegeButtonPosi[4][0],SiegeButtonPosi[4][1],lpTax_Ok[0] ,0, 0, SiegeButtonPosi[4][2], SiegeButtonPosi[4][3], 1); //세금찾기버튼
DrawSprite(SiegeIconPosi[5][0],SiegeIconPosi[5][1],lpTaxScroll[1] ,0, 0,SiegeIconPosi[5][2], SiegeIconPosi[5][3], 1); //스크롤
DrawSprite(SiegeIconPosi[0][0]-8,SiegeIconPosi[0][1],lpTaxScroll[0] ,0, 0, SiegeIconPosi[0][2],SiegeIconPosi[0][3], 1); //스크롤
DrawSprite(70+26,SiegeIconPosi[0][1]-10,lpTaxGraph ,0, 0, SiegeIconPosi[0][0]-(70+26), 10, 1); //스크롤
break;
case HASIEGE_DEFENSE: //방어 설정
DrawSprite(SiegeButtonPosi[0][0],SiegeButtonPosi[0][1],lpSiegeDefense ,0, 0, SiegeButtonPosi[0][2], SiegeButtonPosi[0][3], 1); //방어 설정 메인
DrawSprite(SiegeButtonPosi[0][0]+10,SiegeButtonPosi[0][1]+63,lpMercenary ,0, 0,248, 88, 1); //메뉴 박스
//클랜스킬 표시
if(cSinSiege.ClanSkill){
DrawSprite(SiegeIconPosi[2][0]+(cSinSiege.ClanSkill-1)*84,SiegeIconPosi[2][1],lpSiegeClanskillIcon[cSinSiege.ClanSkill-1] ,0, 0, SiegeIconPosi[2][2], SiegeIconPosi[2][3], 1);//
}
//타워방어설정일 경우 (기본은 타워방어설정 )
if(!haSiegeMerFlag){
DrawSprite(SiegeButtonPosi[0][0]+10,SiegeButtonPosi[0][1]+43,lpCastleButton ,0, 0, 249, 22, 1); //성 메인
for(i=0;i<3;i++){
DrawSprite(SiegeIconPosi[1][0]+(i*82),SiegeIconPosi[1][1],lpSiegeDefeseIcon_[i] ,0, 0, SiegeIconPosi[1][2], SiegeIconPosi[1][3], 1);
}
//성의 종류와 타워 타입표시
for( i=0;i<6;i++){
for( j=0;j<2;j++){
if(cSinSiege.TowerTypeDraw[i][0]){
//그림 보정
if(cSinSiege.TowerTypeDraw[i][0]==1)
DrawSprite(SiegeIconPosi[3][0]+2,SiegeIconPosi[3][1]-2,lpCastleIcon[i] ,0, 0,SiegeIconPosi[3][2], SiegeIconPosi[3][3], 1);
else if(cSinSiege.TowerTypeDraw[i][0]==3)
DrawSprite(SiegeIconPosi[3][0]+80-1,SiegeIconPosi[3][1]-2,lpCastleIcon[i] ,0, 0,SiegeIconPosi[3][2], SiegeIconPosi[3][3], 1);
else
DrawSprite(SiegeIconPosi[3][0]+(cSinSiege.TowerTypeDraw[i][0]-1)*40,SiegeIconPosi[3][1]-2,lpCastleIcon[i] ,0, 0,SiegeIconPosi[3][2], SiegeIconPosi[3][3], 1);
if(cSinSiege.TowerTypeDraw[i][1]){
DrawSprite(SiegeIconPosi[1][0]+(cSinSiege.TowerTypeDraw[i][1]-1)*82,SiegeIconPosi[1][1],lpSiegeDefeseIcon[cSinSiege.TowerTypeDraw[i][1]-1] ,0, 0, SiegeIconPosi[1][2], SiegeIconPosi[1][3], 1);
}
}
}
}
}
//용병설정 일경우
if(haSiegeMerFlag){
for(i=0;i<3;i++){
DrawSprite(SiegeIconPosi[1][0]+(i*82),SiegeIconPosi[1][1],lpSiegeMercenaryIcon_[i] ,0, 0, 30, 30, 1);
if(cSinSiege.MercenaryNum[i]){
DrawSprite(SiegeIconPosi[1][0]+i*82,SiegeIconPosi[1][1],lpSiegeMercenaryIcon[i] ,0, 0, SiegeIconPosi[1][2], SiegeIconPosi[1][3], 1);
}
}
if(TowerIconIndex > 0){
DrawSprite(SiegeIconPosi[1][0]+(TowerIconIndex-1)*82,SiegeIconPosi[1][1],lpSiegeMercenaryIcon[TowerIconIndex-1] ,0, 0, SiegeIconPosi[1][2], SiegeIconPosi[1][3], 1);
}
}
if(!haSiegeMerFlag)//용병설정 / 방어설정 버튼 활성화
DrawSprite(SiegeButtonPosi[5][0],SiegeButtonPosi[5][1],lpDefenseButton[1] ,0, 0, SiegeButtonPosi[5][2], SiegeButtonPosi[5][3], 1); //방어설정버튼
else
DrawSprite(SiegeButtonPosi[6][0],SiegeButtonPosi[6][1],lpDefenseButton[0] ,0, 0, SiegeButtonPosi[6][2], SiegeButtonPosi[6][3], 1); //용병설정버튼
//정보박스를 보여준다.
if(TowerIconIndex > 0){
if(TowerIconIndex>3){ //클랜스킬 정보박스를 띠운다.
ClanSkillBoxPosi.x=SiegeIconPosi[2][0]+(TowerIconIndex-4)*84;
ClanSkillBoxPosi.y=SiegeIconPosi[2][1]-96;
ClanSkillBoxSize.x=11;
ClanSkillBoxSize.y=6;
}
else if(TowerIconIndex<4 && haSiegeMerFlag){ //용병설정 정보 박스를 띠운다.
ClanSkillBoxPosi.x=SiegeIconPosi[2][0]+(TowerIconIndex-1)*84;;
ClanSkillBoxPosi.y=SiegeIconPosi[2][1]-216-20;
ClanSkillBoxSize.x=15;
ClanSkillBoxSize.y=7;
}
else{ //기본 설정 정보박스를 띠운다.
ClanSkillBoxPosi.x=SiegeIconPosi[2][0]+(TowerIconIndex-1)*84;;
ClanSkillBoxPosi.y=SiegeIconPosi[2][1]-216;
ClanSkillBoxSize.x=15;
ClanSkillBoxSize.y=6;
}
for(i = 0; i < ClanSkillBoxSize.x ; i++){
for(int j = 0; j< ClanSkillBoxSize.y ; j++){
if(i == 0 && j == 0 ) //좌측상단
dsDrawTexImage( cItem.MatItemInfoBox_TopLeft , ClanSkillBoxPosi.x+(i*16) , ClanSkillBoxPosi.y+(j*16), 16, 16 , 255 );
if(j == 0 && i !=0 && i+1 < ClanSkillBoxSize.x ) //가운데
dsDrawTexImage( cItem.MatItemInfoBox_TopCenter , ClanSkillBoxPosi.x+(i*16) , ClanSkillBoxPosi.y+(j*16), 16, 16 , 255 );
if(j == 0 && i+1 == ClanSkillBoxSize.x) //우측상단
dsDrawTexImage( cItem.MatItemInfoBox_TopRight , ClanSkillBoxPosi.x+(i*16) , ClanSkillBoxPosi.y+(j*16), 16, 16 , 255 );
if(i == 0 && j != 0 && j+1 != ClanSkillBoxSize.y) //좌측 줄거리
dsDrawTexImage( cItem.MatItemInfoBox_Left , ClanSkillBoxPosi.x+(i*16) , ClanSkillBoxPosi.y+(j*16), 16, 16 , 255 );
if(i != 0 && j != 0 && i+1 !=ClanSkillBoxSize.x && j+1 !=ClanSkillBoxSize.y) //가운데 토막
dsDrawTexImage( cItem.MatItemInfoBox_Center , ClanSkillBoxPosi.x+(i*16) , ClanSkillBoxPosi.y+(j*16), 16, 16 , 255 );
if(i+1 == ClanSkillBoxSize.x && j != 0 && j+1 != ClanSkillBoxSize.y) //우측 줄거리
dsDrawTexImage( cItem.MatItemInfoBox_Right , ClanSkillBoxPosi.x+(i*16) , ClanSkillBoxPosi.y+(j*16), 16, 16 , 255 );
if(i == 0 && j+1 == ClanSkillBoxSize.y) //밑바닥 왼쪽
dsDrawTexImage( cItem.MatItemInfoBox_BottomLeft , ClanSkillBoxPosi.x+(i*16) , ClanSkillBoxPosi.y+(j*16), 16, 16 , 255 );
if(i != 0 && j+1 == ClanSkillBoxSize.y && i+1 !=ClanSkillBoxSize.x)//밑바닥 가운데
dsDrawTexImage( cItem.MatItemInfoBox_BottomCenter , ClanSkillBoxPosi.x+(i*16) , ClanSkillBoxPosi.y+(j*16), 16, 16 , 255 );
if(j+1 == ClanSkillBoxSize.y && i+1 ==ClanSkillBoxSize.x)//밑바닥 오른쪽
dsDrawTexImage( cItem.MatItemInfoBox_BottomRight , ClanSkillBoxPosi.x+(i*16) , ClanSkillBoxPosi.y+(j*16), 16, 16 , 255 );
}
}
}
//선택된 창에 한에서 테두리를 보여준다.
break;
}
switch(MenuButtonIndex){ //메뉴 버튼 관련
case 2:
DrawSprite(SiegeButtonPosi[2][0],SiegeButtonPosi[2][1],lpSiegeOkButton,0, 0, SiegeButtonPosi[2][2], SiegeButtonPosi[2][3], 1);
break;
case 3:
DrawSprite(SiegeButtonPosi[3][0],SiegeButtonPosi[3][1],lpSiegeCancelButton ,0, 0, SiegeButtonPosi[3][2], SiegeButtonPosi[3][3], 1);
break;
case 4:
if(haSiegeMenuKind==HASIEGE_TAXRATES) //돈찾기 버튼을 활성화 시킨다.
DrawSprite(SiegeButtonPosi[4][0],SiegeButtonPosi[4][1],lpSiegeOkButton ,0, 0, SiegeButtonPosi[4][2], SiegeButtonPosi[4][3], 1); //세금찾기버튼
break;
case 5:
DrawSprite(SiegeButtonPosi[5][0],SiegeButtonPosi[5][1],lpDefenseButton[1] ,0, 0, SiegeButtonPosi[5][2], SiegeButtonPosi[5][3], 1); //방어설정버튼
break;
case 6:
DrawSprite(SiegeButtonPosi[6][0],SiegeButtonPosi[6][1],lpDefenseButton[0] ,0, 0, SiegeButtonPosi[6][2], SiegeButtonPosi[6][3], 1); //용병설정버튼
break;
case 7:
DrawSprite(SiegeButtonPosi[1][0],SiegeButtonPosi[1][1],lpSiegeDefenseButton ,0, 0,SiegeButtonPosi[1][2],SiegeButtonPosi[1][3], 1);//방어메인설정 버튼
break;
case 8:
DrawSprite(SiegeButtonPosi[1][0],SiegeButtonPosi[1][1],lpSiegeTaxButton ,0, 0, SiegeButtonPosi[1][2], SiegeButtonPosi[1][3], 1);//재정메인설정 버튼
break;
}
}
//==================================================================//
// 공성전 보드 설정
//==================================================================//
if(haSiegeBoardFlag){
char TempBuff[64];
memset(&TempBuff,0,sizeof(TempBuff));
if(rsBlessCastle.TimeSec[0] < 10){
if(haStartPosiX < WinSizeX/2+256/2){
haStartPosiX+=8+haStartPosiX/2;
if(haAlpha < 255)
haAlpha+=20;
else
haAlpha=255;
}
else{
haStartPosiX = WinSizeX/2+256/2;
if(haAlpha > 0)
haAlpha-=5;
else
haAlpha=0;
}
dsDrawTexImage(haStartTga,haStartPosiX-256,haStartPosiY, 256, 64 , haAlpha );
}
DrawFontImage(ScoreBoardName[5],WinSizeX/2-200, 5,RGBA_MAKE(0,255,0,255),1.0f);
DrawFontImage(ScoreBoardName[4],WinSizeX/2-200,30,RGBA_MAKE(255,255,0,255),0.7f);
DrawFontImage(ScoreBoardName[1],WinSizeX/2-200,49,RGBA_MAKE(255,255,0,255),0.7f);
DrawFontImage(ScoreBoardName[3],WinSizeX/2+20,7,RGBA_MAKE(100,100,255,255),0.8f);
wsprintf(TempBuff,"%d:%d:%d",haPlayTime[2],haPlayTime[1],haPlayTime[0]);
DrawFontImage(TempBuff,WinSizeX/2+115,7,RGBA_MAKE(100,100,255,255),0.8f);
DrawFontImage(ScoreBoardName[0],WinSizeX/2-360,7,RGBA_MAKE(0,255,0,255),0.7f);
wsprintf(TempBuff,"%d",lpCurPlayer->sBlessCastle_Damage[1]);
DrawFontImage(TempBuff,WinSizeX/2-240,7,RGBA_MAKE(200,0,0,255),0.7f);
if(!haStartTga){
haStartTga=CreateTextureMaterial("image\\Bellatra\\T_Start_278_65.tga", 0, 0, 0,0, SMMAT_BLEND_ALPHA);
ReadTextures(); //텍스쳐 로딩
}
for( i=0;i<10;i++){
if(sHaClanData[i].Flag){
if(GetClanCode(lpCurPlayer->smCharInfo.ClassClan) == sHaClanData[i].CLANCODE){
wsprintf(TempBuff,"%d",sHaClanData[i].Score*100/haTotalDamage);
if(haTempScore[0]==sHaClanData[i].Score*100/haTotalDamage)
DrawFontImage(TempBuff,WinSizeX/2-100,30,RGBA_MAKE(255,255,0,255),0.8f);
else
DrawFontImage(TempBuff,WinSizeX/2-100,29,RGBA_MAKE(255,0,0,255),0.8f);
haTempScore[0]=sHaClanData[i].Score*100/haTotalDamage;
wsprintf(TempBuff,"%d",(int)lpCurPlayer->sBlessCastle_Damage[0]*100/sHaClanData[i].Score);
if(haTempScore[1]==(int)lpCurPlayer->sBlessCastle_Damage[0]*100/sHaClanData[i].Score)
DrawFontImage(TempBuff,WinSizeX/2-100,49,RGBA_MAKE(255,255,0,255),0.8f);
else
DrawFontImage(TempBuff,WinSizeX/2-100,48,RGBA_MAKE(255,0,0,255),0.8f);
haTempScore[1] = (int)lpCurPlayer->sBlessCastle_Damage[0]*100/sHaClanData[i].Score;
}
}
}
int TempCount=0;
for(i=0;i<5;i++){
if(sHaClanData[i].Flag){
//디버그 모드일때
if(smConfig.DebugMode){
wsprintf(TempBuff,"%d",sHaClanData[i].Score);
if(GetClanCode(lpCurPlayer->smCharInfo.ClassClan) == sHaClanData[i].CLANCODE){
DrawFontImage(TempBuff,WinSizeX/2+120,30+i*17,RGBA_MAKE(255,255,0,255),0.6f);
}
else{
DrawFontImage(TempBuff,WinSizeX/2+120,30+i*17,RGBA_MAKE(255,128,0,255),0.6f);
}
}
DrawSprite(WinSizeX/2+20,30+i*17,sHaClanData[i].lpClanMark,0, 0, 16, 16, 1);
}
if(haCrystalTowerCount[i] && i<4){
TempCount+= haCrystalTowerCount[i];
if(lpTwoerImage==NULL){
lpTwoerImage = LoadDibSurfaceOffscreen("image\\Sinimage\\Siege\\Tower_image.bmp");
}
}
}
for(i=0;i<TempCount;i++){
DrawSprite(WinSizeX/2-360+i*20,30,lpTwoerImage ,0, 0, 16, 32, 1);
}
}
//-----------------------------------------------------------------------------------/
// 공성전 동영상 플레이어 그림
//-----------------------------------------------------------------------------------/
if(haMovieFlag){
char szBuff[128];
for(i = 0 ; i < 9 ; i++){
wsprintf(szBuff,"Image\\SinImage\\Player\\ha_B%d.tga",i+1);
if(haMatPlayMenu[i]==NULL){
haMatPlayMenu[i] = CreateTextureMaterial( szBuff , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
ReadTextures();
}
}
//int BoxSizeX=10,BoxSizeY=10;
for(i=0;i<7;i++){
dsDrawTexImage( haMatPlayMenu[1] ,26+64+(i*32), 70, 32, 64 , 255 );
if(i<6){
dsDrawTexImage( haMatPlayMenu[3] ,64+(8*32),70+64+(i*32), 32, 32 , 255 );
dsDrawTexImage( haMatPlayMenu[7] ,40,70+64+(i*32), 32, 32 , 255 );
}
dsDrawTexImage( haMatPlayMenu[5] ,26+32+(i*32),70+64+(6*32), 64, 64 , 255 );
}
dsDrawTexImage( haMatPlayMenu[0],40, 70, 64, 64 , 255 );
dsDrawTexImage( haMatPlayMenu[2] ,64+(i*32),70,64,64,255 );
dsDrawTexImage( haMatPlayMenu[4] ,64+(i*32),70+64+((i-1)*32), 64, 64 , 255 );
dsDrawTexImage( haMatPlayMenu[6] ,40 ,70+64+((i-1)*32), 64, 64 , 255 );
dsDrawTexImage( haMatPlayMenu[5] ,26+32+(8*32),70+64+(6*32), 18, 64 , 255 );
for(i =0;i<3;i++){
wsprintf(szBuff,"Image\\SinImage\\Player\\habox_0%d.bmp",i+1);
if(haPlayerButtonBox[i]==NULL){
haPlayerButtonBox[i] = LoadDibSurfaceOffscreen(szBuff);
}
wsprintf(szBuff,"Image\\SinImage\\Player\\ha_S%d_.bmp",i+1);
if(haPlayerButton_G[i]==NULL){
haPlayerButton_G[i] = LoadDibSurfaceOffscreen(szBuff);
}
wsprintf(szBuff,"Image\\SinImage\\Player\\ha_S%d.bmp",i+1);
if(haPlayerButton[i]==NULL){
haPlayerButton[i] = LoadDibSurfaceOffscreen(szBuff);
}
wsprintf(szBuff,"Image\\SinImage\\Player\\ha0%d.bmp",i+1);
if(haPlayerButtonDown[i]==NULL){
haPlayerButtonDown[i] = LoadDibSurfaceOffscreen(szBuff);
}
DrawSprite(haPlayerPosi[0][0]+(i*34),haPlayerPosi[0][1],haPlayerButton_G[i],0, 0,haPlayerPosi[0][2],haPlayerPosi[0][3], 1);
}
DrawSprite(haPlayerPosi[0][0]+((ParkPlayMode/150)*34),haPlayerPosi[0][1],haPlayerButton[ParkPlayMode/150] ,0, 0,32,32, 1);
DrawSprite(120,74 ,haPlayerButtonBox[0] ,0, 0,149,23, 1); //
DrawSprite(64,363 ,haPlayerButtonBox[1] ,0, 0,68 ,23, 1);
DrawSprite(haPlayerPosi[1][0],haPlayerPosi[1][1],haPlayerButtonBox[2] ,0, 0,haPlayerPosi[1][2] ,haPlayerPosi[1][3], 1);
DrawSprite(78,368,haPlayerButtonDown[2] ,0, 0,36,12, 1);
if(haMovieKind==4){
DrawSprite(haPlayerPosi[1][0]+8,haPlayerPosi[1][1]+5,haPlayerButtonDown[0] ,0, 0,32,16, 1);
}
else{
DrawSprite(haPlayerPosi[1][0]+8,haPlayerPosi[1][1]+5,haPlayerButtonDown[1] ,0, 0,32,16, 1);
}
}
}
/*----------------------------------------------------------------------------*
* 서버에서 호출돼는 함수
*-----------------------------------------------------------------------------*/
//<ha>공성전 메뉴를 열어준다.
int cHASIEGE::ShowSiegeMenu(smTRANS_BLESSCASTLE *pData)
{
int i;
//클랜칩 부클랜칩이 아닐경우 리턴
#ifdef _WINMODE_DEBUG
#else
if(rsBlessCastle.dwMasterClan != GetClanCode(lpCurPlayer->smCharInfo.ClassClan))return TRUE;
#endif
SendClanMoneyToServer(0,0,1);
cSinSiege.ClanSkill = pData->ClanSkill; //클랜 스킬
for(i=0;i<3;i++){
cSinSiege.MercenaryNum[i] = pData->MercenaryNum[i]; //용병타입
}
for(i=0;i<6;i++){
cSinSiege.TowerTypeDraw[i][0] = 0;
cSinSiege.TowerTypeDraw[0][0] = 1; //내성 A를 활성화 시킨다.
cSinSiege.TowerTypeDraw[i][1] = pData->Tower[i]; //성타입의 타워만 저장
}
ImageLoad(); //이미지를 로드
int Temp=0,Temp2=0;
Temp = (pData->TaxRate*22)+96;
Temp2 = (cSinSiege.TaxRate*22)+96-8; //현재 적용돼는 세율
//현재의 세율을 세팅한다.
SiegeIconPosi[0][0] = Temp-2;
SiegeIconPosi[5][0] = Temp2-2;
HaTaxRate = pData->TaxRate;
//공성전 메뉴를 연다.
haSiegeMenuFlag = 1;
haSiegeMenuKind = HASIEGE_TAXRATES;//재정설정을 연다.
return TRUE;
}
/*----------------------------------------------------------------------------*
* 서버로부터 공성 점수를 받는다.
*-----------------------------------------------------------------------------*/
int cHASIEGE::ShowSiegeScore(rsUSER_LIST_TOP10 *pData)
{
int i;
//클랜 정보를 받아서 저장한다.
for(i=0;i<HACLAN_MAX ;i++){
if(pData->dwUserCode[i] && pData->Damage[i]){
sHaClanData[i].CLANCODE = pData->dwUserCode[i];
sHaClanData[i].Score = pData->Damage[i];
haTotalDamage = pData->dwTotalDamage;
sHaClanData[i].Flag = 1;
sHaClanData[i].ClanInfoNum = ReadClanInfo(sHaClanData[i].CLANCODE);
if(sHaClanData[i].ClanInfoNum >=0){
lstrcpy(sHaClanData[i].ClanName , ClanInfo[sHaClanData[i].ClanInfoNum].ClanInfoHeader.ClanName);
sHaClanData[i].lpClanMark = ClanInfo[sHaClanData[i].ClanInfoNum].hClanMark;
}
}
}
//크리스탈 카운트 를 받는다.
for(i=0;i<4;i++){
haCrystalTowerCount[i] = pData->bCrystalTowerCount[i];
}
return TRUE;
}
/*----------------------------------------------------------------------------*
* <ha>공성전 종료 메세지를 보여준다.
*-----------------------------------------------------------------------------*/
int cHASIEGE::ShowExitMessage()
{
//공성전 진행중 메세지
haSiegeBoardFlag = 0;
SetCastleInit();
//승리와 패배 메세지
if(rsBlessCastle.dwMasterClan == GetClanCode(lpCurPlayer->smCharInfo.ClassClan)){
cSinHelp.sinShowHelp(SIN_HELP_KIND_C_TELEPORT,QuestMessageBoxPosi2.x,QuestMessageBoxPosi2.y,QuestMessageBoxSize2.x,QuestMessageBoxSize2.y, RGBA_MAKE(0,15,128,125),haC_CastleWinFilePath);
}
else{
cSinHelp.sinShowHelp(SIN_HELP_KIND_C_TELEPORT,QuestMessageBoxPosi2.x,QuestMessageBoxPosi2.y,QuestMessageBoxSize2.x,QuestMessageBoxSize2.y, RGBA_MAKE(0,15,128,125),haC_CastleLoseFilePath);
}
return TRUE;
}
/*----------------------------------------------------------------------------*
* <ha>공성전 보드 초기화 함수
*-----------------------------------------------------------------------------*/
int cHASIEGE::SetCastleInit()
{
for(int i=0;i<3;i++){
haPlayTime[i]=0;
}
for(int i=0;i<HACLAN_MAX ;i++){
sHaClanData[i].CLANCODE=0;
sHaClanData[i].Flag=0;
sHaClanData[i].lpClanMark=0;
sHaClanData[i].Score=0;
if(i<4){
haCrystalTowerCount[i]=0;
}
}
BoardTime = 60*30;
return TRUE;
}
/*----------------------------------------------------------------------------*
* 플레이 타임 표시
*-----------------------------------------------------------------------------*/
int cHASIEGE::ShowPlayTime(int StartTime)
{
if(StartTime==0){
SetCastleInit();
return TRUE;
}
//플레이 타임을 세팅한다.
haPlayTime[0] = StartTime%60; //초
haPlayTime[1] = StartTime/60;
haPlayTime[1]-= StartTime/3600*60;
haPlayTime[2] = StartTime/3600; //시간
//1시간 간격으로 초기화 해준다.
//if(StartTime%60*10 == 0){
// SetCastleInit();
//}
if(rsBlessCastle.TimeSec[1] > 0 ){
haSiegeBoardFlag = 1;//초기화 해준다.
BoardTime = 0;
}
else{
haSiegeBoardFlag = 0;
haStartPosiX = 0;
}
return TRUE;
}
/*----------------------------------------------------------------------------*
* <ha>
*-----------------------------------------------------------------------------*/
int cHASIEGE::ShowPickUserKillPoint(int x,int y,int KillCount)
{
char TempBuff[32];
memset(&TempBuff,0,sizeof(TempBuff));
DrawFontImage(ScoreBoardName[2],x,y,RGBA_MAKE(0,255,0,255),0.7f);
wsprintf(TempBuff,"%d",KillCount);
DrawFontImage(TempBuff,x+24,y,RGBA_MAKE(255,0,0,255),0.7f);
return TRUE;
}
/*----------------------------------------------------------------------------*
* 클랜스킬 관련
*-----------------------------------------------------------------------------*/
//클랜스킬이 있으면 세팅한다.
int cHASIEGE::SetClanSkill(int ClanSkill)
{
DWORD SkillCode;
haClanSkillTime = 0;
//초기화
switch(ClanSkill){
case SIN_CLANSKILL_ABSORB:
SkillCode = CLANSKILL_ABSORB;
break;
case SIN_CLANSKILL_DAMAGE:
SkillCode = CLANSKILL_ATTACK;
break;
case SIN_CLANSKILL_EVASION:
SkillCode = CLANSKILL_EVASION;
break;
}
if(rsBlessCastle.dwMasterClan == GetClanCode(lpCurPlayer->smCharInfo.ClassClan)){
if(cSkill.SearchContiueSkillCODE(SkillCode)==SkillCode){
return TRUE;
}
else{
cSkill.CancelContinueSkill(CLANSKILL_ATTACK);
cSkill.CancelContinueSkill(CLANSKILL_EVASION);
cSkill.CancelContinueSkill(CLANSKILL_ABSORB);
}
}
else{
cSkill.CancelContinueSkill(CLANSKILL_ATTACK);
cSkill.CancelContinueSkill(CLANSKILL_EVASION);
cSkill.CancelContinueSkill(CLANSKILL_ABSORB);
return TRUE;
}
//클랜원이 맞으면 클랜스킬을 세팅한다.
sSKILL haClanSkill;
for(int j = 0 ; j < SIN_MAX_SKILL; j++){
if(sSkill[j].CODE == SkillCode){
memcpy(&haClanSkill,&sSkill[j],sizeof(sSKILL));
haClanSkill.UseTime=60;
sinContinueSkillSet(&haClanSkill);
break;
}
}
cInvenTory.SetItemToChar();
return TRUE;
}
/*----------------------------------------------------------------------------*
* haGoon 공성전 전용 아이템을 사용한다.
*-----------------------------------------------------------------------------*/
int haCastleSkillUseFlag =0;
int cHASIEGE::SetCastleItemSkill(int ItemKind)
{
DWORD CastleSkillCode;
int CastleSkillUseTime=0;
switch(ItemKind){
case SIN_CASTLEITEMSKILL_S_INVU:
CastleSkillCode = SCROLL_INVULNERABILITY;
CastleSkillUseTime = 30;
break;
case SIN_CASTLEITEMSKILL_S_CRITICAL:
CastleSkillCode = SCROLL_CRITICAL;
CastleSkillUseTime = 30;
break;
case SIN_CASTLEITEMSKILL_S_EVASION:
CastleSkillCode = SCROLL_EVASION;
CastleSkillUseTime = 30;
break;
case SIN_CASTLEITEMSKILL_S_P_LIFE:
CastleSkillCode = 0;
break;
case SIN_CASTLEITEMSKILL_S_RES:
CastleSkillCode = 0;
break;
case SIN_CASTLEITEMSKILL_R_FIRE_C:
CastleSkillCode = STONE_R_FIRECRYTAL;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_R_ICE_C:
CastleSkillCode = STONE_R_ICECRYTAL;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_R_LIGHTING_C:
CastleSkillCode = STONE_R_LINGHTINGCRYTAL;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_A_FIGHTER:
CastleSkillCode = STONE_A_FIGHTER;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_A_MECHANICIAN:
CastleSkillCode = STONE_A_MECHANICIAN;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_A_PIKEMAN:
CastleSkillCode = STONE_A_PIKEMAN;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_A_ARCHER:
CastleSkillCode = STONE_A_ARCHER;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_A_KNIGHT:
CastleSkillCode = STONE_A_KNIGHT;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_A_ATALANTA:
CastleSkillCode = STONE_A_ATALANTA;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_A_MAGICIAN:
CastleSkillCode = STONE_A_MAGICIAN;
CastleSkillUseTime = 60;
break;
case SIN_CASTLEITEMSKILL_A_PRIESTESS:
CastleSkillCode = STONE_A_PRIESTESS;
CastleSkillUseTime = 60;
break;
}
//해당 돼는 아이템이 맞으면 아이템스킬을 세팅한다.
sSKILL haCastleSkill;
if(cSkill.SearchContiueSkillCODE(CastleSkillCode)==CastleSkillCode && CastleSkillCode != 0){
cMessageBox.ShowMessage(MESSAGE_CLANSKILL_USE);
haCastleSkillUseFlag = 0;
return TRUE;
}
haCastleSkillUseFlag =1;
if(CastleSkillCode==0)return TRUE; //유지형 아이콘을 띄어주지 않는 것은 리턴 시켜준다.
for(int j = 0 ; j < SIN_MAX_SKILL; j++){
if(sSkill[j].CODE == CastleSkillCode){
memcpy(&haCastleSkill,&sSkill[j],sizeof(sSKILL));
haCastleSkill.UseTime=CastleSkillUseTime;
sinContinueSkillSet(&haCastleSkill);
SwitchSkill(&haCastleSkill);
break;
}
}
return TRUE;
}
/*----------------------------------------------------------------------------*
* 서버로 공성메뉴 데이타를 보낸다
*-----------------------------------------------------------------------------*/
int cHASIEGE::SendServerSiegeData()
{
int i;
smTRANS_BLESSCASTLE TempBlessCastle;
//TempBlessCastle 서버에 보낸다
TempBlessCastle.TaxRate = HaTaxRate; //세율
TempBlessCastle.ClanSkill = cSinSiege.ClanSkill; //클랜스킬
TempBlessCastle.Price = cSinSiege.Price;
for(i=0;i<3;i++){
TempBlessCastle.MercenaryNum[i] = cSinSiege.MercenaryNum[i]; //용병
}
for(i=0;i<6;i++){
TempBlessCastle.Tower[i] = cSinSiege.TowerTypeDraw[i][1]; //성타입의 타워만 저장
}
SendBlessCastleToServer(&TempBlessCastle,0);//서버로 보내다.
SaveGameData();
return TRUE;
}
/*----------------------------------------------------------------------------*
* 메뉴 초기화를 해준다.
*-----------------------------------------------------------------------------*/
int cHASIEGE::SetCastleMenuInit()
{
haSiegeMenuFlag=0; //메뉴를 닫아준다.
haSiegeMenuKind=0; //메뉴종류를 초기화 해준다.
haSiegeMerFlag=0; //용병 플랙을 초기화 해준다.
SiegeIconPosi[0][0]=70+20-7; //스크롤은 다시 배치
SiegeIconPosi[5][0]=70+20-7; //스크롤은 다시 배치
return TRUE;
}
/*----------------------------------------------------------------------------*
* 키다운
*-----------------------------------------------------------------------------*/
void cHASIEGE::KeyDown()
{
}
/*----------------------------------------------------------------------------*
* LButtonDown/UP
*-----------------------------------------------------------------------------*/
void cHASIEGE::LButtonDown(int x,int y)
{
int i;
//==================================================================//
// haGoon공성전 메뉴 설정
//==================================================================//
if(haSiegeMenuFlag){
//클랜칩과 부클랜칩만이 변경 할수있다.
if(cldata.myPosition == 101 ){
if(GraphLineFlag){ //스크롤
if(SiegeIconPosi[0][0]-16 < pCursorPos.x && SiegeIconPosi[0][0]+SiegeIconPosi[0][2]+16> pCursorPos.x && SiegeIconPosi[0][1]-16< pCursorPos.y && SiegeIconPosi[0][1]+SiegeIconPosi[0][3]+16> pCursorPos.y ){
ScrollButtonFlag=1;
}
else{
SiegeIconPosi[0][0] = pCursorPos.x;
}
}
if(CastleKindIndex){ //성의종류 인덱스를 넘겨준다.
for( i=0;i<6;i++){
if((CastleKindIndex-1)==i){
cSinSiege.TowerTypeDraw[CastleKindIndex-1][0] = CastleKindIndex;//선택된 성의 종류만 활성화 시킨다.
}
else{
cSinSiege.TowerTypeDraw[i][0] = 0;//선택돼지않은 성의 종류는 비활성화
}
}
}
if(TowerIconIndex){ //현재 성의 타입에 속성타워를 넘겨준다.
if(TowerIconIndex<4){
if(haSiegeMerFlag){ //용병설정
haMercenrayIndex=TowerIconIndex;
if(cSinSiege.MercenaryNum[haMercenrayIndex-1] < 20){
cMessageBox.ShowMessage2(MESSAGE_SIEGE_SET_MERCENRAY);//확인창을 띠운다.
}
}
else{ //현재성의 종류에 타워 인덱스를 넘겨준다.
for( i=0;i<6;i++){
if(cSinSiege.TowerTypeDraw[i][0]){
haSendTowerIndex=TowerIconIndex;
if(cSinSiege.TowerTypeDraw[i][1]==0){
switch(TowerIconIndex){
case 1:
cMessageBox.ShowMessage3(MESSAGE_CASTLE_BUYTOWER,"ICE");
break;
case 2:
cMessageBox.ShowMessage3(MESSAGE_CASTLE_BUYTOWER,"LIGHTING");
break;
case 3:
cMessageBox.ShowMessage3(MESSAGE_CASTLE_BUYTOWER,"FIRE");
break;
}
}
else{
cSinSiege.TowerTypeDraw[i][1]=TowerIconIndex;
}
}
}
}
}
else{
//현재 클랜 스킬에 클랜 인덱스를 넘겨준다.
cSinSiege.ClanSkill = TowerIconIndex-3;
}
}
}
switch(MenuButtonIndex){ //메뉴 버튼 관련
case 2:
if(cldata.myPosition == 101 ){
SendServerSiegeData(); //메뉴정보를 저장한다.
SetCastleMenuInit(); //초기화
}
break;
case 3:
SetCastleMenuInit(); //초기화
break;
case 4: //세금회수 버튼을 클릭하면 이 쪽으로 들어온다
if(cldata.myPosition == 101 ){
if(haSiegeMenuKind==HASIEGE_TAXRATES){
//찾을 돈이 0이면 찾을수 없다.
if((int)cSinSiege.TotalTax <= 0){
cMessageBox.ShowMessage(MESSAGE_NOT_CASTLE_TOTALMONEY);
}
else{
cMessageBox.ShowMessage2(MESSAGE_SIEGE_GET_MONEY);//돈을 찾다.
}
}
}
break;
case 5:
haSiegeMerFlag =0; //방어설정
break;
case 6:
haSiegeMerFlag =1; //용병설정
break;
case 7:
haSiegeMenuKind=2; //방어설정
break;
case 8:
haSiegeMenuKind=1; //재정설정
break;
}
}
//==================================================================//
// 동영상 재생 메뉴버튼
//==================================================================//
if(haMovieFlag){
switch(haMovieKind){
case 1: //동영상 프레임 상
ParkPlayMode = 0;
break;
case 2: //중
ParkPlayMode = 150;
break;
case 3: //하
ParkPlayMode = 300;
break;
case 4: //exit
haMovieFlag = 0;
Stop_ParkPlayer();
break;
}
}
}
void cHASIEGE::LButtonUp(int x,int y)
{
if(haSiegeMenuFlag){
if(ScrollButtonFlag){ //스크롤을 죽여준다.
ScrollButtonFlag=0;
}
}
}
/*----------------------------------------------------------------------------*
* DrawText
*-----------------------------------------------------------------------------*/
void cHASIEGE::DrawText()
{
HDC hdc;
lpDDSBack->GetDC( &hdc );
SelectObject( hdc, sinFont);
SetBkMode( hdc, TRANSPARENT );
SetTextColor( hdc, RGB(255,255,255) );
char szTempBuff[128];
char haTempBuffer[128];//임시 버퍼
//==================================================================//
// haGoon공성전 메뉴 설정
//==================================================================//
//공성전 설정을 보여준다.
if(haSiegeMenuFlag){
/*문자열을 출력한다*/
int TempCount =0;
int Skilllen=0;
int cnt=0,cnt1=0,cnt2=0;
int i=0,j=0;
int stringcut=18; //문자열을 자를 크기
int LineCount[10]={0}; //10줄 까지의 정보를 저장한다.
char TempBuffer[64]; //임시 버퍼
int Taxlen=0; //세금총액의 길이를 구한다.
switch(haSiegeMenuKind){
case HASIEGE_TAXRATES: //재정 설정
//현재 세율 (스크롤)
HaTaxRate= SiegeIconPosi[0][0]-(73+24-9);
HaTaxRate =HaTaxRate/22;
SelectObject( hdc, sinBoldFont);
SetTextColor( hdc, RGB(100,200,200) );
//세율
wsprintf(szTempBuff,SiegeMessage_Taxrates[4],cSinSiege.TaxRate,"%");
dsTextLineOut(hdc,97,112, szTempBuff, lstrlen(szTempBuff));
wsprintf(szTempBuff,SiegeMessage_Taxrates[0],HaTaxRate,"%");
dsTextLineOut(hdc,97,182, szTempBuff, lstrlen(szTempBuff));
memset(szTempBuff,0,sizeof(szTempBuff));
NumLineComa(cSinSiege.TotalTax, szTempBuff); //세금총액
lstrcat(szTempBuff,SiegeMessage_Taxrates[2]);
Taxlen=lstrlen(szTempBuff);
dsTextLineOut(hdc,247-((Taxlen-8)*8),260, szTempBuff, lstrlen(szTempBuff));
SelectObject( hdc, sinFont);
SetTextColor( hdc, RGB(255,255,255) );
wsprintf(szTempBuff,SiegeMessage_Taxrates[1]); //세금 총액
dsTextLineOut(hdc,97,244, szTempBuff, lstrlen(szTempBuff));
SetTextColor( hdc, RGB(255,255,255) );
wsprintf(szTempBuff,SiegeMessage_Taxrates[3],HaTestMoney);
dsTextLineOut(hdc,97,310, szTempBuff, lstrlen(szTempBuff));
break;
case HASIEGE_DEFENSE: //방어 설정
int LinePosX = 0;
int Linelen = 0;
int LineSetX = 0;
/*----클랜스킬 정보를 보여주다.--------*/
SelectObject( hdc, sinBoldFont);
SetBkMode( hdc, TRANSPARENT );
SetTextColor( hdc, RGB(255,200,100) );
//현재의 아이콘인덱스에 해당하는 스킬 정보를 보여준다.
if(TowerIconIndex>3){
for( i=0;i<160;i++){
if(sSkill_Info[i].CODE == CLANSKILL_ABSORB && TowerIconIndex-3== 1){
TempCount=i;
break;
}
if(sSkill_Info[i].CODE == CLANSKILL_ATTACK && TowerIconIndex-3== 2){
TempCount=i;
break;
}
if(sSkill_Info[i].CODE == CLANSKILL_EVASION && TowerIconIndex-3== 3){
TempCount=i;
break;
}
}
//스킬의 이름을 보여준다.
wsprintf(szTempBuff,sSkill_Info[TempCount].SkillName);
LineSetX = 4;
Linelen = lstrlen(szTempBuff);
LinePosX = (ClanSkillBoxSize.x*16-(Linelen*8))/2;
LineSetX+=Linelen/8*5;
dsTextLineOut(hdc,ClanSkillBoxPosi.x+LineSetX+LinePosX ,ClanSkillBoxPosi.y+20, szTempBuff, lstrlen(szTempBuff));
SelectObject( hdc, sinFont);
SetTextColor( hdc, RGB(250,250,250) );
Skilllen = lstrlen(sSkill_Info[TempCount].SkillDoc);
lstrcpy(haTempBuffer,sSkill_Info[TempCount].SkillDoc);
//띄어쓰기 돼있는 문자열을 자른다.
for(cnt=0;cnt<Skilllen;cnt++){
if(cnt1*stringcut+stringcut > cnt)continue;
if(haTempBuffer[cnt] == ' ' ){
if(LineCount[cnt1]-cnt)
LineCount[cnt1++]=cnt+1;
}
}
//마지막엔 전체값을 넣어준다.
LineCount[cnt1++]=Skilllen;
//자른문자열만큼 보여준다.
for(j=0;j<cnt1+1;j++){
//다시 초기화 해준다.
memset(TempBuffer,0,sizeof(TempBuffer));
for(i=0;cnt2<LineCount[j*1];i++,cnt2++){
TempBuffer[i]=haTempBuffer[cnt2];
}
//해당돼는 클랜스킬을 보여준다.
lstrcpy(szTempBuff,TempBuffer);
Linelen = lstrlen(szTempBuff);
LineSetX=0;
LineSetX+=Linelen/4*5;
LinePosX = (ClanSkillBoxSize.x*16-(Linelen*8))/2;
dsTextLineOut(hdc,ClanSkillBoxPosi.x+LineSetX+LinePosX,ClanSkillBoxPosi.y+40+j*18, szTempBuff, lstrlen(szTempBuff));
}
}
//타워설정/용병 설정을 보여주다.
memset(TempBuffer,0,sizeof(TempBuffer));
if(TowerIconIndex>0){
cSinSiege.MercenaryNumDraw = cSinSiege.MercenaryNum[TowerIconIndex-1];
for(i=0;i<5;i++){
switch(TowerIconIndex){ //현재 타워/용병 종류
case 1:
if(haSiegeMerFlag){
if(i==3){
wsprintf(szTempBuff,SiegeMessage_MercenrayA[i],cSinSiege.MercenaryNumDraw);
}
else
lstrcpy(szTempBuff,SiegeMessage_MercenrayA[i]);
}
else{
if(i>3)break;
lstrcpy(szTempBuff,SiegeMessage_TowerIce[i]);
}
break;
case 2:
if(haSiegeMerFlag){
if(i==3){
wsprintf(szTempBuff,SiegeMessage_MercenrayB[i],cSinSiege.MercenaryNumDraw);
}
else
lstrcpy(szTempBuff,SiegeMessage_MercenrayB[i]);
}
else{
if(i>3)break;
lstrcpy(szTempBuff,SiegeMessage_TowerLighting[i]);
}
break;
case 3:
if(haSiegeMerFlag){
if(i==3){
wsprintf(szTempBuff,SiegeMessage_MercenrayC[i],cSinSiege.MercenaryNumDraw);
}
else
lstrcpy(szTempBuff,SiegeMessage_MercenrayC[i]);
}
else{
if(i>3)break;
lstrcpy(szTempBuff,SiegeMessage_TowerFire[i]);
}
break;
}
//현재성의 종류를 얻어온다.
int TempIndex=0;
int TempIconIndex[3]={0};
for(int k=0;k<6;k++){
if(cSinSiege.TowerTypeDraw[k][0]){
TempIndex = cSinSiege.TowerTypeDraw[k][0];
break;
}
}
if(TowerIconIndex){
if(cSinSiege.MercenaryNum[TowerIconIndex-1]){
TempIconIndex[TowerIconIndex-1]=cSinSiege.MercenaryNum[TowerIconIndex-1];
}
}
SelectObject( hdc, sinBoldFont);
LineSetX = 4;
Linelen = lstrlen(szTempBuff);
LinePosX = (ClanSkillBoxSize.x*16-(Linelen*8))/2;
LineSetX+= Linelen/8*5;
//텍스트 표시
if(i==0){ //이름
SetTextColor( hdc, RGB(100,100,200));
}
else if(i==3 && cSinSiege.TowerTypeDraw[TempIndex-1][1]==TowerIconIndex && !haSiegeMerFlag){ //타워설정
SetTextColor( hdc, RGB(200,200,100));
}
else if(i==4 && haSiegeMerFlag && cSinSiege.MercenaryNumDraw == 20){
SetTextColor( hdc, RGB(200,200,100));
}
else{ //기본
SelectObject( hdc, sinFont);
SetTextColor( hdc, RGB(250,250,250));
Linelen = lstrlen(szTempBuff);
LineSetX=-4;
LineSetX+=Linelen/4*5;
LinePosX = (ClanSkillBoxSize.x*16-(Linelen*8))/2;
}
char TempBuff[32];
memset(&TempBuff,0,sizeof(TempBuff));
switch(i){
case 0: //이름
dsTextLineOut(hdc,ClanSkillBoxPosi.x+LineSetX+LinePosX ,ClanSkillBoxPosi.y+14, szTempBuff, lstrlen(szTempBuff));
break;
case 1:
case 2: //내용
case 3:
if(cSinSiege.TowerTypeDraw[TempIndex-1][1]==TowerIconIndex && !haSiegeMerFlag){
dsTextLineOut(hdc,ClanSkillBoxPosi.x+LineSetX+LinePosX,ClanSkillBoxPosi.y+20+i*18, szTempBuff, lstrlen(szTempBuff));
}
if(cSinSiege.TowerTypeDraw[TempIndex-1][1]==0 && !haSiegeMerFlag && i==3 && TowerIconIndex<4){
lstrcpy(szTempBuff,SiegeMessage_TowerMoney);
NumLineComa(haTowerMoney,TempBuff);
lstrcat(szTempBuff,TempBuff);
lstrcat(szTempBuff,Won);
Linelen = lstrlen(szTempBuff);
LineSetX=-4;
LineSetX+=Linelen/4*5;
LinePosX = (ClanSkillBoxSize.x*16-(Linelen*8))/2;
dsTextLineOut(hdc,ClanSkillBoxPosi.x+LineSetX+LinePosX,ClanSkillBoxPosi.y+20+i*18, szTempBuff, lstrlen(szTempBuff));
}
if(i==3&&haSiegeMerFlag){
dsTextLineOut(hdc,ClanSkillBoxPosi.x+LineSetX+LinePosX,ClanSkillBoxPosi.y+20+i*18, szTempBuff, lstrlen(szTempBuff));
}
else{
dsTextLineOut(hdc,ClanSkillBoxPosi.x+LineSetX+LinePosX,ClanSkillBoxPosi.y+20+i*18, szTempBuff, lstrlen(szTempBuff));
}
break;
case 4:
if(!haSiegeMerFlag || TowerIconIndex >3) break;
//용병 가격 표시
if(haSiegeMerFlag && cSinSiege.MercenaryNumDraw < 20){
lstrcpy(szTempBuff,SiegeMessage_MerMoney);
NumLineComa(haMercenrayMoney[TowerIconIndex-1],TempBuff);
lstrcat(szTempBuff,TempBuff);
lstrcat(szTempBuff,Won);
}
else{
lstrcpy(szTempBuff,SiegeMessage_MerComplete); //용병설정 완료
}
Linelen = lstrlen(szTempBuff);
LineSetX=-4;
LineSetX+=Linelen/4*5;
LinePosX = (ClanSkillBoxSize.x*16-(Linelen*8))/2;
dsTextLineOut(hdc,ClanSkillBoxPosi.x+LineSetX+LinePosX,ClanSkillBoxPosi.y+20+i*18, szTempBuff, lstrlen(szTempBuff));
break;
}
}
}//if(TowerIconIndex>0){ 종료
break;
}//haSiegeMenuKind
}//haSiegeMenuFlag
//==================================================================//
// 공성전 보드 설정
//==================================================================//
//공성전 보드에 데이타를 보여준다.
if(haSiegeBoardFlag){
SelectObject( hdc, sinBoldFont);
for(int i=0;i<5 ;i++){
if(sHaClanData[i].Flag ){
if(sHaClanData[i].ClanInfoNum >=0){
if(sinChar->ClassClan == sHaClanData[i].CLANCODE){
SetTextColor( hdc, RGB(200,200,0));
}
else{
SetTextColor( hdc, RGB(200,128,0));
}
lstrcpy(szTempBuff,sHaClanData[i].ClanName);
dsTextLineOut(hdc,WinSizeX/2+40,32+i*17,szTempBuff, lstrlen(szTempBuff));
}
}
}
}
//==================================================================//
// 공성전 동영상 플레이를 보여준다.
//==================================================================//
if(haMovieFlag){
SelectObject( hdc, sinBoldFont);
SetTextColor( hdc, RGB(255,255,255));
dsTextLineOut(hdc,152,80,haMovieName, lstrlen(haMovieName));
}
lpDDSBack->ReleaseDC( hdc );
}
/*----------------------------------------------------------------------------*
* Class cSINSIEGE
*-----------------------------------------------------------------------------*/
int cSINSIEGE::GetTaxRate()
{
return TaxRate;
}
int cSINSIEGE::SetTaxRate(int TempTaxRate)
{
TaxRate = TempTaxRate;
return TRUE;
}
int cSINSIEGE::GetTotalTax()
{
//서버에 클랜머니금액 정보를 요구한다
//TotalTax = getSiegeClanMoneyToServer(0,0); 대략
return TotalTax;
}
int cSINSIEGE::GetTaxMoney(int Money )
{
//찾고싶은 만큼의 돈을 요구한다
return TRUE;
}
/*----------------------------------------------------------------------------*
* 공성전 동영상 플레이를 보여준다.
*-----------------------------------------------------------------------------*/
int cHASIEGE::ShowCastlePlayMovie(char *szPath,char *TitleName,int Option)
{
memset(haMovieName ,0,sizeof(haMovieName));
lstrcpy(haMovieName,TitleName);
haMovieFlag = 1; //플랙을 열어준다.
if(haMovieFlag){
Play_ParkPlayer( szPath ,42,100, 307,260 ,150);
}
return TRUE;
}
| [
"cainankk@outlook.com"
] | cainankk@outlook.com |
cee5c3c5f2b47f2a22fae989d8970b2a2962544e | fdc522072a2a998b40ca5695e387a428f0a2ad5a | /Link/Windows Kits/8.0/Include/winrt/Windows.Media.Streaming.h | c5677922c020bf216a42b53adf11a9374faf5023 | [] | no_license | fajaralmu/kufi-sqr-open-gl | 876d163ef4edc7d2a278ace42a9505659f13a2ca | da30611f55e29e75094a9e085c1adc6dbe9d34ee | refs/heads/master | 2021-07-12T01:41:00.349589 | 2020-10-20T06:21:48 | 2020-10-20T06:21:48 | 203,924,499 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 357,600 | h |
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.00.0595 */
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __windows2Emedia2Estreaming_h__
#define __windows2Emedia2Estreaming_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IConnectionStatusHandler;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IDeviceControllerFinderHandler;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface ITransportParametersUpdateHandler;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IRenderingParametersUpdateHandler;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_FWD_DEFINED__ */
#ifndef ____FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
#define ____FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
typedef interface __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice;
#endif /* ____FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__ */
#ifndef ____FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
#define ____FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
typedef interface __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice;
#endif /* ____FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__ */
#ifndef ____FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
#define ____FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
typedef interface __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice;
#endif /* ____FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__ */
#ifndef ____FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
#define ____FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
typedef interface __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice;
#endif /* ____FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IDeviceController;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_FWD_DEFINED__ */
#ifndef ____FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
#define ____FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
typedef interface __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon;
#endif /* ____FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__ */
#ifndef ____FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
#define ____FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
typedef interface __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon;
#endif /* ____FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__ */
#ifndef ____FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
#define ____FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
typedef interface __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon;
#endif /* ____FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__ */
#ifndef ____FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
#define ____FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
typedef interface __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon;
#endif /* ____FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IBasicDevice;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IDeviceIcon;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_FWD_DEFINED__ */
#ifndef ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_FWD_DEFINED__
#define ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_FWD_DEFINED__
typedef interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation;
#endif /* ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_FWD_DEFINED__ */
#ifndef ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_FWD_DEFINED__
#define ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_FWD_DEFINED__
typedef interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation;
#endif /* ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_FWD_DEFINED__ */
#ifndef ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_FWD_DEFINED__
#define ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_FWD_DEFINED__
typedef interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation;
#endif /* ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_FWD_DEFINED__ */
#ifndef ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_FWD_DEFINED__
#define ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_FWD_DEFINED__
typedef interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation;
#endif /* ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IMediaRenderer;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_FWD_DEFINED__ */
#ifndef ____FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
#define ____FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
typedef interface __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed;
#endif /* ____FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__ */
#ifndef ____FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
#define ____FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
typedef interface __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed;
#endif /* ____FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__ */
#ifndef ____FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
#define ____FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
typedef interface __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed;
#endif /* ____FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__ */
#ifndef ____FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
#define ____FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
typedef interface __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed;
#endif /* ____FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IMediaRendererActionInformation;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface ITransportParameters;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_FWD_DEFINED__ */
#ifndef ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_FWD_DEFINED__
#define ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_FWD_DEFINED__
typedef interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer;
#endif /* ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_FWD_DEFINED__ */
#ifndef ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_FWD_DEFINED__
#define ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_FWD_DEFINED__
typedef interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer;
#endif /* ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IMediaRendererFactory;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_FWD_DEFINED__ */
#ifndef ____FIIterator_1___F__CIPropertySet_FWD_DEFINED__
#define ____FIIterator_1___F__CIPropertySet_FWD_DEFINED__
typedef interface __FIIterator_1___F__CIPropertySet __FIIterator_1___F__CIPropertySet;
#endif /* ____FIIterator_1___F__CIPropertySet_FWD_DEFINED__ */
#ifndef ____FIIterable_1___F__CIPropertySet_FWD_DEFINED__
#define ____FIIterable_1___F__CIPropertySet_FWD_DEFINED__
typedef interface __FIIterable_1___F__CIPropertySet __FIIterable_1___F__CIPropertySet;
#endif /* ____FIIterable_1___F__CIPropertySet_FWD_DEFINED__ */
#ifndef ____FIVectorView_1___F__CIPropertySet_FWD_DEFINED__
#define ____FIVectorView_1___F__CIPropertySet_FWD_DEFINED__
typedef interface __FIVectorView_1___F__CIPropertySet __FIVectorView_1___F__CIPropertySet;
#endif /* ____FIVectorView_1___F__CIPropertySet_FWD_DEFINED__ */
#ifndef ____FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_FWD_DEFINED__
#define ____FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_FWD_DEFINED__
typedef interface __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet;
#endif /* ____FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_FWD_DEFINED__ */
#ifndef ____FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_FWD_DEFINED__
#define ____FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_FWD_DEFINED__
typedef interface __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet;
#endif /* ____FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_FWD_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_FWD_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_FWD_DEFINED__
typedef interface __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics;
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IStreamSelectorStatics;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
#endif /* __cplusplus */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_FWD_DEFINED__ */
/* header files for imported files */
#include "windows.foundation.h"
#include "Windows.Storage.Streams.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0000 */
/* [local] */
#ifdef __cplusplus
} /*extern "C"*/
#endif
#include <windows.foundation.collections.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IBasicDevice;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0000 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0000_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0431 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0431 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0431_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0431_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0001 */
/* [local] */
#ifndef DEF___FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_USE
#define DEF___FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("84a8c766-4bc5-5757-9f1b-f61cfd9e5693"))
IIterator<ABI::Windows::Media::Streaming::IBasicDevice*> : IIterator_impl<ABI::Windows::Media::Streaming::IBasicDevice*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterator`1<Windows.Media.Streaming.IBasicDevice>"; }
};
typedef IIterator<ABI::Windows::Media::Streaming::IBasicDevice*> __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_t;
#define ____FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice ABI::Windows::Foundation::Collections::__FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0001 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0001_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0001_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0432 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0432 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0432_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0432_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0002 */
/* [local] */
#ifndef DEF___FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_USE
#define DEF___FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("7d468b5e-763b-59cd-a086-ec6d8be0d858"))
IIterable<ABI::Windows::Media::Streaming::IBasicDevice*> : IIterable_impl<ABI::Windows::Media::Streaming::IBasicDevice*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterable`1<Windows.Media.Streaming.IBasicDevice>"; }
};
typedef IIterable<ABI::Windows::Media::Streaming::IBasicDevice*> __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_t;
#define ____FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
#define __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice ABI::Windows::Foundation::Collections::__FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0002 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0002_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0002_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0433 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0433 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0433_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0433_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0003 */
/* [local] */
#ifndef DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_USE
#define DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("a55cf16b-71a2-5525-ac3b-2f5bc1eeec46"))
IVectorView<ABI::Windows::Media::Streaming::IBasicDevice*> : IVectorView_impl<ABI::Windows::Media::Streaming::IBasicDevice*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IVectorView`1<Windows.Media.Streaming.IBasicDevice>"; }
};
typedef IVectorView<ABI::Windows::Media::Streaming::IBasicDevice*> __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_t;
#define ____FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice ABI::Windows::Foundation::Collections::__FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0003 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0003_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0003_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0434 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0434 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0434_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0434_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0004 */
/* [local] */
#ifndef DEF___FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_USE
#define DEF___FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("4c58be45-d16f-5b3a-840d-a6b4e20b7088"))
IVector<ABI::Windows::Media::Streaming::IBasicDevice*> : IVector_impl<ABI::Windows::Media::Streaming::IBasicDevice*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IVector`1<Windows.Media.Streaming.IBasicDevice>"; }
};
typedef IVector<ABI::Windows::Media::Streaming::IBasicDevice*> __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_t;
#define ____FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_FWD_DEFINED__
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice ABI::Windows::Foundation::Collections::__FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0004 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0004_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0004_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0435 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0435 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0435_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0435_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0005 */
/* [local] */
#ifndef DEF___FIIterator_1_HSTRING_USE
#define DEF___FIIterator_1_HSTRING_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("8c304ebb-6615-50a4-8829-879ecd443236"))
IIterator<HSTRING> : IIterator_impl<HSTRING> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterator`1<String>"; }
};
typedef IIterator<HSTRING> __FIIterator_1_HSTRING_t;
#define ____FIIterator_1_HSTRING_FWD_DEFINED__
#define __FIIterator_1_HSTRING ABI::Windows::Foundation::Collections::__FIIterator_1_HSTRING_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterator_1_HSTRING_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0005 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0005_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0005_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0436 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0436 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0436_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0436_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0006 */
/* [local] */
#ifndef DEF___FIIterable_1_HSTRING_USE
#define DEF___FIIterable_1_HSTRING_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("e2fcc7c1-3bfc-5a0b-b2b0-72e769d1cb7e"))
IIterable<HSTRING> : IIterable_impl<HSTRING> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterable`1<String>"; }
};
typedef IIterable<HSTRING> __FIIterable_1_HSTRING_t;
#define ____FIIterable_1_HSTRING_FWD_DEFINED__
#define __FIIterable_1_HSTRING ABI::Windows::Foundation::Collections::__FIIterable_1_HSTRING_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterable_1_HSTRING_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0006 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0006_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0006_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0437 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0437 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0437_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0437_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0007 */
/* [local] */
#ifndef DEF___FIVectorView_1_HSTRING_USE
#define DEF___FIVectorView_1_HSTRING_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("2f13c006-a03a-5f69-b090-75a43e33423e"))
IVectorView<HSTRING> : IVectorView_impl<HSTRING> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IVectorView`1<String>"; }
};
typedef IVectorView<HSTRING> __FIVectorView_1_HSTRING_t;
#define ____FIVectorView_1_HSTRING_FWD_DEFINED__
#define __FIVectorView_1_HSTRING ABI::Windows::Foundation::Collections::__FIVectorView_1_HSTRING_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIVectorView_1_HSTRING_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0007 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0007_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0007_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0438 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0438 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0438_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0438_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0008 */
/* [local] */
#ifndef DEF___FIVector_1_HSTRING_USE
#define DEF___FIVector_1_HSTRING_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("98b9acc1-4b56-532e-ac73-03d5291cca90"))
IVector<HSTRING> : IVector_impl<HSTRING> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IVector`1<String>"; }
};
typedef IVector<HSTRING> __FIVector_1_HSTRING_t;
#define ____FIVector_1_HSTRING_FWD_DEFINED__
#define __FIVector_1_HSTRING ABI::Windows::Foundation::Collections::__FIVector_1_HSTRING_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIVector_1_HSTRING_USE */
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IDeviceIcon;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0008 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0008_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0008_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0439 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0439 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0439_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0439_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0009 */
/* [local] */
#ifndef DEF___FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE
#define DEF___FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("57fd211a-4ef0-58a0-90e2-7c3b816102c9"))
IIterator<ABI::Windows::Media::Streaming::IDeviceIcon*> : IIterator_impl<ABI::Windows::Media::Streaming::IDeviceIcon*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterator`1<Windows.Media.Streaming.IDeviceIcon>"; }
};
typedef IIterator<ABI::Windows::Media::Streaming::IDeviceIcon*> __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_t;
#define ____FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon ABI::Windows::Foundation::Collections::__FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0009 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0009_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0009_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0440 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0440 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0440_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0440_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0010 */
/* [local] */
#ifndef DEF___FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE
#define DEF___FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("16077ee6-dcfc-53aa-ab0e-d666ac819d6c"))
IIterable<ABI::Windows::Media::Streaming::IDeviceIcon*> : IIterable_impl<ABI::Windows::Media::Streaming::IDeviceIcon*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterable`1<Windows.Media.Streaming.IDeviceIcon>"; }
};
typedef IIterable<ABI::Windows::Media::Streaming::IDeviceIcon*> __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_t;
#define ____FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
#define __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon ABI::Windows::Foundation::Collections::__FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0010 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0010_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0010_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0441 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0441 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0441_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0441_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0011 */
/* [local] */
#ifndef DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE
#define DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("ff195e52-48eb-5709-be50-3a3914c189db"))
IVectorView<ABI::Windows::Media::Streaming::IDeviceIcon*> : IVectorView_impl<ABI::Windows::Media::Streaming::IDeviceIcon*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IVectorView`1<Windows.Media.Streaming.IDeviceIcon>"; }
};
typedef IVectorView<ABI::Windows::Media::Streaming::IDeviceIcon*> __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_t;
#define ____FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon ABI::Windows::Foundation::Collections::__FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0011 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0011_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0011_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0442 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0442 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0442_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0442_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0012 */
/* [local] */
#ifndef DEF___FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE
#define DEF___FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("a32d7731-05f6-55a2-930f-1cf5a12b19ae"))
IVector<ABI::Windows::Media::Streaming::IDeviceIcon*> : IVector_impl<ABI::Windows::Media::Streaming::IDeviceIcon*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IVector`1<Windows.Media.Streaming.IDeviceIcon>"; }
};
typedef IVector<ABI::Windows::Media::Streaming::IDeviceIcon*> __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_t;
#define ____FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_FWD_DEFINED__
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon ABI::Windows::Foundation::Collections::__FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0012 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0012_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0012_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0443 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0443 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0443_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0443_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0013 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1_UINT32_USE
#define DEF___FIAsyncOperationCompletedHandler_1_UINT32_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("9343b6e7-e3d2-5e4a-ab2d-2bce4919a6a4"))
IAsyncOperationCompletedHandler<UINT32> : IAsyncOperationCompletedHandler_impl<UINT32> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.AsyncOperationCompletedHandler`1<UInt32>"; }
};
typedef IAsyncOperationCompletedHandler<UINT32> __FIAsyncOperationCompletedHandler_1_UINT32_t;
#define ____FIAsyncOperationCompletedHandler_1_UINT32_FWD_DEFINED__
#define __FIAsyncOperationCompletedHandler_1_UINT32 ABI::Windows::Foundation::__FIAsyncOperationCompletedHandler_1_UINT32_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperationCompletedHandler_1_UINT32_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0013 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0013_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0013_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0444 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0444 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0444_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0444_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0014 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1_UINT32_USE
#define DEF___FIAsyncOperation_1_UINT32_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("ef60385f-be78-584b-aaef-7829ada2b0de"))
IAsyncOperation<UINT32> : IAsyncOperation_impl<UINT32> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.IAsyncOperation`1<UInt32>"; }
};
typedef IAsyncOperation<UINT32> __FIAsyncOperation_1_UINT32_t;
#define ____FIAsyncOperation_1_UINT32_FWD_DEFINED__
#define __FIAsyncOperation_1_UINT32 ABI::Windows::Foundation::__FIAsyncOperation_1_UINT32_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperation_1_UINT32_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0014 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0014_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0014_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0445 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0445 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0445_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0445_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0015 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1_boolean_USE
#define DEF___FIAsyncOperationCompletedHandler_1_boolean_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("c1d3d1a2-ae17-5a5f-b5a2-bdcc8844889a"))
IAsyncOperationCompletedHandler<bool> : IAsyncOperationCompletedHandler_impl<ABI::Windows::Foundation::Internal::AggregateType<bool, boolean>> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.AsyncOperationCompletedHandler`1<Boolean>"; }
};
typedef IAsyncOperationCompletedHandler<bool> __FIAsyncOperationCompletedHandler_1_boolean_t;
#define ____FIAsyncOperationCompletedHandler_1_boolean_FWD_DEFINED__
#define __FIAsyncOperationCompletedHandler_1_boolean ABI::Windows::Foundation::__FIAsyncOperationCompletedHandler_1_boolean_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperationCompletedHandler_1_boolean_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0015 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0015_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0015_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0446 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0446 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0446_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0446_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0016 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1_boolean_USE
#define DEF___FIAsyncOperation_1_boolean_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("cdb5efb3-5788-509d-9be1-71ccb8a3362a"))
IAsyncOperation<bool> : IAsyncOperation_impl<ABI::Windows::Foundation::Internal::AggregateType<bool, boolean>> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.IAsyncOperation`1<Boolean>"; }
};
typedef IAsyncOperation<bool> __FIAsyncOperation_1_boolean_t;
#define ____FIAsyncOperation_1_boolean_FWD_DEFINED__
#define __FIAsyncOperation_1_boolean ABI::Windows::Foundation::__FIAsyncOperation_1_boolean_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperation_1_boolean_USE */
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
struct TransportInformation;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0016 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0016_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0016_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0447 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0447 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0447_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0447_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0017 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_USE
#define DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("9970f463-bcd0-55b9-94cd-8932d42446ca"))
IAsyncOperationCompletedHandler<struct ABI::Windows::Media::Streaming::TransportInformation> : IAsyncOperationCompletedHandler_impl<struct ABI::Windows::Media::Streaming::TransportInformation> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.AsyncOperationCompletedHandler`1<Windows.Media.Streaming.TransportInformation>"; }
};
typedef IAsyncOperationCompletedHandler<struct ABI::Windows::Media::Streaming::TransportInformation> __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_t;
#define ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_FWD_DEFINED__
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation ABI::Windows::Foundation::__FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0017 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0017_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0017_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0448 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0448 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0448_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0448_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0018 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_USE
#define DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("f99e7d9c-2274-5f3d-89e7-f5f862ba0334"))
IAsyncOperation<struct ABI::Windows::Media::Streaming::TransportInformation> : IAsyncOperation_impl<struct ABI::Windows::Media::Streaming::TransportInformation> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.IAsyncOperation`1<Windows.Media.Streaming.TransportInformation>"; }
};
typedef IAsyncOperation<struct ABI::Windows::Media::Streaming::TransportInformation> __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_t;
#define ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_FWD_DEFINED__
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation ABI::Windows::Foundation::__FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_USE */
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
struct PositionInformation;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0018 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0018_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0018_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0449 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0449 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0449_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0449_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0019 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_USE
#define DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("adc7daf4-9a69-5d0b-aec8-e2ee3292d178"))
IAsyncOperationCompletedHandler<struct ABI::Windows::Media::Streaming::PositionInformation> : IAsyncOperationCompletedHandler_impl<struct ABI::Windows::Media::Streaming::PositionInformation> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.AsyncOperationCompletedHandler`1<Windows.Media.Streaming.PositionInformation>"; }
};
typedef IAsyncOperationCompletedHandler<struct ABI::Windows::Media::Streaming::PositionInformation> __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_t;
#define ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_FWD_DEFINED__
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation ABI::Windows::Foundation::__FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0019 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0019_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0019_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0450 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0450 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0450_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0450_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0020 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_USE
#define DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("e2b45a37-e1c1-5e80-8962-a134d7f3557c"))
IAsyncOperation<struct ABI::Windows::Media::Streaming::PositionInformation> : IAsyncOperation_impl<struct ABI::Windows::Media::Streaming::PositionInformation> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.IAsyncOperation`1<Windows.Media.Streaming.PositionInformation>"; }
};
typedef IAsyncOperation<struct ABI::Windows::Media::Streaming::PositionInformation> __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_t;
#define ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_FWD_DEFINED__
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation ABI::Windows::Foundation::__FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_USE */
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
struct PlaySpeed;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0020 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0020_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0020_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0451 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0451 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0451_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0451_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0021 */
/* [local] */
#ifndef DEF___FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_USE
#define DEF___FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("fd051cd8-25c7-5780-9606-b35062137d21"))
IIterator<struct ABI::Windows::Media::Streaming::PlaySpeed> : IIterator_impl<struct ABI::Windows::Media::Streaming::PlaySpeed> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterator`1<Windows.Media.Streaming.PlaySpeed>"; }
};
typedef IIterator<struct ABI::Windows::Media::Streaming::PlaySpeed> __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_t;
#define ____FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed ABI::Windows::Foundation::Collections::__FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0021 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0021_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0021_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0452 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0452 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0452_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0452_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0022 */
/* [local] */
#ifndef DEF___FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_USE
#define DEF___FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("c4a17a40-8c62-5884-822b-502526970b0d"))
IIterable<struct ABI::Windows::Media::Streaming::PlaySpeed> : IIterable_impl<struct ABI::Windows::Media::Streaming::PlaySpeed> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterable`1<Windows.Media.Streaming.PlaySpeed>"; }
};
typedef IIterable<struct ABI::Windows::Media::Streaming::PlaySpeed> __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_t;
#define ____FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
#define __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed ABI::Windows::Foundation::Collections::__FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0022 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0022_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0022_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0453 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0453 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0453_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0453_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0023 */
/* [local] */
#ifndef DEF___FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_USE
#define DEF___FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("1295caf3-c1da-54ea-ac66-da2c044f9eb0"))
IVectorView<struct ABI::Windows::Media::Streaming::PlaySpeed> : IVectorView_impl<struct ABI::Windows::Media::Streaming::PlaySpeed> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IVectorView`1<Windows.Media.Streaming.PlaySpeed>"; }
};
typedef IVectorView<struct ABI::Windows::Media::Streaming::PlaySpeed> __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_t;
#define ____FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed ABI::Windows::Foundation::Collections::__FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0023 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0023_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0023_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0454 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0454 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0454_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0454_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0024 */
/* [local] */
#ifndef DEF___FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_USE
#define DEF___FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("fde57c75-5b86-5921-8ffb-101b0a184230"))
IVector<struct ABI::Windows::Media::Streaming::PlaySpeed> : IVector_impl<struct ABI::Windows::Media::Streaming::PlaySpeed> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IVector`1<Windows.Media.Streaming.PlaySpeed>"; }
};
typedef IVector<struct ABI::Windows::Media::Streaming::PlaySpeed> __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_t;
#define ____FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_FWD_DEFINED__
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed ABI::Windows::Foundation::Collections::__FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_USE */
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
class MediaRenderer;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
interface IMediaRenderer;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0024 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0024_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0024_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0455 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0455 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0455_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0455_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0025 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_USE
#define DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("f0d971af-e054-5616-9fdf-0903b9ceb182"))
IAsyncOperationCompletedHandler<ABI::Windows::Media::Streaming::MediaRenderer*> : IAsyncOperationCompletedHandler_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Media::Streaming::MediaRenderer*, ABI::Windows::Media::Streaming::IMediaRenderer*>> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.AsyncOperationCompletedHandler`1<Windows.Media.Streaming.MediaRenderer>"; }
};
typedef IAsyncOperationCompletedHandler<ABI::Windows::Media::Streaming::MediaRenderer*> __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_t;
#define ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_FWD_DEFINED__
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer ABI::Windows::Foundation::__FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0025 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0025_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0025_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0456 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0456 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0456_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0456_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0026 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_USE
#define DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("557dd3fb-4710-5059-921c-0dee68361fb5"))
IAsyncOperation<ABI::Windows::Media::Streaming::MediaRenderer*> : IAsyncOperation_impl<ABI::Windows::Foundation::Internal::AggregateType<ABI::Windows::Media::Streaming::MediaRenderer*, ABI::Windows::Media::Streaming::IMediaRenderer*>> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.IAsyncOperation`1<Windows.Media.Streaming.MediaRenderer>"; }
};
typedef IAsyncOperation<ABI::Windows::Media::Streaming::MediaRenderer*> __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_t;
#define ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_FWD_DEFINED__
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer ABI::Windows::Foundation::__FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_USE */
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Storage {
namespace Streams {
interface IRandomAccessStreamWithContentType;
} /*Streams*/
} /*Storage*/
} /*Windows*/
}
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0026 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0026_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0026_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0457 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0457 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0457_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0457_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0027 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_USE
#define DEF___FIAsyncOperationCompletedHandler_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("3dddecf4-1d39-58e8-83b1-dbed541c7f35"))
IAsyncOperationCompletedHandler<ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType*> : IAsyncOperationCompletedHandler_impl<ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.AsyncOperationCompletedHandler`1<Windows.Storage.Streams.IRandomAccessStreamWithContentType>"; }
};
typedef IAsyncOperationCompletedHandler<ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType*> __FIAsyncOperationCompletedHandler_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_t;
#define ____FIAsyncOperationCompletedHandler_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_FWD_DEFINED__
#define __FIAsyncOperationCompletedHandler_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType ABI::Windows::Foundation::__FIAsyncOperationCompletedHandler_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0027 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0027_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0027_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0458 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0458 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0458_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0458_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0028 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_USE
#define DEF___FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("c4a57c5e-32b0-55b3-ad13-ce1c23041ed6"))
IAsyncOperation<ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType*> : IAsyncOperation_impl<ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.IAsyncOperation`1<Windows.Storage.Streams.IRandomAccessStreamWithContentType>"; }
};
typedef IAsyncOperation<ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType*> __FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_t;
#define ____FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_FWD_DEFINED__
#define __FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType ABI::Windows::Foundation::__FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType_USE */
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Foundation {
namespace Collections {
interface IPropertySet;
} /*Collections*/
} /*Foundation*/
} /*Windows*/
}
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0028 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0028_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0028_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0459 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0459 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0459_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0459_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0029 */
/* [local] */
#ifndef DEF___FIIterator_1___F__CIPropertySet_USE
#define DEF___FIIterator_1___F__CIPropertySet_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("d79a75c8-b1d2-544d-9b09-7f7900a34efb"))
IIterator<ABI::Windows::Foundation::Collections::IPropertySet*> : IIterator_impl<ABI::Windows::Foundation::Collections::IPropertySet*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterator`1<Windows.Foundation.Collections.IPropertySet>"; }
};
typedef IIterator<ABI::Windows::Foundation::Collections::IPropertySet*> __FIIterator_1___F__CIPropertySet_t;
#define ____FIIterator_1___F__CIPropertySet_FWD_DEFINED__
#define __FIIterator_1___F__CIPropertySet ABI::Windows::Foundation::Collections::__FIIterator_1___F__CIPropertySet_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterator_1___F__CIPropertySet_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0029 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0029_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0029_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0460 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0460 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0460_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0460_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0030 */
/* [local] */
#ifndef DEF___FIIterable_1___F__CIPropertySet_USE
#define DEF___FIIterable_1___F__CIPropertySet_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("489b756d-be43-5abb-b9a0-a47254103339"))
IIterable<ABI::Windows::Foundation::Collections::IPropertySet*> : IIterable_impl<ABI::Windows::Foundation::Collections::IPropertySet*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IIterable`1<Windows.Foundation.Collections.IPropertySet>"; }
};
typedef IIterable<ABI::Windows::Foundation::Collections::IPropertySet*> __FIIterable_1___F__CIPropertySet_t;
#define ____FIIterable_1___F__CIPropertySet_FWD_DEFINED__
#define __FIIterable_1___F__CIPropertySet ABI::Windows::Foundation::Collections::__FIIterable_1___F__CIPropertySet_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIIterable_1___F__CIPropertySet_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0030 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0030_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0030_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0461 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0461 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0461_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0461_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0031 */
/* [local] */
#ifndef DEF___FIVectorView_1___F__CIPropertySet_USE
#define DEF___FIVectorView_1___F__CIPropertySet_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation { namespace Collections {
template <>
struct __declspec(uuid("c25d9a17-c31e-5311-8122-3c04d28af9fc"))
IVectorView<ABI::Windows::Foundation::Collections::IPropertySet*> : IVectorView_impl<ABI::Windows::Foundation::Collections::IPropertySet*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.Collections.IVectorView`1<Windows.Foundation.Collections.IPropertySet>"; }
};
typedef IVectorView<ABI::Windows::Foundation::Collections::IPropertySet*> __FIVectorView_1___F__CIPropertySet_t;
#define ____FIVectorView_1___F__CIPropertySet_FWD_DEFINED__
#define __FIVectorView_1___F__CIPropertySet ABI::Windows::Foundation::Collections::__FIVectorView_1___F__CIPropertySet_t
/* ABI */ } /* Windows */ } /* Foundation */ } /* Collections */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIVectorView_1___F__CIPropertySet_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0031 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0031_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0031_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0462 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0462 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0462_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0462_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0032 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_USE
#define DEF___FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("af4e2f8a-92ca-5640-865c-9948fbde4495"))
IAsyncOperationCompletedHandler<__FIVectorView_1___F__CIPropertySet*> : IAsyncOperationCompletedHandler_impl<__FIVectorView_1___F__CIPropertySet*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.AsyncOperationCompletedHandler`1<Windows.Foundation.Collections.IVectorView`1<Windows.Foundation.Collections.IPropertySet>>"; }
};
typedef IAsyncOperationCompletedHandler<__FIVectorView_1___F__CIPropertySet*> __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_t;
#define ____FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_FWD_DEFINED__
#define __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet ABI::Windows::Foundation::__FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_USE */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0032 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0032_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0032_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0463 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0463 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0463_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0463_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0033 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_USE
#define DEF___FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_USE
#if defined(__cplusplus) && !defined(RO_NO_TEMPLATE_NAME)
} /*extern "C"*/
namespace ABI { namespace Windows { namespace Foundation {
template <>
struct __declspec(uuid("216f9390-ea3d-5465-a789-6394a47eb4a4"))
IAsyncOperation<__FIVectorView_1___F__CIPropertySet*> : IAsyncOperation_impl<__FIVectorView_1___F__CIPropertySet*> {
static const wchar_t* z_get_rc_name_impl() {
return L"Windows.Foundation.IAsyncOperation`1<Windows.Foundation.Collections.IVectorView`1<Windows.Foundation.Collections.IPropertySet>>"; }
};
typedef IAsyncOperation<__FIVectorView_1___F__CIPropertySet*> __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_t;
#define ____FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_FWD_DEFINED__
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet ABI::Windows::Foundation::__FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_t
/* ABI */ } /* Windows */ } /* Foundation */ }
extern "C" {
#endif //__cplusplus
#endif /* DEF___FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_USE */
#pragma warning(push)
#pragma warning(disable:4001)
#pragma once
#pragma warning(pop)
#if !defined(__cplusplus)
#if !defined(__cplusplus)
typedef /* [v1_enum][v1_enum] */
enum __x_ABI_CWindows_CMedia_CStreaming_CDeviceTypes
{
DeviceTypes_Unknown = 0,
DeviceTypes_DigitalMediaRenderer = 0x1,
DeviceTypes_DigitalMediaServer = 0x2,
DeviceTypes_DigitalMediaPlayer = 0x4
} __x_ABI_CWindows_CMedia_CStreaming_CDeviceTypes;
#endif /* end if !defined(__cplusplus) */
#else
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef enum DeviceTypes DeviceTypes;
DEFINE_ENUM_FLAG_OPERATORS(DeviceTypes)
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
#if !defined(__cplusplus)
#if !defined(__cplusplus)
typedef /* [v1_enum][v1_enum] */
enum __x_ABI_CWindows_CMedia_CStreaming_CTransportState
{
TransportState_Unknown = 0,
TransportState_Stopped = ( TransportState_Unknown + 1 ) ,
TransportState_Playing = ( TransportState_Stopped + 1 ) ,
TransportState_Transitioning = ( TransportState_Playing + 1 ) ,
TransportState_Paused = ( TransportState_Transitioning + 1 ) ,
TransportState_Recording = ( TransportState_Paused + 1 ) ,
TransportState_NoMediaPresent = ( TransportState_Recording + 1 ) ,
TransportState_Last = ( TransportState_NoMediaPresent + 1 )
} __x_ABI_CWindows_CMedia_CStreaming_CTransportState;
#endif /* end if !defined(__cplusplus) */
#endif
#if !defined(__cplusplus)
#if !defined(__cplusplus)
typedef /* [v1_enum][v1_enum] */
enum __x_ABI_CWindows_CMedia_CStreaming_CTransportStatus
{
TransportStatus_Unknown = 0,
TransportStatus_Ok = ( TransportStatus_Unknown + 1 ) ,
TransportStatus_ErrorOccurred = ( TransportStatus_Ok + 1 ) ,
TransportStatus_Last = ( TransportStatus_ErrorOccurred + 1 )
} __x_ABI_CWindows_CMedia_CStreaming_CTransportStatus;
#endif /* end if !defined(__cplusplus) */
#endif
#if !defined(__cplusplus)
#if !defined(__cplusplus)
typedef /* [v1_enum][v1_enum] */
enum __x_ABI_CWindows_CMedia_CStreaming_CConnectionStatus
{
ConnectionStatus_Online = 0,
ConnectionStatus_Offline = ( ConnectionStatus_Online + 1 ) ,
ConnectionStatus_Sleeping = ( ConnectionStatus_Offline + 1 )
} __x_ABI_CWindows_CMedia_CStreaming_CConnectionStatus;
#endif /* end if !defined(__cplusplus) */
#endif
#if !defined(__cplusplus)
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CRenderingParameters
{
UINT volume;
boolean mute;
} __x_ABI_CWindows_CMedia_CStreaming_CRenderingParameters;
#endif
#if !defined(__cplusplus)
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed
{
INT32 Numerator;
UINT32 Denominator;
} __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed;
#endif
#if !defined(__cplusplus)
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CTransportInformation
{
__x_ABI_CWindows_CMedia_CStreaming_CTransportState CurrentTransportState;
__x_ABI_CWindows_CMedia_CStreaming_CTransportStatus CurrentTransportStatus;
__x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed CurrentSpeed;
} __x_ABI_CWindows_CMedia_CStreaming_CTransportInformation;
#endif
typedef UINT32 __x_ABI_CWindows_CMedia_CStreaming_CTrackId;
#if !defined(__cplusplus)
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CTrackInformation
{
UINT32 Track;
__x_ABI_CWindows_CMedia_CStreaming_CTrackId TrackId;
__x_ABI_CWindows_CFoundation_CTimeSpan TrackDuration;
} __x_ABI_CWindows_CMedia_CStreaming_CTrackInformation;
#endif
#if !defined(__cplusplus)
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CPositionInformation
{
__x_ABI_CWindows_CMedia_CStreaming_CTrackInformation trackInformation;
__x_ABI_CWindows_CFoundation_CTimeSpan relativeTime;
} __x_ABI_CWindows_CMedia_CStreaming_CPositionInformation;
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0033 */
/* [local] */
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef /* [v1_enum][v1_enum] */
enum DeviceTypes
{
DeviceTypes_Unknown = 0,
DeviceTypes_DigitalMediaRenderer = 0x1,
DeviceTypes_DigitalMediaServer = 0x2,
DeviceTypes_DigitalMediaPlayer = 0x4
} DeviceTypes;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef /* [v1_enum][v1_enum] */
enum TransportState
{
TransportState_Unknown = 0,
TransportState_Stopped = ( TransportState_Unknown + 1 ) ,
TransportState_Playing = ( TransportState_Stopped + 1 ) ,
TransportState_Transitioning = ( TransportState_Playing + 1 ) ,
TransportState_Paused = ( TransportState_Transitioning + 1 ) ,
TransportState_Recording = ( TransportState_Paused + 1 ) ,
TransportState_NoMediaPresent = ( TransportState_Recording + 1 ) ,
TransportState_Last = ( TransportState_NoMediaPresent + 1 )
} TransportState;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef /* [v1_enum][v1_enum] */
enum TransportStatus
{
TransportStatus_Unknown = 0,
TransportStatus_Ok = ( TransportStatus_Unknown + 1 ) ,
TransportStatus_ErrorOccurred = ( TransportStatus_Ok + 1 ) ,
TransportStatus_Last = ( TransportStatus_ErrorOccurred + 1 )
} TransportStatus;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef /* [v1_enum][v1_enum] */
enum ConnectionStatus
{
ConnectionStatus_Online = 0,
ConnectionStatus_Offline = ( ConnectionStatus_Online + 1 ) ,
ConnectionStatus_Sleeping = ( ConnectionStatus_Offline + 1 )
} ConnectionStatus;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef struct RenderingParameters
{
UINT volume;
boolean mute;
} RenderingParameters;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef struct PlaySpeed
{
INT32 Numerator;
UINT32 Denominator;
} PlaySpeed;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef struct TransportInformation
{
TransportState CurrentTransportState;
TransportStatus CurrentTransportStatus;
PlaySpeed CurrentSpeed;
} TransportInformation;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef UINT32 TrackId;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef struct TrackInformation
{
UINT32 Track;
TrackId TrackId;
ABI::Windows::Foundation::TimeSpan TrackDuration;
} TrackInformation;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
#ifdef __cplusplus
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
typedef struct PositionInformation
{
TrackInformation trackInformation;
ABI::Windows::Foundation::TimeSpan relativeTime;
} PositionInformation;
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#endif
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0033_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0033_v0_0_s_ifspec;
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IConnectionStatusHandler */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("b571c28c-a472-48d5-88d2-8adcaf1b8813")
IConnectionStatusHandler : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Invoke(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IBasicDevice *sender,
/* [in] */ ABI::Windows::Media::Streaming::ConnectionStatus arg) = 0;
};
extern const __declspec(selectany) IID & IID_IConnectionStatusHandler = __uuidof(IConnectionStatusHandler);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandlerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler * This);
HRESULT ( STDMETHODCALLTYPE *Invoke )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice *sender,
/* [in] */ __x_ABI_CWindows_CMedia_CStreaming_CConnectionStatus arg);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandlerVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandlerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_Invoke(This,sender,arg) \
( (This)->lpVtbl -> Invoke(This,sender,arg) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler_INTERFACE_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IDeviceControllerFinderHandler */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("a88a7d06-988c-4403-9d8a-015bed140b34")
IDeviceControllerFinderHandler : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Invoke(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IDeviceController *sender,
/* [in] */ __RPC__in HSTRING uniqueDeviceName,
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IBasicDevice *device) = 0;
};
extern const __declspec(selectany) IID & IID_IDeviceControllerFinderHandler = __uuidof(IDeviceControllerFinderHandler);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandlerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler * This);
HRESULT ( STDMETHODCALLTYPE *Invoke )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController *sender,
/* [in] */ __RPC__in HSTRING uniqueDeviceName,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice *device);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandlerVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandlerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_Invoke(This,sender,uniqueDeviceName,device) \
( (This)->lpVtbl -> Invoke(This,sender,uniqueDeviceName,device) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler_INTERFACE_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::ITransportParametersUpdateHandler */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("16fd02d5-da61-49d7-aab2-76867dd42db7")
ITransportParametersUpdateHandler : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Invoke(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IMediaRenderer *sender,
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::ITransportParameters *arg) = 0;
};
extern const __declspec(selectany) IID & IID_ITransportParametersUpdateHandler = __uuidof(ITransportParametersUpdateHandler);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandlerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler * This);
HRESULT ( STDMETHODCALLTYPE *Invoke )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer *sender,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters *arg);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandlerVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandlerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_Invoke(This,sender,arg) \
( (This)->lpVtbl -> Invoke(This,sender,arg) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler_INTERFACE_DEFINED__ */
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IRenderingParametersUpdateHandler */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("3a2d9d45-72e9-4311-b46c-27c8bb7e6cb3")
IRenderingParametersUpdateHandler : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Invoke(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IMediaRenderer *sender,
/* [in] */ ABI::Windows::Media::Streaming::RenderingParameters arg) = 0;
};
extern const __declspec(selectany) IID & IID_IRenderingParametersUpdateHandler = __uuidof(IRenderingParametersUpdateHandler);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandlerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler * This);
HRESULT ( STDMETHODCALLTYPE *Invoke )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer *sender,
/* [in] */ __x_ABI_CWindows_CMedia_CStreaming_CRenderingParameters arg);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandlerVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandlerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_Invoke(This,sender,arg) \
( (This)->lpVtbl -> Invoke(This,sender,arg) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0464 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0464 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0464_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0464_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0038 */
/* [local] */
#ifndef DEF___FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice
#define DEF___FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0038 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0038_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0038_v0_0_s_ifspec;
#ifndef ____FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__
#define ____FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__
/* interface __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* [unique][uuid][object] */
/* interface __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("84a8c766-4bc5-5757-9f1b-f61cfd9e5693")
__FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Current(
/* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Media::Streaming::IBasicDevice **current) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_HasCurrent(
/* [retval][out] */ __RPC__out boolean *hasCurrent) = 0;
virtual HRESULT STDMETHODCALLTYPE MoveNext(
/* [retval][out] */ __RPC__out boolean *hasCurrent) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Media::Streaming::IBasicDevice **items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
};
#else /* C style interface */
typedef struct __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Current )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice **current);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_HasCurrent )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [retval][out] */ __RPC__out boolean *hasCurrent);
HRESULT ( STDMETHODCALLTYPE *MoveNext )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [retval][out] */ __RPC__out boolean *hasCurrent);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice **items,
/* [retval][out] */ __RPC__out unsigned int *actual);
END_INTERFACE
} __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl;
interface __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice
{
CONST_VTBL struct __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_get_Current(This,current) \
( (This)->lpVtbl -> get_Current(This,current) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_get_HasCurrent(This,hasCurrent) \
( (This)->lpVtbl -> get_HasCurrent(This,hasCurrent) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_MoveNext(This,hasCurrent) \
( (This)->lpVtbl -> MoveNext(This,hasCurrent) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_GetMany(This,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,capacity,items,actual) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0039 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0039 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0039_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0039_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0465 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0465 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0465_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0465_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0040 */
/* [local] */
#ifndef DEF___FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice
#define DEF___FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0040 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0040_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0040_v0_0_s_ifspec;
#ifndef ____FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__
#define ____FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__
/* interface __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* [unique][uuid][object] */
/* interface __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("7d468b5e-763b-59cd-a086-ec6d8be0d858")
__FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE First(
/* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice **first) = 0;
};
#else /* C style interface */
typedef struct __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *First )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CMedia__CStreaming__CIBasicDevice **first);
END_INTERFACE
} __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl;
interface __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice
{
CONST_VTBL struct __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_First(This,first) \
( (This)->lpVtbl -> First(This,first) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0041 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIIterable_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0041 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0041_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0041_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0466 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0466 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0466_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0466_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0042 */
/* [local] */
#ifndef DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice
#define DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0042 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0042_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0042_v0_0_s_ifspec;
#ifndef ____FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__
#define ____FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__
/* interface __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* [unique][uuid][object] */
/* interface __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("a55cf16b-71a2-5525-ac3b-2f5bc1eeec46")
__FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAt(
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Media::Streaming::IBasicDevice **item) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size(
/* [retval][out] */ __RPC__out unsigned int *size) = 0;
virtual HRESULT STDMETHODCALLTYPE IndexOf(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IBasicDevice *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Media::Streaming::IBasicDevice **items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
};
#else /* C style interface */
typedef struct __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *GetAt )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice **item);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [retval][out] */ __RPC__out unsigned int *size);
HRESULT ( STDMETHODCALLTYPE *IndexOf )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice **items,
/* [retval][out] */ __RPC__out unsigned int *actual);
END_INTERFACE
} __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl;
interface __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice
{
CONST_VTBL struct __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_GetAt(This,index,item) \
( (This)->lpVtbl -> GetAt(This,index,item) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_get_Size(This,size) \
( (This)->lpVtbl -> get_Size(This,size) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_IndexOf(This,item,index,found) \
( (This)->lpVtbl -> IndexOf(This,item,index,found) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_GetMany(This,startIndex,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,startIndex,capacity,items,actual) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0043 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0043 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0043_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0043_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0467 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0467 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0467_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0467_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0044 */
/* [local] */
#ifndef DEF___FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice
#define DEF___FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0044 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0044_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0044_v0_0_s_ifspec;
#ifndef ____FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__
#define ____FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__
/* interface __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* [unique][uuid][object] */
/* interface __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("4c58be45-d16f-5b3a-840d-a6b4e20b7088")
__FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAt(
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Media::Streaming::IBasicDevice **item) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size(
/* [retval][out] */ __RPC__out unsigned int *size) = 0;
virtual HRESULT STDMETHODCALLTYPE GetView(
/* [retval][out] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice **view) = 0;
virtual HRESULT STDMETHODCALLTYPE IndexOf(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IBasicDevice *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found) = 0;
virtual HRESULT STDMETHODCALLTYPE SetAt(
/* [in] */ unsigned int index,
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IBasicDevice *item) = 0;
virtual HRESULT STDMETHODCALLTYPE InsertAt(
/* [in] */ unsigned int index,
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IBasicDevice *item) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveAt(
/* [in] */ unsigned int index) = 0;
virtual HRESULT STDMETHODCALLTYPE Append(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IBasicDevice *item) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveAtEnd( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Media::Streaming::IBasicDevice **items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
virtual HRESULT STDMETHODCALLTYPE ReplaceAll(
/* [in] */ unsigned int count,
/* [size_is][in] */ __RPC__in_ecount_full(count) ABI::Windows::Media::Streaming::IBasicDevice **value) = 0;
};
#else /* C style interface */
typedef struct __FIVector_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *GetAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice **item);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [retval][out] */ __RPC__out unsigned int *size);
HRESULT ( STDMETHODCALLTYPE *GetView )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [retval][out] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CMedia__CStreaming__CIBasicDevice **view);
HRESULT ( STDMETHODCALLTYPE *IndexOf )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found);
HRESULT ( STDMETHODCALLTYPE *SetAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ unsigned int index,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice *item);
HRESULT ( STDMETHODCALLTYPE *InsertAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ unsigned int index,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice *item);
HRESULT ( STDMETHODCALLTYPE *RemoveAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ unsigned int index);
HRESULT ( STDMETHODCALLTYPE *Append )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice *item);
HRESULT ( STDMETHODCALLTYPE *RemoveAtEnd )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
HRESULT ( STDMETHODCALLTYPE *Clear )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice **items,
/* [retval][out] */ __RPC__out unsigned int *actual);
HRESULT ( STDMETHODCALLTYPE *ReplaceAll )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice * This,
/* [in] */ unsigned int count,
/* [size_is][in] */ __RPC__in_ecount_full(count) __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice **value);
END_INTERFACE
} __FIVector_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl;
interface __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice
{
CONST_VTBL struct __FIVector_1_Windows__CMedia__CStreaming__CIBasicDeviceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_GetAt(This,index,item) \
( (This)->lpVtbl -> GetAt(This,index,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_get_Size(This,size) \
( (This)->lpVtbl -> get_Size(This,size) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_GetView(This,view) \
( (This)->lpVtbl -> GetView(This,view) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_IndexOf(This,item,index,found) \
( (This)->lpVtbl -> IndexOf(This,item,index,found) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_SetAt(This,index,item) \
( (This)->lpVtbl -> SetAt(This,index,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_InsertAt(This,index,item) \
( (This)->lpVtbl -> InsertAt(This,index,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_RemoveAt(This,index) \
( (This)->lpVtbl -> RemoveAt(This,index) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_Append(This,item) \
( (This)->lpVtbl -> Append(This,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_RemoveAtEnd(This) \
( (This)->lpVtbl -> RemoveAtEnd(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_Clear(This) \
( (This)->lpVtbl -> Clear(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_GetMany(This,startIndex,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,startIndex,capacity,items,actual) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_ReplaceAll(This,count,value) \
( (This)->lpVtbl -> ReplaceAll(This,count,value) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0045 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice */
#if !defined(____x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_INTERFACE_DEFINED__)
extern const __declspec(selectany) WCHAR InterfaceName_Windows_Media_Streaming_IDeviceController[] = L"Windows.Media.Streaming.IDeviceController";
#endif /* !defined(____x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_INTERFACE_DEFINED__) */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0045 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0045_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0045_v0_0_s_ifspec;
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IDeviceController */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIDeviceController;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("4feeb26d-50a7-402b-896a-be95064d6bff")
IDeviceController : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_CachedDevices(
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice **value) = 0;
virtual HRESULT STDMETHODCALLTYPE AddDevice(
/* [in] */ __RPC__in HSTRING uniqueDeviceName) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveDevice(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IBasicDevice *device) = 0;
virtual HRESULT STDMETHODCALLTYPE add_DeviceArrival(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IDeviceControllerFinderHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token) = 0;
virtual HRESULT STDMETHODCALLTYPE remove_DeviceArrival(
/* [in] */ EventRegistrationToken token) = 0;
virtual HRESULT STDMETHODCALLTYPE add_DeviceDeparture(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IDeviceControllerFinderHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token) = 0;
virtual HRESULT STDMETHODCALLTYPE remove_DeviceDeparture(
/* [in] */ EventRegistrationToken token) = 0;
};
extern const __declspec(selectany) IID & IID_IDeviceController = __uuidof(IDeviceController);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_CachedDevices )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_Windows__CMedia__CStreaming__CIBasicDevice **value);
HRESULT ( STDMETHODCALLTYPE *AddDevice )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [in] */ __RPC__in HSTRING uniqueDeviceName);
HRESULT ( STDMETHODCALLTYPE *RemoveDevice )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice *device);
HRESULT ( STDMETHODCALLTYPE *add_DeviceArrival )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token);
HRESULT ( STDMETHODCALLTYPE *remove_DeviceArrival )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [in] */ EventRegistrationToken token);
HRESULT ( STDMETHODCALLTYPE *add_DeviceDeparture )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerFinderHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token);
HRESULT ( STDMETHODCALLTYPE *remove_DeviceDeparture )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController * This,
/* [in] */ EventRegistrationToken token);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIDeviceControllerVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_get_CachedDevices(This,value) \
( (This)->lpVtbl -> get_CachedDevices(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_AddDevice(This,uniqueDeviceName) \
( (This)->lpVtbl -> AddDevice(This,uniqueDeviceName) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_RemoveDevice(This,device) \
( (This)->lpVtbl -> RemoveDevice(This,device) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_add_DeviceArrival(This,handler,token) \
( (This)->lpVtbl -> add_DeviceArrival(This,handler,token) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_remove_DeviceArrival(This,token) \
( (This)->lpVtbl -> remove_DeviceArrival(This,token) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_add_DeviceDeparture(This,handler,token) \
( (This)->lpVtbl -> add_DeviceDeparture(This,handler,token) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_remove_DeviceDeparture(This,token) \
( (This)->lpVtbl -> remove_DeviceDeparture(This,token) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceController_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0468 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0468 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0468_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0468_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0047 */
/* [local] */
#ifndef DEF___FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon
#define DEF___FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0047 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0047_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0047_v0_0_s_ifspec;
#ifndef ____FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__
#define ____FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__
/* interface __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* [unique][uuid][object] */
/* interface __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("57fd211a-4ef0-58a0-90e2-7c3b816102c9")
__FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Current(
/* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Media::Streaming::IDeviceIcon **current) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_HasCurrent(
/* [retval][out] */ __RPC__out boolean *hasCurrent) = 0;
virtual HRESULT STDMETHODCALLTYPE MoveNext(
/* [retval][out] */ __RPC__out boolean *hasCurrent) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Media::Streaming::IDeviceIcon **items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
};
#else /* C style interface */
typedef struct __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Current )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon **current);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_HasCurrent )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [retval][out] */ __RPC__out boolean *hasCurrent);
HRESULT ( STDMETHODCALLTYPE *MoveNext )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [retval][out] */ __RPC__out boolean *hasCurrent);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon **items,
/* [retval][out] */ __RPC__out unsigned int *actual);
END_INTERFACE
} __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl;
interface __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon
{
CONST_VTBL struct __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_get_Current(This,current) \
( (This)->lpVtbl -> get_Current(This,current) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_get_HasCurrent(This,hasCurrent) \
( (This)->lpVtbl -> get_HasCurrent(This,hasCurrent) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_MoveNext(This,hasCurrent) \
( (This)->lpVtbl -> MoveNext(This,hasCurrent) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetMany(This,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,capacity,items,actual) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0048 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0048 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0048_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0048_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0469 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0469 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0469_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0469_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0049 */
/* [local] */
#ifndef DEF___FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon
#define DEF___FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0049 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0049_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0049_v0_0_s_ifspec;
#ifndef ____FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__
#define ____FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__
/* interface __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* [unique][uuid][object] */
/* interface __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("16077ee6-dcfc-53aa-ab0e-d666ac819d6c")
__FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE First(
/* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon **first) = 0;
};
#else /* C style interface */
typedef struct __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *First )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CMedia__CStreaming__CIDeviceIcon **first);
END_INTERFACE
} __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl;
interface __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon
{
CONST_VTBL struct __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_First(This,first) \
( (This)->lpVtbl -> First(This,first) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0050 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIIterable_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0050 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0050_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0050_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0470 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0470 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0470_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0470_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0051 */
/* [local] */
#ifndef DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon
#define DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0051 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0051_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0051_v0_0_s_ifspec;
#ifndef ____FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__
#define ____FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__
/* interface __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* [unique][uuid][object] */
/* interface __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("ff195e52-48eb-5709-be50-3a3914c189db")
__FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAt(
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Media::Streaming::IDeviceIcon **item) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size(
/* [retval][out] */ __RPC__out unsigned int *size) = 0;
virtual HRESULT STDMETHODCALLTYPE IndexOf(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IDeviceIcon *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Media::Streaming::IDeviceIcon **items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
};
#else /* C style interface */
typedef struct __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *GetAt )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon **item);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [retval][out] */ __RPC__out unsigned int *size);
HRESULT ( STDMETHODCALLTYPE *IndexOf )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon **items,
/* [retval][out] */ __RPC__out unsigned int *actual);
END_INTERFACE
} __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl;
interface __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon
{
CONST_VTBL struct __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetAt(This,index,item) \
( (This)->lpVtbl -> GetAt(This,index,item) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_get_Size(This,size) \
( (This)->lpVtbl -> get_Size(This,size) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_IndexOf(This,item,index,found) \
( (This)->lpVtbl -> IndexOf(This,item,index,found) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetMany(This,startIndex,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,startIndex,capacity,items,actual) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0052 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0052 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0052_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0052_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0471 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0471 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0471_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0471_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0053 */
/* [local] */
#ifndef DEF___FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon
#define DEF___FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0053 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0053_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0053_v0_0_s_ifspec;
#ifndef ____FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__
#define ____FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__
/* interface __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* [unique][uuid][object] */
/* interface __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("a32d7731-05f6-55a2-930f-1cf5a12b19ae")
__FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAt(
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Media::Streaming::IDeviceIcon **item) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size(
/* [retval][out] */ __RPC__out unsigned int *size) = 0;
virtual HRESULT STDMETHODCALLTYPE GetView(
/* [retval][out] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon **view) = 0;
virtual HRESULT STDMETHODCALLTYPE IndexOf(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IDeviceIcon *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found) = 0;
virtual HRESULT STDMETHODCALLTYPE SetAt(
/* [in] */ unsigned int index,
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IDeviceIcon *item) = 0;
virtual HRESULT STDMETHODCALLTYPE InsertAt(
/* [in] */ unsigned int index,
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IDeviceIcon *item) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveAt(
/* [in] */ unsigned int index) = 0;
virtual HRESULT STDMETHODCALLTYPE Append(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IDeviceIcon *item) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveAtEnd( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Media::Streaming::IDeviceIcon **items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
virtual HRESULT STDMETHODCALLTYPE ReplaceAll(
/* [in] */ unsigned int count,
/* [size_is][in] */ __RPC__in_ecount_full(count) ABI::Windows::Media::Streaming::IDeviceIcon **value) = 0;
};
#else /* C style interface */
typedef struct __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *GetAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon **item);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [retval][out] */ __RPC__out unsigned int *size);
HRESULT ( STDMETHODCALLTYPE *GetView )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [retval][out] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CMedia__CStreaming__CIDeviceIcon **view);
HRESULT ( STDMETHODCALLTYPE *IndexOf )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found);
HRESULT ( STDMETHODCALLTYPE *SetAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ unsigned int index,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon *item);
HRESULT ( STDMETHODCALLTYPE *InsertAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ unsigned int index,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon *item);
HRESULT ( STDMETHODCALLTYPE *RemoveAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ unsigned int index);
HRESULT ( STDMETHODCALLTYPE *Append )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon *item);
HRESULT ( STDMETHODCALLTYPE *RemoveAtEnd )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
HRESULT ( STDMETHODCALLTYPE *Clear )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon **items,
/* [retval][out] */ __RPC__out unsigned int *actual);
HRESULT ( STDMETHODCALLTYPE *ReplaceAll )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon * This,
/* [in] */ unsigned int count,
/* [size_is][in] */ __RPC__in_ecount_full(count) __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon **value);
END_INTERFACE
} __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl;
interface __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon
{
CONST_VTBL struct __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIconVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetAt(This,index,item) \
( (This)->lpVtbl -> GetAt(This,index,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_get_Size(This,size) \
( (This)->lpVtbl -> get_Size(This,size) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetView(This,view) \
( (This)->lpVtbl -> GetView(This,view) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_IndexOf(This,item,index,found) \
( (This)->lpVtbl -> IndexOf(This,item,index,found) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_SetAt(This,index,item) \
( (This)->lpVtbl -> SetAt(This,index,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_InsertAt(This,index,item) \
( (This)->lpVtbl -> InsertAt(This,index,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_RemoveAt(This,index) \
( (This)->lpVtbl -> RemoveAt(This,index) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_Append(This,item) \
( (This)->lpVtbl -> Append(This,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_RemoveAtEnd(This) \
( (This)->lpVtbl -> RemoveAtEnd(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_Clear(This) \
( (This)->lpVtbl -> Clear(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_GetMany(This,startIndex,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,startIndex,capacity,items,actual) )
#define __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_ReplaceAll(This,count,value) \
( (This)->lpVtbl -> ReplaceAll(This,count,value) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0054 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon */
#if !defined(____x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_INTERFACE_DEFINED__)
extern const __declspec(selectany) WCHAR InterfaceName_Windows_Media_Streaming_IBasicDevice[] = L"Windows.Media.Streaming.IBasicDevice";
#endif /* !defined(____x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_INTERFACE_DEFINED__) */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0054 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0054_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0054_v0_0_s_ifspec;
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IBasicDevice */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("f4f26cbb-7962-48b7-80f7-c3a5d753bcb0")
IBasicDevice : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_FriendlyName(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_FriendlyName(
/* [in] */ __RPC__in HSTRING value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ManufacturerName(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ManufacturerUrl(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_UniqueDeviceName(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ModelName(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ModelNumber(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ModelUrl(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Description(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_SerialNumber(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PresentationUrl(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_RemoteStreamingUrls(
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_HSTRING **value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PhysicalAddresses(
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_HSTRING **value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IpAddresses(
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_HSTRING **value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_CanWakeDevices(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_DiscoveredOnCurrentNetwork(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Type(
/* [out][retval] */ __RPC__out ABI::Windows::Media::Streaming::DeviceTypes *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Icons(
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon **value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ConnectionStatus(
/* [out][retval] */ __RPC__out ABI::Windows::Media::Streaming::ConnectionStatus *value) = 0;
virtual HRESULT STDMETHODCALLTYPE add_ConnectionStatusChanged(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IConnectionStatusHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token) = 0;
virtual HRESULT STDMETHODCALLTYPE remove_ConnectionStatusChanged(
/* [in] */ EventRegistrationToken token) = 0;
};
extern const __declspec(selectany) IID & IID_IBasicDevice = __uuidof(IBasicDevice);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIBasicDeviceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_FriendlyName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_FriendlyName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [in] */ __RPC__in HSTRING value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ManufacturerName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ManufacturerUrl )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_UniqueDeviceName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ModelName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ModelNumber )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ModelUrl )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Description )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_SerialNumber )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PresentationUrl )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_RemoteStreamingUrls )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_HSTRING **value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PhysicalAddresses )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_HSTRING **value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IpAddresses )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_HSTRING **value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_CanWakeDevices )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_DiscoveredOnCurrentNetwork )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Type )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__out __x_ABI_CWindows_CMedia_CStreaming_CDeviceTypes *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Icons )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_Windows__CMedia__CStreaming__CIDeviceIcon **value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ConnectionStatus )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [out][retval] */ __RPC__out __x_ABI_CWindows_CMedia_CStreaming_CConnectionStatus *value);
HRESULT ( STDMETHODCALLTYPE *add_ConnectionStatusChanged )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIConnectionStatusHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token);
HRESULT ( STDMETHODCALLTYPE *remove_ConnectionStatusChanged )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice * This,
/* [in] */ EventRegistrationToken token);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIBasicDeviceVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIBasicDeviceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_FriendlyName(This,value) \
( (This)->lpVtbl -> get_FriendlyName(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_put_FriendlyName(This,value) \
( (This)->lpVtbl -> put_FriendlyName(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_ManufacturerName(This,value) \
( (This)->lpVtbl -> get_ManufacturerName(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_ManufacturerUrl(This,value) \
( (This)->lpVtbl -> get_ManufacturerUrl(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_UniqueDeviceName(This,value) \
( (This)->lpVtbl -> get_UniqueDeviceName(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_ModelName(This,value) \
( (This)->lpVtbl -> get_ModelName(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_ModelNumber(This,value) \
( (This)->lpVtbl -> get_ModelNumber(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_ModelUrl(This,value) \
( (This)->lpVtbl -> get_ModelUrl(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_Description(This,value) \
( (This)->lpVtbl -> get_Description(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_SerialNumber(This,value) \
( (This)->lpVtbl -> get_SerialNumber(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_PresentationUrl(This,value) \
( (This)->lpVtbl -> get_PresentationUrl(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_RemoteStreamingUrls(This,value) \
( (This)->lpVtbl -> get_RemoteStreamingUrls(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_PhysicalAddresses(This,value) \
( (This)->lpVtbl -> get_PhysicalAddresses(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_IpAddresses(This,value) \
( (This)->lpVtbl -> get_IpAddresses(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_CanWakeDevices(This,value) \
( (This)->lpVtbl -> get_CanWakeDevices(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_DiscoveredOnCurrentNetwork(This,value) \
( (This)->lpVtbl -> get_DiscoveredOnCurrentNetwork(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_Type(This,value) \
( (This)->lpVtbl -> get_Type(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_Icons(This,value) \
( (This)->lpVtbl -> get_Icons(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_get_ConnectionStatus(This,value) \
( (This)->lpVtbl -> get_ConnectionStatus(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_add_ConnectionStatusChanged(This,handler,token) \
( (This)->lpVtbl -> add_ConnectionStatusChanged(This,handler,token) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_remove_ConnectionStatusChanged(This,token) \
( (This)->lpVtbl -> remove_ConnectionStatusChanged(This,token) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0055 */
/* [local] */
#if !defined(____x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_INTERFACE_DEFINED__)
extern const __declspec(selectany) WCHAR InterfaceName_Windows_Media_Streaming_IDeviceIcon[] = L"Windows.Media.Streaming.IDeviceIcon";
#endif /* !defined(____x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_INTERFACE_DEFINED__) */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0055 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0055_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0055_v0_0_s_ifspec;
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IDeviceIcon */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("8ffb1a1e-023d-4de1-b556-ab5abf01929c")
IDeviceIcon : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Width(
/* [out][retval] */ __RPC__out UINT32 *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Height(
/* [out][retval] */ __RPC__out UINT32 *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ContentType(
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Stream(
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Storage::Streams::IRandomAccessStreamWithContentType **value) = 0;
};
extern const __declspec(selectany) IID & IID_IDeviceIcon = __uuidof(IDeviceIcon);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIconVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Width )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This,
/* [out][retval] */ __RPC__out UINT32 *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Height )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This,
/* [out][retval] */ __RPC__out UINT32 *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ContentType )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This,
/* [out][retval] */ __RPC__deref_out_opt HSTRING *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Stream )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon * This,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStreamWithContentType **value);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIconVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIconVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_get_Width(This,value) \
( (This)->lpVtbl -> get_Width(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_get_Height(This,value) \
( (This)->lpVtbl -> get_Height(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_get_ContentType(This,value) \
( (This)->lpVtbl -> get_ContentType(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_get_Stream(This,value) \
( (This)->lpVtbl -> get_Stream(This,value) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIDeviceIcon_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0472 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0472 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0472_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0472_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0057 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation
#define DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0057 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0057_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0057_v0_0_s_ifspec;
#ifndef ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_INTERFACE_DEFINED__
#define ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_INTERFACE_DEFINED__
/* interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation */
/* [unique][uuid][object] */
/* interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("9970f463-bcd0-55b9-94cd-8932d42446ca")
__FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Invoke(
/* [in] */ __RPC__in_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation *asyncInfo,
/* [in] */ AsyncStatus status) = 0;
};
#else /* C style interface */
typedef struct __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformationVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation * This);
HRESULT ( STDMETHODCALLTYPE *Invoke )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation * This,
/* [in] */ __RPC__in_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation *asyncInfo,
/* [in] */ AsyncStatus status);
END_INTERFACE
} __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformationVtbl;
interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation
{
CONST_VTBL struct __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformationVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_Invoke(This,asyncInfo,status) \
( (This)->lpVtbl -> Invoke(This,asyncInfo,status) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0058 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0058 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0058_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0058_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0473 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0473 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0473_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0473_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0059 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation
#define DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0059 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0059_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0059_v0_0_s_ifspec;
#ifndef ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_INTERFACE_DEFINED__
#define ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_INTERFACE_DEFINED__
/* interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation */
/* [unique][uuid][object] */
/* interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("f99e7d9c-2274-5f3d-89e7-f5f862ba0334")
__FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation : public IInspectable
{
public:
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Completed(
/* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation *handler) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Completed(
/* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation **handler) = 0;
virtual HRESULT STDMETHODCALLTYPE GetResults(
/* [retval][out] */ __RPC__out struct ABI::Windows::Media::Streaming::TransportInformation *results) = 0;
};
#else /* C style interface */
typedef struct __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformationVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Completed )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation * This,
/* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation *handler);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Completed )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation * This,
/* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CTransportInformation **handler);
HRESULT ( STDMETHODCALLTYPE *GetResults )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation * This,
/* [retval][out] */ __RPC__out struct __x_ABI_CWindows_CMedia_CStreaming_CTransportInformation *results);
END_INTERFACE
} __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformationVtbl;
interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation
{
CONST_VTBL struct __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformationVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_put_Completed(This,handler) \
( (This)->lpVtbl -> put_Completed(This,handler) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_get_Completed(This,handler) \
( (This)->lpVtbl -> get_Completed(This,handler) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_GetResults(This,results) \
( (This)->lpVtbl -> GetResults(This,results) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0060 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0060 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0060_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0060_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0474 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0474 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0474_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0474_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0061 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation
#define DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0061 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0061_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0061_v0_0_s_ifspec;
#ifndef ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_INTERFACE_DEFINED__
#define ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_INTERFACE_DEFINED__
/* interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation */
/* [unique][uuid][object] */
/* interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("adc7daf4-9a69-5d0b-aec8-e2ee3292d178")
__FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Invoke(
/* [in] */ __RPC__in_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation *asyncInfo,
/* [in] */ AsyncStatus status) = 0;
};
#else /* C style interface */
typedef struct __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformationVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation * This);
HRESULT ( STDMETHODCALLTYPE *Invoke )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation * This,
/* [in] */ __RPC__in_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation *asyncInfo,
/* [in] */ AsyncStatus status);
END_INTERFACE
} __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformationVtbl;
interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation
{
CONST_VTBL struct __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformationVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_Invoke(This,asyncInfo,status) \
( (This)->lpVtbl -> Invoke(This,asyncInfo,status) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0062 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0062 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0062_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0062_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0475 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0475 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0475_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0475_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0063 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation
#define DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0063 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0063_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0063_v0_0_s_ifspec;
#ifndef ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_INTERFACE_DEFINED__
#define ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_INTERFACE_DEFINED__
/* interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation */
/* [unique][uuid][object] */
/* interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("e2b45a37-e1c1-5e80-8962-a134d7f3557c")
__FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation : public IInspectable
{
public:
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Completed(
/* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation *handler) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Completed(
/* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation **handler) = 0;
virtual HRESULT STDMETHODCALLTYPE GetResults(
/* [retval][out] */ __RPC__out struct ABI::Windows::Media::Streaming::PositionInformation *results) = 0;
};
#else /* C style interface */
typedef struct __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformationVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Completed )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation * This,
/* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation *handler);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Completed )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation * This,
/* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CPositionInformation **handler);
HRESULT ( STDMETHODCALLTYPE *GetResults )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation * This,
/* [retval][out] */ __RPC__out struct __x_ABI_CWindows_CMedia_CStreaming_CPositionInformation *results);
END_INTERFACE
} __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformationVtbl;
interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation
{
CONST_VTBL struct __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformationVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_put_Completed(This,handler) \
( (This)->lpVtbl -> put_Completed(This,handler) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_get_Completed(This,handler) \
( (This)->lpVtbl -> get_Completed(This,handler) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_GetResults(This,results) \
( (This)->lpVtbl -> GetResults(This,results) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0064 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation */
#if !defined(____x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_INTERFACE_DEFINED__)
extern const __declspec(selectany) WCHAR InterfaceName_Windows_Media_Streaming_IMediaRenderer[] = L"Windows.Media.Streaming.IMediaRenderer";
#endif /* !defined(____x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_INTERFACE_DEFINED__) */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0064 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0064_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0064_v0_0_s_ifspec;
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IMediaRenderer */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("2c012ec3-d975-47fb-96ac-a6418b326d2b")
IMediaRenderer : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsAudioSupported(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsVideoSupported(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsImageSupported(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ActionInformation(
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Media::Streaming::IMediaRendererActionInformation **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SetSourceFromUriAsync(
/* [in] */ __RPC__in HSTRING URI,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SetSourceFromStreamAsync(
/* [in] */ __RPC__in_opt IInspectable *stream,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SetSourceFromMediaSourceAsync(
/* [in] */ __RPC__in_opt IInspectable *mediaSource,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SetNextSourceFromUriAsync(
/* [in] */ __RPC__in HSTRING URI,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SetNextSourceFromStreamAsync(
/* [in] */ __RPC__in_opt IInspectable *stream,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SetNextSourceFromMediaSourceAsync(
/* [in] */ __RPC__in_opt IInspectable *mediaSource,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value) = 0;
virtual HRESULT STDMETHODCALLTYPE PlayAsync(
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Foundation::IAsyncAction **value) = 0;
virtual HRESULT STDMETHODCALLTYPE PlayAtSpeedAsync(
/* [in] */ ABI::Windows::Media::Streaming::PlaySpeed playSpeed,
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Foundation::IAsyncAction **value) = 0;
virtual HRESULT STDMETHODCALLTYPE StopAsync(
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Foundation::IAsyncAction **value) = 0;
virtual HRESULT STDMETHODCALLTYPE PauseAsync(
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Foundation::IAsyncAction **value) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMuteAsync(
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_boolean **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SetMuteAsync(
/* [in] */ boolean mute,
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Foundation::IAsyncAction **value) = 0;
virtual HRESULT STDMETHODCALLTYPE GetVolumeAsync(
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SetVolumeAsync(
/* [in] */ UINT32 volume,
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Foundation::IAsyncAction **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SeekAsync(
/* [in] */ ABI::Windows::Foundation::TimeSpan target,
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Foundation::IAsyncAction **value) = 0;
virtual HRESULT STDMETHODCALLTYPE GetTransportInformationAsync(
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation **value) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPositionInformationAsync(
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation **value) = 0;
virtual HRESULT STDMETHODCALLTYPE add_TransportParametersUpdate(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::ITransportParametersUpdateHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token) = 0;
virtual HRESULT STDMETHODCALLTYPE remove_TransportParametersUpdate(
/* [in] */ EventRegistrationToken token) = 0;
virtual HRESULT STDMETHODCALLTYPE add_RenderingParametersUpdate(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IRenderingParametersUpdateHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token) = 0;
virtual HRESULT STDMETHODCALLTYPE remove_RenderingParametersUpdate(
/* [in] */ EventRegistrationToken token) = 0;
virtual HRESULT STDMETHODCALLTYPE NextAsync(
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Foundation::IAsyncAction **value) = 0;
};
extern const __declspec(selectany) IID & IID_IMediaRenderer = __uuidof(IMediaRenderer);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsAudioSupported )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsVideoSupported )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsImageSupported )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ActionInformation )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation **value);
HRESULT ( STDMETHODCALLTYPE *SetSourceFromUriAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __RPC__in HSTRING URI,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value);
HRESULT ( STDMETHODCALLTYPE *SetSourceFromStreamAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __RPC__in_opt IInspectable *stream,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value);
HRESULT ( STDMETHODCALLTYPE *SetSourceFromMediaSourceAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __RPC__in_opt IInspectable *mediaSource,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value);
HRESULT ( STDMETHODCALLTYPE *SetNextSourceFromUriAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __RPC__in HSTRING URI,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value);
HRESULT ( STDMETHODCALLTYPE *SetNextSourceFromStreamAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __RPC__in_opt IInspectable *stream,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value);
HRESULT ( STDMETHODCALLTYPE *SetNextSourceFromMediaSourceAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __RPC__in_opt IInspectable *mediaSource,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value);
HRESULT ( STDMETHODCALLTYPE *PlayAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CIAsyncAction **value);
HRESULT ( STDMETHODCALLTYPE *PlayAtSpeedAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed playSpeed,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CIAsyncAction **value);
HRESULT ( STDMETHODCALLTYPE *StopAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CIAsyncAction **value);
HRESULT ( STDMETHODCALLTYPE *PauseAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CIAsyncAction **value);
HRESULT ( STDMETHODCALLTYPE *GetMuteAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_boolean **value);
HRESULT ( STDMETHODCALLTYPE *SetMuteAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ boolean mute,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CIAsyncAction **value);
HRESULT ( STDMETHODCALLTYPE *GetVolumeAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_UINT32 **value);
HRESULT ( STDMETHODCALLTYPE *SetVolumeAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ UINT32 volume,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CIAsyncAction **value);
HRESULT ( STDMETHODCALLTYPE *SeekAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __x_ABI_CWindows_CFoundation_CTimeSpan target,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CIAsyncAction **value);
HRESULT ( STDMETHODCALLTYPE *GetTransportInformationAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CTransportInformation **value);
HRESULT ( STDMETHODCALLTYPE *GetPositionInformationAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CPositionInformation **value);
HRESULT ( STDMETHODCALLTYPE *add_TransportParametersUpdate )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersUpdateHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token);
HRESULT ( STDMETHODCALLTYPE *remove_TransportParametersUpdate )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ EventRegistrationToken token);
HRESULT ( STDMETHODCALLTYPE *add_RenderingParametersUpdate )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIRenderingParametersUpdateHandler *handler,
/* [out][retval] */ __RPC__out EventRegistrationToken *token);
HRESULT ( STDMETHODCALLTYPE *remove_RenderingParametersUpdate )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [in] */ EventRegistrationToken token);
HRESULT ( STDMETHODCALLTYPE *NextAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer * This,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CIAsyncAction **value);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_get_IsAudioSupported(This,value) \
( (This)->lpVtbl -> get_IsAudioSupported(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_get_IsVideoSupported(This,value) \
( (This)->lpVtbl -> get_IsVideoSupported(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_get_IsImageSupported(This,value) \
( (This)->lpVtbl -> get_IsImageSupported(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_get_ActionInformation(This,value) \
( (This)->lpVtbl -> get_ActionInformation(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_SetSourceFromUriAsync(This,URI,value) \
( (This)->lpVtbl -> SetSourceFromUriAsync(This,URI,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_SetSourceFromStreamAsync(This,stream,value) \
( (This)->lpVtbl -> SetSourceFromStreamAsync(This,stream,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_SetSourceFromMediaSourceAsync(This,mediaSource,value) \
( (This)->lpVtbl -> SetSourceFromMediaSourceAsync(This,mediaSource,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_SetNextSourceFromUriAsync(This,URI,value) \
( (This)->lpVtbl -> SetNextSourceFromUriAsync(This,URI,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_SetNextSourceFromStreamAsync(This,stream,value) \
( (This)->lpVtbl -> SetNextSourceFromStreamAsync(This,stream,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_SetNextSourceFromMediaSourceAsync(This,mediaSource,value) \
( (This)->lpVtbl -> SetNextSourceFromMediaSourceAsync(This,mediaSource,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_PlayAsync(This,value) \
( (This)->lpVtbl -> PlayAsync(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_PlayAtSpeedAsync(This,playSpeed,value) \
( (This)->lpVtbl -> PlayAtSpeedAsync(This,playSpeed,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_StopAsync(This,value) \
( (This)->lpVtbl -> StopAsync(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_PauseAsync(This,value) \
( (This)->lpVtbl -> PauseAsync(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_GetMuteAsync(This,value) \
( (This)->lpVtbl -> GetMuteAsync(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_SetMuteAsync(This,mute,value) \
( (This)->lpVtbl -> SetMuteAsync(This,mute,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_GetVolumeAsync(This,value) \
( (This)->lpVtbl -> GetVolumeAsync(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_SetVolumeAsync(This,volume,value) \
( (This)->lpVtbl -> SetVolumeAsync(This,volume,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_SeekAsync(This,target,value) \
( (This)->lpVtbl -> SeekAsync(This,target,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_GetTransportInformationAsync(This,value) \
( (This)->lpVtbl -> GetTransportInformationAsync(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_GetPositionInformationAsync(This,value) \
( (This)->lpVtbl -> GetPositionInformationAsync(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_add_TransportParametersUpdate(This,handler,token) \
( (This)->lpVtbl -> add_TransportParametersUpdate(This,handler,token) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_remove_TransportParametersUpdate(This,token) \
( (This)->lpVtbl -> remove_TransportParametersUpdate(This,token) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_add_RenderingParametersUpdate(This,handler,token) \
( (This)->lpVtbl -> add_RenderingParametersUpdate(This,handler,token) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_remove_RenderingParametersUpdate(This,token) \
( (This)->lpVtbl -> remove_RenderingParametersUpdate(This,token) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_NextAsync(This,value) \
( (This)->lpVtbl -> NextAsync(This,value) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0476 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0476 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0476_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0476_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0066 */
/* [local] */
#ifndef DEF___FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed
#define DEF___FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0066 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0066_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0066_v0_0_s_ifspec;
#ifndef ____FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__
#define ____FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__
/* interface __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* [unique][uuid][object] */
/* interface __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("fd051cd8-25c7-5780-9606-b35062137d21")
__FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Current(
/* [retval][out] */ __RPC__out struct ABI::Windows::Media::Streaming::PlaySpeed *current) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_HasCurrent(
/* [retval][out] */ __RPC__out boolean *hasCurrent) = 0;
virtual HRESULT STDMETHODCALLTYPE MoveNext(
/* [retval][out] */ __RPC__out boolean *hasCurrent) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) struct ABI::Windows::Media::Streaming::PlaySpeed *items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
};
#else /* C style interface */
typedef struct __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Current )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [retval][out] */ __RPC__out struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed *current);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_HasCurrent )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [retval][out] */ __RPC__out boolean *hasCurrent);
HRESULT ( STDMETHODCALLTYPE *MoveNext )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [retval][out] */ __RPC__out boolean *hasCurrent);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed *items,
/* [retval][out] */ __RPC__out unsigned int *actual);
END_INTERFACE
} __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl;
interface __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed
{
CONST_VTBL struct __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_get_Current(This,current) \
( (This)->lpVtbl -> get_Current(This,current) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_get_HasCurrent(This,hasCurrent) \
( (This)->lpVtbl -> get_HasCurrent(This,hasCurrent) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_MoveNext(This,hasCurrent) \
( (This)->lpVtbl -> MoveNext(This,hasCurrent) )
#define __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_GetMany(This,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,capacity,items,actual) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0067 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0067 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0067_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0067_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0477 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0477 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0477_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0477_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0068 */
/* [local] */
#ifndef DEF___FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed
#define DEF___FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0068 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0068_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0068_v0_0_s_ifspec;
#ifndef ____FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__
#define ____FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__
/* interface __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* [unique][uuid][object] */
/* interface __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c4a17a40-8c62-5884-822b-502526970b0d")
__FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE First(
/* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed **first) = 0;
};
#else /* C style interface */
typedef struct __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *First )(
__RPC__in __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [retval][out] */ __RPC__deref_out_opt __FIIterator_1_Windows__CMedia__CStreaming__CPlaySpeed **first);
END_INTERFACE
} __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl;
interface __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed
{
CONST_VTBL struct __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_First(This,first) \
( (This)->lpVtbl -> First(This,first) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0069 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIIterable_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0069 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0069_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0069_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0478 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0478 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0478_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0478_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0070 */
/* [local] */
#ifndef DEF___FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed
#define DEF___FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0070 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0070_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0070_v0_0_s_ifspec;
#ifndef ____FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__
#define ____FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__
/* interface __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* [unique][uuid][object] */
/* interface __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("1295caf3-c1da-54ea-ac66-da2c044f9eb0")
__FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAt(
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__out struct ABI::Windows::Media::Streaming::PlaySpeed *item) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size(
/* [retval][out] */ __RPC__out unsigned int *size) = 0;
virtual HRESULT STDMETHODCALLTYPE IndexOf(
/* [in] */ struct ABI::Windows::Media::Streaming::PlaySpeed item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) struct ABI::Windows::Media::Streaming::PlaySpeed *items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
};
#else /* C style interface */
typedef struct __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *GetAt )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__out struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed *item);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [retval][out] */ __RPC__out unsigned int *size);
HRESULT ( STDMETHODCALLTYPE *IndexOf )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed *items,
/* [retval][out] */ __RPC__out unsigned int *actual);
END_INTERFACE
} __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl;
interface __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed
{
CONST_VTBL struct __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_GetAt(This,index,item) \
( (This)->lpVtbl -> GetAt(This,index,item) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_get_Size(This,size) \
( (This)->lpVtbl -> get_Size(This,size) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_IndexOf(This,item,index,found) \
( (This)->lpVtbl -> IndexOf(This,item,index,found) )
#define __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_GetMany(This,startIndex,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,startIndex,capacity,items,actual) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0071 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0071 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0071_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0071_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0479 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0479 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0479_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0479_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0072 */
/* [local] */
#ifndef DEF___FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed
#define DEF___FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0072 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0072_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0072_v0_0_s_ifspec;
#ifndef ____FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__
#define ____FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__
/* interface __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* [unique][uuid][object] */
/* interface __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("fde57c75-5b86-5921-8ffb-101b0a184230")
__FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAt(
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__out struct ABI::Windows::Media::Streaming::PlaySpeed *item) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size(
/* [retval][out] */ __RPC__out unsigned int *size) = 0;
virtual HRESULT STDMETHODCALLTYPE GetView(
/* [retval][out] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed **view) = 0;
virtual HRESULT STDMETHODCALLTYPE IndexOf(
/* [in] */ struct ABI::Windows::Media::Streaming::PlaySpeed item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found) = 0;
virtual HRESULT STDMETHODCALLTYPE SetAt(
/* [in] */ unsigned int index,
/* [in] */ struct ABI::Windows::Media::Streaming::PlaySpeed item) = 0;
virtual HRESULT STDMETHODCALLTYPE InsertAt(
/* [in] */ unsigned int index,
/* [in] */ struct ABI::Windows::Media::Streaming::PlaySpeed item) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveAt(
/* [in] */ unsigned int index) = 0;
virtual HRESULT STDMETHODCALLTYPE Append(
/* [in] */ struct ABI::Windows::Media::Streaming::PlaySpeed item) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveAtEnd( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) struct ABI::Windows::Media::Streaming::PlaySpeed *items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
virtual HRESULT STDMETHODCALLTYPE ReplaceAll(
/* [in] */ unsigned int count,
/* [size_is][in] */ __RPC__in_ecount_full(count) struct ABI::Windows::Media::Streaming::PlaySpeed *value) = 0;
};
#else /* C style interface */
typedef struct __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *GetAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__out struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed *item);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [retval][out] */ __RPC__out unsigned int *size);
HRESULT ( STDMETHODCALLTYPE *GetView )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [retval][out] */ __RPC__deref_out_opt __FIVectorView_1_Windows__CMedia__CStreaming__CPlaySpeed **view);
HRESULT ( STDMETHODCALLTYPE *IndexOf )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found);
HRESULT ( STDMETHODCALLTYPE *SetAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ unsigned int index,
/* [in] */ struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed item);
HRESULT ( STDMETHODCALLTYPE *InsertAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ unsigned int index,
/* [in] */ struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed item);
HRESULT ( STDMETHODCALLTYPE *RemoveAt )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ unsigned int index);
HRESULT ( STDMETHODCALLTYPE *Append )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed item);
HRESULT ( STDMETHODCALLTYPE *RemoveAtEnd )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
HRESULT ( STDMETHODCALLTYPE *Clear )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed *items,
/* [retval][out] */ __RPC__out unsigned int *actual);
HRESULT ( STDMETHODCALLTYPE *ReplaceAll )(
__RPC__in __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed * This,
/* [in] */ unsigned int count,
/* [size_is][in] */ __RPC__in_ecount_full(count) struct __x_ABI_CWindows_CMedia_CStreaming_CPlaySpeed *value);
END_INTERFACE
} __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl;
interface __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed
{
CONST_VTBL struct __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeedVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_GetAt(This,index,item) \
( (This)->lpVtbl -> GetAt(This,index,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_get_Size(This,size) \
( (This)->lpVtbl -> get_Size(This,size) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_GetView(This,view) \
( (This)->lpVtbl -> GetView(This,view) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_IndexOf(This,item,index,found) \
( (This)->lpVtbl -> IndexOf(This,item,index,found) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_SetAt(This,index,item) \
( (This)->lpVtbl -> SetAt(This,index,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_InsertAt(This,index,item) \
( (This)->lpVtbl -> InsertAt(This,index,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_RemoveAt(This,index) \
( (This)->lpVtbl -> RemoveAt(This,index) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_Append(This,item) \
( (This)->lpVtbl -> Append(This,item) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_RemoveAtEnd(This) \
( (This)->lpVtbl -> RemoveAtEnd(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_Clear(This) \
( (This)->lpVtbl -> Clear(This) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_GetMany(This,startIndex,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,startIndex,capacity,items,actual) )
#define __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_ReplaceAll(This,count,value) \
( (This)->lpVtbl -> ReplaceAll(This,count,value) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0073 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed */
#if !defined(____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_INTERFACE_DEFINED__)
extern const __declspec(selectany) WCHAR InterfaceName_Windows_Media_Streaming_IMediaRendererActionInformation[] = L"Windows.Media.Streaming.IMediaRendererActionInformation";
#endif /* !defined(____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_INTERFACE_DEFINED__) */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0073 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0073_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0073_v0_0_s_ifspec;
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IMediaRendererActionInformation */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("66fbbfee-5ab0-4a4f-8d15-e5056b26beda")
IMediaRendererActionInformation : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsMuteAvailable(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsPauseAvailable(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsPlayAvailable(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsSeekAvailable(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsSetNextSourceAvailable(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsStopAvailable(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_IsVolumeAvailable(
/* [out][retval] */ __RPC__out boolean *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_PlaySpeeds(
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed **value) = 0;
};
extern const __declspec(selectany) IID & IID_IMediaRendererActionInformation = __uuidof(IMediaRendererActionInformation);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformationVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsMuteAvailable )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsPauseAvailable )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsPlayAvailable )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsSeekAvailable )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsSetNextSourceAvailable )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsStopAvailable )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsVolumeAvailable )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out][retval] */ __RPC__out boolean *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_PlaySpeeds )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation * This,
/* [out][retval] */ __RPC__deref_out_opt __FIVector_1_Windows__CMedia__CStreaming__CPlaySpeed **value);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformationVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformationVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_get_IsMuteAvailable(This,value) \
( (This)->lpVtbl -> get_IsMuteAvailable(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_get_IsPauseAvailable(This,value) \
( (This)->lpVtbl -> get_IsPauseAvailable(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_get_IsPlayAvailable(This,value) \
( (This)->lpVtbl -> get_IsPlayAvailable(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_get_IsSeekAvailable(This,value) \
( (This)->lpVtbl -> get_IsSeekAvailable(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_get_IsSetNextSourceAvailable(This,value) \
( (This)->lpVtbl -> get_IsSetNextSourceAvailable(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_get_IsStopAvailable(This,value) \
( (This)->lpVtbl -> get_IsStopAvailable(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_get_IsVolumeAvailable(This,value) \
( (This)->lpVtbl -> get_IsVolumeAvailable(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_get_PlaySpeeds(This,value) \
( (This)->lpVtbl -> get_PlaySpeeds(This,value) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0074 */
/* [local] */
#if !defined(____x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_INTERFACE_DEFINED__)
extern const __declspec(selectany) WCHAR InterfaceName_Windows_Media_Streaming_ITransportParameters[] = L"Windows.Media.Streaming.ITransportParameters";
#endif /* !defined(____x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_INTERFACE_DEFINED__) */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0074 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0074_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0074_v0_0_s_ifspec;
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::ITransportParameters */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CITransportParameters;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("eb0c4e24-2283-438d-8fff-dbe9df1cb2cc")
ITransportParameters : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_ActionInformation(
/* [out][retval] */ __RPC__deref_out_opt ABI::Windows::Media::Streaming::IMediaRendererActionInformation **value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_TrackInformation(
/* [out][retval] */ __RPC__out ABI::Windows::Media::Streaming::TrackInformation *value) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_TransportInformation(
/* [out][retval] */ __RPC__out ABI::Windows::Media::Streaming::TransportInformation *value) = 0;
};
extern const __declspec(selectany) IID & IID_ITransportParameters = __uuidof(ITransportParameters);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_ActionInformation )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters * This,
/* [out][retval] */ __RPC__deref_out_opt __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererActionInformation **value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_TrackInformation )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters * This,
/* [out][retval] */ __RPC__out __x_ABI_CWindows_CMedia_CStreaming_CTrackInformation *value);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_TransportInformation )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters * This,
/* [out][retval] */ __RPC__out __x_ABI_CWindows_CMedia_CStreaming_CTransportInformation *value);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CITransportParametersVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_get_ActionInformation(This,value) \
( (This)->lpVtbl -> get_ActionInformation(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_get_TrackInformation(This,value) \
( (This)->lpVtbl -> get_TrackInformation(This,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_get_TransportInformation(This,value) \
( (This)->lpVtbl -> get_TransportInformation(This,value) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CITransportParameters_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0075 */
/* [local] */
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
class CreateMediaRendererOperation;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0075 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0075_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0075_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0480 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0480 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0480_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0480_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0076 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer
#define DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0076 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0076_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0076_v0_0_s_ifspec;
#ifndef ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_INTERFACE_DEFINED__
#define ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_INTERFACE_DEFINED__
/* interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer */
/* [unique][uuid][object] */
/* interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("f0d971af-e054-5616-9fdf-0903b9ceb182")
__FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Invoke(
/* [in] */ __RPC__in_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer *asyncInfo,
/* [in] */ AsyncStatus status) = 0;
};
#else /* C style interface */
typedef struct __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRendererVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer * This);
HRESULT ( STDMETHODCALLTYPE *Invoke )(
__RPC__in __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer * This,
/* [in] */ __RPC__in_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer *asyncInfo,
/* [in] */ AsyncStatus status);
END_INTERFACE
} __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRendererVtbl;
interface __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer
{
CONST_VTBL struct __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRendererVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_Invoke(This,asyncInfo,status) \
( (This)->lpVtbl -> Invoke(This,asyncInfo,status) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0077 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0077 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0077_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0077_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0481 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0481 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0481_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0481_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0078 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer
#define DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0078 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0078_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0078_v0_0_s_ifspec;
#ifndef ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_INTERFACE_DEFINED__
#define ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_INTERFACE_DEFINED__
/* interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer */
/* [unique][uuid][object] */
/* interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("557dd3fb-4710-5059-921c-0dee68361fb5")
__FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer : public IInspectable
{
public:
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Completed(
/* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer *handler) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Completed(
/* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer **handler) = 0;
virtual HRESULT STDMETHODCALLTYPE GetResults(
/* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Media::Streaming::IMediaRenderer **results) = 0;
};
#else /* C style interface */
typedef struct __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRendererVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Completed )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer * This,
/* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer *handler);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Completed )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer * This,
/* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1_Windows__CMedia__CStreaming__CMediaRenderer **handler);
HRESULT ( STDMETHODCALLTYPE *GetResults )(
__RPC__in __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer * This,
/* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CMedia_CStreaming_CIMediaRenderer **results);
END_INTERFACE
} __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRendererVtbl;
interface __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer
{
CONST_VTBL struct __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRendererVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_put_Completed(This,handler) \
( (This)->lpVtbl -> put_Completed(This,handler) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_get_Completed(This,handler) \
( (This)->lpVtbl -> get_Completed(This,handler) )
#define __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_GetResults(This,results) \
( (This)->lpVtbl -> GetResults(This,results) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0079 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer */
#ifndef RUNTIMECLASS_Windows_Media_Streaming_CreateMediaRendererOperation_DEFINED
#define RUNTIMECLASS_Windows_Media_Streaming_CreateMediaRendererOperation_DEFINED
extern const __declspec(selectany) WCHAR RuntimeClass_Windows_Media_Streaming_CreateMediaRendererOperation[] = L"Windows.Media.Streaming.CreateMediaRendererOperation";
#endif
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
class DeviceController;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
#ifndef RUNTIMECLASS_Windows_Media_Streaming_DeviceController_DEFINED
#define RUNTIMECLASS_Windows_Media_Streaming_DeviceController_DEFINED
extern const __declspec(selectany) WCHAR RuntimeClass_Windows_Media_Streaming_DeviceController[] = L"Windows.Media.Streaming.DeviceController";
#endif
#ifdef __cplusplus
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
class BasicDevice;
} /*Streaming*/
} /*Media*/
} /*Windows*/
}
#endif
#ifndef RUNTIMECLASS_Windows_Media_Streaming_BasicDevice_DEFINED
#define RUNTIMECLASS_Windows_Media_Streaming_BasicDevice_DEFINED
extern const __declspec(selectany) WCHAR RuntimeClass_Windows_Media_Streaming_BasicDevice[] = L"Windows.Media.Streaming.BasicDevice";
#endif
#ifndef RUNTIMECLASS_Windows_Media_Streaming_MediaRenderer_DEFINED
#define RUNTIMECLASS_Windows_Media_Streaming_MediaRenderer_DEFINED
extern const __declspec(selectany) WCHAR RuntimeClass_Windows_Media_Streaming_MediaRenderer[] = L"Windows.Media.Streaming.MediaRenderer";
#endif
#if !defined(____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_INTERFACE_DEFINED__)
extern const __declspec(selectany) WCHAR InterfaceName_Windows_Media_Streaming_IMediaRendererFactory[] = L"Windows.Media.Streaming.IMediaRendererFactory";
#endif /* !defined(____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_INTERFACE_DEFINED__) */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0079 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0079_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0079_v0_0_s_ifspec;
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IMediaRendererFactory */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("657ab43d-b909-42b2-94d0-e3a0b134e8c9")
IMediaRendererFactory : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE CreateMediaRendererAsync(
/* [in] */ __RPC__in HSTRING deviceIdentifier,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer **value) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateMediaRendererFromBasicDeviceAsync(
/* [in] */ __RPC__in_opt ABI::Windows::Media::Streaming::IBasicDevice *basicDevice,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer **value) = 0;
};
extern const __declspec(selectany) IID & IID_IMediaRendererFactory = __uuidof(IMediaRendererFactory);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactoryVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *CreateMediaRendererAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory * This,
/* [in] */ __RPC__in HSTRING deviceIdentifier,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer **value);
HRESULT ( STDMETHODCALLTYPE *CreateMediaRendererFromBasicDeviceAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CMedia_CStreaming_CIBasicDevice *basicDevice,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CMedia__CStreaming__CMediaRenderer **value);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactoryVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactoryVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_CreateMediaRendererAsync(This,deviceIdentifier,value) \
( (This)->lpVtbl -> CreateMediaRendererAsync(This,deviceIdentifier,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_CreateMediaRendererFromBasicDeviceAsync(This,basicDevice,value) \
( (This)->lpVtbl -> CreateMediaRendererFromBasicDeviceAsync(This,basicDevice,value) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIMediaRendererFactory_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0080 */
/* [local] */
#ifndef RUNTIMECLASS_Windows_Media_Streaming_StreamSelector_DEFINED
#define RUNTIMECLASS_Windows_Media_Streaming_StreamSelector_DEFINED
extern const __declspec(selectany) WCHAR RuntimeClass_Windows_Media_Streaming_StreamSelector[] = L"Windows.Media.Streaming.StreamSelector";
#endif
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0080 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0080_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0080_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0482 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0482 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0482_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0482_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0081 */
/* [local] */
#ifndef DEF___FIIterator_1___F__CIPropertySet
#define DEF___FIIterator_1___F__CIPropertySet
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0081 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0081_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0081_v0_0_s_ifspec;
#ifndef ____FIIterator_1___F__CIPropertySet_INTERFACE_DEFINED__
#define ____FIIterator_1___F__CIPropertySet_INTERFACE_DEFINED__
/* interface __FIIterator_1___F__CIPropertySet */
/* [unique][uuid][object] */
/* interface __FIIterator_1___F__CIPropertySet */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIIterator_1___F__CIPropertySet;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("d79a75c8-b1d2-544d-9b09-7f7900a34efb")
__FIIterator_1___F__CIPropertySet : public IInspectable
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Current(
/* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Foundation::Collections::IPropertySet **current) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_HasCurrent(
/* [retval][out] */ __RPC__out boolean *hasCurrent) = 0;
virtual HRESULT STDMETHODCALLTYPE MoveNext(
/* [retval][out] */ __RPC__out boolean *hasCurrent) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Foundation::Collections::IPropertySet **items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
};
#else /* C style interface */
typedef struct __FIIterator_1___F__CIPropertySetVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIIterator_1___F__CIPropertySet * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIIterator_1___F__CIPropertySet * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIIterator_1___F__CIPropertySet * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIIterator_1___F__CIPropertySet * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIIterator_1___F__CIPropertySet * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIIterator_1___F__CIPropertySet * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Current )(
__RPC__in __FIIterator_1___F__CIPropertySet * This,
/* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet **current);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_HasCurrent )(
__RPC__in __FIIterator_1___F__CIPropertySet * This,
/* [retval][out] */ __RPC__out boolean *hasCurrent);
HRESULT ( STDMETHODCALLTYPE *MoveNext )(
__RPC__in __FIIterator_1___F__CIPropertySet * This,
/* [retval][out] */ __RPC__out boolean *hasCurrent);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIIterator_1___F__CIPropertySet * This,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet **items,
/* [retval][out] */ __RPC__out unsigned int *actual);
END_INTERFACE
} __FIIterator_1___F__CIPropertySetVtbl;
interface __FIIterator_1___F__CIPropertySet
{
CONST_VTBL struct __FIIterator_1___F__CIPropertySetVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIIterator_1___F__CIPropertySet_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIIterator_1___F__CIPropertySet_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIIterator_1___F__CIPropertySet_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIIterator_1___F__CIPropertySet_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIIterator_1___F__CIPropertySet_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIIterator_1___F__CIPropertySet_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIIterator_1___F__CIPropertySet_get_Current(This,current) \
( (This)->lpVtbl -> get_Current(This,current) )
#define __FIIterator_1___F__CIPropertySet_get_HasCurrent(This,hasCurrent) \
( (This)->lpVtbl -> get_HasCurrent(This,hasCurrent) )
#define __FIIterator_1___F__CIPropertySet_MoveNext(This,hasCurrent) \
( (This)->lpVtbl -> MoveNext(This,hasCurrent) )
#define __FIIterator_1___F__CIPropertySet_GetMany(This,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,capacity,items,actual) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIIterator_1___F__CIPropertySet_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0082 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIIterator_1___F__CIPropertySet */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0082 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0082_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0082_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0483 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0483 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0483_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0483_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0083 */
/* [local] */
#ifndef DEF___FIIterable_1___F__CIPropertySet
#define DEF___FIIterable_1___F__CIPropertySet
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0083 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0083_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0083_v0_0_s_ifspec;
#ifndef ____FIIterable_1___F__CIPropertySet_INTERFACE_DEFINED__
#define ____FIIterable_1___F__CIPropertySet_INTERFACE_DEFINED__
/* interface __FIIterable_1___F__CIPropertySet */
/* [unique][uuid][object] */
/* interface __FIIterable_1___F__CIPropertySet */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIIterable_1___F__CIPropertySet;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("489b756d-be43-5abb-b9a0-a47254103339")
__FIIterable_1___F__CIPropertySet : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE First(
/* [retval][out] */ __RPC__deref_out_opt __FIIterator_1___F__CIPropertySet **first) = 0;
};
#else /* C style interface */
typedef struct __FIIterable_1___F__CIPropertySetVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIIterable_1___F__CIPropertySet * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIIterable_1___F__CIPropertySet * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIIterable_1___F__CIPropertySet * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIIterable_1___F__CIPropertySet * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIIterable_1___F__CIPropertySet * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIIterable_1___F__CIPropertySet * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *First )(
__RPC__in __FIIterable_1___F__CIPropertySet * This,
/* [retval][out] */ __RPC__deref_out_opt __FIIterator_1___F__CIPropertySet **first);
END_INTERFACE
} __FIIterable_1___F__CIPropertySetVtbl;
interface __FIIterable_1___F__CIPropertySet
{
CONST_VTBL struct __FIIterable_1___F__CIPropertySetVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIIterable_1___F__CIPropertySet_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIIterable_1___F__CIPropertySet_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIIterable_1___F__CIPropertySet_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIIterable_1___F__CIPropertySet_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIIterable_1___F__CIPropertySet_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIIterable_1___F__CIPropertySet_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIIterable_1___F__CIPropertySet_First(This,first) \
( (This)->lpVtbl -> First(This,first) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIIterable_1___F__CIPropertySet_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0084 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIIterable_1___F__CIPropertySet */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0084 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0084_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0084_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0484 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0484 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0484_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0484_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0085 */
/* [local] */
#ifndef DEF___FIVectorView_1___F__CIPropertySet
#define DEF___FIVectorView_1___F__CIPropertySet
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0085 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0085_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0085_v0_0_s_ifspec;
#ifndef ____FIVectorView_1___F__CIPropertySet_INTERFACE_DEFINED__
#define ____FIVectorView_1___F__CIPropertySet_INTERFACE_DEFINED__
/* interface __FIVectorView_1___F__CIPropertySet */
/* [unique][uuid][object] */
/* interface __FIVectorView_1___F__CIPropertySet */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIVectorView_1___F__CIPropertySet;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("c25d9a17-c31e-5311-8122-3c04d28af9fc")
__FIVectorView_1___F__CIPropertySet : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAt(
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt ABI::Windows::Foundation::Collections::IPropertySet **item) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Size(
/* [retval][out] */ __RPC__out unsigned int *size) = 0;
virtual HRESULT STDMETHODCALLTYPE IndexOf(
/* [in] */ __RPC__in_opt ABI::Windows::Foundation::Collections::IPropertySet *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMany(
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) ABI::Windows::Foundation::Collections::IPropertySet **items,
/* [retval][out] */ __RPC__out unsigned int *actual) = 0;
};
#else /* C style interface */
typedef struct __FIVectorView_1___F__CIPropertySetVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *GetAt )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This,
/* [in] */ unsigned int index,
/* [retval][out] */ __RPC__deref_out_opt __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet **item);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Size )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This,
/* [retval][out] */ __RPC__out unsigned int *size);
HRESULT ( STDMETHODCALLTYPE *IndexOf )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet *item,
/* [out] */ __RPC__out unsigned int *index,
/* [retval][out] */ __RPC__out boolean *found);
HRESULT ( STDMETHODCALLTYPE *GetMany )(
__RPC__in __FIVectorView_1___F__CIPropertySet * This,
/* [in] */ unsigned int startIndex,
/* [in] */ unsigned int capacity,
/* [size_is][length_is][out] */ __RPC__out_ecount_part(capacity, *actual) __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet **items,
/* [retval][out] */ __RPC__out unsigned int *actual);
END_INTERFACE
} __FIVectorView_1___F__CIPropertySetVtbl;
interface __FIVectorView_1___F__CIPropertySet
{
CONST_VTBL struct __FIVectorView_1___F__CIPropertySetVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIVectorView_1___F__CIPropertySet_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIVectorView_1___F__CIPropertySet_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIVectorView_1___F__CIPropertySet_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIVectorView_1___F__CIPropertySet_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIVectorView_1___F__CIPropertySet_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIVectorView_1___F__CIPropertySet_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIVectorView_1___F__CIPropertySet_GetAt(This,index,item) \
( (This)->lpVtbl -> GetAt(This,index,item) )
#define __FIVectorView_1___F__CIPropertySet_get_Size(This,size) \
( (This)->lpVtbl -> get_Size(This,size) )
#define __FIVectorView_1___F__CIPropertySet_IndexOf(This,item,index,found) \
( (This)->lpVtbl -> IndexOf(This,item,index,found) )
#define __FIVectorView_1___F__CIPropertySet_GetMany(This,startIndex,capacity,items,actual) \
( (This)->lpVtbl -> GetMany(This,startIndex,capacity,items,actual) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIVectorView_1___F__CIPropertySet_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0086 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIVectorView_1___F__CIPropertySet */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0086 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0086_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0086_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0485 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0485 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0485_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0485_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0087 */
/* [local] */
#ifndef DEF___FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet
#define DEF___FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0087 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0087_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0087_v0_0_s_ifspec;
#ifndef ____FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_INTERFACE_DEFINED__
#define ____FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_INTERFACE_DEFINED__
/* interface __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet */
/* [unique][uuid][object] */
/* interface __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("af4e2f8a-92ca-5640-865c-9948fbde4495")
__FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Invoke(
/* [in] */ __RPC__in_opt __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet *asyncInfo,
/* [in] */ AsyncStatus status) = 0;
};
#else /* C style interface */
typedef struct __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySetVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet * This);
HRESULT ( STDMETHODCALLTYPE *Invoke )(
__RPC__in __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet * This,
/* [in] */ __RPC__in_opt __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet *asyncInfo,
/* [in] */ AsyncStatus status);
END_INTERFACE
} __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySetVtbl;
interface __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet
{
CONST_VTBL struct __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySetVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_Invoke(This,asyncInfo,status) \
( (This)->lpVtbl -> Invoke(This,asyncInfo,status) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0088 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0088 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0088_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0088_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0486 */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0486 */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0486_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0486_v0_0_s_ifspec;
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0089 */
/* [local] */
#ifndef DEF___FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet
#define DEF___FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet
#if !defined(__cplusplus) || defined(RO_NO_TEMPLATE_NAME)
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0089 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0089_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0089_v0_0_s_ifspec;
#ifndef ____FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_INTERFACE_DEFINED__
#define ____FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_INTERFACE_DEFINED__
/* interface __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet */
/* [unique][uuid][object] */
/* interface __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet */
/* [unique][uuid][object] */
EXTERN_C const IID IID___FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("216f9390-ea3d-5465-a789-6394a47eb4a4")
__FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet : public IInspectable
{
public:
virtual /* [propput] */ HRESULT STDMETHODCALLTYPE put_Completed(
/* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet *handler) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Completed(
/* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet **handler) = 0;
virtual HRESULT STDMETHODCALLTYPE GetResults(
/* [retval][out] */ __RPC__deref_out_opt __FIVectorView_1___F__CIPropertySet **results) = 0;
};
#else /* C style interface */
typedef struct __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySetVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
/* [propput] */ HRESULT ( STDMETHODCALLTYPE *put_Completed )(
__RPC__in __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet * This,
/* [in] */ __RPC__in_opt __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet *handler);
/* [propget] */ HRESULT ( STDMETHODCALLTYPE *get_Completed )(
__RPC__in __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet * This,
/* [retval][out] */ __RPC__deref_out_opt __FIAsyncOperationCompletedHandler_1___FIVectorView_1___F__CIPropertySet **handler);
HRESULT ( STDMETHODCALLTYPE *GetResults )(
__RPC__in __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet * This,
/* [retval][out] */ __RPC__deref_out_opt __FIVectorView_1___F__CIPropertySet **results);
END_INTERFACE
} __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySetVtbl;
interface __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet
{
CONST_VTBL struct __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySetVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_put_Completed(This,handler) \
( (This)->lpVtbl -> put_Completed(This,handler) )
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_get_Completed(This,handler) \
( (This)->lpVtbl -> get_Completed(This,handler) )
#define __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_GetResults(This,results) \
( (This)->lpVtbl -> GetResults(This,results) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0090 */
/* [local] */
#endif /* pinterface */
#endif /* DEF___FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet */
#if !defined(____x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_INTERFACE_DEFINED__)
extern const __declspec(selectany) WCHAR InterfaceName_Windows_Media_Streaming_IStreamSelectorStatics[] = L"Windows.Media.Streaming.IStreamSelectorStatics";
#endif /* !defined(____x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_INTERFACE_DEFINED__) */
/* interface __MIDL_itf_windows2Emedia2Estreaming_0000_0090 */
/* [local] */
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0090_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_windows2Emedia2Estreaming_0000_0090_v0_0_s_ifspec;
#ifndef ____x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_INTERFACE_DEFINED__
#define ____x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_INTERFACE_DEFINED__
/* interface __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics */
/* [uuid][object] */
/* interface ABI::Windows::Media::Streaming::IStreamSelectorStatics */
/* [uuid][object] */
EXTERN_C const IID IID___x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics;
#if defined(__cplusplus) && !defined(CINTERFACE)
} /* end extern "C" */
namespace ABI {
namespace Windows {
namespace Media {
namespace Streaming {
MIDL_INTERFACE("8a4cd4a1-ed85-4e0f-bd68-8a6862e4636d")
IStreamSelectorStatics : public IInspectable
{
public:
virtual HRESULT STDMETHODCALLTYPE SelectBestStreamAsync(
/* [in] */ __RPC__in_opt ABI::Windows::Storage::IStorageFile *storageFile,
/* [in] */ __RPC__in_opt ABI::Windows::Foundation::Collections::IPropertySet *selectorProperties,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType **value) = 0;
virtual HRESULT STDMETHODCALLTYPE GetStreamPropertiesAsync(
/* [in] */ __RPC__in_opt ABI::Windows::Storage::IStorageFile *storageFile,
/* [in] */ __RPC__in_opt ABI::Windows::Foundation::Collections::IPropertySet *selectorProperties,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet **value) = 0;
virtual HRESULT STDMETHODCALLTYPE SelectBestStreamFromStreamAsync(
/* [in] */ __RPC__in_opt ABI::Windows::Storage::Streams::IRandomAccessStream *stream,
/* [in] */ __RPC__in_opt ABI::Windows::Foundation::Collections::IPropertySet *selectorProperties,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType **value) = 0;
virtual HRESULT STDMETHODCALLTYPE GetStreamPropertiesFromStreamAsync(
/* [in] */ __RPC__in_opt ABI::Windows::Storage::Streams::IRandomAccessStream *stream,
/* [in] */ __RPC__in_opt ABI::Windows::Foundation::Collections::IPropertySet *selectorProperties,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet **value) = 0;
};
extern const __declspec(selectany) IID & IID_IStreamSelectorStatics = __uuidof(IStreamSelectorStatics);
} /* end namespace */
} /* end namespace */
} /* end namespace */
} /* end namespace */
extern "C" {
#else /* C style interface */
typedef struct __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStaticsVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This);
HRESULT ( STDMETHODCALLTYPE *GetIids )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This,
/* [out] */ __RPC__out ULONG *iidCount,
/* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*iidCount) IID **iids);
HRESULT ( STDMETHODCALLTYPE *GetRuntimeClassName )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This,
/* [out] */ __RPC__deref_out_opt HSTRING *className);
HRESULT ( STDMETHODCALLTYPE *GetTrustLevel )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This,
/* [out] */ __RPC__out TrustLevel *trustLevel);
HRESULT ( STDMETHODCALLTYPE *SelectBestStreamAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CStorage_CIStorageFile *storageFile,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet *selectorProperties,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType **value);
HRESULT ( STDMETHODCALLTYPE *GetStreamPropertiesAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CStorage_CIStorageFile *storageFile,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet *selectorProperties,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet **value);
HRESULT ( STDMETHODCALLTYPE *SelectBestStreamFromStreamAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStream *stream,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet *selectorProperties,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1_Windows__CStorage__CStreams__CIRandomAccessStreamWithContentType **value);
HRESULT ( STDMETHODCALLTYPE *GetStreamPropertiesFromStreamAsync )(
__RPC__in __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics * This,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CStorage_CStreams_CIRandomAccessStream *stream,
/* [in] */ __RPC__in_opt __x_ABI_CWindows_CFoundation_CCollections_CIPropertySet *selectorProperties,
/* [out][retval] */ __RPC__deref_out_opt __FIAsyncOperation_1___FIVectorView_1___F__CIPropertySet **value);
END_INTERFACE
} __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStaticsVtbl;
interface __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics
{
CONST_VTBL struct __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStaticsVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_GetIids(This,iidCount,iids) \
( (This)->lpVtbl -> GetIids(This,iidCount,iids) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_GetRuntimeClassName(This,className) \
( (This)->lpVtbl -> GetRuntimeClassName(This,className) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_GetTrustLevel(This,trustLevel) \
( (This)->lpVtbl -> GetTrustLevel(This,trustLevel) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_SelectBestStreamAsync(This,storageFile,selectorProperties,value) \
( (This)->lpVtbl -> SelectBestStreamAsync(This,storageFile,selectorProperties,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_GetStreamPropertiesAsync(This,storageFile,selectorProperties,value) \
( (This)->lpVtbl -> GetStreamPropertiesAsync(This,storageFile,selectorProperties,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_SelectBestStreamFromStreamAsync(This,stream,selectorProperties,value) \
( (This)->lpVtbl -> SelectBestStreamFromStreamAsync(This,stream,selectorProperties,value) )
#define __x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_GetStreamPropertiesFromStreamAsync(This,stream,selectorProperties,value) \
( (This)->lpVtbl -> GetStreamPropertiesFromStreamAsync(This,stream,selectorProperties,value) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* ____x_ABI_CWindows_CMedia_CStreaming_CIStreamSelectorStatics_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER HSTRING_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in HSTRING * );
unsigned char * __RPC_USER HSTRING_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in HSTRING * );
unsigned char * __RPC_USER HSTRING_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out HSTRING * );
void __RPC_USER HSTRING_UserFree( __RPC__in unsigned long *, __RPC__in HSTRING * );
unsigned long __RPC_USER HSTRING_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in HSTRING * );
unsigned char * __RPC_USER HSTRING_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in HSTRING * );
unsigned char * __RPC_USER HSTRING_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out HSTRING * );
void __RPC_USER HSTRING_UserFree64( __RPC__in unsigned long *, __RPC__in HSTRING * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
| [
"fajaralmunawwar@yahoo.com"
] | fajaralmunawwar@yahoo.com |
6622f687135a37e169893824b05b87dd56fefc25 | 04ecdf08a159fd9b469cf357657f46ec98517be7 | /sorting/squares-sorted-arr.cpp | d4b913c053fda696c0c78f0948cfaea4e6e99597 | [] | no_license | rjt007/LeetCode-Problems | d9cc890c2492d084e6035a69883a950c5985e976 | b0c02dcc6cb58439b8b94f40dcb3968cd6dfbcf1 | refs/heads/master | 2023-08-17T04:33:57.379783 | 2021-09-22T17:54:11 | 2021-09-22T17:54:11 | 382,655,578 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 901 | cpp | //https://leetcode.com/problems/squares-of-a-sorted-array/
#include <bits/stdc++.h>
using namespace std;
//T.C->O(N), S.C->O(1)
vector<int> sortedSquares(vector<int> &nums)
{
vector<int> ans;
int n = nums.size();
int i = 0, j = n - 1;
while (i <= j)
{
if (nums[j] * nums[j] >= nums[i] * nums[i])
{
ans.push_back(nums[j] * nums[j]);
j--;
}
else
{
ans.push_back(nums[i] * nums[i]);
i++;
}
}
reverse(ans.begin(), ans.end());
return ans;
}
int main()
{
int n;
cin >> n;
vector<int> v;
int val;
for (int i = 0; i < n; i++)
{
cin >> val;
v.push_back(val);
}
vector<int> ans = sortedSquares(v);
cout<<"Result is:\n";
for (int i = 0; i < ans.size(); i++)
{
cout<<ans[i]<<" ";
}
cout<<endl;
return 0;
} | [
"rajatagrawal007.ra@gmail.com"
] | rajatagrawal007.ra@gmail.com |
60aded838c8cc6c71aed5d44e81214d53f8d2ad8 | 20fffb1bc2795021c4612ad4b408d96fa5b761cf | /POJ/POJ 1679.cpp | e6ab19d1e4057b51a3b3a461e6ad236324edbcfd | [] | no_license | myk502/ACM | 244c0a614ab2454332d11fd9afd7a5434d22b090 | 7c4d55a4655e58de89307965a322dd862758adbd | refs/heads/master | 2021-01-01T16:42:05.678466 | 2018-10-01T14:31:57 | 2018-10-01T14:34:42 | 97,893,148 | 7 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,200 | cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<queue>
#include<climits>
#include<cmath>
#include<string>
#include<map>
#include<algorithm>
using namespace std;
int n,m,pre[110];
struct Edge
{
int from;
int to;
int cost;
};
Edge a[10010];
int indexx;
int find_ancestor(int x)
{
int r=x;
while(pre[r]!=r)
{
r=pre[r];
}
int i=x,j;
while(i!=r)
{
j=pre[i];
pre[i]=r;
i=j;
}
return r;
}
void join(int x,int y)
{
int fx=find_ancestor(x);
int fy=find_ancestor(y);
if(fx!=fy)
pre[fx]=fy;
}
bool cmp(Edge xx,Edge yy)
{
return(xx.cost<yy.cost);
}
int main(void)
{
int t,u,v,w,cnt,flag,ans;
cin>>t;
while(t--)
{
cnt=0;
cin>>n>>m;
flag=0;
ans=0;
for(int i=1;i<=n;i++)
pre[i]=i;
for(int i=0;i<m;i++)
{
scanf("%d%d%d",&u,&v,&w);
Edge input;
input.from=u;
input.to=v;
input.cost=w;
a[i]=input;
}
sort(a,a+m,cmp);
indexx=0;
while(cnt<n-1)
{
Edge temp=a[indexx];
int uu=temp.from,vv=temp.to,ww=temp.cost;
int fauu=find_ancestor(uu),favv=find_ancestor(vv);
if(find_ancestor(uu)!=find_ancestor(vv))
{
for(int j=indexx+1;j<m;j++)
{
Edge tempp=a[j];
int uuu=tempp.from,vvv=tempp.to,www=tempp.cost;
if(www!=ww)
break;
int fauuu=find_ancestor(uuu),favvv=find_ancestor(vvv);
if((fauu==fauuu)&&(favv==favvv))
flag=1;
if((fauu==favvv)&&(fauuu==favv))
flag=1;
}
cnt++;
join(uu,vv);
ans+=ww;
}
indexx++;
}
if(flag==1)
printf("Not Unique!\n");
else
printf("%d\n",ans);
}
return 0;
}
| [
"525039107@qq.com"
] | 525039107@qq.com |
264d4ff635befc5c138c817b264b9d8c88c85957 | f7b2758ba036bf7a817f21fa4f909bee2890c521 | /source/hpp/ovcxfer.hpp | 37539d8a61c855c322af11a30d306bc8219c4257 | [] | no_license | kputy/Orpheus | 4f47d9d3c7fa22af10aa8d4fce05054038f1148c | 5b5186fb59c2f791952a9c1f563eed335b6ea01c | refs/heads/master | 2021-01-18T07:00:34.402335 | 2015-03-07T11:01:08 | 2015-03-07T11:01:08 | 41,523,922 | 0 | 1 | null | 2015-08-28T03:03:48 | 2015-08-28T03:03:48 | null | UTF-8 | C++ | false | false | 4,918 | hpp | // CodeGear C++Builder
// Copyright (c) 1995, 2014 by Embarcadero Technologies, Inc.
// All rights reserved
// (DO NOT EDIT: machine generated header) 'ovcxfer.pas' rev: 28.00 (Windows)
#ifndef OvcxferHPP
#define OvcxferHPP
#pragma delphiheader begin
#pragma option push
#pragma option -w- // All warnings off
#pragma option -Vx // Zero-length empty class member
#pragma pack(push,8)
#include <System.hpp> // Pascal unit
#include <SysInit.hpp> // Pascal unit
#include <Winapi.Windows.hpp> // Pascal unit
#include <System.Classes.hpp> // Pascal unit
#include <Vcl.Controls.hpp> // Pascal unit
#include <Vcl.ExtCtrls.hpp> // Pascal unit
#include <Vcl.Forms.hpp> // Pascal unit
#include <Vcl.StdCtrls.hpp> // Pascal unit
#include <System.SysUtils.hpp> // Pascal unit
#include <ovcbase.hpp> // Pascal unit
#include <ovcconst.hpp> // Pascal unit
#include <ovcdata.hpp> // Pascal unit
#include <ovcef.hpp> // Pascal unit
#include <ovcrlbl.hpp> // Pascal unit
#include <ovcedit.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Ovcxfer
{
//-- type declarations -------------------------------------------------------
enum DECLSPEC_DENUM TxfrStringtype : unsigned char { xfrString, xfrPChar, xfrShortString };
struct TListBoxTransfer;
typedef TListBoxTransfer *PListBoxTransfer;
#pragma pack(push,1)
struct DECLSPEC_DRECORD TListBoxTransfer
{
public:
int ItemIndex;
System::Classes::TStrings* Items;
};
#pragma pack(pop)
struct TComboBoxTransfer;
typedef TComboBoxTransfer *PComboBoxTransfer;
#pragma pack(push,1)
struct DECLSPEC_DRECORD TComboBoxTransfer
{
public:
int ItemIndex;
System::UnicodeString Text;
System::Classes::TStrings* Items;
};
#pragma pack(pop)
struct TComboBoxTransfer_xfrPChar;
typedef TComboBoxTransfer_xfrPChar *PComboBoxTransfer_xfrPChar;
#pragma pack(push,1)
struct DECLSPEC_DRECORD TComboBoxTransfer_xfrPChar
{
public:
int ItemIndex;
System::StaticArray<System::WideChar, 256> Text;
System::Classes::TStrings* Items;
};
#pragma pack(pop)
struct TComboBoxTransfer_xfrShortString;
typedef TComboBoxTransfer_xfrShortString *PComboBoxTransfer_xfrShortString;
#pragma pack(push,1)
struct DECLSPEC_DRECORD TComboBoxTransfer_xfrShortString
{
public:
int ItemIndex;
System::SmallString<255> Text;
System::Classes::TStrings* Items;
};
#pragma pack(pop)
class DELPHICLASS TOvcTransfer;
class PASCALIMPLEMENTATION TOvcTransfer : public Ovcbase::TOvcComponent
{
typedef Ovcbase::TOvcComponent inherited;
protected:
System::Classes::TList* xfrList;
System::Word __fastcall xfrGetComponentDataSize(System::Classes::TComponent* C, TxfrStringtype xfrStringtype);
public:
void __fastcall GetTransferList(System::Classes::TList* L);
System::Word __fastcall GetTransferBufferSizePrim(System::Classes::TComponent* *CNA, const int CNA_High, TxfrStringtype xfrStringtype);
System::Word __fastcall GetTransferBufferSize(System::Classes::TComponent* *CNA, const int CNA_High);
System::Word __fastcall GetTransferBufferSizeZ(System::Classes::TComponent* *CNA, const int CNA_High);
System::Word __fastcall GetTransferBufferSizeS(System::Classes::TComponent* *CNA, const int CNA_High);
void __fastcall TransferFromFormPrim(System::Classes::TComponent* *CNA, const int CNA_High, void *Data, TxfrStringtype xfrStringtype);
void __fastcall TransferFromForm(System::Classes::TComponent* *CNA, const int CNA_High, void *Data);
void __fastcall TransferFromFormZ(System::Classes::TComponent* *CNA, const int CNA_High, void *Data);
void __fastcall TransferFromFormS(System::Classes::TComponent* *CNA, const int CNA_High, void *Data);
void __fastcall TransferToFormPrim(System::Classes::TComponent* *CNA, const int CNA_High, const void *Data, TxfrStringtype xfrStringtype);
void __fastcall TransferToForm(System::Classes::TComponent* *CNA, const int CNA_High, const void *Data);
void __fastcall TransferToFormZ(System::Classes::TComponent* *CNA, const int CNA_High, const void *Data);
void __fastcall TransferToFormS(System::Classes::TComponent* *CNA, const int CNA_High, const void *Data);
public:
/* TOvcComponent.Create */ inline __fastcall virtual TOvcTransfer(System::Classes::TComponent* AOwner) : Ovcbase::TOvcComponent(AOwner) { }
/* TOvcComponent.Destroy */ inline __fastcall virtual ~TOvcTransfer(void) { }
};
//-- var, const, procedure ---------------------------------------------------
static const System::Byte xfrMaxPChar = System::Byte(0xff);
} /* namespace Ovcxfer */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_OVCXFER)
using namespace Ovcxfer;
#endif
#pragma pack(pop)
#pragma option pop
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // OvcxferHPP
| [
"romankassebaum@users.noreply.github.com"
] | romankassebaum@users.noreply.github.com |
2962dfb266039935205f03324b4b97e97167277a | 7446390f0213548cebe1362b2953438de8420d9e | /Analysis/MssmHbb/interface/HbbLimits.h | adf9b03b4bc4d0094433c08360955b866391f3c5 | [] | no_license | desy-cms/analysis | c223db1075dc7b21414e039501965438c1b3b031 | e1bd297c8ac1db4cdd2855caa7d652308196eaa8 | refs/heads/develop | 2021-04-09T17:12:11.830400 | 2017-05-16T13:07:25 | 2017-05-16T13:07:25 | 43,806,324 | 6 | 18 | null | 2017-04-18T12:57:01 | 2015-10-07T09:30:16 | C++ | UTF-8 | C++ | false | false | 4,568 | h | /*
* HbbLimits.h
*
* Created on: Dec 13, 2016
* Author: shevchen
*/
#include <string>
#include <iostream>
#include <map>
#include "Analysis/MssmHbb/interface/Luminosity.h"
#include "Analysis/MssmHbb/macros/Drawer/HbbStyle.cc"
#include "TH3.h"
#include <TH2.h>
#include <TH1.h>
#include "TLegend.h"
#include "TGraph.h"
#include "TMultiGraph.h"
#include "TGraphAsymmErrors.h"
#ifndef MSSMHBB_INTERFACE_HBBLIMITS_H_
#define MSSMHBB_INTERFACE_HBBLIMITS_H_
// Root includes
#include <TTree.h>
#include <TMath.h>
#include <TH1.h>
#include <TH3F.h>
// cpp includes
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
//my includes
#include "Analysis/MssmHbb/interface/Limit.h"
#include "Analysis/MssmHbb/interface/utilLib.h"
// MSSM tools
#include "Analysis/MssmHbb/macros/signal/mssm_xs_tools.h"
#include "Analysis/MssmHbb/macros/signal/mssm_xs_tools.C"
namespace analysis {
namespace mssmhbb {
class HbbLimits {
public:
HbbLimits();
HbbLimits(const bool& blindData, const bool& test = false);
HbbLimits(const bool& blindData, const std::string& boson, const bool& test = false);
virtual ~HbbLimits();
struct THDMScan{
TH2D expected;
TH2D observed;
};
// Method to read Limits from the combine output
std::vector<Limit> ReadCombineLimits(const std::string& file_name);
// Method to read one limit
const Limit ReadCombineLimit(const std::string& tfile_name, const bool& blindData);
// Method to set higgs boson to be used: A/H/Degenarated
void SetHiggsBoson(const std::string& boson);
// Method to get tanBeta limits according to theoretical Br and Sigma
const std::vector<Limit> GetMSSMLimits(const std::vector<Limit>& GxBR_limits, const std::string& benchmark_path, const std::string& uncert = "", const bool& UP = false, const std::string& benchmark_ref_path = "", const double& tanBref = -1);
// Method to get 2HDM 3D GxBR
TH3D Get2HDM_GxBR_3D(const std::string& benchmark_path);
// Method to get 2HDM 2D GxBR for particular value of VAR
TH2D Get2HDM_GxBR_2D(const TH3& GxBR, const double& var, const std::string& axis = "X");
// Method to get 2D limits of G_95%CL / G_pred for particular mass point
THDMScan Get2HDMmuScan(const TH2& GxBR_2hdm, const Limit& GxBR_95CL);
// Method to calculate 2HDM limits
std::vector<Limit> Get2HDM_Limits(const TH2& GxBR_2hdm, const Limit& GxBR_95CL, const double& xmin = -1, const double& xmax = 1);
// Method to plot Brazil 2HDM limits
const std::vector<Limit> Get2HDM_1D_Limits(const TH2& GxBR_2hdm,const std::vector<Limit>& GxBR_limits);
// Make output .txt with limits written in a human readable way
void Write(const std::vector<Limit>& limits, const std::string& name);
// Method to receive tanBeta value from Sigma x BR in MSSM interpretation
double MSSMTanBeta(const std::string& benchmark_path, double mA, double xsection, const std::string& uncert = "", const bool& UP = false, const std::string& benchmark_ref_path = "", const double& tanBref = -1);
// Method to receive tanBeta value for 1D Siga x BR in 2HDMinterpretation
double THDMTanBeta(const TH2& GxBR_2hdm, double mA, double xsection);
// Method to get contour of atlas plot
TGraph GetAtlasZhll_flipped();
// // Method to get 2HDM tanBeta vs MA limits
// const std::vector<Limit> Get2HDM_tanB_mA_Limits(const std::vector<Limit>& GxBR_limits, const std::string& benchmark_path, const double& sinB_A);
// // Method to get 2HDM sin(beta-alpha) vs tanBeta limits for particular value of mA
// const std::vector<Limit> Get2HDM_cosB_A_tanB_Limits(const std::vector<Limit>& GxBR_limits, const std::string& benchmark_path, const double& mA);
// const std::vector<Limit> Get2HDM_cosB_A_tanB_Limits(const Limit& GxBR_limit, const std::string& benchmark_path, const double& mA); // TODO: Implement!
void LimitPlotter(const std::vector<Limit>& limits,
const std::vector<Limit>& differ_limits,
TLegend& leg,
const std::string& output = "",
const float& yMin = 1,
const float& yMax = 60,
const float& xMin = 200,
const float& xMax = 700,
const std::string& Lumi = "2.69 fb^{-1}",
const std::string& xtitle = "m_{A} [GeV]",
const std::string& ytitle = "tan#beta",
const bool& logY = true);
private:
bool blindData_;
std::string boson_;
bool TEST_;
HbbStyle style_;
protected:
void CheckHiggsBoson();
void SetTHDMHistos(TFile& file,std::map<std::string,TH3D*>&);
};
inline void HbbLimits::SetHiggsBoson(const std::string& boson) {
boson_ = boson;
}
} /* namespace MssmHbb */
} /* namespace Analysis */
#endif /* MSSMHBB_INTERFACE_HBBLIMITS_H_ */
| [
"shevchenko.rostislav@gmail.com"
] | shevchenko.rostislav@gmail.com |
34b7d5f9d3a973dc39e0686fc64f1fbf1e033850 | 9ed70c97db0f8c7c5b28dc80da19e3101186d573 | /goggles/goggles.ino | 290bb1fca0030e8c17bc5c47ab7eed96c61181fc | [] | no_license | adgedenkers/arduino | c832bb0478cd43fd348daefc0f873d8df06d9c74 | 7a7ace2e9a293559f258dfbd8d8c99867ec13a14 | refs/heads/master | 2021-06-09T09:37:51.880555 | 2021-05-04T23:56:58 | 2021-05-04T23:56:58 | 157,988,204 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,659 | ino | // Low power NeoPixel goggles example. Makes a nice blinky display // with just a few LEDs on at any time.
#include <Adafruit_NeoPixel.h>
#ifdef __AVR_ATtiny85__ // Trinket, Gemma, etc.
#include <avr/power.h> #endif
#define PIN 0
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(32, PIN);
uint8_t mode = 0; // Current animation effect
offset = 0; // Position of spinny eyes
uint32_t color = 0xFF0000; // Start red
uint32_t prevTime;
void setup() {
#ifdef __AVR_ATtiny85__ // Trinket, Gemma, etc.
if(F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif
pixels.begin();
pixels.setBrightness(85); // 1/3 brightness prevTime = millis();
}
void loop() {
uint8_t i;
uint32_t t;
switch(mode) {
case 0: // Random sparks - just one LED on at a time! i = random(32);
pixels.setPixelColor(i, color);
pixels.show();
delay(10);
pixels.setPixelColor(i, 0);
break;
case 1: // Spinny wheels (8 LEDs on at a time)
for(i=0; i<16; i++) {
uint32_t c = 0;
if(((offset + i) & 7) < 2) {
c = color; // 4 pixels on...
pixels.setPixelColor( i, c); // First eye
pixels.setPixelColor(31-i, c); // Second eye (flipped)
}
}
pixels.show();
offset++;
delay(50);
break;
}
t = millis();
if((t - prevTime) > 8000) {
// Every 8 seconds... // Next mode
// End of modes?
// Start modes over // Next color R->G->B // Reset to red
mode++;
if(mode > 1) {
mode = 0;
color >>= 8;
if(!color) color = 0xFF0000;
}
for(i=0; i<32; i++) {
pixels.setPixelColor(i, 0);
prevTime = t;
}
}
| [
"adge.denkers@gmail.com"
] | adge.denkers@gmail.com |
90c22297fe7915a6bb6e33f8139d68b38a1cf059 | 5125535717f1f4c2123c666ea90e7041a9ac98dd | /_rings.ino | 2de79e36cfc3ddc9e3eb6813ed8be39af4debbc5 | [] | no_license | Jaharmi/pixelated | d07ee1cb5db684a08dd22c4f307da70814f9c377 | 88a3df2a44e49c79898d7c5b39d813a7bf664a58 | refs/heads/master | 2022-03-01T21:22:08.788118 | 2019-10-22T10:07:54 | 2019-10-22T10:07:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,680 | ino | float noiseScale =0.2;
float fractalNoise (float x, float y, float z) {
float r=0;
float amp=1.0;
for (int octave=0; octave<4;octave ++){
r+=noise(x)+noise(y)+noise(z) * amp;
amp /=2;
x*=2;
y*=2;
z*=2;
}
return r;
}
float noise (float val) {
return (float (random( 0,1000)/1000.0));
}
float dx,dy,dz;
void DoRings() {
long now = millis();
float speed = 0.002;
float zspeed= 0.1;
float angle=sin (now * 0.001);
float z= now * 0.00008;
float hue= now *0.01;
float scale=0.005;
float saturation = 100* constrain(pow(1.15 * noise(now * 0.000122) ,2.5),0,1);
float spacing = noise (now*0.000124) * 0.1;
dx += cos(angle)*speed;
dy += sin(angle)*speed;
dz += (noise(now * 0.000014) -0.5) * zspeed;
float centerx = noise (now * 0.000125) * 1.25 * COLUMNS;
float centery = noise (now * -0.000125) * 1.25 * ROWS;
for (int x=0; x< COLUMNS; x++) {
for (int y=0; y< ROWS; y++){
float dist = sqrt(pow(x - centerx,2) + pow(y - centery,2));
float pulse = (sin (dz + dist* spacing) - 0.3) * 0.3;
float n = fractalNoise (dx+ x*scale + pulse , dy+y*scale,z) - 0.75;
float m = fractalNoise (dx + x*scale , dy + y* scale, z+10.0) - 0.75;
// color c= color ( ( hue+ 40.0 * m ) % 100.0, saturation, 100* constrain(pow(3.0*n,1.5) ,0,0.9) );
//matrix.drawPixelRGB888(x, y, red, green, blue);
matrix.drawPixel (x,y,BLUE);
// matrix.drawPixelRGB888 (x,y,int (( hue+ 40.0 * m ) % 100.0),int ( saturation) ,int ( 100* constrain(pow(3.0*n,1.5) ,0,0.9)) ); //c = color
}
}
}
| [
"lawrence@computersolutions.cn"
] | lawrence@computersolutions.cn |
56795db6803647e622651c3290f9a661c5f33633 | 0dca3325c194509a48d0c4056909175d6c29f7bc | /dbfs/include/alibabacloud/dbfs/model/GetDbfsResult.h | b1402893f34c2b06d80e37d3840bb2a8debc0439 | [
"Apache-2.0"
] | permissive | dingshiyu/aliyun-openapi-cpp-sdk | 3eebd9149c2e6a2b835aba9d746ef9e6bef9ad62 | 4edd799a79f9b94330d5705bb0789105b6d0bb44 | refs/heads/master | 2023-07-31T10:11:20.446221 | 2021-09-26T10:08:42 | 2021-09-26T10:08:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,242 | h | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_DBFS_MODEL_GETDBFSRESULT_H_
#define ALIBABACLOUD_DBFS_MODEL_GETDBFSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dbfs/DBFSExport.h>
namespace AlibabaCloud
{
namespace DBFS
{
namespace Model
{
class ALIBABACLOUD_DBFS_EXPORT GetDbfsResult : public ServiceResult
{
public:
struct DBFSInfo
{
struct TagList
{
std::string tagKey;
int id;
std::string tagValue;
};
struct EcsListItem
{
std::string ecsId;
};
struct EbsListItem
{
int sizeG;
std::string ebsId;
};
std::string status;
std::string description;
std::string category;
std::string createdTime;
std::string kMSKeyId;
std::string zoneId;
bool enableRaid;
std::vector<EcsListItem> ecsList;
int sizeG;
std::string performanceLevel;
std::string fsId;
std::string dBFSClusterId;
std::string payType;
bool encryption;
std::string lastUmountTime;
std::string fsName;
std::vector<EbsListItem> ebsList;
std::string usedScene;
int raidStrip;
std::string lastMountTime;
std::string regionId;
int attachNodeNumber;
std::vector<TagList> tags;
};
GetDbfsResult();
explicit GetDbfsResult(const std::string &payload);
~GetDbfsResult();
DBFSInfo getDBFSInfo()const;
protected:
void parse(const std::string &payload);
private:
DBFSInfo dBFSInfo_;
};
}
}
}
#endif // !ALIBABACLOUD_DBFS_MODEL_GETDBFSRESULT_H_ | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
651f3d786cbf2c8d8d47551b185e498446daa760 | 366e3a877c42869d17ab85c2384c3d98da2b579b | /Student_OMP/src/cpp/core/omp/02_Slice/07_pi_for_promotionTab.cpp | d331e77efb190956b03ca28f3ceb6ce3e9a57b85 | [] | no_license | sylvain1811/WCuda | 21ff9b66e87058d25b5cda27d41f893350c40f8d | 080fda79e74c695809dc71bb361cee34b9862c11 | refs/heads/master | 2021-05-05T14:29:09.478535 | 2018-04-30T17:16:46 | 2018-04-30T17:16:46 | 118,453,141 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,260 | cpp | #include <omp.h>
#include "MathTools.h"
#include "OmpTools.h"
#include "../02_Slice/00_pi_tools.h"
/*----------------------------------------------------------------------*\
|* Declaration *|
\*---------------------------------------------------------------------*/
/*--------------------------------------*\
|* Imported *|
\*-------------------------------------*/
/*--------------------------------------*\
|* Public *|
\*-------------------------------------*/
bool isPiOMPforPromotionTab_Ok(int n);
/*--------------------------------------*\
|* Private *|
\*-------------------------------------*/
static double piOMPforPromotionTab(int n);
static void syntaxeSimplifier(double* tabSumThread, int n);
static void syntaxeFull(double* tabSumThread, int n);
/*----------------------------------------------------------------------*\
|* Implementation *|
\*---------------------------------------------------------------------*/
/*--------------------------------------*\
|* Public *|
\*-------------------------------------*/
bool isPiOMPforPromotionTab_Ok(int n)
{
return isAlgoPI_OK(piOMPforPromotionTab, n, "Pi OMP for promotion tab");
}
/*--------------------------------------*\
|* Private *|
\*-------------------------------------*/
/**
* De-synchronisation avec PromotionTab
*/
double piOMPforPromotionTab(int n)
{
const double DX = 1 / (double) n;
double sum = 0;
const int NB_THREAD = OmpTools::setAndGetNaturalGranularity();
double tabSommeThread[NB_THREAD];
// Initialisation séquentielle
for (int c = 0; c < NB_THREAD; c++)
{
tabSommeThread[c] = 0;
}
#pragma omp parallel for
for (int i = 0; i < n; i++)
{
double xi = i * DX;
const int TID = OmpTools::getTid();
tabSommeThread[TID] += fpi(xi);
}
// Reduction sequentielle du tableau promu -> GRATUIT
double somme = 0;
for (int i = 0; i < NB_THREAD; i++)
{
somme += tabSommeThread[i];
}
return somme * DX;
}
/*----------------------------------------------------------------------*\
|* End *|
\*---------------------------------------------------------------------*/
| [
"sylvain.renaud@he-arc.ch"
] | sylvain.renaud@he-arc.ch |
fb4fa5d46fe3c809f531f6e6efb9ca55c6e3d726 | 49e150b4bf0655743d88d30c127183044e318889 | /bg.hpp | e707cb3425bed8ac38490ef42c6f910daa863fd1 | [] | no_license | jonigata/pasta_webgl | d79b2c26ca55ea94370a5e3acaf9cd5fcf9b6787 | 773836c7dc83d8dc65801402a16316919751913b | refs/heads/master | 2021-09-03T13:52:17.189813 | 2018-01-09T14:56:29 | 2018-01-09T14:56:29 | 116,162,456 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 789 | hpp | // 2014/09/20 Naoyuki Hirayama
#ifndef BG_HPP_
#define BG_HPP_
#include "textured_piece.hpp"
class BG {
public:
BG() {
piece_.set_texture("city_night002.png");
add_vertex(0, 0);
add_vertex(1, 0);
add_vertex(0, 1);
add_vertex(1, 1);
piece_.add_index(0);
piece_.add_index(1);
piece_.add_index(2);
piece_.add_index(2);
piece_.add_index(1);
piece_.add_index(3);
piece_.build();
}
void add_vertex(float x, float y){
Color c {{1.0f ,1.0f ,1.0f, 1.0f}};
piece_.add_vertex(x, y, 0, 0, 0, 1, c, x, 1-y);
}
void render() {
piece_.render();
}
private:
TexturedPiece piece_;
};
#endif // BG_HPP_
| [
"naoyuki.hirayama@gmail.com"
] | naoyuki.hirayama@gmail.com |
84441d0b3b3bacda5501967f40afeaaa4b7218ea | 073484a15c53c891074bfa612b19bc7c7cbe9937 | /pizza2.cpp | b2bc299de05579619e599c656ae879e6dbb1e2aa | [] | no_license | KarthikNarla/MapReduce-programs | bfbe59ee1e7de5ca5914ed986a581c4098ef75ee | 8671fc3a2a1a1f8953870424de3af5b73182eefd | refs/heads/master | 2021-01-15T16:51:41.706504 | 2017-08-14T09:19:12 | 2017-08-14T09:19:12 | 99,730,159 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 287 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
double tradius, cradius;
cin>>tradius>>cradius;
double presult= tradius*tradius;
double result = (((tradius - cradius)* (tradius-cradius))/presult);
printf("%.6f\n", (result*100));
return 0;
}
| [
"karthiknarla22@gmail.com"
] | karthiknarla22@gmail.com |
0363f9df19b5f586af5adedd1252fb730a4786d2 | 8fa7f86ed5db77a122469c4e6c16adf700002cd6 | /separ.h | cf10a7b785f24907dead3e625bd144d1c2da416b | [] | no_license | longway34/Separator | 71dd4fea38e1a38f6a4bdca1d5a946fd0a6a96a4 | 73614df4f5116d6d7f3bd99029c6ef2ff14632dc | refs/heads/master | 2021-08-10T12:05:32.768563 | 2017-11-12T14:52:26 | 2017-11-12T14:52:26 | 110,437,384 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,810 | h | /***************************************************************************
* Copyright (C) 2006 by and *
* and@andrey *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* 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, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef SEPAR_H
#define SEPAR_H
#include <iostream>
#include <cstdlib>
#include <pthread.h>
#include <signal.h>
#include <sys/time.h>
#include <math.h>
#include <sys/socket.h>
#include <unistd.h>
#include "sdevice.h"
/**
@author and
*/
const bool TESTPL = false;
const int SIZE_SPK = 512;
const int MAX_OBL = 6;
const int MAX_CH = 4;
const int MIN_TIME= 1;
const int MAX_TIME= 600;
const int S_SPK =256;
const int BF_IM =10;
const int MN_GZ =4;
const int MAX_GR =5;
const int MAX_GIST=200;
const int KC_TIME=5;
const int MAX_KC=250*KC_TIME;
const double CON_USTPUW = 18307;
const int TIMEPL = 250*120;
const int U_SIZE = 250;
const int DELAY_RGU = 30;
const int ROW = 2;
struct sobl{
//unsigned short
double ls;
//unsigned short
double rs;
};
struct sep_ust{
sobl obl[MAX_CH][MAX_OBL];
double gmz[MAX_CH];
double sh1[6];
double sh2[6];
double sh3[6];
double kh1[2];
double kh2[2];
double kh3[2];
double prg[MAX_CH][6];
double prg2[MAX_CH][6];
double tiz[MAX_GR];
double fh12;
double fotb;
double fotbR2;
double maxg1;
double ming1;
double gcol;
double kruch;
double usl[MAX_CH];
double totb;
double totbR2;
double k_im[2][MAX_CH];
double b_im[2][MAX_CH];
double k_zd[2][MAX_CH];
double b_zd[2][MAX_CH];
double kprMin;
double kprMax;
double alg;
double sep_row;
};
struct ssep_work {
//double i_kn[MAX_CH+1];
//double i_xw[MAX_CH+1];
//double i_km[MAX_CH+1];
double i_prd[MAX_CH][4];
//double p_cr[MAX_CH];
//double p_crk[MAX_CH];
//double p_crx[MAX_CH];
double p_prd[MAX_CH][4];
double p_tk[MAX_CH];
double p_tkh1[MAX_CH];
double p_tkh2[MAX_CH];
double p_tkh3[MAX_CH];
double wcount[MAX_CH];
double s_rst[MAX_CH][MAX_GR];
double error ;
};
struct sspk{
unsigned short spk[S_SPK];
};
struct sgist{
int gist[MAX_GIST];
};
struct sim_work{
double dl[ROW];
double wt[ROW];
double im[ROW];
};
class Separ{
public:
int sock;
sep_ust *wust;
ssep_work sep_work;
sspk *ch[MAX_CH];
sspk *kch[MAX_CH];
sgist *gch[MAX_CH];
sim_work im_work;
int timekspk[MAX_CH];
unsigned short kod[MAX_CH];
int kw1,kw2,mka1,mka2;
double loterm,hiterm,tterm;
bool f_Reset;
Separ();
~Separ();
void setspk(int tm);
bool flag_spk();
void setudeu();
void setptdeu();
void startsep();
void stopsep();
int setm50(int num,int km);
int getm50(int num);
int getchannel();
int getmintime();
int getmaxtime();
int getszspk();
bool test_ust();
void clrkspk(int ch);
int getszgist();
void getren();
void setren(int ch,int kw,int mka);
void on_offsep(bool f);
void on_offpren(bool f);
void on_offexp(bool f,int ch);
void on_offiw(bool f);
void on_offosw(bool f);
void setterm(int l,int h);
void start_puw();
void stop_puw();
void set_puw(int ust);
void set_rgu(int rgu);
void set_rgu2(int rgu);
int get_rgu2();
void testim(int ch,int gr,int dl);
void stop_im();
void reset();
int getblk();
void initada();
void set_stopall();
void set_im();
int sizeUst();
protected:
sep_ust *ust;
SDevice mySDevice;
pthread_t thread_id;
pthread_cond_t flag_cv;
pthread_mutex_t flag_mutex;
pthread_mutex_t flag_mutex_wait;
struct sigaction sa;
struct itimerval timer;
struct timeval tv,atv;
int time,atime;
int rez;
int max_time;
bool f_spk;
int count;
int time_end;
bool f_kon;
bool f_kon2;
int countPl;
double kpdl;
double bpdl;
//GMZ
bool f_sep;
int intgm[MAX_CH];
int sumgm[MAX_CH][MAX_OBL];
bool fgm_io[MAX_CH];
bool f_rech[MAX_CH];
int prgm[MAX_CH];
int ngm[MAX_CH];
int lgm[MAX_CH];
int countgm[MAX_CH];
sobl oblgm[MAX_CH][MAX_OBL];
double h1sum[MAX_CH],h2sum[MAX_CH];
int fl_time[MAX_CH][BF_IM];
int cn_time[MAX_CH][BF_IM];
int dl_1[MAX_CH][BF_IM];
int dl_2[MAX_CH][BF_IM];
int r2_fl_time[MAX_CH][BF_IM];
int r2_cn_time[MAX_CH][BF_IM];
int r2_dl_1[MAX_CH][BF_IM];
int r2_dl_2[MAX_CH][BF_IM];
int t_ind[MAX_CH];
static void* execute(void* unused);
void real_execute();
static void timer_handler(int signum);
void getspk();
bool f_sm50;
bool f_gm50;
int m50_num,m50_km;
int musl[MAX_CH];
int wrm[MAX_CH];
int kms[MAX_CH];
int akms[MAX_CH];
int countkc[MAX_CH];
bool botb[MAX_CH];
//PUW
int ustpuw,tkustpuw;
bool f_puw;
int count_u;
double u_cet;
double setust;
//TEST_IM
int im_ch;
int im_d1;
int im_d2;
int count_im;
bool f_im;
bool f_stop;
//GMZ
void my_gmz();
void gm_in(int ch);
void gm_out(int ch);
void rec_h(int ch);
void rec_im(int ch);
void work_im(int ch);
//PUW
void work_puw();
void work_im();
//RGU
bool f_rgu;
int m_rgu;
bool f_stop_rgu;
int count_rgu;
void work_rgu();
// PL
void stopAll();
//ROW 2
void sum_h_i(int ch,int n);
void alg0(int ch,double h1,double h2,double h3);
void alg1(int ch,double h1,double h2,double h3);
void alg2(int ch,double h1,double h2,double h3);
void alg3(int ch,double h1,double h2,double h3);
//
bool f_wim;
};
#endif
| [
"longway34@gmail.com"
] | longway34@gmail.com |
c23aab76666a81798c67aada0566ccc41acb48b6 | 600df3590cce1fe49b9a96e9ca5b5242884a2a70 | /components/security_interstitials/core/ssl_error_ui.cc | 320fbbe0447a1c34ec725e93fb25dfb188b2f28a | [
"BSD-3-Clause"
] | permissive | metux/chromium-suckless | efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a | 72a05af97787001756bae2511b7985e61498c965 | refs/heads/orig | 2022-12-04T23:53:58.681218 | 2017-04-30T10:59:06 | 2017-04-30T23:35:58 | 89,884,931 | 5 | 3 | BSD-3-Clause | 2022-11-23T20:52:53 | 2017-05-01T00:09:08 | null | UTF-8 | C++ | false | false | 7,560 | cc | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/security_interstitials/core/ssl_error_ui.h"
#include "base/i18n/time_formatting.h"
#include "components/security_interstitials/core/common_string_util.h"
#include "components/security_interstitials/core/metrics_helper.h"
#include "components/ssl_errors/error_classification.h"
#include "components/ssl_errors/error_info.h"
#include "grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
namespace security_interstitials {
namespace {
// URL for help page.
const char kHelpURL[] = "https://support.google.com/chrome/answer/6098869";
bool IsMasked(int options, SSLErrorUI::SSLErrorOptionsMask mask) {
return ((options & mask) != 0);
}
} // namespace
SSLErrorUI::SSLErrorUI(const GURL& request_url,
int cert_error,
const net::SSLInfo& ssl_info,
int display_options,
const base::Time& time_triggered,
ControllerClient* controller)
: request_url_(request_url),
cert_error_(cert_error),
ssl_info_(ssl_info),
time_triggered_(time_triggered),
requested_strict_enforcement_(
IsMasked(display_options, STRICT_ENFORCEMENT)),
soft_override_enabled_(IsMasked(display_options, SOFT_OVERRIDE_ENABLED)),
hard_override_enabled_(
!IsMasked(display_options, HARD_OVERRIDE_DISABLED)),
controller_(controller),
user_made_decision_(false) {
controller_->metrics_helper()->RecordUserDecision(MetricsHelper::SHOW);
controller_->metrics_helper()->RecordUserInteraction(
MetricsHelper::TOTAL_VISITS);
ssl_errors::RecordUMAStatistics(soft_override_enabled_, time_triggered_,
request_url, cert_error_,
*ssl_info_.cert.get());
}
SSLErrorUI::~SSLErrorUI() {
// If the page is closing without an explicit decision, record it as not
// proceeding.
if (!user_made_decision_) {
controller_->metrics_helper()->RecordUserDecision(
MetricsHelper::DONT_PROCEED);
}
controller_->metrics_helper()->RecordShutdownMetrics();
}
void SSLErrorUI::PopulateStringsForHTML(base::DictionaryValue* load_time_data) {
DCHECK(load_time_data);
// Shared with other errors.
common_string_util::PopulateSSLLayoutStrings(cert_error_, load_time_data);
common_string_util::PopulateSSLDebuggingStrings(ssl_info_, time_triggered_,
load_time_data);
common_string_util::PopulateNewIconStrings(load_time_data);
// Shared values for both the overridable and non-overridable versions.
load_time_data->SetBoolean("bad_clock", false);
load_time_data->SetString("tabTitle",
l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE));
load_time_data->SetString("heading",
l10n_util::GetStringUTF16(IDS_SSL_V2_HEADING));
load_time_data->SetString(
"primaryParagraph",
l10n_util::GetStringFUTF16(
IDS_SSL_V2_PRIMARY_PARAGRAPH,
common_string_util::GetFormattedHostName(request_url_)));
if (soft_override_enabled_)
PopulateOverridableStrings(load_time_data);
else
PopulateNonOverridableStrings(load_time_data);
}
void SSLErrorUI::PopulateOverridableStrings(
base::DictionaryValue* load_time_data) {
DCHECK(soft_override_enabled_);
base::string16 url(common_string_util::GetFormattedHostName(request_url_));
ssl_errors::ErrorInfo error_info = ssl_errors::ErrorInfo::CreateError(
ssl_errors::ErrorInfo::NetErrorToErrorType(cert_error_),
ssl_info_.cert.get(), request_url_);
load_time_data->SetBoolean("overridable", true);
load_time_data->SetString("explanationParagraph", error_info.details());
load_time_data->SetString(
"primaryButtonText",
l10n_util::GetStringUTF16(IDS_SSL_OVERRIDABLE_SAFETY_BUTTON));
load_time_data->SetString(
"finalParagraph",
l10n_util::GetStringFUTF16(IDS_SSL_OVERRIDABLE_PROCEED_PARAGRAPH, url));
}
void SSLErrorUI::PopulateNonOverridableStrings(
base::DictionaryValue* load_time_data) {
DCHECK(!soft_override_enabled_);
base::string16 url(common_string_util::GetFormattedHostName(request_url_));
ssl_errors::ErrorInfo::ErrorType type =
ssl_errors::ErrorInfo::NetErrorToErrorType(cert_error_);
load_time_data->SetBoolean("overridable", false);
load_time_data->SetString(
"explanationParagraph",
l10n_util::GetStringFUTF16(IDS_SSL_NONOVERRIDABLE_MORE, url));
load_time_data->SetString("primaryButtonText",
l10n_util::GetStringUTF16(IDS_SSL_RELOAD));
// Customize the help link depending on the specific error type.
// Only mark as HSTS if none of the more specific error types apply,
// and use INVALID as a fallback if no other string is appropriate.
load_time_data->SetInteger("errorType", type);
int help_string = IDS_SSL_NONOVERRIDABLE_INVALID;
switch (type) {
case ssl_errors::ErrorInfo::CERT_REVOKED:
help_string = IDS_SSL_NONOVERRIDABLE_REVOKED;
break;
case ssl_errors::ErrorInfo::CERT_PINNED_KEY_MISSING:
help_string = IDS_SSL_NONOVERRIDABLE_PINNED;
break;
case ssl_errors::ErrorInfo::CERT_INVALID:
help_string = IDS_SSL_NONOVERRIDABLE_INVALID;
break;
default:
if (requested_strict_enforcement_)
help_string = IDS_SSL_NONOVERRIDABLE_HSTS;
}
load_time_data->SetString("finalParagraph",
l10n_util::GetStringFUTF16(help_string, url));
}
void SSLErrorUI::HandleCommand(SecurityInterstitialCommands command) {
switch (command) {
case CMD_DONT_PROCEED:
controller_->metrics_helper()->RecordUserDecision(
MetricsHelper::DONT_PROCEED);
user_made_decision_ = true;
controller_->GoBack();
break;
case CMD_PROCEED:
if (hard_override_enabled_) {
controller_->metrics_helper()->RecordUserDecision(
MetricsHelper::PROCEED);
controller_->Proceed();
user_made_decision_ = true;
}
break;
case CMD_DO_REPORT:
controller_->SetReportingPreference(true);
break;
case CMD_DONT_REPORT:
controller_->SetReportingPreference(false);
break;
case CMD_SHOW_MORE_SECTION:
controller_->metrics_helper()->RecordUserInteraction(
security_interstitials::MetricsHelper::SHOW_ADVANCED);
break;
case CMD_OPEN_HELP_CENTER:
controller_->metrics_helper()->RecordUserInteraction(
security_interstitials::MetricsHelper::SHOW_LEARN_MORE);
controller_->OpenUrlInCurrentTab(GURL(kHelpURL));
break;
case CMD_RELOAD:
controller_->metrics_helper()->RecordUserInteraction(
security_interstitials::MetricsHelper::RELOAD);
controller_->Reload();
break;
case CMD_OPEN_REPORTING_PRIVACY:
controller_->OpenExtendedReportingPrivacyPolicy();
break;
case CMD_OPEN_WHITEPAPER:
controller_->OpenExtendedReportingWhitepaper();
break;
case CMD_OPEN_DATE_SETTINGS:
case CMD_OPEN_DIAGNOSTIC:
case CMD_OPEN_LOGIN:
case CMD_REPORT_PHISHING_ERROR:
// Not supported by the SSL error page.
NOTREACHED() << "Unsupported command: " << command;
case CMD_ERROR:
case CMD_TEXT_FOUND:
case CMD_TEXT_NOT_FOUND:
// Commands are for testing.
break;
}
}
} // security_interstitials
| [
"enrico.weigelt@gr13.net"
] | enrico.weigelt@gr13.net |
c2713e277e51cda2ab3044319311c7a44bab8cad | e6407f3ac4a3bfda7d930c4319c10028189a76c7 | /include/CollisionTile.h | e790cc37cd3b2ecf87975299654da731e47bd3d8 | [] | no_license | SuperTails/ProjectTails | 55dd0930b593539c14fb81234243e55b54bd80f4 | d5815a77d47a0c4c818b5eb0912dca40ccc5b79c | refs/heads/master | 2021-07-02T06:20:12.753406 | 2020-01-19T22:00:55 | 2020-01-19T22:00:55 | 91,393,663 | 2 | 0 | null | 2017-05-17T23:13:37 | 2017-05-15T23:32:14 | C++ | UTF-8 | C++ | false | false | 1,803 | h | #pragma once
#include "DataReader.h"
#include "Player.h"
#include <array>
#include <json.hpp>
class CollisionTile {
public:
static const std::size_t heightMapSize = 16;
CollisionTile() = default;
CollisionTile(int idx, int fl) : dataIndex(idx), flags(fl) {};
void setHeights(const std::array< int, heightMapSize >& heights) noexcept;
void setHeight(int index, int height) { dataList[dataIndex].heightMap[index] = height; };
void setAngle(double ang) { dataList[dataIndex].angle = ang; };
int getHeight(int ind) const { return dataList[dataIndex].heightMap[ind]; };
int getAngle() const;
int getAngle(Direction dir) const;
void setIndex(int idx) { dataIndex = idx; };
int getIndex() const { return dataIndex; };
int flags = 0;
static void loadFromImage(const std::string& image);
private:
int dataIndex = 0;
struct CollisionTileData {
CollisionTileData() = default;
CollisionTileData(const CollisionTileData&) = default;
CollisionTileData(CollisionTileData&&) = default;
CollisionTileData(std::array< int, heightMapSize > hMap, double ang);
constexpr CollisionTileData& operator=(CollisionTileData&) = default;
constexpr CollisionTileData& operator=(const CollisionTileData&) = default;
std::array < int, heightMapSize > heightMap{};
double angle{};
};
static CollisionTileData loadCollisionTile(const Surface& surface, SDL_Point topLeft);
static void setCollisionList(const std::vector< CollisionTileData >& list);
public:
static std::vector< CollisionTileData > dataList;
static void test();
};
// dir:
// 0 = from the right
// 1 = from the bottom
// 2 = from the left
// 3 = from the top
int getHeight(const CollisionTile &tile, int idx, Direction dir);
std::optional< SDL_Point > surfacePos(const CollisionTile &tile, int idx, Direction dir);
| [
"sciencedude2003@gmail.com"
] | sciencedude2003@gmail.com |
a32cab94dc2b4c2387b69d4e87acdc370dd46a20 | 5b46f96a2eda33e39913d3aacb304d229dbcd8ce | /engine/Source/SpriteComponent.cpp | 1529603e364fd983b395d8d892803615abafdc5e | [] | no_license | Valakor/CSCI-580 | 6ad1da58caa603344ca10bdeba24afc94c1e0c58 | 6f4f69074bd26850bf549035e3f157a422c9d6da | refs/heads/master | 2021-01-10T15:23:43.785683 | 2015-12-02T00:09:42 | 2015-12-02T00:09:42 | 45,649,738 | 0 | 0 | null | 2015-12-03T11:27:06 | 2015-11-06T00:49:44 | C++ | UTF-8 | C++ | false | false | 521 | cpp | #include "SpriteComponent.h"
#include "Actor.h"
#include <SDL/SDL.h>
#include "Renderer.h"
IMPL_COMPONENT(SpriteComponent, DrawComponent);
SpriteComponent::SpriteComponent(Actor& owner)
:DrawComponent(owner)
{
}
void SpriteComponent::Draw(Renderer& render)
{
if (!mTexture)
{
return;
}
Matrix4 scale = Matrix4::CreateScale(static_cast<float>(mTexture->GetWidth()), static_cast<float>(mTexture->GetHeight()), 1.0f);
render.DrawSprite(mTexture, scale * mOwner.GetWorldTransform());
}
| [
"pohlmann@usc.edu"
] | pohlmann@usc.edu |
0e88745dfe16e809ced21778879e0008d20fa71a | 536656cd89e4fa3a92b5dcab28657d60d1d244bd | /chrome/browser/ui/views/device_chooser_content_view.cc | dfd5cc57b1b4e88f8bc35db266db3e6db5c29a7e | [
"BSD-3-Clause"
] | permissive | ECS-251-W2020/chromium | 79caebf50443f297557d9510620bf8d44a68399a | ac814e85cb870a6b569e184c7a60a70ff3cb19f9 | refs/heads/master | 2022-08-19T17:42:46.887573 | 2020-03-18T06:08:44 | 2020-03-18T06:08:44 | 248,141,336 | 7 | 8 | BSD-3-Clause | 2022-07-06T20:32:48 | 2020-03-18T04:52:18 | null | UTF-8 | C++ | false | false | 14,421 | cc | // Copyright 2016 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/views/device_chooser_content_view.h"
#include "base/numerics/safe_conversions.h"
#include "base/stl_util.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/grit/generated_resources.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/image_button_factory.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/controls/table/table_view.h"
#include "ui/views/controls/throbber.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/widget/widget.h"
namespace {
constexpr int kHelpButtonTag = 1;
constexpr int kReScanButtonTag = 2;
} // namespace
class BluetoothStatusContainer : public views::View {
public:
explicit BluetoothStatusContainer(views::ButtonListener* listener);
void ShowScanningLabelAndThrobber();
void ShowReScanButton(bool enabled);
private:
friend class DeviceChooserContentView;
views::LabelButton* re_scan_button_;
views::Throbber* throbber_;
views::Label* scanning_label_;
DISALLOW_COPY_AND_ASSIGN(BluetoothStatusContainer);
};
BluetoothStatusContainer::BluetoothStatusContainer(
views::ButtonListener* listener) {
SetLayoutManager(std::make_unique<views::FillLayout>());
auto* rescan_container = AddChildView(std::make_unique<views::View>());
rescan_container
->SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kHorizontal))
->set_cross_axis_alignment(views::BoxLayout::CrossAxisAlignment::kCenter);
auto re_scan_button = views::MdTextButton::CreateSecondaryUiButton(
listener,
l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_RE_SCAN));
re_scan_button->SetTooltipText(
l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_RE_SCAN_TOOLTIP));
re_scan_button->SetFocusForPlatform();
re_scan_button->set_tag(kReScanButtonTag);
re_scan_button_ = rescan_container->AddChildView(std::move(re_scan_button));
auto* scan_container = AddChildView(std::make_unique<views::View>());
auto* scan_layout =
scan_container->SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kHorizontal));
scan_layout->set_cross_axis_alignment(
views::BoxLayout::CrossAxisAlignment::kCenter);
scan_layout->set_between_child_spacing(
ChromeLayoutProvider::Get()->GetDistanceMetric(
views::DISTANCE_RELATED_CONTROL_HORIZONTAL));
throbber_ = scan_container->AddChildView(std::make_unique<views::Throbber>());
auto scanning_label = std::make_unique<views::Label>(
l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_SCANNING_LABEL),
views::style::CONTEXT_LABEL, views::style::STYLE_DISABLED);
scanning_label->SetTooltipText(l10n_util::GetStringUTF16(
IDS_BLUETOOTH_DEVICE_CHOOSER_SCANNING_LABEL_TOOLTIP));
scanning_label_ = scan_container->AddChildView(std::move(scanning_label));
}
void BluetoothStatusContainer::ShowScanningLabelAndThrobber() {
re_scan_button_->SetVisible(false);
throbber_->SetVisible(true);
scanning_label_->SetVisible(true);
throbber_->Start();
}
void BluetoothStatusContainer::ShowReScanButton(bool enabled) {
re_scan_button_->SetVisible(true);
re_scan_button_->SetEnabled(enabled);
throbber_->Stop();
throbber_->SetVisible(false);
scanning_label_->SetVisible(false);
}
DeviceChooserContentView::DeviceChooserContentView(
views::TableViewObserver* table_view_observer,
std::unique_ptr<ChooserController> chooser_controller)
: chooser_controller_(std::move(chooser_controller)) {
chooser_controller_->set_view(this);
SetPreferredSize({402, 320});
SetLayoutManager(std::make_unique<views::FillLayout>());
std::vector<ui::TableColumn> table_columns = {ui::TableColumn()};
auto table_view = std::make_unique<views::TableView>(
this, table_columns,
chooser_controller_->ShouldShowIconBeforeText() ? views::ICON_AND_TEXT
: views::TEXT_ONLY,
!chooser_controller_->AllowMultipleSelection() /* single_selection */);
table_view_ = table_view.get();
table_view->SetSelectOnRemove(false);
table_view->set_observer(table_view_observer);
table_view->GetViewAccessibility().OverrideName(l10n_util::GetStringUTF16(
IDS_DEVICE_CHOOSER_ACCNAME_COMPATIBLE_DEVICES_LIST));
table_parent_ = AddChildView(
views::TableView::CreateScrollViewWithTable(std::move(table_view)));
const auto add_centering_view = [this](auto view) {
auto* container = AddChildView(std::make_unique<views::View>());
auto* layout =
container->SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kHorizontal));
layout->set_main_axis_alignment(
views::BoxLayout::MainAxisAlignment::kCenter);
layout->set_cross_axis_alignment(
views::BoxLayout::CrossAxisAlignment::kCenter);
layout->set_inside_border_insets(gfx::Insets(0, 6));
container->AddChildView(std::move(view));
return container;
};
auto no_options_help =
std::make_unique<views::Label>(chooser_controller_->GetNoOptionsText());
no_options_help->SetMultiLine(true);
no_options_view_ = add_centering_view(std::move(no_options_help));
base::string16 link_text = l10n_util::GetStringUTF16(
IDS_BLUETOOTH_DEVICE_CHOOSER_TURN_ON_BLUETOOTH_LINK_TEXT);
size_t offset = 0;
base::string16 text = l10n_util::GetStringFUTF16(
IDS_BLUETOOTH_DEVICE_CHOOSER_TURN_ADAPTER_OFF, link_text, &offset);
auto adapter_off_help = std::make_unique<views::StyledLabel>(text, this);
adapter_off_help->AddStyleRange(
gfx::Range(0, link_text.size()),
views::StyledLabel::RangeStyleInfo::CreateForLink());
adapter_off_view_ = add_centering_view(std::move(adapter_off_help));
UpdateTableView();
}
DeviceChooserContentView::~DeviceChooserContentView() {
chooser_controller_->set_view(nullptr);
table_view_->set_observer(nullptr);
table_view_->SetModel(nullptr);
}
gfx::Size DeviceChooserContentView::GetMinimumSize() const {
// Let the dialog shrink when its parent is smaller than the preferred size.
return gfx::Size();
}
int DeviceChooserContentView::RowCount() {
return base::checked_cast<int>(chooser_controller_->NumOptions());
}
base::string16 DeviceChooserContentView::GetText(int row, int column_id) {
DCHECK_GE(row, 0);
DCHECK_LT(row, RowCount());
base::string16 text = chooser_controller_->GetOption(size_t{row});
return chooser_controller_->IsPaired(row)
? l10n_util::GetStringFUTF16(
IDS_DEVICE_CHOOSER_DEVICE_NAME_AND_PAIRED_STATUS_TEXT, text)
: text;
}
void DeviceChooserContentView::SetObserver(ui::TableModelObserver* observer) {}
gfx::ImageSkia DeviceChooserContentView::GetIcon(int row) {
DCHECK(chooser_controller_->ShouldShowIconBeforeText());
DCHECK_GE(row, 0);
DCHECK_LT(row, RowCount());
if (chooser_controller_->IsConnected(row)) {
return gfx::CreateVectorIcon(vector_icons::kBluetoothConnectedIcon,
TableModel::kIconSize, gfx::kChromeIconGrey);
}
int level = chooser_controller_->GetSignalStrengthLevel(row);
if (level == -1)
return gfx::ImageSkia();
constexpr int kSignalStrengthLevelImageIds[5] = {
IDR_SIGNAL_0_BAR, IDR_SIGNAL_1_BAR, IDR_SIGNAL_2_BAR, IDR_SIGNAL_3_BAR,
IDR_SIGNAL_4_BAR};
DCHECK_GE(level, 0);
DCHECK_LT(size_t{level}, base::size(kSignalStrengthLevelImageIds));
return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
kSignalStrengthLevelImageIds[level]);
}
void DeviceChooserContentView::OnOptionsInitialized() {
is_initialized_ = true;
table_view_->OnModelChanged();
UpdateTableView();
}
void DeviceChooserContentView::OnOptionAdded(size_t index) {
is_initialized_ = true;
table_view_->OnItemsAdded(base::checked_cast<int>(index), 1);
UpdateTableView();
}
void DeviceChooserContentView::OnOptionRemoved(size_t index) {
table_view_->OnItemsRemoved(base::checked_cast<int>(index), 1);
UpdateTableView();
}
void DeviceChooserContentView::OnOptionUpdated(size_t index) {
table_view_->OnItemsChanged(base::checked_cast<int>(index), 1);
UpdateTableView();
}
void DeviceChooserContentView::OnAdapterEnabledChanged(bool enabled) {
// No row is selected since the adapter status has changed.
// This will also disable the OK button if it was enabled because
// of a previously selected row.
table_view_->Select(-1);
adapter_enabled_ = enabled;
UpdateTableView();
bluetooth_status_container_->ShowReScanButton(enabled);
if (GetWidget() && GetWidget()->GetRootView())
GetWidget()->GetRootView()->Layout();
}
void DeviceChooserContentView::OnRefreshStateChanged(bool refreshing) {
if (refreshing) {
// No row is selected since the chooser is refreshing. This will also
// disable the OK button if it was enabled because of a previously
// selected row.
table_view_->Select(-1);
UpdateTableView();
}
if (refreshing)
bluetooth_status_container_->ShowScanningLabelAndThrobber();
else
bluetooth_status_container_->ShowReScanButton(true /* enabled */);
if (GetWidget() && GetWidget()->GetRootView())
GetWidget()->GetRootView()->Layout();
}
void DeviceChooserContentView::StyledLabelLinkClicked(views::StyledLabel* label,
const gfx::Range& range,
int event_flags) {
chooser_controller_->OpenAdapterOffHelpUrl();
}
void DeviceChooserContentView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
if (sender->tag() == kHelpButtonTag) {
chooser_controller_->OpenHelpCenterUrl();
} else {
DCHECK_EQ(kReScanButtonTag, sender->tag());
// Refreshing will cause the table view to yield focus, which
// will land on the help button. Instead, briefly let the
// rescan button take focus. When it hides itself, focus will
// advance to the "Cancel" button as desired.
sender->RequestFocus();
chooser_controller_->RefreshOptions();
}
}
base::string16 DeviceChooserContentView::GetWindowTitle() const {
return chooser_controller_->GetTitle();
}
std::unique_ptr<views::View> DeviceChooserContentView::CreateExtraView() {
const auto make_help_button = [this]() {
auto help_button = views::CreateVectorImageButton(this);
views::SetImageFromVectorIcon(help_button.get(),
vector_icons::kHelpOutlineIcon);
help_button->SetFocusForPlatform();
help_button->SetTooltipText(l10n_util::GetStringUTF16(IDS_LEARN_MORE));
help_button->set_tag(kHelpButtonTag);
return help_button;
};
const auto make_bluetooth_status_container = [this]() {
auto bluetooth_status_container =
std::make_unique<BluetoothStatusContainer>(this);
bluetooth_status_container_ = bluetooth_status_container.get();
return bluetooth_status_container;
};
const bool add_bluetooth = chooser_controller_->ShouldShowReScanButton();
if (!chooser_controller_->ShouldShowHelpButton())
return add_bluetooth ? make_bluetooth_status_container() : nullptr;
if (!add_bluetooth)
return make_help_button();
auto container = std::make_unique<views::View>();
auto layout = std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kHorizontal, gfx::Insets(),
ChromeLayoutProvider::Get()->GetDistanceMetric(
views::DISTANCE_RELATED_CONTROL_HORIZONTAL));
container->SetLayoutManager(std::move(layout))
->set_cross_axis_alignment(views::BoxLayout::CrossAxisAlignment::kCenter);
container->AddChildView(make_help_button());
container->AddChildView(make_bluetooth_status_container());
return container;
}
bool DeviceChooserContentView::IsDialogButtonEnabled(
ui::DialogButton button) const {
return chooser_controller_->BothButtonsAlwaysEnabled() ||
button != ui::DIALOG_BUTTON_OK ||
!table_view_->selection_model().empty();
}
void DeviceChooserContentView::Accept() {
std::vector<size_t> indices(
table_view_->selection_model().selected_indices().begin(),
table_view_->selection_model().selected_indices().end());
chooser_controller_->Select(indices);
}
void DeviceChooserContentView::Cancel() {
chooser_controller_->Cancel();
}
void DeviceChooserContentView::Close() {
chooser_controller_->Close();
}
void DeviceChooserContentView::UpdateTableView() {
bool has_options = adapter_enabled_ && RowCount() > 0;
if (!is_initialized_ && GetWidget() &&
GetWidget()->GetFocusManager()->GetFocusedView()) {
is_initialized_ = true; // Can show no_options_view_ after initial focus.
}
table_parent_->SetVisible(has_options);
table_view_->SetEnabled(has_options &&
!chooser_controller_->TableViewAlwaysDisabled());
// Do not set to visible until initialization is complete, in order to prevent
// message from briefly flashing and being read by screen reader.
no_options_view_->SetVisible(!has_options && adapter_enabled_ &&
is_initialized_);
adapter_off_view_->SetVisible(!adapter_enabled_);
}
views::LabelButton* DeviceChooserContentView::ReScanButtonForTesting() {
return bluetooth_status_container_->re_scan_button_;
}
views::Throbber* DeviceChooserContentView::ThrobberForTesting() {
return bluetooth_status_container_->throbber_;
}
views::Label* DeviceChooserContentView::ScanningLabelForTesting() {
return bluetooth_status_container_->scanning_label_;
}
| [
"pcding@ucdavis.edu"
] | pcding@ucdavis.edu |
77db58ddf4a4724b2d9a867623da09091472e475 | d3f6b5f34e00f6e69297b8c0f93abda4ece9f55b | /leituraEEscrita/leituraEEscrita/Source.cpp | d9e3e5d8b42fd297eccb46264f19152e92b6307e | [] | no_license | carlosfl11/P3D | db489fdf312b85ea8292b281b35582827d0688d9 | c263a03f88feacf8737c5a54c58c6b6dcec9518b | refs/heads/master | 2020-04-25T21:30:41.500307 | 2018-05-11T15:22:35 | 2018-05-11T15:22:35 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 2,084 | cpp | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
int escrita() {
ofstream ficheiro("meuficheiro.txt");
if (ficheiro.is_open()) {
cout << "Ficheiro criado e alterado!\n";
ficheiro << "Primeira linha.\n";
ficheiro << "Segunda linha.\n";
ficheiro.close();
}
else {
cout << "Erro ao abrir o ficheiro!\n";
}
return 0;
};
void leitura() {
string linha;
ifstream ficheiro("meuficheiro.txt");
if (ficheiro.is_open()) {
// Lê, linha a linha, até ao final do ficheiro
while (getline(ficheiro, linha)) {
cout << linha << endl;
}
ficheiro.close();
}
else {
cout << "Erro ao abrir o ficheiro!\n";
}
};
void lerPalavra() {
char linha[100];
ifstream ficheiro("meuficheiro.txt");
if (ficheiro.is_open()) {
// Lê, palavra a palavra, até ao final do ficheiro
while (!ficheiro.eof()) {
ficheiro >> linha;
cout << linha << endl;
}
ficheiro.close();
}
else {
cout << "Erro ao abrir o ficheiro!\n";
}
};
void lerChar() {
char c;
ifstream ficheiro("meuficheiro.txt");
if (ficheiro.is_open()) {
// Lê, carácter a carácter, até ao final do ficheiro
while (!ficheiro.eof()) {
c = ficheiro.get();
cout << c;
}
ficheiro.close();
}
else {
cout << "Erro ao abrir o ficheiro!\n";
}
};
// escrever em binario
struct _s {
char a;
int b;
float c;
};
void escreverBin() {
struct _s data1[2] = { { 'A', 1, 1.1f },{ 'B', 2, 2.2f } };
struct _s data2[2];
fstream fileRW;
fileRW.open("ficheiro.dat", ios::out | ios::binary | ios::trunc);
fileRW.write((char *)data1, 2 * sizeof(struct _s));
fileRW.close();
fileRW.open("ficheiro.dat", ios::in | ios::binary | ios::_Nocreate);
fileRW.read((char *)data2, 2 * sizeof(struct _s));
fileRW.close();
for (int i = 0; i < 2; i++)
cout << data2[i].a << " " << data2[i].b << " " << data2[i].c << endl;
}
int main() {
cout << "-- escrita\n";
escrita();
cout << "-- leitura\n";
leitura();
cout << "-- ler linha\n";
lerPalavra();
cout << "-- ler char\n";
lerChar();
cin.get();
system("cls");
escreverBin();
cin.get();
return 0;
} | [
"32069840+ninjanazal@users.noreply.github.com"
] | 32069840+ninjanazal@users.noreply.github.com |
e35a8760738e4b965046e19ffc23493b073092a8 | c3a758c536c82e3def0a714445a4e40b27787180 | /Babe/Command/Commands/Plugin/BabeLoadPluginCmd.cpp | b5aec0d336ae715ea5b5e3bdabf458ad810956a1 | [] | no_license | catuss-a/SkypeLIKE | fefe9670a6e8a364bdabc321f95e73bab7db8fc4 | d9cb175db408c7635fc24e67b1c3096b11c215c4 | refs/heads/master | 2020-04-14T16:18:04.821689 | 2014-03-13T16:49:05 | 2014-03-13T16:49:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,892 | cpp | //
// BabeLoadPluginCmd.cpp for in /home/champi_d//AdvancedCPP/Babel/Mercurial/babel-2014-champi_d/Babe
//
// Made by alexandre champion
// Login <champi_d@epitech.net>
//
// Started on Mon Nov 28 17:26:45 2011 alexandre champion
// Last update Sat Dec 3 15:19:45 2011 alexandre champion
//
#include "BabeLoadPluginCmd.hpp"
#include "BabeApplicationManager.hpp"
#include "BabePluginManager.hpp"
#include "BabeCommandManager.hpp"
#include "BabeSystemManager.hpp"
namespace Babe
{
LoadPluginCmd::LoadPluginCmd(std::string const& pluginPath)
: ICommand(HIGH),
mName("loadplugin"),
mPluginPath(pluginPath)
{
}
LoadPluginCmd::LoadPluginCmd(CommandParser::ArgVector& args)
: ICommand(HIGH),
mName("loadplugin")
{
if (args.empty())
return ;
mPluginPath = args.front();
}
void LoadPluginCmd::exec()
{
if (mPluginPath.empty())
return ;
Plugin* plugin = PluginManager::getSingletonPtr()->getPluginByFileName(mPluginPath);
if (!plugin)
{
if (PluginManager::getSingletonPtr()->loadPlugin(mPluginPath))
{
Plugin* plugin = PluginManager::getSingletonPtr()->getPluginByFileName(mPluginPath);
System* system = SystemManager::getSingletonPtr()->getSystemByName(plugin->getSystemName());
system->shutdown();
if (!plugin->initialize())
{
LOGE("Couldn't initialise the plugin '" + plugin->getName() + "'");
CommandManager::getSingletonPtr()->setReturnMessage("Plugin \"" + mPluginPath + "\" failed : Couldn't initialise the plugin '" + plugin->getName() + "'");
return ;
}
system->init();
CommandManager::getSingletonPtr()->setReturnMessage("Plugin \"" + mPluginPath + "\" loaded");
}
else
CommandManager::getSingletonPtr()->setReturnMessage("Failed to load plugin \"" + mPluginPath + "\"");
}
else
{
std::string pluginName = plugin->getName();
System* system = SystemManager::getSingletonPtr()->getSystemByName(plugin->getSystemName());
std::string systemPluginName = system->getPluginName();
if (pluginName != systemPluginName)
{
system->shutdown();
if (!plugin->initialize())
{
LOGE("Couldn't initialise the plugin '" + plugin->getName() + "'");
CommandManager::getSingletonPtr()->setReturnMessage("Couldn't initialise the plugin '" + plugin->getName() + "'");
return ;
}
system->init();
CommandManager::getSingletonPtr()->setReturnMessage("Plugin \"" + mPluginPath + "\" loaded. System " + system->getName() + " initialized.");
}
else
CommandManager::getSingletonPtr()->setReturnMessage("Plugin \"" + mPluginPath + "\" already loaded.");
}
}
std::string const& LoadPluginCmd::getName() const
{
return mName;
}
std::string const& LoadPluginCmd::stringify()
{
mStringified = mName + " " + mPluginPath;
return mStringified;
}
} // End of namespace Babe
| [
"axel.catusse@gmail.com"
] | axel.catusse@gmail.com |
f1b6ce1ee35e8c1a2e7f391611a7b07edeb53154 | 717cfbb815d7232f69b7836e6b8a19ab1c8214ec | /sstd_qt_and_qml_library/application/sstd_application_environment.hpp | 45ffa96bc94fb8cd2093a86546ead6be632ca5fd | [] | no_license | ngzHappy/QtQmlBook | b1014fb862aa6b78522e06ec59b94b13951edd56 | 296fabfd4dc47b884631598c05a2f123e1e5a3b5 | refs/heads/master | 2020-04-09T04:34:41.261770 | 2019-02-26T13:13:15 | 2019-02-26T13:13:15 | 160,028,971 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 485 | hpp | #pragma once
#include <sstd_library.hpp>
#include "../global/sstd_qt_and_qml_global.hpp"
namespace sstd {
/*用于在QApplication构造之前构造*/
class EXPORT_SSTD_QT_AND_QML_LIBRARY ApplicationEnvironment :
SSTD_BEGIN_DEFINE_VIRTUAL_CLASS(ApplicationEnvironment) {
public:
ApplicationEnvironment();
private:
SSTD_DELETE_COPY_ASSIGN(ApplicationEnvironment);
SSTD_END_DEFINE_VIRTUAL_CLASS(ApplicationEnvironment);
};
}/**/
| [
"zhaixueqiang@hotmail.com"
] | zhaixueqiang@hotmail.com |
480cf87e09fc61af9318b075628a2acdeefc24e4 | 3e52a128b8ffa42e097ae290171d39c5244fa04d | /Console/Win32Project1/AllocCon.cpp | 595ae8fe2480511550c913c2cd13996914b344a1 | [] | no_license | awakening95/BoB_Study | 74331348301e65d48c080ad11e6b3109624df6cb | 82805e026b95d0d48eb3a04b9f5bcad6528a1d1e | refs/heads/master | 2020-03-26T16:20:33.347056 | 2018-09-01T08:25:31 | 2018-09-01T08:25:31 | 145,095,493 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 1,011 | cpp | #include "stdafx.h"
#include <stdio.h>
#include <tchar.h>
LRESULT CALLBACK WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
DWORD dw;
TCHAR *str = "New Console is created";
TCHAR *Mes = TEXT("마우스 왼쪽 버튼을 누르면 새로운 콘솔 윈도우를 만듭니다");
switch (iMessage) {
case WM_LBUTTONDOWN:
if (AllocConsole() == FALSE) {
//콘솔 생성 실패
puts("");
}
// 출력하는 함수 //
/* 핸들값, 문자열 담은 변수, 문자열의 길이, 함수 호출 후 전송한 실제 길이, NULL */
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), str, lstrlen(str), &dw, NULL);
Sleep(3000);
FreeConsole();
break;
case WM_PAINT:
// GUI 창 띄우기
hdc = BeginPaint(hWnd, &ps);
// GUI 내에 50, 50 위치에 메세지 출력
TextOut(hdc, 50, 50, Mes, lstrlen(Mes));
EndPaint(hWnd, &ps);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return(DefWindowProc(hWnd, iMessage, wParam, lParam));
} | [
"gusdnr420@naver.com"
] | gusdnr420@naver.com |
a4b19c619881ada9ce1a46b85629b25c2b9cb9d2 | d77d525bcf0b94c5f552e782390236113049183d | /simple spaceship/ADXL345/ADXL345.ino | 790850f008415b20bba0a8ee227367a847bfa0d5 | [] | no_license | ravi94/Repo | 1a5400f444ddcabb7b187c91856dcdef1c762a8e | cec4de248227e946c1f4cb696f49f08f4b56de2d | refs/heads/master | 2021-01-19T02:13:28.692202 | 2013-04-19T09:04:58 | 2013-04-19T09:04:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,533 | ino | #include <Wire.h>
#define DEVICE (0x53)
#define TO_READ (6)
byte buff[TO_READ] ;
char str1[512], str2[512];
void setup()
{
Wire.begin();
Serial.begin(9600);
writeTo(DEVICE, 0x2D, 0);
writeTo(DEVICE, 0x2D, 16);
writeTo(DEVICE, 0x2D, 8);
}
void loop()
{
int regAddress = 0x32;
int x, y, z;
readFrom(DEVICE, regAddress, TO_READ, buff);
x = (((int)buff[1]) << 8) | buff[0];
y = (((int)buff[3])<< 8) | buff[2];
z = (((int)buff[5]) << 8) | buff[4];
//sprintf(str, "%d %d %d", x, y, z);
// Serial.println(str);
// delay(15);
//Serial.println(x);
x=map(x, -250, 290, 0, 255); //var in range2 = map(var in range1, low_lim1, high_lim1, low_lim2, high_lim2);
y=map(y, -250, 290, 0, 255);
sprintf(str1, "$%d", y);
sprintf(str2,"#%d", x);
//Serial.println(str);
Serial.println(str1);
Serial.println(str2);
delay(10);
// analogWrite(11,x);
}
void writeTo(int device, byte address, byte val) {
Wire.beginTransmission(device);
Wire.write(address);
Wire.write(val);
Wire.endTransmission();
}
void readFrom(int device, byte address, int num, byte buff[]) {
Wire.beginTransmission(device);
Wire.write(address);
Wire.endTransmission();
Wire.beginTransmission(device);
Wire.requestFrom(device, num);
int i = 0;
while(Wire.available())
{
buff[i] = Wire.read();
i++;
}
Wire.endTransmission();
}
| [
"ravibhushan94@gmail.com"
] | ravibhushan94@gmail.com |
09fc815c8853470103e6932f929d1cb39a23efa8 | aab2b891bdb9f3d431e56c997b35bb3e0ead56a3 | /untitled1/multiplyByTwo.cpp | c7c453ad323e7f199d70378c6c56d829e39ab4f3 | [] | no_license | marcinbielinski/CLion | ed2bf76a6b4332b2ead64abb8a38b2b4bfa032d5 | e12c4cdae9c21b59c776c87d3399ce76a788ab6a | refs/heads/master | 2022-12-19T03:52:25.911739 | 2020-09-14T10:43:16 | 2020-09-14T10:43:16 | 295,383,908 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,552 | cpp | // Standard library - allows printing and taking input
//#include <iostream>
//
//// Area of main function that is taken line by line upon building a program
//int main()
//{
// // Welcome prompt
// std::cout << "This program multiplies your number by 2! \n";
//
// // Zero initializing variable "x" temporary because user is assigning it in next statement
// int x{0};
//
// // Prompt for user asking for a number
// std::cout << "Please enter your number: \n";
//
// // User inputs his desirable number to multiply
// std::cin >> x;
//
// // Ending statement with a multiplying expression
// std::cout << "Your number after multiplication is equal to: " << x * 2;
//
// // Finishing process, code 0 implies that everything went smoothly
// return 0;
//}
//#include <iostream>
//
//int main()
//{
// std::cout << "Enter an integer: ";
//
// int num{ 0 };
//
// std::cin >> num;
//
// std::cout << "Double " << num << " is: " << num * 2 << "\n";
//
// std::cout << "Triple " << num << " is: " << num * 3 << "\n";
//
// return 0;
//}
//#include <iostream>
//
//int main()
//{
//
// std::cout << "Enter an integer: ";
//
// int x {}; // direct zero init when asking for input
//
// std::cin >> x;
//
// std::cout << "Enter another integer: ";
//
// int y {}; // direct zero init when asking for input
//
// std::cin >> y;
//
// std::cout << x << " + " << y << " is: " << x + y << "\n";
//
// std::cout << x << " - " << y << " is: " << x - y << "\n";
//
// return 0;
//}; | [
"howlempyrean@gmail.com"
] | howlempyrean@gmail.com |
90197981f7766207bcd237d252e6d3be83d8569f | 82d8b01a5bd5a1fa7bcf1ae85d0a6445555c5cb1 | /cpp/gen/lib_fm_gen.cpp | c09ce0192aa34ce2c6db6829f5a168929b4af4b6 | [] | no_license | alexeilebedev/openacr | dbb7ddda18988ae2448d4e1eae188a0ac3d9d179 | 0b124c185b2be687650ec65056077ed32d5d7f76 | refs/heads/master | 2023-08-22T15:59:54.763217 | 2023-08-14T19:58:42 | 2023-08-14T19:58:42 | 184,338,252 | 31 | 17 | null | 2023-09-13T15:14:12 | 2019-04-30T22:10:24 | C++ | UTF-8 | C++ | false | false | 48,686 | cpp | //
// cpp/gen/lib_fm_gen.cpp
// Generated by AMC
//
// (C) AlgoEngineering LLC 2008-2013
// (C) NYSE | Intercontinental Exchange 2013-2016
//
#include "include/algo.h" // hard-coded include
#include "include/gen/lib_fm_gen.h"
#include "include/gen/lib_fm_gen.inl.h"
#include "include/gen/fmdb_gen.h"
#include "include/gen/fmdb_gen.inl.h"
#include "include/gen/algo_gen.h"
#include "include/gen/algo_gen.inl.h"
#include "include/gen/fm_gen.h"
#include "include/gen/fm_gen.inl.h"
#include "include/gen/lib_json_gen.h"
#include "include/gen/lib_json_gen.inl.h"
#include "include/gen/lib_prot_gen.h"
#include "include/gen/lib_prot_gen.inl.h"
#include "include/gen/algo_lib_gen.h"
#include "include/gen/algo_lib_gen.inl.h"
//#pragma endinclude
namespace lib_fm { // gen:ns_gsymbol
const char* fmdb_alm_code_TEST_EXER("TEST-EXER");
} // gen:ns_gsymbol
namespace lib_fm { // gen:ns_gsymbol
const char* fmdb_alm_objtype_SYS("SYS");
} // gen:ns_gsymbol
namespace lib_fm { // gen:ns_gsymbol
const char* fmdb_alm_source_UnitTest("UnitTest");
} // gen:ns_gsymbol
namespace lib_fm { // gen:ns_print_proto
// Load statically available data into tables, register tables and database.
static void InitReflection();
static bool alm_code_InputMaybe(fmdb::AlmCode &elem) __attribute__((nothrow));
static bool alm_objtype_InputMaybe(fmdb::AlmObjtype &elem) __attribute__((nothrow));
// find trace by row id (used to implement reflection)
static algo::ImrowPtr trace_RowidFind(int t) __attribute__((nothrow));
// Function return 1
static i32 trace_N() __attribute__((__warn_unused_result__, nothrow, pure));
static void SizeCheck();
} // gen:ns_print_proto
// --- lib_fm.FAlarm.base.CopyOut
// Copy fields out of row
void lib_fm::alarm_CopyOut(lib_fm::FAlarm &row, fmdb::Alarm &out) {
out.alarm = row.alarm;
out.flag = row.flag;
out.severity = row.severity;
out.n_occurred = row.n_occurred;
out.first_time = row.first_time;
out.last_time = row.last_time;
out.clear_time = row.clear_time;
out.update_time = row.update_time;
out.objtype_summary = row.objtype_summary;
out.summary = row.summary;
out.description = row.description;
out.source = row.source;
}
// --- lib_fm.FAlarm.base.CopyIn
// Copy fields in to row
void lib_fm::alarm_CopyIn(lib_fm::FAlarm &row, fmdb::Alarm &in) {
row.alarm = in.alarm;
row.flag = in.flag;
row.severity = in.severity;
row.n_occurred = in.n_occurred;
row.first_time = in.first_time;
row.last_time = in.last_time;
row.clear_time = in.clear_time;
row.update_time = in.update_time;
row.objtype_summary = in.objtype_summary;
row.summary = in.summary;
row.description = in.description;
row.source = in.source;
}
// --- lib_fm.FAlarm.code.Get
fm::Code lib_fm::code_Get(lib_fm::FAlarm& alarm) {
fm::Code ret(algo::Pathcomp(alarm.alarm, "@LL"));
return ret;
}
// --- lib_fm.FAlarm.object.Get
algo::Smallstr200 lib_fm::object_Get(lib_fm::FAlarm& alarm) {
algo::Smallstr200 ret(algo::Pathcomp(alarm.alarm, "@LR"));
return ret;
}
// --- lib_fm.FAlarm.objtype.Get
fm::Objtype lib_fm::objtype_Get(lib_fm::FAlarm& alarm) {
fm::Objtype ret(algo::Pathcomp(object_Get(alarm), ".LL"));
return ret;
}
// --- lib_fm.FAlarm.objinst.Get
fm::Objinst lib_fm::objinst_Get(lib_fm::FAlarm& alarm) {
fm::Objinst ret(algo::Pathcomp(object_Get(alarm), ".LR"));
return ret;
}
// --- lib_fm.FAlarm.objprefix.Get
algo::Smallstr50 lib_fm::objprefix_Get(lib_fm::FAlarm& alarm) {
algo::Smallstr50 ret(algo::Pathcomp(objinst_Get(alarm), ".LL"));
return ret;
}
// --- lib_fm.FAlarm..Init
// Set all fields to initial values.
void lib_fm::FAlarm_Init(lib_fm::FAlarm& alarm) {
alarm.n_occurred = i32(0);
alarm.ind_alarm_next = (lib_fm::FAlarm*)-1; // (lib_fm.FDb.ind_alarm) not-in-hash
}
// --- lib_fm.FAlarm..Uninit
void lib_fm::FAlarm_Uninit(lib_fm::FAlarm& alarm) {
lib_fm::FAlarm &row = alarm; (void)row;
ind_alarm_Remove(row); // remove alarm from index ind_alarm
}
// --- lib_fm.FAlmCode.base.CopyOut
// Copy fields out of row
void lib_fm::alm_code_CopyOut(lib_fm::FAlmCode &row, fmdb::AlmCode &out) {
out.alm_code = row.alm_code;
out.severity = row.severity;
out.source = row.source;
out.summary = row.summary;
}
// --- lib_fm.FAlmCode.base.CopyIn
// Copy fields in to row
void lib_fm::alm_code_CopyIn(lib_fm::FAlmCode &row, fmdb::AlmCode &in) {
row.alm_code = in.alm_code;
row.severity = in.severity;
row.source = in.source;
row.summary = in.summary;
}
// --- lib_fm.FAlmCode..Uninit
void lib_fm::FAlmCode_Uninit(lib_fm::FAlmCode& alm_code) {
lib_fm::FAlmCode &row = alm_code; (void)row;
ind_alm_code_Remove(row); // remove alm_code from index ind_alm_code
}
// --- lib_fm.FAlmObjtype.base.CopyOut
// Copy fields out of row
void lib_fm::alm_objtype_CopyOut(lib_fm::FAlmObjtype &row, fmdb::AlmObjtype &out) {
out.alm_objtype = row.alm_objtype;
out.summary = row.summary;
}
// --- lib_fm.FAlmObjtype.base.CopyIn
// Copy fields in to row
void lib_fm::alm_objtype_CopyIn(lib_fm::FAlmObjtype &row, fmdb::AlmObjtype &in) {
row.alm_objtype = in.alm_objtype;
row.summary = in.summary;
}
// --- lib_fm.FAlmObjtype..Uninit
void lib_fm::FAlmObjtype_Uninit(lib_fm::FAlmObjtype& alm_objtype) {
lib_fm::FAlmObjtype &row = alm_objtype; (void)row;
ind_alm_objtype_Remove(row); // remove alm_objtype from index ind_alm_objtype
}
// --- lib_fm.trace..Print
// print string representation of lib_fm::trace to string LHS, no header -- cprint:lib_fm.trace.String
void lib_fm::trace_Print(lib_fm::trace & row, algo::cstring &str) {
algo::tempstr temp;
str << "lib_fm.trace";
(void)row;//only to avoid -Wunused-parameter
}
// --- lib_fm.FDb._db.InitReflection
// Load statically available data into tables, register tables and database.
static void lib_fm::InitReflection() {
algo_lib::imdb_InsertMaybe(algo::Imdb("lib_fm", lib_fm::InsertStrptrMaybe, NULL, NULL, NULL, algo::Comment()));
algo::Imtable t_trace;
t_trace.imtable = "lib_fm.trace";
t_trace.ssimfile = "";
t_trace.size = sizeof(lib_fm::trace);
t_trace.comment.value = "";
t_trace.c_RowidFind = trace_RowidFind;
t_trace.NItems = trace_N;
t_trace.Print = (algo::ImrowPrintFcn)lib_fm::trace_Print;
algo_lib::imtable_InsertMaybe(t_trace);
// -- load signatures of existing dispatches --
algo_lib::InsertStrptrMaybe("dmmeta.Dispsigcheck dispsig:'lib_fm.Input' signature:'31fbf0507fb2ed9da38949e132b768cb72b6de2b'");
}
// --- lib_fm.FDb._db.StaticCheck
void lib_fm::StaticCheck() {
algo_assert(sizeof(lib_fm::_db_h_alarm_hook) == 8); // csize:lib_fm._db_h_alarm_hook
algo_assert(_offset_of(lib_fm::FieldId, value) + sizeof(((lib_fm::FieldId*)0)->value) == sizeof(lib_fm::FieldId));
}
// --- lib_fm.FDb._db.InsertStrptrMaybe
// Parse strptr into known type and add to database.
// Return value is true unless an error occurs. If return value is false, algo_lib::_db.errtext has error text
bool lib_fm::InsertStrptrMaybe(algo::strptr str) {
bool retval = true;
lib_fm::TableId table_id(-1);
value_SetStrptrMaybe(table_id, algo::GetTypeTag(str));
switch (value_GetEnum(table_id)) {
case lib_fm_TableId_fmdb_AlmCode: { // finput:lib_fm.FDb.alm_code
fmdb::AlmCode elem;
retval = fmdb::AlmCode_ReadStrptrMaybe(elem, str);
retval = retval && alm_code_InputMaybe(elem);
break;
}
case lib_fm_TableId_fmdb_AlmObjtype: { // finput:lib_fm.FDb.alm_objtype
fmdb::AlmObjtype elem;
retval = fmdb::AlmObjtype_ReadStrptrMaybe(elem, str);
retval = retval && alm_objtype_InputMaybe(elem);
break;
}
default:
retval = algo_lib::InsertStrptrMaybe(str);
break;
} //switch
if (!retval) {
algo_lib::NoteInsertErr(str); // increment error counter
}
return retval;
}
// --- lib_fm.FDb._db.LoadTuplesMaybe
// Load all finputs from given directory.
bool lib_fm::LoadTuplesMaybe(algo::strptr root) {
bool retval = true;
static const char *ssimfiles[] = {
"fmdb.alm_code", "fmdb.alm_objtype"
, NULL};
retval = algo_lib::DoLoadTuples(root, lib_fm::InsertStrptrMaybe, ssimfiles, true);
return retval;
}
// --- lib_fm.FDb._db.SaveTuples
// Save ssim data to given directory.
u32 lib_fm::SaveTuples(algo::strptr root) {
u32 retval = 0;
u32 nbefore = algo_lib::_db.stringtofile_nwrite;
(void)alarm_SaveSsimfile(SsimFname(root, "fmdb.alarm"));
retval = algo_lib::_db.stringtofile_nwrite - nbefore;
return retval;
}
// --- lib_fm.FDb._db.LoadSsimfileMaybe
// Load specified ssimfile.
bool lib_fm::LoadSsimfileMaybe(algo::strptr fname) {
bool retval = true;
if (FileQ(fname)) {
retval = algo_lib::LoadTuplesFile(fname, lib_fm::InsertStrptrMaybe, true);
}
return retval;
}
// --- lib_fm.FDb._db.Steps
// Calls Step function of dependencies
void lib_fm::Steps() {
algo_lib::Step(); // dependent namespace specified via (dev.targdep)
}
// --- lib_fm.FDb._db.XrefMaybe
// Insert row into all appropriate indices. If error occurs, store error
// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row.
bool lib_fm::_db_XrefMaybe() {
bool retval = true;
return retval;
}
// --- lib_fm.FDb.alarm.Alloc
// Allocate memory for new default row.
// If out of memory, process is killed.
lib_fm::FAlarm& lib_fm::alarm_Alloc() {
lib_fm::FAlarm* row = alarm_AllocMaybe();
if (UNLIKELY(row == NULL)) {
FatalErrorExit("lib_fm.out_of_mem field:lib_fm.FDb.alarm comment:'Alloc failed'");
}
return *row;
}
// --- lib_fm.FDb.alarm.AllocMaybe
// Allocate memory for new element. If out of memory, return NULL.
lib_fm::FAlarm* lib_fm::alarm_AllocMaybe() {
lib_fm::FAlarm *row = (lib_fm::FAlarm*)alarm_AllocMem();
if (row) {
new (row) lib_fm::FAlarm; // call constructor
}
return row;
}
// --- lib_fm.FDb.alarm.InsertMaybe
// Create new row from struct.
// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc)
lib_fm::FAlarm* lib_fm::alarm_InsertMaybe(const fmdb::Alarm &value) {
lib_fm::FAlarm *row = &alarm_Alloc(); // if out of memory, process dies. if input error, return NULL.
alarm_CopyIn(*row,const_cast<fmdb::Alarm&>(value));
bool ok = alarm_XrefMaybe(*row); // this may return false
if (!ok) {
alarm_RemoveLast(); // delete offending row, any existing xrefs are cleared
row = NULL; // forget this ever happened
}
return row;
}
// --- lib_fm.FDb.alarm.AllocMem
// Allocate space for one element. If no memory available, return NULL.
void* lib_fm::alarm_AllocMem() {
u64 new_nelems = _db.alarm_n+1;
// compute level and index on level
u64 bsr = algo::u64_BitScanReverse(new_nelems);
u64 base = u64(1)<<bsr;
u64 index = new_nelems-base;
void *ret = NULL;
// if level doesn't exist yet, create it
lib_fm::FAlarm* lev = NULL;
if (bsr < 32) {
lev = _db.alarm_lary[bsr];
if (!lev) {
lev=(lib_fm::FAlarm*)algo_lib::malloc_AllocMem(sizeof(lib_fm::FAlarm) * (u64(1)<<bsr));
_db.alarm_lary[bsr] = lev;
}
}
// allocate element from this level
if (lev) {
_db.alarm_n = i32(new_nelems);
ret = lev + index;
}
return ret;
}
// --- lib_fm.FDb.alarm.RemoveAll
// Remove all elements from Lary
void lib_fm::alarm_RemoveAll() {
for (u64 n = _db.alarm_n; n>0; ) {
n--;
alarm_qFind(u64(n)).~FAlarm(); // destroy last element
_db.alarm_n = i32(n);
}
}
// --- lib_fm.FDb.alarm.RemoveLast
// Delete last element of array. Do nothing if array is empty.
void lib_fm::alarm_RemoveLast() {
u64 n = _db.alarm_n;
if (n > 0) {
n -= 1;
alarm_qFind(u64(n)).~FAlarm();
_db.alarm_n = i32(n);
}
}
// --- lib_fm.FDb.alarm.SaveSsimfile
// Save table to ssimfile
bool lib_fm::alarm_SaveSsimfile(algo::strptr fname) {
cstring text;
ind_beg(lib_fm::_db_alarm_curs, alarm, lib_fm::_db) {
fmdb::Alarm out;
alarm_CopyOut(alarm, out);
fmdb::Alarm_Print(out, text);
text << eol;
}ind_end;
(void)algo::CreateDirRecurse(algo::GetDirName(fname));
// it is a silent error if the file cannot be saved.
return algo::SafeStringToFile(text, fname);
}
// --- lib_fm.FDb.alarm.XrefMaybe
// Insert row into all appropriate indices. If error occurs, store error
// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row.
bool lib_fm::alarm_XrefMaybe(lib_fm::FAlarm &row) {
bool retval = true;
(void)row;
// insert alarm into index ind_alarm
if (true) { // user-defined insert condition
bool success = ind_alarm_InsertMaybe(row);
if (UNLIKELY(!success)) {
ch_RemoveAll(algo_lib::_db.errtext);
algo_lib::_db.errtext << "lib_fm.duplicate_key xref:lib_fm.FDb.ind_alarm"; // check for duplicate key
return false;
}
}
return retval;
}
// --- lib_fm.FDb.ind_alarm.Find
// Find row by key. Return NULL if not found.
lib_fm::FAlarm* lib_fm::ind_alarm_Find(const algo::strptr& key) {
u32 index = algo::Smallstr200_Hash(0, key) & (_db.ind_alarm_buckets_n - 1);
lib_fm::FAlarm* *e = &_db.ind_alarm_buckets_elems[index];
lib_fm::FAlarm* ret=NULL;
do {
ret = *e;
bool done = !ret || (*ret).alarm == key;
if (done) break;
e = &ret->ind_alarm_next;
} while (true);
return ret;
}
// --- lib_fm.FDb.ind_alarm.FindX
// Look up row by key and return reference. Throw exception if not found
lib_fm::FAlarm& lib_fm::ind_alarm_FindX(const algo::strptr& key) {
lib_fm::FAlarm* ret = ind_alarm_Find(key);
vrfy(ret, tempstr() << "lib_fm.key_error table:ind_alarm key:'"<<key<<"' comment:'key not found'");
return *ret;
}
// --- lib_fm.FDb.ind_alarm.GetOrCreate
// Find row by key. If not found, create and x-reference a new row with with this key.
lib_fm::FAlarm& lib_fm::ind_alarm_GetOrCreate(const algo::strptr& key) {
lib_fm::FAlarm* ret = ind_alarm_Find(key);
if (!ret) { // if memory alloc fails, process dies; if insert fails, function returns NULL.
ret = &alarm_Alloc();
(*ret).alarm = key;
bool good = alarm_XrefMaybe(*ret);
if (!good) {
alarm_RemoveLast(); // delete offending row, any existing xrefs are cleared
ret = NULL;
}
}
vrfy(ret, tempstr() << "lib_fm.create_error table:ind_alarm key:'"<<key<<"' comment:'bad xref'");
return *ret;
}
// --- lib_fm.FDb.ind_alarm.InsertMaybe
// Insert row into hash table. Return true if row is reachable through the hash after the function completes.
bool lib_fm::ind_alarm_InsertMaybe(lib_fm::FAlarm& row) {
ind_alarm_Reserve(1);
bool retval = true; // if already in hash, InsertMaybe returns true
if (LIKELY(row.ind_alarm_next == (lib_fm::FAlarm*)-1)) {// check if in hash already
u32 index = algo::Smallstr200_Hash(0, row.alarm) & (_db.ind_alarm_buckets_n - 1);
lib_fm::FAlarm* *prev = &_db.ind_alarm_buckets_elems[index];
do {
lib_fm::FAlarm* ret = *prev;
if (!ret) { // exit condition 1: reached the end of the list
break;
}
if ((*ret).alarm == row.alarm) { // exit condition 2: found matching key
retval = false;
break;
}
prev = &ret->ind_alarm_next;
} while (true);
if (retval) {
row.ind_alarm_next = *prev;
_db.ind_alarm_n++;
*prev = &row;
}
}
return retval;
}
// --- lib_fm.FDb.ind_alarm.Remove
// Remove reference to element from hash index. If element is not in hash, do nothing
void lib_fm::ind_alarm_Remove(lib_fm::FAlarm& row) {
if (LIKELY(row.ind_alarm_next != (lib_fm::FAlarm*)-1)) {// check if in hash already
u32 index = algo::Smallstr200_Hash(0, row.alarm) & (_db.ind_alarm_buckets_n - 1);
lib_fm::FAlarm* *prev = &_db.ind_alarm_buckets_elems[index]; // addr of pointer to current element
while (lib_fm::FAlarm *next = *prev) { // scan the collision chain for our element
if (next == &row) { // found it?
*prev = next->ind_alarm_next; // unlink (singly linked list)
_db.ind_alarm_n--;
row.ind_alarm_next = (lib_fm::FAlarm*)-1;// not-in-hash
break;
}
prev = &next->ind_alarm_next;
}
}
}
// --- lib_fm.FDb.ind_alarm.Reserve
// Reserve enough room in the hash for N more elements. Return success code.
void lib_fm::ind_alarm_Reserve(int n) {
u32 old_nbuckets = _db.ind_alarm_buckets_n;
u32 new_nelems = _db.ind_alarm_n + n;
// # of elements has to be roughly equal to the number of buckets
if (new_nelems > old_nbuckets) {
int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4));
u32 old_size = old_nbuckets * sizeof(lib_fm::FAlarm*);
u32 new_size = new_nbuckets * sizeof(lib_fm::FAlarm*);
// allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably
// means new memory will have to be allocated anyway
lib_fm::FAlarm* *new_buckets = (lib_fm::FAlarm**)algo_lib::malloc_AllocMem(new_size);
if (UNLIKELY(!new_buckets)) {
FatalErrorExit("lib_fm.out_of_memory field:lib_fm.FDb.ind_alarm");
}
memset(new_buckets, 0, new_size); // clear pointers
// rehash all entries
for (int i = 0; i < _db.ind_alarm_buckets_n; i++) {
lib_fm::FAlarm* elem = _db.ind_alarm_buckets_elems[i];
while (elem) {
lib_fm::FAlarm &row = *elem;
lib_fm::FAlarm* next = row.ind_alarm_next;
u32 index = algo::Smallstr200_Hash(0, row.alarm) & (new_nbuckets-1);
row.ind_alarm_next = new_buckets[index];
new_buckets[index] = &row;
elem = next;
}
}
// free old array
algo_lib::malloc_FreeMem(_db.ind_alarm_buckets_elems, old_size);
_db.ind_alarm_buckets_elems = new_buckets;
_db.ind_alarm_buckets_n = new_nbuckets;
}
}
// --- lib_fm.FDb.alm_code.Alloc
// Allocate memory for new default row.
// If out of memory, process is killed.
lib_fm::FAlmCode& lib_fm::alm_code_Alloc() {
lib_fm::FAlmCode* row = alm_code_AllocMaybe();
if (UNLIKELY(row == NULL)) {
FatalErrorExit("lib_fm.out_of_mem field:lib_fm.FDb.alm_code comment:'Alloc failed'");
}
return *row;
}
// --- lib_fm.FDb.alm_code.AllocMaybe
// Allocate memory for new element. If out of memory, return NULL.
lib_fm::FAlmCode* lib_fm::alm_code_AllocMaybe() {
lib_fm::FAlmCode *row = (lib_fm::FAlmCode*)alm_code_AllocMem();
if (row) {
new (row) lib_fm::FAlmCode; // call constructor
}
return row;
}
// --- lib_fm.FDb.alm_code.InsertMaybe
// Create new row from struct.
// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc)
lib_fm::FAlmCode* lib_fm::alm_code_InsertMaybe(const fmdb::AlmCode &value) {
lib_fm::FAlmCode *row = &alm_code_Alloc(); // if out of memory, process dies. if input error, return NULL.
alm_code_CopyIn(*row,const_cast<fmdb::AlmCode&>(value));
bool ok = alm_code_XrefMaybe(*row); // this may return false
if (!ok) {
alm_code_RemoveLast(); // delete offending row, any existing xrefs are cleared
row = NULL; // forget this ever happened
}
return row;
}
// --- lib_fm.FDb.alm_code.AllocMem
// Allocate space for one element. If no memory available, return NULL.
void* lib_fm::alm_code_AllocMem() {
u64 new_nelems = _db.alm_code_n+1;
// compute level and index on level
u64 bsr = algo::u64_BitScanReverse(new_nelems);
u64 base = u64(1)<<bsr;
u64 index = new_nelems-base;
void *ret = NULL;
// if level doesn't exist yet, create it
lib_fm::FAlmCode* lev = NULL;
if (bsr < 32) {
lev = _db.alm_code_lary[bsr];
if (!lev) {
lev=(lib_fm::FAlmCode*)algo_lib::malloc_AllocMem(sizeof(lib_fm::FAlmCode) * (u64(1)<<bsr));
_db.alm_code_lary[bsr] = lev;
}
}
// allocate element from this level
if (lev) {
_db.alm_code_n = i32(new_nelems);
ret = lev + index;
}
return ret;
}
// --- lib_fm.FDb.alm_code.RemoveAll
// Remove all elements from Lary
void lib_fm::alm_code_RemoveAll() {
for (u64 n = _db.alm_code_n; n>0; ) {
n--;
alm_code_qFind(u64(n)).~FAlmCode(); // destroy last element
_db.alm_code_n = i32(n);
}
}
// --- lib_fm.FDb.alm_code.RemoveLast
// Delete last element of array. Do nothing if array is empty.
void lib_fm::alm_code_RemoveLast() {
u64 n = _db.alm_code_n;
if (n > 0) {
n -= 1;
alm_code_qFind(u64(n)).~FAlmCode();
_db.alm_code_n = i32(n);
}
}
// --- lib_fm.FDb.alm_code.InputMaybe
static bool lib_fm::alm_code_InputMaybe(fmdb::AlmCode &elem) {
bool retval = true;
retval = alm_code_InsertMaybe(elem) != nullptr;
return retval;
}
// --- lib_fm.FDb.alm_code.XrefMaybe
// Insert row into all appropriate indices. If error occurs, store error
// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row.
bool lib_fm::alm_code_XrefMaybe(lib_fm::FAlmCode &row) {
bool retval = true;
(void)row;
// insert alm_code into index ind_alm_code
if (true) { // user-defined insert condition
bool success = ind_alm_code_InsertMaybe(row);
if (UNLIKELY(!success)) {
ch_RemoveAll(algo_lib::_db.errtext);
algo_lib::_db.errtext << "lib_fm.duplicate_key xref:lib_fm.FDb.ind_alm_code"; // check for duplicate key
return false;
}
}
return retval;
}
// --- lib_fm.FDb.ind_alm_code.Find
// Find row by key. Return NULL if not found.
lib_fm::FAlmCode* lib_fm::ind_alm_code_Find(const algo::strptr& key) {
u32 index = fm::Code_Hash(0, key) & (_db.ind_alm_code_buckets_n - 1);
lib_fm::FAlmCode* *e = &_db.ind_alm_code_buckets_elems[index];
lib_fm::FAlmCode* ret=NULL;
do {
ret = *e;
bool done = !ret || (*ret).alm_code == key;
if (done) break;
e = &ret->ind_alm_code_next;
} while (true);
return ret;
}
// --- lib_fm.FDb.ind_alm_code.FindX
// Look up row by key and return reference. Throw exception if not found
lib_fm::FAlmCode& lib_fm::ind_alm_code_FindX(const algo::strptr& key) {
lib_fm::FAlmCode* ret = ind_alm_code_Find(key);
vrfy(ret, tempstr() << "lib_fm.key_error table:ind_alm_code key:'"<<key<<"' comment:'key not found'");
return *ret;
}
// --- lib_fm.FDb.ind_alm_code.GetOrCreate
// Find row by key. If not found, create and x-reference a new row with with this key.
lib_fm::FAlmCode& lib_fm::ind_alm_code_GetOrCreate(const algo::strptr& key) {
lib_fm::FAlmCode* ret = ind_alm_code_Find(key);
if (!ret) { // if memory alloc fails, process dies; if insert fails, function returns NULL.
ret = &alm_code_Alloc();
(*ret).alm_code = key;
bool good = alm_code_XrefMaybe(*ret);
if (!good) {
alm_code_RemoveLast(); // delete offending row, any existing xrefs are cleared
ret = NULL;
}
}
vrfy(ret, tempstr() << "lib_fm.create_error table:ind_alm_code key:'"<<key<<"' comment:'bad xref'");
return *ret;
}
// --- lib_fm.FDb.ind_alm_code.InsertMaybe
// Insert row into hash table. Return true if row is reachable through the hash after the function completes.
bool lib_fm::ind_alm_code_InsertMaybe(lib_fm::FAlmCode& row) {
ind_alm_code_Reserve(1);
bool retval = true; // if already in hash, InsertMaybe returns true
if (LIKELY(row.ind_alm_code_next == (lib_fm::FAlmCode*)-1)) {// check if in hash already
u32 index = fm::Code_Hash(0, row.alm_code) & (_db.ind_alm_code_buckets_n - 1);
lib_fm::FAlmCode* *prev = &_db.ind_alm_code_buckets_elems[index];
do {
lib_fm::FAlmCode* ret = *prev;
if (!ret) { // exit condition 1: reached the end of the list
break;
}
if ((*ret).alm_code == row.alm_code) { // exit condition 2: found matching key
retval = false;
break;
}
prev = &ret->ind_alm_code_next;
} while (true);
if (retval) {
row.ind_alm_code_next = *prev;
_db.ind_alm_code_n++;
*prev = &row;
}
}
return retval;
}
// --- lib_fm.FDb.ind_alm_code.Remove
// Remove reference to element from hash index. If element is not in hash, do nothing
void lib_fm::ind_alm_code_Remove(lib_fm::FAlmCode& row) {
if (LIKELY(row.ind_alm_code_next != (lib_fm::FAlmCode*)-1)) {// check if in hash already
u32 index = fm::Code_Hash(0, row.alm_code) & (_db.ind_alm_code_buckets_n - 1);
lib_fm::FAlmCode* *prev = &_db.ind_alm_code_buckets_elems[index]; // addr of pointer to current element
while (lib_fm::FAlmCode *next = *prev) { // scan the collision chain for our element
if (next == &row) { // found it?
*prev = next->ind_alm_code_next; // unlink (singly linked list)
_db.ind_alm_code_n--;
row.ind_alm_code_next = (lib_fm::FAlmCode*)-1;// not-in-hash
break;
}
prev = &next->ind_alm_code_next;
}
}
}
// --- lib_fm.FDb.ind_alm_code.Reserve
// Reserve enough room in the hash for N more elements. Return success code.
void lib_fm::ind_alm_code_Reserve(int n) {
u32 old_nbuckets = _db.ind_alm_code_buckets_n;
u32 new_nelems = _db.ind_alm_code_n + n;
// # of elements has to be roughly equal to the number of buckets
if (new_nelems > old_nbuckets) {
int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4));
u32 old_size = old_nbuckets * sizeof(lib_fm::FAlmCode*);
u32 new_size = new_nbuckets * sizeof(lib_fm::FAlmCode*);
// allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably
// means new memory will have to be allocated anyway
lib_fm::FAlmCode* *new_buckets = (lib_fm::FAlmCode**)algo_lib::malloc_AllocMem(new_size);
if (UNLIKELY(!new_buckets)) {
FatalErrorExit("lib_fm.out_of_memory field:lib_fm.FDb.ind_alm_code");
}
memset(new_buckets, 0, new_size); // clear pointers
// rehash all entries
for (int i = 0; i < _db.ind_alm_code_buckets_n; i++) {
lib_fm::FAlmCode* elem = _db.ind_alm_code_buckets_elems[i];
while (elem) {
lib_fm::FAlmCode &row = *elem;
lib_fm::FAlmCode* next = row.ind_alm_code_next;
u32 index = fm::Code_Hash(0, row.alm_code) & (new_nbuckets-1);
row.ind_alm_code_next = new_buckets[index];
new_buckets[index] = &row;
elem = next;
}
}
// free old array
algo_lib::malloc_FreeMem(_db.ind_alm_code_buckets_elems, old_size);
_db.ind_alm_code_buckets_elems = new_buckets;
_db.ind_alm_code_buckets_n = new_nbuckets;
}
}
// --- lib_fm.FDb.alm_objtype.Alloc
// Allocate memory for new default row.
// If out of memory, process is killed.
lib_fm::FAlmObjtype& lib_fm::alm_objtype_Alloc() {
lib_fm::FAlmObjtype* row = alm_objtype_AllocMaybe();
if (UNLIKELY(row == NULL)) {
FatalErrorExit("lib_fm.out_of_mem field:lib_fm.FDb.alm_objtype comment:'Alloc failed'");
}
return *row;
}
// --- lib_fm.FDb.alm_objtype.AllocMaybe
// Allocate memory for new element. If out of memory, return NULL.
lib_fm::FAlmObjtype* lib_fm::alm_objtype_AllocMaybe() {
lib_fm::FAlmObjtype *row = (lib_fm::FAlmObjtype*)alm_objtype_AllocMem();
if (row) {
new (row) lib_fm::FAlmObjtype; // call constructor
}
return row;
}
// --- lib_fm.FDb.alm_objtype.InsertMaybe
// Create new row from struct.
// Return pointer to new element, or NULL if insertion failed (due to out-of-memory, duplicate key, etc)
lib_fm::FAlmObjtype* lib_fm::alm_objtype_InsertMaybe(const fmdb::AlmObjtype &value) {
lib_fm::FAlmObjtype *row = &alm_objtype_Alloc(); // if out of memory, process dies. if input error, return NULL.
alm_objtype_CopyIn(*row,const_cast<fmdb::AlmObjtype&>(value));
bool ok = alm_objtype_XrefMaybe(*row); // this may return false
if (!ok) {
alm_objtype_RemoveLast(); // delete offending row, any existing xrefs are cleared
row = NULL; // forget this ever happened
}
return row;
}
// --- lib_fm.FDb.alm_objtype.AllocMem
// Allocate space for one element. If no memory available, return NULL.
void* lib_fm::alm_objtype_AllocMem() {
u64 new_nelems = _db.alm_objtype_n+1;
// compute level and index on level
u64 bsr = algo::u64_BitScanReverse(new_nelems);
u64 base = u64(1)<<bsr;
u64 index = new_nelems-base;
void *ret = NULL;
// if level doesn't exist yet, create it
lib_fm::FAlmObjtype* lev = NULL;
if (bsr < 32) {
lev = _db.alm_objtype_lary[bsr];
if (!lev) {
lev=(lib_fm::FAlmObjtype*)algo_lib::malloc_AllocMem(sizeof(lib_fm::FAlmObjtype) * (u64(1)<<bsr));
_db.alm_objtype_lary[bsr] = lev;
}
}
// allocate element from this level
if (lev) {
_db.alm_objtype_n = i32(new_nelems);
ret = lev + index;
}
return ret;
}
// --- lib_fm.FDb.alm_objtype.RemoveAll
// Remove all elements from Lary
void lib_fm::alm_objtype_RemoveAll() {
for (u64 n = _db.alm_objtype_n; n>0; ) {
n--;
alm_objtype_qFind(u64(n)).~FAlmObjtype(); // destroy last element
_db.alm_objtype_n = i32(n);
}
}
// --- lib_fm.FDb.alm_objtype.RemoveLast
// Delete last element of array. Do nothing if array is empty.
void lib_fm::alm_objtype_RemoveLast() {
u64 n = _db.alm_objtype_n;
if (n > 0) {
n -= 1;
alm_objtype_qFind(u64(n)).~FAlmObjtype();
_db.alm_objtype_n = i32(n);
}
}
// --- lib_fm.FDb.alm_objtype.InputMaybe
static bool lib_fm::alm_objtype_InputMaybe(fmdb::AlmObjtype &elem) {
bool retval = true;
retval = alm_objtype_InsertMaybe(elem) != nullptr;
return retval;
}
// --- lib_fm.FDb.alm_objtype.XrefMaybe
// Insert row into all appropriate indices. If error occurs, store error
// in algo_lib::_db.errtext and return false. Caller must Delete or Unref such row.
bool lib_fm::alm_objtype_XrefMaybe(lib_fm::FAlmObjtype &row) {
bool retval = true;
(void)row;
// insert alm_objtype into index ind_alm_objtype
if (true) { // user-defined insert condition
bool success = ind_alm_objtype_InsertMaybe(row);
if (UNLIKELY(!success)) {
ch_RemoveAll(algo_lib::_db.errtext);
algo_lib::_db.errtext << "lib_fm.duplicate_key xref:lib_fm.FDb.ind_alm_objtype"; // check for duplicate key
return false;
}
}
return retval;
}
// --- lib_fm.FDb.ind_alm_objtype.Find
// Find row by key. Return NULL if not found.
lib_fm::FAlmObjtype* lib_fm::ind_alm_objtype_Find(const algo::strptr& key) {
u32 index = fm::Objtype_Hash(0, key) & (_db.ind_alm_objtype_buckets_n - 1);
lib_fm::FAlmObjtype* *e = &_db.ind_alm_objtype_buckets_elems[index];
lib_fm::FAlmObjtype* ret=NULL;
do {
ret = *e;
bool done = !ret || (*ret).alm_objtype == key;
if (done) break;
e = &ret->ind_alm_objtype_next;
} while (true);
return ret;
}
// --- lib_fm.FDb.ind_alm_objtype.FindX
// Look up row by key and return reference. Throw exception if not found
lib_fm::FAlmObjtype& lib_fm::ind_alm_objtype_FindX(const algo::strptr& key) {
lib_fm::FAlmObjtype* ret = ind_alm_objtype_Find(key);
vrfy(ret, tempstr() << "lib_fm.key_error table:ind_alm_objtype key:'"<<key<<"' comment:'key not found'");
return *ret;
}
// --- lib_fm.FDb.ind_alm_objtype.GetOrCreate
// Find row by key. If not found, create and x-reference a new row with with this key.
lib_fm::FAlmObjtype& lib_fm::ind_alm_objtype_GetOrCreate(const algo::strptr& key) {
lib_fm::FAlmObjtype* ret = ind_alm_objtype_Find(key);
if (!ret) { // if memory alloc fails, process dies; if insert fails, function returns NULL.
ret = &alm_objtype_Alloc();
(*ret).alm_objtype = key;
bool good = alm_objtype_XrefMaybe(*ret);
if (!good) {
alm_objtype_RemoveLast(); // delete offending row, any existing xrefs are cleared
ret = NULL;
}
}
vrfy(ret, tempstr() << "lib_fm.create_error table:ind_alm_objtype key:'"<<key<<"' comment:'bad xref'");
return *ret;
}
// --- lib_fm.FDb.ind_alm_objtype.InsertMaybe
// Insert row into hash table. Return true if row is reachable through the hash after the function completes.
bool lib_fm::ind_alm_objtype_InsertMaybe(lib_fm::FAlmObjtype& row) {
ind_alm_objtype_Reserve(1);
bool retval = true; // if already in hash, InsertMaybe returns true
if (LIKELY(row.ind_alm_objtype_next == (lib_fm::FAlmObjtype*)-1)) {// check if in hash already
u32 index = fm::Objtype_Hash(0, row.alm_objtype) & (_db.ind_alm_objtype_buckets_n - 1);
lib_fm::FAlmObjtype* *prev = &_db.ind_alm_objtype_buckets_elems[index];
do {
lib_fm::FAlmObjtype* ret = *prev;
if (!ret) { // exit condition 1: reached the end of the list
break;
}
if ((*ret).alm_objtype == row.alm_objtype) { // exit condition 2: found matching key
retval = false;
break;
}
prev = &ret->ind_alm_objtype_next;
} while (true);
if (retval) {
row.ind_alm_objtype_next = *prev;
_db.ind_alm_objtype_n++;
*prev = &row;
}
}
return retval;
}
// --- lib_fm.FDb.ind_alm_objtype.Remove
// Remove reference to element from hash index. If element is not in hash, do nothing
void lib_fm::ind_alm_objtype_Remove(lib_fm::FAlmObjtype& row) {
if (LIKELY(row.ind_alm_objtype_next != (lib_fm::FAlmObjtype*)-1)) {// check if in hash already
u32 index = fm::Objtype_Hash(0, row.alm_objtype) & (_db.ind_alm_objtype_buckets_n - 1);
lib_fm::FAlmObjtype* *prev = &_db.ind_alm_objtype_buckets_elems[index]; // addr of pointer to current element
while (lib_fm::FAlmObjtype *next = *prev) { // scan the collision chain for our element
if (next == &row) { // found it?
*prev = next->ind_alm_objtype_next; // unlink (singly linked list)
_db.ind_alm_objtype_n--;
row.ind_alm_objtype_next = (lib_fm::FAlmObjtype*)-1;// not-in-hash
break;
}
prev = &next->ind_alm_objtype_next;
}
}
}
// --- lib_fm.FDb.ind_alm_objtype.Reserve
// Reserve enough room in the hash for N more elements. Return success code.
void lib_fm::ind_alm_objtype_Reserve(int n) {
u32 old_nbuckets = _db.ind_alm_objtype_buckets_n;
u32 new_nelems = _db.ind_alm_objtype_n + n;
// # of elements has to be roughly equal to the number of buckets
if (new_nelems > old_nbuckets) {
int new_nbuckets = i32_Max(algo::BumpToPow2(new_nelems), u32(4));
u32 old_size = old_nbuckets * sizeof(lib_fm::FAlmObjtype*);
u32 new_size = new_nbuckets * sizeof(lib_fm::FAlmObjtype*);
// allocate new array. we don't use Realloc since copying is not needed and factor of 2 probably
// means new memory will have to be allocated anyway
lib_fm::FAlmObjtype* *new_buckets = (lib_fm::FAlmObjtype**)algo_lib::malloc_AllocMem(new_size);
if (UNLIKELY(!new_buckets)) {
FatalErrorExit("lib_fm.out_of_memory field:lib_fm.FDb.ind_alm_objtype");
}
memset(new_buckets, 0, new_size); // clear pointers
// rehash all entries
for (int i = 0; i < _db.ind_alm_objtype_buckets_n; i++) {
lib_fm::FAlmObjtype* elem = _db.ind_alm_objtype_buckets_elems[i];
while (elem) {
lib_fm::FAlmObjtype &row = *elem;
lib_fm::FAlmObjtype* next = row.ind_alm_objtype_next;
u32 index = fm::Objtype_Hash(0, row.alm_objtype) & (new_nbuckets-1);
row.ind_alm_objtype_next = new_buckets[index];
new_buckets[index] = &row;
elem = next;
}
}
// free old array
algo_lib::malloc_FreeMem(_db.ind_alm_objtype_buckets_elems, old_size);
_db.ind_alm_objtype_buckets_elems = new_buckets;
_db.ind_alm_objtype_buckets_n = new_nbuckets;
}
}
// --- lib_fm.FDb.trace.RowidFind
// find trace by row id (used to implement reflection)
static algo::ImrowPtr lib_fm::trace_RowidFind(int t) {
return algo::ImrowPtr(t==0 ? u64(&_db.trace) : u64(0));
}
// --- lib_fm.FDb.trace.N
// Function return 1
inline static i32 lib_fm::trace_N() {
return 1;
}
// --- lib_fm.FDb..Init
// Set all fields to initial values.
void lib_fm::FDb_Init() {
// initialize LAry alarm (lib_fm.FDb.alarm)
_db.alarm_n = 0;
memset(_db.alarm_lary, 0, sizeof(_db.alarm_lary)); // zero out all level pointers
lib_fm::FAlarm* alarm_first = (lib_fm::FAlarm*)algo_lib::malloc_AllocMem(sizeof(lib_fm::FAlarm) * (u64(1)<<4));
if (!alarm_first) {
FatalErrorExit("out of memory");
}
for (int i = 0; i < 4; i++) {
_db.alarm_lary[i] = alarm_first;
alarm_first += 1ULL<<i;
}
// initialize hash table for lib_fm::FAlarm;
_db.ind_alarm_n = 0; // (lib_fm.FDb.ind_alarm)
_db.ind_alarm_buckets_n = 4; // (lib_fm.FDb.ind_alarm)
_db.ind_alarm_buckets_elems = (lib_fm::FAlarm**)algo_lib::malloc_AllocMem(sizeof(lib_fm::FAlarm*)*_db.ind_alarm_buckets_n); // initial buckets (lib_fm.FDb.ind_alarm)
if (!_db.ind_alarm_buckets_elems) {
FatalErrorExit("out of memory"); // (lib_fm.FDb.ind_alarm)
}
memset(_db.ind_alarm_buckets_elems, 0, sizeof(lib_fm::FAlarm*)*_db.ind_alarm_buckets_n); // (lib_fm.FDb.ind_alarm)
// initialize LAry alm_code (lib_fm.FDb.alm_code)
_db.alm_code_n = 0;
memset(_db.alm_code_lary, 0, sizeof(_db.alm_code_lary)); // zero out all level pointers
lib_fm::FAlmCode* alm_code_first = (lib_fm::FAlmCode*)algo_lib::malloc_AllocMem(sizeof(lib_fm::FAlmCode) * (u64(1)<<4));
if (!alm_code_first) {
FatalErrorExit("out of memory");
}
for (int i = 0; i < 4; i++) {
_db.alm_code_lary[i] = alm_code_first;
alm_code_first += 1ULL<<i;
}
// initialize hash table for lib_fm::FAlmCode;
_db.ind_alm_code_n = 0; // (lib_fm.FDb.ind_alm_code)
_db.ind_alm_code_buckets_n = 4; // (lib_fm.FDb.ind_alm_code)
_db.ind_alm_code_buckets_elems = (lib_fm::FAlmCode**)algo_lib::malloc_AllocMem(sizeof(lib_fm::FAlmCode*)*_db.ind_alm_code_buckets_n); // initial buckets (lib_fm.FDb.ind_alm_code)
if (!_db.ind_alm_code_buckets_elems) {
FatalErrorExit("out of memory"); // (lib_fm.FDb.ind_alm_code)
}
memset(_db.ind_alm_code_buckets_elems, 0, sizeof(lib_fm::FAlmCode*)*_db.ind_alm_code_buckets_n); // (lib_fm.FDb.ind_alm_code)
// initialize LAry alm_objtype (lib_fm.FDb.alm_objtype)
_db.alm_objtype_n = 0;
memset(_db.alm_objtype_lary, 0, sizeof(_db.alm_objtype_lary)); // zero out all level pointers
lib_fm::FAlmObjtype* alm_objtype_first = (lib_fm::FAlmObjtype*)algo_lib::malloc_AllocMem(sizeof(lib_fm::FAlmObjtype) * (u64(1)<<4));
if (!alm_objtype_first) {
FatalErrorExit("out of memory");
}
for (int i = 0; i < 4; i++) {
_db.alm_objtype_lary[i] = alm_objtype_first;
alm_objtype_first += 1ULL<<i;
}
// initialize hash table for lib_fm::FAlmObjtype;
_db.ind_alm_objtype_n = 0; // (lib_fm.FDb.ind_alm_objtype)
_db.ind_alm_objtype_buckets_n = 4; // (lib_fm.FDb.ind_alm_objtype)
_db.ind_alm_objtype_buckets_elems = (lib_fm::FAlmObjtype**)algo_lib::malloc_AllocMem(sizeof(lib_fm::FAlmObjtype*)*_db.ind_alm_objtype_buckets_n); // initial buckets (lib_fm.FDb.ind_alm_objtype)
if (!_db.ind_alm_objtype_buckets_elems) {
FatalErrorExit("out of memory"); // (lib_fm.FDb.ind_alm_objtype)
}
memset(_db.ind_alm_objtype_buckets_elems, 0, sizeof(lib_fm::FAlmObjtype*)*_db.ind_alm_objtype_buckets_n); // (lib_fm.FDb.ind_alm_objtype)
lib_fm::InitReflection();
_db.h_alarm = NULL;
_db.h_alarm_ctx = 0;
}
// --- lib_fm.FDb..Uninit
void lib_fm::FDb_Uninit() {
lib_fm::FDb &row = _db; (void)row;
// lib_fm.FDb.ind_alm_objtype.Uninit (Thash) //
// skip destruction of ind_alm_objtype in global scope
// lib_fm.FDb.alm_objtype.Uninit (Lary) //
// skip destruction in global scope
// lib_fm.FDb.ind_alm_code.Uninit (Thash) //
// skip destruction of ind_alm_code in global scope
// lib_fm.FDb.alm_code.Uninit (Lary) //
// skip destruction in global scope
// lib_fm.FDb.ind_alarm.Uninit (Thash) //
// skip destruction of ind_alarm in global scope
// lib_fm.FDb.alarm.Uninit (Lary) //
// skip destruction in global scope
}
// --- lib_fm.FieldId.value.ToCstr
// Convert numeric value of field to one of predefined string constants.
// If string is found, return a static C string. Otherwise, return NULL.
const char* lib_fm::value_ToCstr(const lib_fm::FieldId& parent) {
const char *ret = NULL;
switch(value_GetEnum(parent)) {
case lib_fm_FieldId_value : ret = "value"; break;
}
return ret;
}
// --- lib_fm.FieldId.value.Print
// Convert value to a string. First, attempt conversion to a known string.
// If no string matches, print value as a numeric value.
void lib_fm::value_Print(const lib_fm::FieldId& parent, algo::cstring &lhs) {
const char *strval = value_ToCstr(parent);
if (strval) {
lhs << strval;
} else {
lhs << parent.value;
}
}
// --- lib_fm.FieldId.value.SetStrptrMaybe
// Convert string to field.
// If the string is invalid, do not modify field and return false.
// In case of success, return true
bool lib_fm::value_SetStrptrMaybe(lib_fm::FieldId& parent, algo::strptr rhs) {
bool ret = false;
switch (elems_N(rhs)) {
case 5: {
switch (u64(algo::ReadLE32(rhs.elems))|(u64(rhs[4])<<32)) {
case LE_STR5('v','a','l','u','e'): {
value_SetEnum(parent,lib_fm_FieldId_value); ret = true; break;
}
}
break;
}
}
return ret;
}
// --- lib_fm.FieldId.value.SetStrptr
// Convert string to field.
// If the string is invalid, set numeric value to DFLT
void lib_fm::value_SetStrptr(lib_fm::FieldId& parent, algo::strptr rhs, lib_fm_FieldIdEnum dflt) {
if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt);
}
// --- lib_fm.FieldId.value.ReadStrptrMaybe
// Convert string to field. Return success value
bool lib_fm::value_ReadStrptrMaybe(lib_fm::FieldId& parent, algo::strptr rhs) {
bool retval = false;
retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion
if (!retval) { // didn't work? try reading as underlying type
retval = i32_ReadStrptrMaybe(parent.value,rhs);
}
return retval;
}
// --- lib_fm.FieldId..ReadStrptrMaybe
// Read fields of lib_fm::FieldId from an ascii string.
// The format of the string is the format of the lib_fm::FieldId's only field
bool lib_fm::FieldId_ReadStrptrMaybe(lib_fm::FieldId &parent, algo::strptr in_str) {
bool retval = true;
retval = retval && lib_fm::value_ReadStrptrMaybe(parent, in_str);
return retval;
}
// --- lib_fm.FieldId..Print
// print string representation of lib_fm::FieldId to string LHS, no header -- cprint:lib_fm.FieldId.String
void lib_fm::FieldId_Print(lib_fm::FieldId & row, algo::cstring &str) {
lib_fm::value_Print(row, str);
}
// --- lib_fm.TableId.value.ToCstr
// Convert numeric value of field to one of predefined string constants.
// If string is found, return a static C string. Otherwise, return NULL.
const char* lib_fm::value_ToCstr(const lib_fm::TableId& parent) {
const char *ret = NULL;
switch(value_GetEnum(parent)) {
case lib_fm_TableId_fmdb_AlmCode : ret = "fmdb.AlmCode"; break;
case lib_fm_TableId_fmdb_AlmObjtype: ret = "fmdb.AlmObjtype"; break;
}
return ret;
}
// --- lib_fm.TableId.value.Print
// Convert value to a string. First, attempt conversion to a known string.
// If no string matches, print value as a numeric value.
void lib_fm::value_Print(const lib_fm::TableId& parent, algo::cstring &lhs) {
const char *strval = value_ToCstr(parent);
if (strval) {
lhs << strval;
} else {
lhs << parent.value;
}
}
// --- lib_fm.TableId.value.SetStrptrMaybe
// Convert string to field.
// If the string is invalid, do not modify field and return false.
// In case of success, return true
bool lib_fm::value_SetStrptrMaybe(lib_fm::TableId& parent, algo::strptr rhs) {
bool ret = false;
switch (elems_N(rhs)) {
case 12: {
switch (algo::ReadLE64(rhs.elems)) {
case LE_STR8('f','m','d','b','.','A','l','m'): {
if (memcmp(rhs.elems+8,"Code",4)==0) { value_SetEnum(parent,lib_fm_TableId_fmdb_AlmCode); ret = true; break; }
break;
}
}
break;
}
case 13: {
switch (algo::ReadLE64(rhs.elems)) {
case LE_STR8('f','m','d','b','.','a','l','m'): {
if (memcmp(rhs.elems+8,"_code",5)==0) { value_SetEnum(parent,lib_fm_TableId_fmdb_alm_code); ret = true; break; }
break;
}
}
break;
}
case 15: {
switch (algo::ReadLE64(rhs.elems)) {
case LE_STR8('f','m','d','b','.','A','l','m'): {
if (memcmp(rhs.elems+8,"Objtype",7)==0) { value_SetEnum(parent,lib_fm_TableId_fmdb_AlmObjtype); ret = true; break; }
break;
}
}
break;
}
case 16: {
switch (algo::ReadLE64(rhs.elems)) {
case LE_STR8('f','m','d','b','.','a','l','m'): {
if (memcmp(rhs.elems+8,"_objtype",8)==0) { value_SetEnum(parent,lib_fm_TableId_fmdb_alm_objtype); ret = true; break; }
break;
}
}
break;
}
}
return ret;
}
// --- lib_fm.TableId.value.SetStrptr
// Convert string to field.
// If the string is invalid, set numeric value to DFLT
void lib_fm::value_SetStrptr(lib_fm::TableId& parent, algo::strptr rhs, lib_fm_TableIdEnum dflt) {
if (!value_SetStrptrMaybe(parent,rhs)) value_SetEnum(parent,dflt);
}
// --- lib_fm.TableId.value.ReadStrptrMaybe
// Convert string to field. Return success value
bool lib_fm::value_ReadStrptrMaybe(lib_fm::TableId& parent, algo::strptr rhs) {
bool retval = false;
retval = value_SetStrptrMaybe(parent,rhs); // try symbol conversion
if (!retval) { // didn't work? try reading as underlying type
retval = i32_ReadStrptrMaybe(parent.value,rhs);
}
return retval;
}
// --- lib_fm.TableId..ReadStrptrMaybe
// Read fields of lib_fm::TableId from an ascii string.
// The format of the string is the format of the lib_fm::TableId's only field
bool lib_fm::TableId_ReadStrptrMaybe(lib_fm::TableId &parent, algo::strptr in_str) {
bool retval = true;
retval = retval && lib_fm::value_ReadStrptrMaybe(parent, in_str);
return retval;
}
// --- lib_fm.TableId..Print
// print string representation of lib_fm::TableId to string LHS, no header -- cprint:lib_fm.TableId.String
void lib_fm::TableId_Print(lib_fm::TableId & row, algo::cstring &str) {
lib_fm::value_Print(row, str);
}
// --- lib_fm...SizeCheck
inline static void lib_fm::SizeCheck() {
}
| [
"noreply@github.com"
] | alexeilebedev.noreply@github.com |
29d8934e1e60f634fc4d3c695603eda4f76c7e71 | 2348000ede440b3513010c29a154ca70b22eb88e | /src/CPP/src/leetcode/SimplifyPath.cpp | e7bbf493be9a39e3e79996d67633c96eeb5d00b9 | [] | no_license | ZhenyingZhu/ClassicAlgorithms | 76438e02ecc813b75646df87f56d9588ffa256df | 86c90c23ea7ed91e8ce5278f334f0ce6e034a38c | refs/heads/master | 2023-08-27T20:34:18.427614 | 2023-08-25T06:08:00 | 2023-08-25T06:08:00 | 24,016,875 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,700 | cpp | /*
* [Source] https://leetcode.com/problems/simplify-path/
* [Difficulty]: Medium
* [Tag]: Stack
* [Tag]: String
*/
#include <iostream>
using namespace std;
// [Solution]: Split string by '/'. Use a stack. If find "..", pop, if "." or empty, do nothing.
// [Corner Case]: only "/", then stack is empty.
class Solution {
};
/* Java solution
https://github.com/ZhenyingZhu/ClassicAlgorithms/blob/master/src/algorithms/datastructure/SimplifyPath.java
*/
/* Java solution
public class Solution {
public String simplifyPath(String path) {
if(path==null || path.length()<=0) return null;
if(path.equals("/")) return "/";
char[] array=path.toCharArray();
Stack<String> stack=new Stack<String>();
int idx=1;
while(idx<array.length){
if(array[idx]=='/'){ // a slash
idx++;
continue;
}
String dir=getDirectory(array, idx);
if(!dir.equals(".")){ // current dir
if(dir.equals("..")){ // parent dir
if(!stack.empty()) stack.pop();
}else{
stack.push(dir);
}
idx=idx+dir.length()+1;
}else{
idx=idx+2;
}
}
if(stack.empty()) return "/";
Stack<String> reverse=new Stack<String>();
while(!stack.empty()){
reverse.push(stack.pop());
}
StringBuffer result=new StringBuffer();
while(!reverse.empty()){
result.append('/');
result.append(reverse.pop());
}
return result.toString();
}
public String getDirectory(char[] path, int start){
StringBuffer directory=new StringBuffer();
int index=start;
while(index<path.length){
if(path[index]=='/') break;
directory.append(path[index]);
index++;
}
return directory.toString();
}
}
*/
int main() {
Solution sol;
return 0;
}
| [
"zz2283@columbia.edu"
] | zz2283@columbia.edu |
7a9b6c90531d20934106e46944dc4c4b56c9c4be | b4393b82bcccc59e2b89636f1fde16d82f060736 | /src/utils/CachePruning.cpp | 8fb7a2dfd559f1e62d4b621a8ffa601d96148f2b | [] | no_license | phpmvc/polarphp | abb63ed491a0175aa43c873b1b39811f4eb070a2 | eb0b406e515dd550fd99b9383d4b2952fed0bfa9 | refs/heads/master | 2020-04-08T06:51:03.842159 | 2018-11-23T06:32:04 | 2018-11-23T06:32:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,967 | cpp | // This source file is part of the polarphp.org open source project
//
// Copyright (c) 2017 - 2018 polarphp software foundation
// Copyright (c) 2017 - 2018 zzu_softboy <zzu_softboy@163.com>
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://polarphp.org/LICENSE.txt for license information
// See http://polarphp.org/CONTRIBUTORS.txt for the list of polarphp project authors
//
// Created by softboy on 2018/07/03.
#include "polarphp/utils/CachePruning.h"
#include "polarphp/utils/Debug.h"
#include "polarphp/utils/ErrorCode.h"
#include "polarphp/utils/Error.h"
#include "polarphp/utils/FileSystem.h"
#include "polarphp/utils/Path.h"
#include "polarphp/utils/RawOutStream.h"
#include <set>
#include <system_error>
#define DEBUG_TYPE "cache-pruning"
namespace polar {
namespace utils {
namespace {
/// Write a new timestamp file with the given path. This is used for the pruning
/// interval option.
static void write_timestamp_file(StringRef timestampFile)
{
std::error_code errorCode;
RawFdOutStream outstream(timestampFile.getStr(), errorCode, polar::fs::F_None);
}
static Expected<std::chrono::seconds> parse_duration(StringRef duration)
{
if (duration.empty()) {
return make_error<StringError>("duration must not be empty",
inconvertible_error_code());
}
StringRef numStr = duration.slice(0, duration.getSize() - 1);
uint64_t num;
if (numStr.getAsInteger(0, num)) {
return make_error<StringError>("'" + numStr + "' not an integer",
inconvertible_error_code());
}
switch (duration.back()) {
case 's':
return std::chrono::seconds(num);
case 'm':
return std::chrono::minutes(num);
case 'h':
return std::chrono::hours(num);
default:
return make_error<StringError>("'" + duration +
"' must end with one of 's', 'm' or 'h'",
inconvertible_error_code());
}
}
} // anonymous namespace
Expected<CachePruningPolicy>
parse_cache_pruning_policy(StringRef policyStr)
{
CachePruningPolicy policy;
std::pair<StringRef, StringRef> pair = {"", policyStr};
while (!pair.second.empty()) {
pair = pair.second.split(':');
StringRef key, value;
std::tie(key, value) = pair.first.split('=');
if (key == "prune_interval") {
auto durationOrErr = parse_duration(value);
if (!durationOrErr) {
return durationOrErr.takeError();
}
policy.m_interval = *durationOrErr;
} else if (key == "prune_after") {
auto durationOrErr = parse_duration(value);
if (!durationOrErr)
return durationOrErr.takeError();
policy.m_expiration = *durationOrErr;
} else if (key == "cache_size") {
if (value.back() != '%') {
return make_error<StringError>("'" + value + "' must be a percentage",
inconvertible_error_code());
}
StringRef sizeStr = value.dropBack();
uint64_t size;
if (sizeStr.getAsInteger(0, size)) {
return make_error<StringError>("'" + sizeStr + "' not an integer",
inconvertible_error_code());
}
if (size > 100) {
return make_error<StringError>("'" + sizeStr +
"' must be between 0 and 100",
inconvertible_error_code());
}
policy.m_maxSizePercentageOfAvailableSpace = size;
} else if (key == "cache_size_bytes") {
uint64_t mult = 1;
switch (tolower(value.back())) {
case 'k':
mult = 1024;
value = value.dropBack();
break;
case 'm':
mult = 1024 * 1024;
value = value.dropBack();
break;
case 'g':
mult = 1024 * 1024 * 1024;
value = value.dropBack();
break;
}
uint64_t size;
if (value.getAsInteger(0, size)) {
return make_error<StringError>("'" + value + "' not an integer",
inconvertible_error_code());
}
policy.m_maxSizeBytes = size * mult;
} else if (key == "cache_size_files") {
if (value.getAsInteger(0, policy.m_maxSizeFiles)) {
return make_error<StringError>("'" + value + "' not an integer",
inconvertible_error_code());
}
} else {
return make_error<StringError>("Unknown key: '" + key + "'",
inconvertible_error_code());
}
}
return policy;
}
/// Prune the cache of files that haven't been accessed in a long time.
bool prune_cache(StringRef path, CachePruningPolicy policy)
{
using namespace std::chrono;
if (path.empty()) {
return false;
}
bool isPathDir;
if (polar::fs::is_directory(path, isPathDir)) {
return false;
}
if (!isPathDir) {
return false;
}
policy.m_maxSizePercentageOfAvailableSpace =
std::min(policy.m_maxSizePercentageOfAvailableSpace, 100u);
if (policy.m_expiration == seconds(0) &&
policy.m_maxSizePercentageOfAvailableSpace == 0 &&
policy.m_maxSizeBytes == 0 && policy.m_maxSizeFiles == 0) {
POLAR_DEBUG(debug_stream() << "No pruning settings set, exit early\n");
// Nothing will be pruned, early exit
return false;
}
// Try to stat() the timestamp file.
SmallString<128> timestampFile(path);
polar::fs::path::append(timestampFile, "llvmcache.timestamp");
polar::fs::FileStatus fileStatus;
const auto currentTime = system_clock::now();
if (auto errorCode = polar::fs::status(timestampFile, fileStatus)) {
if (errorCode == ErrorCode::no_such_file_or_directory) {
// If the timestamp file wasn't there, create one now.
write_timestamp_file(timestampFile);
} else {
// Unknown error?
return false;
}
} else {
if (!policy.m_interval) {
return false;
}
if (policy.m_interval != seconds(0)) {
// Check whether the time stamp is older than our pruning interval.
// If not, do nothing.
const auto timeStampModTime = fileStatus.getLastModificationTime();
auto timeStampAge = currentTime - timeStampModTime;
if (timeStampAge <= *policy.m_interval) {
POLAR_DEBUG(debug_stream() << "Timestamp file too recent ("
<< duration_cast<seconds>(timeStampAge).count()
<< "s old), do not prune.\n");
return false;
}
}
// Write a new timestamp file so that nobody else attempts to prune.
// There is a benign race condition here, if two processes happen to
// notice at the same time that the timestamp is out-of-date.
write_timestamp_file(timestampFile);
}
// Keep track of space. Needs to be kept ordered by size for determinism.
std::set<std::pair<uint64_t, std::string>> fileSizes;
uint64_t totalSize = 0;
// Walk the entire directory cache, looking for unused files.
std::error_code errorCode;
SmallString<128> cachePathNative;
polar::fs::path::native(path, cachePathNative);
// Walk all of the files within this directory.
for (polar::fs::DirectoryIterator file(cachePathNative, errorCode), fileEnd;
file != fileEnd && !errorCode; file.increment(errorCode)) {
// Ignore any files not beginning with the string "llvmcache-". This
// includes the timestamp file as well as any files created by the user.
// This acts as a safeguard against data loss if the user specifies the
// wrong directory as their cache directory.
if (!polar::fs::path::filename(file->getPath()).startsWith("polarcache-")) {
continue;
}
// Look at this file. If we can't stat it, there's nothing interesting
// there.
OptionalError<polar::fs::BasicFileStatus> statusOrErr = file->getStatus();
if (!statusOrErr) {
POLAR_DEBUG(debug_stream() << "Ignore " << file->getPath() << " (can't stat)\n");
continue;
}
// If the file hasn't been used recently enough, delete it
const auto fileAccessTime = statusOrErr->getLastAccessedTime();
auto fileAge = currentTime - fileAccessTime;
if (policy.m_expiration != seconds(0) && fileAge > policy.m_expiration) {
POLAR_DEBUG(debug_stream() << "Remove " << file->getPath() << " ("
<< duration_cast<seconds>(fileAge).count() << "s old)\n");
polar::fs::remove(file->getPath());
continue;
}
// Leave it here for now, but add it to the list of size-based pruning.
totalSize += statusOrErr->getSize();
fileSizes.insert({statusOrErr->getSize(), std::string(file->getPath())});
}
auto fileAndSize = fileSizes.rbegin();
size_t numFiles = fileSizes.size();
auto removeCacheFile = [&]() {
// Remove the file.
polar::fs::remove(fileAndSize->second);
// Update size
totalSize -= fileAndSize->first;
numFiles--;
POLAR_DEBUG(debug_stream() << " - Remove " << fileAndSize->second << " (size "
<< fileAndSize->first << "), new occupancy is " << totalSize
<< "%\n");
++fileAndSize;
};
// Prune for number of files.
if (policy.m_maxSizeFiles) {
while (numFiles > policy.m_maxSizeFiles) {
removeCacheFile();
}
}
// Prune for size now if needed
if (policy.m_maxSizePercentageOfAvailableSpace > 0 || policy.m_maxSizeBytes > 0) {
auto errOrSpaceInfo = polar::fs::disk_space(path);
if (!errOrSpaceInfo) {
report_fatal_error("Can't get available size");
}
polar::fs::SpaceInfo spaceInfo = errOrSpaceInfo.get();
auto availableSpace = totalSize + spaceInfo.free;
if (policy.m_maxSizePercentageOfAvailableSpace == 0) {
policy.m_maxSizePercentageOfAvailableSpace = 100;
}
if (policy.m_maxSizeBytes == 0) {
policy.m_maxSizeBytes = availableSpace;
}
auto totalSizeTarget = std::min<uint64_t>(
availableSpace * policy.m_maxSizePercentageOfAvailableSpace / 100ull,
policy.m_maxSizeBytes);
POLAR_DEBUG(debug_stream() << "Occupancy: " << ((100 * totalSize) / availableSpace)
<< "% target is: " << policy.m_maxSizePercentageOfAvailableSpace
<< "%, " << policy.m_maxSizeBytes << " bytes\n");
// Remove the oldest accessed files first, till we get below the threshold.
while (totalSize > totalSizeTarget && fileAndSize != fileSizes.rend()) {
removeCacheFile();
}
}
return true;
}
} // utils
} // polar
| [
"zzu_softboy@163.com"
] | zzu_softboy@163.com |
556ff3965761c160303403e217af3a8ed6d54eb3 | 70fccd06fd08b99208aef7375aee90b019ae5f3e | /test/example_add.cpp | 6291ad2b6d991a2c5cc836a6de407764f4dd41d5 | [
"BSD-3-Clause"
] | permissive | ENCCS/catch2-demo | ab4b116fc174a27486d246216a26ee7aad0f9945 | e7d08ae42148f937888d741e67a07b905d81d8b6 | refs/heads/main | 2023-03-07T23:53:16.820462 | 2021-02-23T08:34:55 | 2021-02-23T08:34:55 | 341,190,630 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 211 | cpp | #include <catch2/catch.hpp>
#include "example.h"
using namespace Catch::literals;
TEST_CASE("Use the example library to add numbers", "[add]") {
auto res = add_numbers(1.0, 2.0);
REQUIRE(res == 3.0_a);
}
| [
"roberto.diremigio@gmail.com"
] | roberto.diremigio@gmail.com |
b294a9f321fc937919b1c2801d269b7680764283 | 2786713e782199d177dafe6d4d23b524533cf9e4 | /Source code/ICMPPacket.cpp | eaa10c7b29c2715bfd93b33deaef5d09a71bf29b | [] | no_license | AgachilyPaul/Sniffer | d22187d15a34480a0935b31866bc259e1f71c4fe | 72619db385cc0307da6dc0ae388c7988d2e25f62 | refs/heads/master | 2023-01-07T20:05:41.476282 | 2020-11-06T12:24:07 | 2020-11-06T12:24:07 | 289,703,302 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 566 | cpp | // ICMPPacket.cpp: implementation of the CICMPPacket class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "CapturePacket.h"
#include "ICMPPacket.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CICMPPacket::CICMPPacket()
{
}
CICMPPacket::~CICMPPacket()
{
}
| [
"noreply@github.com"
] | AgachilyPaul.noreply@github.com |
2ef8ee7c55fe8df029aedf329a2c7c8971a88a41 | 553298299eed97e2c22835bb7c3912f5006c3c28 | /Common/Obj8/Global/PointsCounts.hpp | a9822f0e7af635e510464f9670f65e8ab0b2c1ab | [] | no_license | SchaichAlonso/StaticsMapping | 853d8f8bd6df0f02b755830902ba36199278d7f9 | 9b33139f853a45e3c1a3535d445e89ba6772f9e5 | refs/heads/master | 2022-11-03T03:09:14.964266 | 2022-10-19T17:02:10 | 2022-10-19T17:02:10 | 110,700,210 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 818 | hpp | #pragma once
#include <QtGlobal>
#include <Obj8/Parameter/Integer.hpp>
#include <Obj8/Record.hpp>
namespace Obj8
{
namespace Global
{
struct PointsCounts : Record
{
PointsCounts ();
PointsCounts (StringRef, Parser::LexerContext *);
virtual ~PointsCounts ();
virtual void accept (AbstractVisitor *, bool) Q_DECL_OVERRIDE;
virtual RecordPointer instantiate (StringRef, Parser::LexerContext *) const Q_DECL_OVERRIDE;
virtual String name () const Q_DECL_OVERRIDE;
virtual String toString () const Q_DECL_OVERRIDE;
int vertices () const;
int lineVertices () const;
int lights () const;
int indices () const;
protected:
Parameter::Integer m_tris, m_lines, m_lites, m_indices;
};
}
}
| [
"alonso.schaich@sodgeit.de"
] | alonso.schaich@sodgeit.de |
27ddddc27c5f312d5dd39660bdfcb8c77ab8a90e | 7961eefb240e487f29b179f90a13d1aa2b3f005f | /CheckCapital.cpp | a97049099d2e880d901b3387297a2c6d91d7d91d | [] | no_license | MamataParab/C-programming | f8ccaae993bbee8974d4cd245ff1d7b68a737e2a | 92daf15d65d6d89892cacad8579b479c105447af | refs/heads/master | 2020-05-03T03:37:02.610337 | 2019-04-27T10:17:48 | 2019-04-27T10:17:48 | 178,402,629 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 464 | cpp | #include<stdio.h>
#define TRUE 1
#define FALSE 0
typedef int BOOL;
BOOL ChkCapital(char ch)
{
if((ch>='A')&&(ch<='Z'))
{
return TRUE;
}
else
{
return FALSE;
}
}
int main()
{
char ch='\0';
BOOL Bret=TRUE;
printf("Enter a character\n");
scanf("%c",&ch);
Bret=ChkCapital(ch);
if(Bret==TRUE)
{
printf("It is a capital character\n");
}
else
{
printf("It is not a capital character\n");
}
return 0;
}
| [
"noreply@github.com"
] | MamataParab.noreply@github.com |
997e7eb87253f49ff5d5cedbbdd7d9fd9bb12ca5 | 98054c0fc0415cd7d7733ed63c69d1d25547b338 | /src/HTTP/HttpParserErrorCodes.cpp | 1ec7e8d415721ee5fc6658c29421149d29f0c3bf | [
"MIT"
] | permissive | freelacoin/freelabit | 18dc3f23f0671cb73d1df8a22baca43305549eae | f5a2fa5b9258e5e5688d3281e45503f14e0cb914 | refs/heads/freelabit | 2021-12-11T08:33:30.992223 | 2021-08-31T16:42:48 | 2021-08-31T16:42:48 | 102,800,887 | 3 | 6 | MIT | 2018-05-12T04:02:35 | 2017-09-08T01:01:08 | C++ | UTF-8 | C++ | false | false | 506 | cpp | // Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2014-2017 XDN developers
// Copyright (c) 2016-2017 BXC developers
// Copyright (c) 2017 Royalties developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "HttpParserErrorCodes.h"
namespace CryptoNote {
namespace error {
HttpParserErrorCategory HttpParserErrorCategory::INSTANCE;
} //namespace error
} //namespace CryptoNote
| [
"ericvesprini@yahoo.com"
] | ericvesprini@yahoo.com |
ed3d78b8f0700448ddcfa1dbdc7cf641a42b7a59 | 4060e2d9d840b23979530d88868f15de59fbaf2e | /src/epwing/library.h | c349db14506717539b8f68588e73d75df90be51a | [] | no_license | nellisdev/epwing-exporter | cc7c0d8231630d64ca4d84a8fdd6a6fea0627a40 | 694c9fee00ed1da6e3c69b2130c87951ae2f185f | refs/heads/master | 2023-07-13T15:32:07.235623 | 2021-08-16T14:48:16 | 2021-08-16T14:48:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 240 | h | #ifndef EPWING_EXPORTER_EPWING_LIBRARY_H
#define EPWING_EXPORTER_EPWING_LIBRARY_H
namespace epwing {
struct Library final {
Library() noexcept;
~Library() noexcept;
};
}
#endif // EPWING_EXPORTER_EPWING_LIBRARY_H
| [
"marc.szalkiewicz@gmail.com"
] | marc.szalkiewicz@gmail.com |
a8f5f9a279eb2edc89925a6aa421456d5f475487 | 0ad5d9520e4df29e3a9d700fb8a65bfd0c4da57f | /linux/algorithms/dsa/src/bintree/binnode_travinorder.h | 9cedfc22ca7b1ec27e8f16ea6ec9f914875ae109 | [] | no_license | joeysu33/codenotes | 5793330428348dc2ca022180cbf767d101bc705d | 5eb5296845aeeb8701741549b6d1fe718c323c48 | refs/heads/master | 2022-12-23T01:37:31.444324 | 2021-03-02T00:33:51 | 2021-03-02T00:33:51 | 115,995,226 | 0 | 0 | null | 2022-12-10T05:36:31 | 2018-01-02T08:56:44 | C++ | UTF-8 | C++ | false | false | 1,285 | h | /******************************************************************************************
* Data Structures in C++
* ISBN: 7-302-33064-6 & 7-302-33065-3 & 7-302-29652-2 & 7-302-26883-3
* Junhui DENG, deng@tsinghua.edu.cn
* Computer Science & Technology, Tsinghua University
* Copyright (c) 2006-2013. All rights reserved.
******************************************************************************************/
#pragma once
/*dsa*/#include "../stack/stack.h" //引入栈模板类
/*dsa*/#include "binnode_travinorder_r.h"
/*dsa*/#include "binnode_travinorder_i1.h"
/*dsa*/#include "binnode_travinorder_i2.h"
/*dsa*/#include "binnode_travinorder_i3.h"
/*dsa*/#include "binnode_travinorder_i4.h"
template <typename T> template <typename VST> //元素类型、操作器
void BinNode<T>::travIn ( VST& visit ) { //二叉树中序遍历算法统一入口
switch ( rand() % 5 ) { //此处暂随机选择以做测试,共五种选择
case 1: travIn_I1 ( this, visit ); break; //迭代版#1
case 2: travIn_I2 ( this, visit ); break; //迭代版#2
case 3: travIn_I3 ( this, visit ); break; //迭代版#3
case 4: travIn_I4 ( this, visit ); break; //迭代版#4
default: travIn_R ( this, visit ); break; //递归版
}
}
| [
"davidsu33@qq.com"
] | davidsu33@qq.com |
0c07da322b429edaf4e270493b9ef4b823077b1a | 5bcedc9c0b9c92f795cd04927bc1b752b8bbe6f3 | /gtkmm_examples/src/cairo_thin_lines/examplewindow.h | 0d9f4a961f6c4dc6e7e6e3d63437d925a0d4476b | [
"FSFAP"
] | permissive | hamedobaidy/gtkmm_eclipse_examples | 8d466523b8e680b3d77bf0026320321aa56a22e3 | 379c7b8e7640aef67ec189b10c54442251c2a2b8 | refs/heads/master | 2021-01-20T15:33:35.355311 | 2015-09-15T15:52:20 | 2015-09-15T15:52:20 | 38,481,378 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 524 | h | /*
* examplewindow.h
*
* Created on: Jul 3, 2015
* Author: hamed
*/
#ifndef EXAMPLEWINDOW_H_
#define EXAMPLEWINDOW_H_
#include <gtkmm/window.h>
#include <gtkmm/grid.h>
#include <gtkmm/checkbutton.h>
#include "myarea.h"
class ExampleWindow : public Gtk::Window
{
public:
ExampleWindow();
virtual ~ExampleWindow();
protected:
//Signal handlers:
void on_button_toggled();
private:
Gtk::Grid m_Container;
MyArea m_Area_Lines;
Gtk::CheckButton m_Button_FixLines;
};
#endif /* EXAMPLEWINDOW_H_ */
| [
"hamed.obaidy@gmail.com"
] | hamed.obaidy@gmail.com |
4d40d48f2c78ab0682ab60ce160549df3da8a5a7 | 01345e25f8a9987d13c8776611a62a9b60380481 | /potd-q7/Bar.cpp | e7d30c88ea6bd3c82fe1edfe43a98fb710099de3 | [] | no_license | wenhaoz2/cs225-potd | 4c655e3196c389e0484ac4feb2d9c168e9488feb | d3075969b3724308892ec32a3701824c600ec8d9 | refs/heads/master | 2020-07-29T06:55:53.536377 | 2019-01-02T17:01:27 | 2019-01-02T17:01:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 565 | cpp | // your code here
#include "Bar.h"
#include "Foo.h"
#include <string>
using namespace potd;
using namespace std;
Bar::Bar(string name) {
Foo * new_foo = new Foo(name);
this->f_ = new_foo;
}
Bar::Bar(const Bar & existing) {
string name = existing.f_->get_name();
Foo * new_foo = new Foo(name);
this->f_ = new_foo;
}
Bar::~Bar() {
delete(this->f_);
}
Bar & Bar::operator=(const Bar & right) {
delete(this->f_);
Foo * new_foo = new Foo(right.f_->get_name());
this->f_ = new_foo;
return *this;
}
string Bar::get_name() {
return this->f_->get_name();
}
| [
"marcharvey1470@gmail.com"
] | marcharvey1470@gmail.com |
951ff7945f9b512ae6ffa2e0dc5f52e40dae1918 | 875b7e7fe1aac12b927c5f7177862d29d945ef25 | /extern/pybind/include/pybind11/numpy.h | 119e4fc50f6eca6c7ba1efd12be56da332b7d425 | [
"MIT",
"BSD-3-Clause"
] | permissive | horizon-research/SPlisHSPlasH_with_time | ea8bceb100a10596b45c6bec517a0f13bb644dc5 | 147ada04d35e354f9cb01675834c1bd80e1b1d23 | refs/heads/master | 2023-04-24T09:14:21.936180 | 2021-05-10T22:31:29 | 2021-05-10T22:31:29 | 366,188,051 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 71,005 | h | /*
pybind11/numpy.h: Basic NumPy support, vectorize() wrapper
Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>
All rights reserved. Use of this source code is governed by a
BSD-style license that can be found in the LICENSE file.
*/
#pragma once
#include "pybind11.h"
#include "complex.h"
#include <numeric>
#include <algorithm>
#include <array>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <string>
#include <functional>
#include <type_traits>
#include <utility>
#include <vector>
#include <typeindex>
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4127) // warning C4127: Conditional expression is constant
#endif
/* This will be true on all flat address space platforms and allows us to reduce the
whole npy_intp / ssize_t / Py_intptr_t business down to just ssize_t for all size
and dimension types (e.g. shape, strides, indexing), instead of inflicting this
upon the library user. */
static_assert(sizeof(::pybind11::ssize_t) == sizeof(Py_intptr_t), "ssize_t != Py_intptr_t");
static_assert(std::is_signed<Py_intptr_t>::value, "Py_intptr_t must be signed");
// We now can reinterpret_cast between py::ssize_t and Py_intptr_t (MSVC + PyPy cares)
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
class array; // Forward declaration
PYBIND11_NAMESPACE_BEGIN(detail)
template <> struct handle_type_name<array> { static constexpr auto name = _("numpy.ndarray"); };
template <typename type, typename SFINAE = void> struct npy_format_descriptor;
struct PyArrayDescr_Proxy {
PyObject_HEAD
PyObject *typeobj;
char kind;
char type;
char byteorder;
char flags;
int type_num;
int elsize;
int alignment;
char *subarray;
PyObject *fields;
PyObject *names;
};
struct PyArray_Proxy {
PyObject_HEAD
char *data;
int nd;
ssize_t *dimensions;
ssize_t *strides;
PyObject *base;
PyObject *descr;
int flags;
};
struct PyVoidScalarObject_Proxy {
PyObject_VAR_HEAD
char *obval;
PyArrayDescr_Proxy *descr;
int flags;
PyObject *base;
};
struct numpy_type_info {
PyObject* dtype_ptr;
std::string format_str;
};
struct numpy_internals {
std::unordered_map<std::type_index, numpy_type_info> registered_dtypes;
numpy_type_info *get_type_info(const std::type_info& tinfo, bool throw_if_missing = true) {
auto it = registered_dtypes.find(std::type_index(tinfo));
if (it != registered_dtypes.end())
return &(it->second);
if (throw_if_missing)
pybind11_fail(std::string("NumPy type info missing for ") + tinfo.name());
return nullptr;
}
template<typename T> numpy_type_info *get_type_info(bool throw_if_missing = true) {
return get_type_info(typeid(typename std::remove_cv<T>::type), throw_if_missing);
}
};
inline PYBIND11_NOINLINE void load_numpy_internals(numpy_internals* &ptr) {
ptr = &get_or_create_shared_data<numpy_internals>("_numpy_internals");
}
inline numpy_internals& get_numpy_internals() {
static numpy_internals* ptr = nullptr;
if (!ptr)
load_numpy_internals(ptr);
return *ptr;
}
template <typename T> struct same_size {
template <typename U> using as = bool_constant<sizeof(T) == sizeof(U)>;
};
template <typename Concrete> constexpr int platform_lookup() { return -1; }
// Lookup a type according to its size, and return a value corresponding to the NumPy typenum.
template <typename Concrete, typename T, typename... Ts, typename... Ints>
constexpr int platform_lookup(int I, Ints... Is) {
return sizeof(Concrete) == sizeof(T) ? I : platform_lookup<Concrete, Ts...>(Is...);
}
struct npy_api {
enum constants {
NPY_ARRAY_C_CONTIGUOUS_ = 0x0001,
NPY_ARRAY_F_CONTIGUOUS_ = 0x0002,
NPY_ARRAY_OWNDATA_ = 0x0004,
NPY_ARRAY_FORCECAST_ = 0x0010,
NPY_ARRAY_ENSUREARRAY_ = 0x0040,
NPY_ARRAY_ALIGNED_ = 0x0100,
NPY_ARRAY_WRITEABLE_ = 0x0400,
NPY_BOOL_ = 0,
NPY_BYTE_, NPY_UBYTE_,
NPY_SHORT_, NPY_USHORT_,
NPY_INT_, NPY_UINT_,
NPY_LONG_, NPY_ULONG_,
NPY_LONGLONG_, NPY_ULONGLONG_,
NPY_FLOAT_, NPY_DOUBLE_, NPY_LONGDOUBLE_,
NPY_CFLOAT_, NPY_CDOUBLE_, NPY_CLONGDOUBLE_,
NPY_OBJECT_ = 17,
NPY_STRING_, NPY_UNICODE_, NPY_VOID_,
// Platform-dependent normalization
NPY_INT8_ = NPY_BYTE_,
NPY_UINT8_ = NPY_UBYTE_,
NPY_INT16_ = NPY_SHORT_,
NPY_UINT16_ = NPY_USHORT_,
// `npy_common.h` defines the integer aliases. In order, it checks:
// NPY_BITSOF_LONG, NPY_BITSOF_LONGLONG, NPY_BITSOF_INT, NPY_BITSOF_SHORT, NPY_BITSOF_CHAR
// and assigns the alias to the first matching size, so we should check in this order.
NPY_INT32_ = platform_lookup<std::int32_t, long, int, short>(
NPY_LONG_, NPY_INT_, NPY_SHORT_),
NPY_UINT32_ = platform_lookup<std::uint32_t, unsigned long, unsigned int, unsigned short>(
NPY_ULONG_, NPY_UINT_, NPY_USHORT_),
NPY_INT64_ = platform_lookup<std::int64_t, long, long long, int>(
NPY_LONG_, NPY_LONGLONG_, NPY_INT_),
NPY_UINT64_ = platform_lookup<std::uint64_t, unsigned long, unsigned long long, unsigned int>(
NPY_ULONG_, NPY_ULONGLONG_, NPY_UINT_),
};
typedef struct {
Py_intptr_t *ptr;
int len;
} PyArray_Dims;
static npy_api& get() {
static npy_api api = lookup();
return api;
}
bool PyArray_Check_(PyObject *obj) const {
return (bool) PyObject_TypeCheck(obj, PyArray_Type_);
}
bool PyArrayDescr_Check_(PyObject *obj) const {
return (bool) PyObject_TypeCheck(obj, PyArrayDescr_Type_);
}
unsigned int (*PyArray_GetNDArrayCFeatureVersion_)();
PyObject *(*PyArray_DescrFromType_)(int);
PyObject *(*PyArray_NewFromDescr_)
(PyTypeObject *, PyObject *, int, Py_intptr_t const *,
Py_intptr_t const *, void *, int, PyObject *);
// Unused. Not removed because that affects ABI of the class.
PyObject *(*PyArray_DescrNewFromType_)(int);
int (*PyArray_CopyInto_)(PyObject *, PyObject *);
PyObject *(*PyArray_NewCopy_)(PyObject *, int);
PyTypeObject *PyArray_Type_;
PyTypeObject *PyVoidArrType_Type_;
PyTypeObject *PyArrayDescr_Type_;
PyObject *(*PyArray_DescrFromScalar_)(PyObject *);
PyObject *(*PyArray_FromAny_) (PyObject *, PyObject *, int, int, int, PyObject *);
int (*PyArray_DescrConverter_) (PyObject *, PyObject **);
bool (*PyArray_EquivTypes_) (PyObject *, PyObject *);
int (*PyArray_GetArrayParamsFromObject_)(PyObject *, PyObject *, unsigned char, PyObject **, int *,
Py_intptr_t *, PyObject **, PyObject *);
PyObject *(*PyArray_Squeeze_)(PyObject *);
// Unused. Not removed because that affects ABI of the class.
int (*PyArray_SetBaseObject_)(PyObject *, PyObject *);
PyObject* (*PyArray_Resize_)(PyObject*, PyArray_Dims*, int, int);
private:
enum functions {
API_PyArray_GetNDArrayCFeatureVersion = 211,
API_PyArray_Type = 2,
API_PyArrayDescr_Type = 3,
API_PyVoidArrType_Type = 39,
API_PyArray_DescrFromType = 45,
API_PyArray_DescrFromScalar = 57,
API_PyArray_FromAny = 69,
API_PyArray_Resize = 80,
API_PyArray_CopyInto = 82,
API_PyArray_NewCopy = 85,
API_PyArray_NewFromDescr = 94,
API_PyArray_DescrNewFromType = 96,
API_PyArray_DescrConverter = 174,
API_PyArray_EquivTypes = 182,
API_PyArray_GetArrayParamsFromObject = 278,
API_PyArray_Squeeze = 136,
API_PyArray_SetBaseObject = 282
};
static npy_api lookup() {
module_ m = module_::import("numpy.core.multiarray");
auto c = m.attr("_ARRAY_API");
#if PY_MAJOR_VERSION >= 3
void **api_ptr = (void **) PyCapsule_GetPointer(c.ptr(), NULL);
#else
void **api_ptr = (void **) PyCObject_AsVoidPtr(c.ptr());
#endif
npy_api api;
#define DECL_NPY_API(Func) api.Func##_ = (decltype(api.Func##_)) api_ptr[API_##Func];
DECL_NPY_API(PyArray_GetNDArrayCFeatureVersion);
if (api.PyArray_GetNDArrayCFeatureVersion_() < 0x7)
pybind11_fail("pybind11 numpy support requires numpy >= 1.7.0");
DECL_NPY_API(PyArray_Type);
DECL_NPY_API(PyVoidArrType_Type);
DECL_NPY_API(PyArrayDescr_Type);
DECL_NPY_API(PyArray_DescrFromType);
DECL_NPY_API(PyArray_DescrFromScalar);
DECL_NPY_API(PyArray_FromAny);
DECL_NPY_API(PyArray_Resize);
DECL_NPY_API(PyArray_CopyInto);
DECL_NPY_API(PyArray_NewCopy);
DECL_NPY_API(PyArray_NewFromDescr);
DECL_NPY_API(PyArray_DescrNewFromType);
DECL_NPY_API(PyArray_DescrConverter);
DECL_NPY_API(PyArray_EquivTypes);
DECL_NPY_API(PyArray_GetArrayParamsFromObject);
DECL_NPY_API(PyArray_Squeeze);
DECL_NPY_API(PyArray_SetBaseObject);
#undef DECL_NPY_API
return api;
}
};
inline PyArray_Proxy* array_proxy(void* ptr) {
return reinterpret_cast<PyArray_Proxy*>(ptr);
}
inline const PyArray_Proxy* array_proxy(const void* ptr) {
return reinterpret_cast<const PyArray_Proxy*>(ptr);
}
inline PyArrayDescr_Proxy* array_descriptor_proxy(PyObject* ptr) {
return reinterpret_cast<PyArrayDescr_Proxy*>(ptr);
}
inline const PyArrayDescr_Proxy* array_descriptor_proxy(const PyObject* ptr) {
return reinterpret_cast<const PyArrayDescr_Proxy*>(ptr);
}
inline bool check_flags(const void* ptr, int flag) {
return (flag == (array_proxy(ptr)->flags & flag));
}
template <typename T> struct is_std_array : std::false_type { };
template <typename T, size_t N> struct is_std_array<std::array<T, N>> : std::true_type { };
template <typename T> struct is_complex : std::false_type { };
template <typename T> struct is_complex<std::complex<T>> : std::true_type { };
template <typename T> struct array_info_scalar {
using type = T;
static constexpr bool is_array = false;
static constexpr bool is_empty = false;
static constexpr auto extents = _("");
static void append_extents(list& /* shape */) { }
};
// Computes underlying type and a comma-separated list of extents for array
// types (any mix of std::array and built-in arrays). An array of char is
// treated as scalar because it gets special handling.
template <typename T> struct array_info : array_info_scalar<T> { };
template <typename T, size_t N> struct array_info<std::array<T, N>> {
using type = typename array_info<T>::type;
static constexpr bool is_array = true;
static constexpr bool is_empty = (N == 0) || array_info<T>::is_empty;
static constexpr size_t extent = N;
// appends the extents to shape
static void append_extents(list& shape) {
shape.append(N);
array_info<T>::append_extents(shape);
}
static constexpr auto extents = _<array_info<T>::is_array>(
concat(_<N>(), array_info<T>::extents), _<N>()
);
};
// For numpy we have special handling for arrays of characters, so we don't include
// the size in the array extents.
template <size_t N> struct array_info<char[N]> : array_info_scalar<char[N]> { };
template <size_t N> struct array_info<std::array<char, N>> : array_info_scalar<std::array<char, N>> { };
template <typename T, size_t N> struct array_info<T[N]> : array_info<std::array<T, N>> { };
template <typename T> using remove_all_extents_t = typename array_info<T>::type;
template <typename T> using is_pod_struct = all_of<
std::is_standard_layout<T>, // since we're accessing directly in memory we need a standard layout type
#if !defined(__GNUG__) || defined(_LIBCPP_VERSION) || defined(_GLIBCXX_USE_CXX11_ABI)
// _GLIBCXX_USE_CXX11_ABI indicates that we're using libstdc++ from GCC 5 or newer, independent
// of the actual compiler (Clang can also use libstdc++, but it always defines __GNUC__ == 4).
std::is_trivially_copyable<T>,
#else
// GCC 4 doesn't implement is_trivially_copyable, so approximate it
std::is_trivially_destructible<T>,
satisfies_any_of<T, std::has_trivial_copy_constructor, std::has_trivial_copy_assign>,
#endif
satisfies_none_of<T, std::is_reference, std::is_array, is_std_array, std::is_arithmetic, is_complex, std::is_enum>
>;
// Replacement for std::is_pod (deprecated in C++20)
template <typename T> using is_pod = all_of<
std::is_standard_layout<T>,
std::is_trivial<T>
>;
template <ssize_t Dim = 0, typename Strides> ssize_t byte_offset_unsafe(const Strides &) { return 0; }
template <ssize_t Dim = 0, typename Strides, typename... Ix>
ssize_t byte_offset_unsafe(const Strides &strides, ssize_t i, Ix... index) {
return i * strides[Dim] + byte_offset_unsafe<Dim + 1>(strides, index...);
}
/**
* Proxy class providing unsafe, unchecked const access to array data. This is constructed through
* the `unchecked<T, N>()` method of `array` or the `unchecked<N>()` method of `array_t<T>`. `Dims`
* will be -1 for dimensions determined at runtime.
*/
template <typename T, ssize_t Dims>
class unchecked_reference {
protected:
static constexpr bool Dynamic = Dims < 0;
const unsigned char *data_;
// Storing the shape & strides in local variables (i.e. these arrays) allows the compiler to
// make large performance gains on big, nested loops, but requires compile-time dimensions
conditional_t<Dynamic, const ssize_t *, std::array<ssize_t, (size_t) Dims>>
shape_, strides_;
const ssize_t dims_;
friend class pybind11::array;
// Constructor for compile-time dimensions:
template <bool Dyn = Dynamic>
unchecked_reference(const void *data, const ssize_t *shape, const ssize_t *strides, enable_if_t<!Dyn, ssize_t>)
: data_{reinterpret_cast<const unsigned char *>(data)}, dims_{Dims} {
for (size_t i = 0; i < (size_t) dims_; i++) {
shape_[i] = shape[i];
strides_[i] = strides[i];
}
}
// Constructor for runtime dimensions:
template <bool Dyn = Dynamic>
unchecked_reference(const void *data, const ssize_t *shape, const ssize_t *strides, enable_if_t<Dyn, ssize_t> dims)
: data_{reinterpret_cast<const unsigned char *>(data)}, shape_{shape}, strides_{strides}, dims_{dims} {}
public:
/**
* Unchecked const reference access to data at the given indices. For a compile-time known
* number of dimensions, this requires the correct number of arguments; for run-time
* dimensionality, this is not checked (and so is up to the caller to use safely).
*/
template <typename... Ix> const T &operator()(Ix... index) const {
static_assert(ssize_t{sizeof...(Ix)} == Dims || Dynamic,
"Invalid number of indices for unchecked array reference");
return *reinterpret_cast<const T *>(data_ + byte_offset_unsafe(strides_, ssize_t(index)...));
}
/**
* Unchecked const reference access to data; this operator only participates if the reference
* is to a 1-dimensional array. When present, this is exactly equivalent to `obj(index)`.
*/
template <ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>
const T &operator[](ssize_t index) const { return operator()(index); }
/// Pointer access to the data at the given indices.
template <typename... Ix> const T *data(Ix... ix) const { return &operator()(ssize_t(ix)...); }
/// Returns the item size, i.e. sizeof(T)
constexpr static ssize_t itemsize() { return sizeof(T); }
/// Returns the shape (i.e. size) of dimension `dim`
ssize_t shape(ssize_t dim) const { return shape_[(size_t) dim]; }
/// Returns the number of dimensions of the array
ssize_t ndim() const { return dims_; }
/// Returns the total number of elements in the referenced array, i.e. the product of the shapes
template <bool Dyn = Dynamic>
enable_if_t<!Dyn, ssize_t> size() const {
return std::accumulate(shape_.begin(), shape_.end(), (ssize_t) 1, std::multiplies<ssize_t>());
}
template <bool Dyn = Dynamic>
enable_if_t<Dyn, ssize_t> size() const {
return std::accumulate(shape_, shape_ + ndim(), (ssize_t) 1, std::multiplies<ssize_t>());
}
/// Returns the total number of bytes used by the referenced data. Note that the actual span in
/// memory may be larger if the referenced array has non-contiguous strides (e.g. for a slice).
ssize_t nbytes() const {
return size() * itemsize();
}
};
template <typename T, ssize_t Dims>
class unchecked_mutable_reference : public unchecked_reference<T, Dims> {
friend class pybind11::array;
using ConstBase = unchecked_reference<T, Dims>;
using ConstBase::ConstBase;
using ConstBase::Dynamic;
public:
// Bring in const-qualified versions from base class
using ConstBase::operator();
using ConstBase::operator[];
/// Mutable, unchecked access to data at the given indices.
template <typename... Ix> T& operator()(Ix... index) {
static_assert(ssize_t{sizeof...(Ix)} == Dims || Dynamic,
"Invalid number of indices for unchecked array reference");
return const_cast<T &>(ConstBase::operator()(index...));
}
/**
* Mutable, unchecked access data at the given index; this operator only participates if the
* reference is to a 1-dimensional array (or has runtime dimensions). When present, this is
* exactly equivalent to `obj(index)`.
*/
template <ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>
T &operator[](ssize_t index) { return operator()(index); }
/// Mutable pointer access to the data at the given indices.
template <typename... Ix> T *mutable_data(Ix... ix) { return &operator()(ssize_t(ix)...); }
};
template <typename T, ssize_t Dim>
struct type_caster<unchecked_reference<T, Dim>> {
static_assert(Dim == 0 && Dim > 0 /* always fail */, "unchecked array proxy object is not castable");
};
template <typename T, ssize_t Dim>
struct type_caster<unchecked_mutable_reference<T, Dim>> : type_caster<unchecked_reference<T, Dim>> {};
PYBIND11_NAMESPACE_END(detail)
class dtype : public object {
public:
PYBIND11_OBJECT_DEFAULT(dtype, object, detail::npy_api::get().PyArrayDescr_Check_);
explicit dtype(const buffer_info &info) {
dtype descr(_dtype_from_pep3118()(PYBIND11_STR_TYPE(info.format)));
// If info.itemsize == 0, use the value calculated from the format string
m_ptr = descr.strip_padding(info.itemsize ? info.itemsize : descr.itemsize()).release().ptr();
}
explicit dtype(const std::string &format) {
m_ptr = from_args(pybind11::str(format)).release().ptr();
}
dtype(const char *format) : dtype(std::string(format)) { }
dtype(list names, list formats, list offsets, ssize_t itemsize) {
dict args;
args["names"] = names;
args["formats"] = formats;
args["offsets"] = offsets;
args["itemsize"] = pybind11::int_(itemsize);
m_ptr = from_args(args).release().ptr();
}
/// This is essentially the same as calling numpy.dtype(args) in Python.
static dtype from_args(object args) {
PyObject *ptr = nullptr;
if (!detail::npy_api::get().PyArray_DescrConverter_(args.ptr(), &ptr) || !ptr)
throw error_already_set();
return reinterpret_steal<dtype>(ptr);
}
/// Return dtype associated with a C++ type.
template <typename T> static dtype of() {
return detail::npy_format_descriptor<typename std::remove_cv<T>::type>::dtype();
}
/// Size of the data type in bytes.
ssize_t itemsize() const {
return detail::array_descriptor_proxy(m_ptr)->elsize;
}
/// Returns true for structured data types.
bool has_fields() const {
return detail::array_descriptor_proxy(m_ptr)->names != nullptr;
}
/// Single-character type code.
char kind() const {
return detail::array_descriptor_proxy(m_ptr)->kind;
}
private:
static object _dtype_from_pep3118() {
static PyObject *obj = module_::import("numpy.core._internal")
.attr("_dtype_from_pep3118").cast<object>().release().ptr();
return reinterpret_borrow<object>(obj);
}
dtype strip_padding(ssize_t itemsize) {
// Recursively strip all void fields with empty names that are generated for
// padding fields (as of NumPy v1.11).
if (!has_fields())
return *this;
struct field_descr { PYBIND11_STR_TYPE name; object format; pybind11::int_ offset; };
std::vector<field_descr> field_descriptors;
for (auto field : attr("fields").attr("items")()) {
auto spec = field.cast<tuple>();
auto name = spec[0].cast<pybind11::str>();
auto format = spec[1].cast<tuple>()[0].cast<dtype>();
auto offset = spec[1].cast<tuple>()[1].cast<pybind11::int_>();
if (!len(name) && format.kind() == 'V')
continue;
field_descriptors.push_back({(PYBIND11_STR_TYPE) name, format.strip_padding(format.itemsize()), offset});
}
std::sort(field_descriptors.begin(), field_descriptors.end(),
[](const field_descr& a, const field_descr& b) {
return a.offset.cast<int>() < b.offset.cast<int>();
});
list names, formats, offsets;
for (auto& descr : field_descriptors) {
names.append(descr.name);
formats.append(descr.format);
offsets.append(descr.offset);
}
return dtype(names, formats, offsets, itemsize);
}
};
class array : public buffer {
public:
PYBIND11_OBJECT_CVT(array, buffer, detail::npy_api::get().PyArray_Check_, raw_array)
enum {
c_style = detail::npy_api::NPY_ARRAY_C_CONTIGUOUS_,
f_style = detail::npy_api::NPY_ARRAY_F_CONTIGUOUS_,
forcecast = detail::npy_api::NPY_ARRAY_FORCECAST_
};
array() : array(0, static_cast<const double *>(nullptr)) {}
using ShapeContainer = detail::any_container<ssize_t>;
using StridesContainer = detail::any_container<ssize_t>;
// Constructs an array taking shape/strides from arbitrary container types
array(const pybind11::dtype &dt, ShapeContainer shape, StridesContainer strides,
const void *ptr = nullptr, handle base = handle()) {
if (strides->empty())
*strides = detail::c_strides(*shape, dt.itemsize());
auto ndim = shape->size();
if (ndim != strides->size())
pybind11_fail("NumPy: shape ndim doesn't match strides ndim");
auto descr = dt;
int flags = 0;
if (base && ptr) {
if (isinstance<array>(base))
/* Copy flags from base (except ownership bit) */
flags = reinterpret_borrow<array>(base).flags() & ~detail::npy_api::NPY_ARRAY_OWNDATA_;
else
/* Writable by default, easy to downgrade later on if needed */
flags = detail::npy_api::NPY_ARRAY_WRITEABLE_;
}
auto &api = detail::npy_api::get();
auto tmp = reinterpret_steal<object>(api.PyArray_NewFromDescr_(
api.PyArray_Type_, descr.release().ptr(), (int) ndim,
// Use reinterpret_cast for PyPy on Windows (remove if fixed, checked on 7.3.1)
reinterpret_cast<Py_intptr_t*>(shape->data()),
reinterpret_cast<Py_intptr_t*>(strides->data()),
const_cast<void *>(ptr), flags, nullptr));
if (!tmp)
throw error_already_set();
if (ptr) {
if (base) {
api.PyArray_SetBaseObject_(tmp.ptr(), base.inc_ref().ptr());
} else {
tmp = reinterpret_steal<object>(api.PyArray_NewCopy_(tmp.ptr(), -1 /* any order */));
}
}
m_ptr = tmp.release().ptr();
}
array(const pybind11::dtype &dt, ShapeContainer shape, const void *ptr = nullptr, handle base = handle())
: array(dt, std::move(shape), {}, ptr, base) { }
template <typename T, typename = detail::enable_if_t<std::is_integral<T>::value && !std::is_same<bool, T>::value>>
array(const pybind11::dtype &dt, T count, const void *ptr = nullptr, handle base = handle())
: array(dt, {{count}}, ptr, base) { }
template <typename T>
array(ShapeContainer shape, StridesContainer strides, const T *ptr, handle base = handle())
: array(pybind11::dtype::of<T>(), std::move(shape), std::move(strides), ptr, base) { }
template <typename T>
array(ShapeContainer shape, const T *ptr, handle base = handle())
: array(std::move(shape), {}, ptr, base) { }
template <typename T>
explicit array(ssize_t count, const T *ptr, handle base = handle()) : array({count}, {}, ptr, base) { }
explicit array(const buffer_info &info, handle base = handle())
: array(pybind11::dtype(info), info.shape, info.strides, info.ptr, base) { }
/// Array descriptor (dtype)
pybind11::dtype dtype() const {
return reinterpret_borrow<pybind11::dtype>(detail::array_proxy(m_ptr)->descr);
}
/// Total number of elements
ssize_t size() const {
return std::accumulate(shape(), shape() + ndim(), (ssize_t) 1, std::multiplies<ssize_t>());
}
/// Byte size of a single element
ssize_t itemsize() const {
return detail::array_descriptor_proxy(detail::array_proxy(m_ptr)->descr)->elsize;
}
/// Total number of bytes
ssize_t nbytes() const {
return size() * itemsize();
}
/// Number of dimensions
ssize_t ndim() const {
return detail::array_proxy(m_ptr)->nd;
}
/// Base object
object base() const {
return reinterpret_borrow<object>(detail::array_proxy(m_ptr)->base);
}
/// Dimensions of the array
const ssize_t* shape() const {
return detail::array_proxy(m_ptr)->dimensions;
}
/// Dimension along a given axis
ssize_t shape(ssize_t dim) const {
if (dim >= ndim())
fail_dim_check(dim, "invalid axis");
return shape()[dim];
}
/// Strides of the array
const ssize_t* strides() const {
return detail::array_proxy(m_ptr)->strides;
}
/// Stride along a given axis
ssize_t strides(ssize_t dim) const {
if (dim >= ndim())
fail_dim_check(dim, "invalid axis");
return strides()[dim];
}
/// Return the NumPy array flags
int flags() const {
return detail::array_proxy(m_ptr)->flags;
}
/// If set, the array is writeable (otherwise the buffer is read-only)
bool writeable() const {
return detail::check_flags(m_ptr, detail::npy_api::NPY_ARRAY_WRITEABLE_);
}
/// If set, the array owns the data (will be freed when the array is deleted)
bool owndata() const {
return detail::check_flags(m_ptr, detail::npy_api::NPY_ARRAY_OWNDATA_);
}
/// Pointer to the contained data. If index is not provided, points to the
/// beginning of the buffer. May throw if the index would lead to out of bounds access.
template<typename... Ix> const void* data(Ix... index) const {
return static_cast<const void *>(detail::array_proxy(m_ptr)->data + offset_at(index...));
}
/// Mutable pointer to the contained data. If index is not provided, points to the
/// beginning of the buffer. May throw if the index would lead to out of bounds access.
/// May throw if the array is not writeable.
template<typename... Ix> void* mutable_data(Ix... index) {
check_writeable();
return static_cast<void *>(detail::array_proxy(m_ptr)->data + offset_at(index...));
}
/// Byte offset from beginning of the array to a given index (full or partial).
/// May throw if the index would lead to out of bounds access.
template<typename... Ix> ssize_t offset_at(Ix... index) const {
if ((ssize_t) sizeof...(index) > ndim())
fail_dim_check(sizeof...(index), "too many indices for an array");
return byte_offset(ssize_t(index)...);
}
ssize_t offset_at() const { return 0; }
/// Item count from beginning of the array to a given index (full or partial).
/// May throw if the index would lead to out of bounds access.
template<typename... Ix> ssize_t index_at(Ix... index) const {
return offset_at(index...) / itemsize();
}
/**
* Returns a proxy object that provides access to the array's data without bounds or
* dimensionality checking. Will throw if the array is missing the `writeable` flag. Use with
* care: the array must not be destroyed or reshaped for the duration of the returned object,
* and the caller must take care not to access invalid dimensions or dimension indices.
*/
template <typename T, ssize_t Dims = -1> detail::unchecked_mutable_reference<T, Dims> mutable_unchecked() & {
if (Dims >= 0 && ndim() != Dims)
throw std::domain_error("array has incorrect number of dimensions: " + std::to_string(ndim()) +
"; expected " + std::to_string(Dims));
return detail::unchecked_mutable_reference<T, Dims>(mutable_data(), shape(), strides(), ndim());
}
/**
* Returns a proxy object that provides const access to the array's data without bounds or
* dimensionality checking. Unlike `mutable_unchecked()`, this does not require that the
* underlying array have the `writable` flag. Use with care: the array must not be destroyed or
* reshaped for the duration of the returned object, and the caller must take care not to access
* invalid dimensions or dimension indices.
*/
template <typename T, ssize_t Dims = -1> detail::unchecked_reference<T, Dims> unchecked() const & {
if (Dims >= 0 && ndim() != Dims)
throw std::domain_error("array has incorrect number of dimensions: " + std::to_string(ndim()) +
"; expected " + std::to_string(Dims));
return detail::unchecked_reference<T, Dims>(data(), shape(), strides(), ndim());
}
/// Return a new view with all of the dimensions of length 1 removed
array squeeze() {
auto& api = detail::npy_api::get();
return reinterpret_steal<array>(api.PyArray_Squeeze_(m_ptr));
}
/// Resize array to given shape
/// If refcheck is true and more that one reference exist to this array
/// then resize will succeed only if it makes a reshape, i.e. original size doesn't change
void resize(ShapeContainer new_shape, bool refcheck = true) {
detail::npy_api::PyArray_Dims d = {
// Use reinterpret_cast for PyPy on Windows (remove if fixed, checked on 7.3.1)
reinterpret_cast<Py_intptr_t*>(new_shape->data()),
int(new_shape->size())
};
// try to resize, set ordering param to -1 cause it's not used anyway
object new_array = reinterpret_steal<object>(
detail::npy_api::get().PyArray_Resize_(m_ptr, &d, int(refcheck), -1)
);
if (!new_array) throw error_already_set();
if (isinstance<array>(new_array)) { *this = std::move(new_array); }
}
/// Ensure that the argument is a NumPy array
/// In case of an error, nullptr is returned and the Python error is cleared.
static array ensure(handle h, int ExtraFlags = 0) {
auto result = reinterpret_steal<array>(raw_array(h.ptr(), ExtraFlags));
if (!result)
PyErr_Clear();
return result;
}
protected:
template<typename, typename> friend struct detail::npy_format_descriptor;
void fail_dim_check(ssize_t dim, const std::string& msg) const {
throw index_error(msg + ": " + std::to_string(dim) +
" (ndim = " + std::to_string(ndim()) + ")");
}
template<typename... Ix> ssize_t byte_offset(Ix... index) const {
check_dimensions(index...);
return detail::byte_offset_unsafe(strides(), ssize_t(index)...);
}
void check_writeable() const {
if (!writeable())
throw std::domain_error("array is not writeable");
}
template<typename... Ix> void check_dimensions(Ix... index) const {
check_dimensions_impl(ssize_t(0), shape(), ssize_t(index)...);
}
void check_dimensions_impl(ssize_t, const ssize_t*) const { }
template<typename... Ix> void check_dimensions_impl(ssize_t axis, const ssize_t* shape, ssize_t i, Ix... index) const {
if (i >= *shape) {
throw index_error(std::string("index ") + std::to_string(i) +
" is out of bounds for axis " + std::to_string(axis) +
" with size " + std::to_string(*shape));
}
check_dimensions_impl(axis + 1, shape + 1, index...);
}
/// Create array from any object -- always returns a new reference
static PyObject *raw_array(PyObject *ptr, int ExtraFlags = 0) {
if (ptr == nullptr) {
PyErr_SetString(PyExc_ValueError, "cannot create a pybind11::array from a nullptr");
return nullptr;
}
return detail::npy_api::get().PyArray_FromAny_(
ptr, nullptr, 0, 0, detail::npy_api::NPY_ARRAY_ENSUREARRAY_ | ExtraFlags, nullptr);
}
};
template <typename T, int ExtraFlags = array::forcecast> class array_t : public array {
private:
struct private_ctor {};
// Delegating constructor needed when both moving and accessing in the same constructor
array_t(private_ctor, ShapeContainer &&shape, StridesContainer &&strides, const T *ptr, handle base)
: array(std::move(shape), std::move(strides), ptr, base) {}
public:
static_assert(!detail::array_info<T>::is_array, "Array types cannot be used with array_t");
using value_type = T;
array_t() : array(0, static_cast<const T *>(nullptr)) {}
array_t(handle h, borrowed_t) : array(h, borrowed_t{}) { }
array_t(handle h, stolen_t) : array(h, stolen_t{}) { }
PYBIND11_DEPRECATED("Use array_t<T>::ensure() instead")
array_t(handle h, bool is_borrowed) : array(raw_array_t(h.ptr()), stolen_t{}) {
if (!m_ptr) PyErr_Clear();
if (!is_borrowed) Py_XDECREF(h.ptr());
}
array_t(const object &o) : array(raw_array_t(o.ptr()), stolen_t{}) {
if (!m_ptr) throw error_already_set();
}
explicit array_t(const buffer_info& info, handle base = handle()) : array(info, base) { }
array_t(ShapeContainer shape, StridesContainer strides, const T *ptr = nullptr, handle base = handle())
: array(std::move(shape), std::move(strides), ptr, base) { }
explicit array_t(ShapeContainer shape, const T *ptr = nullptr, handle base = handle())
: array_t(private_ctor{}, std::move(shape),
ExtraFlags & f_style
? detail::f_strides(*shape, itemsize())
: detail::c_strides(*shape, itemsize()),
ptr, base) { }
explicit array_t(ssize_t count, const T *ptr = nullptr, handle base = handle())
: array({count}, {}, ptr, base) { }
constexpr ssize_t itemsize() const {
return sizeof(T);
}
template<typename... Ix> ssize_t index_at(Ix... index) const {
return offset_at(index...) / itemsize();
}
template<typename... Ix> const T* data(Ix... index) const {
return static_cast<const T*>(array::data(index...));
}
template<typename... Ix> T* mutable_data(Ix... index) {
return static_cast<T*>(array::mutable_data(index...));
}
// Reference to element at a given index
template<typename... Ix> const T& at(Ix... index) const {
if ((ssize_t) sizeof...(index) != ndim())
fail_dim_check(sizeof...(index), "index dimension mismatch");
return *(static_cast<const T*>(array::data()) + byte_offset(ssize_t(index)...) / itemsize());
}
// Mutable reference to element at a given index
template<typename... Ix> T& mutable_at(Ix... index) {
if ((ssize_t) sizeof...(index) != ndim())
fail_dim_check(sizeof...(index), "index dimension mismatch");
return *(static_cast<T*>(array::mutable_data()) + byte_offset(ssize_t(index)...) / itemsize());
}
/**
* Returns a proxy object that provides access to the array's data without bounds or
* dimensionality checking. Will throw if the array is missing the `writeable` flag. Use with
* care: the array must not be destroyed or reshaped for the duration of the returned object,
* and the caller must take care not to access invalid dimensions or dimension indices.
*/
template <ssize_t Dims = -1> detail::unchecked_mutable_reference<T, Dims> mutable_unchecked() & {
return array::mutable_unchecked<T, Dims>();
}
/**
* Returns a proxy object that provides const access to the array's data without bounds or
* dimensionality checking. Unlike `unchecked()`, this does not require that the underlying
* array have the `writable` flag. Use with care: the array must not be destroyed or reshaped
* for the duration of the returned object, and the caller must take care not to access invalid
* dimensions or dimension indices.
*/
template <ssize_t Dims = -1> detail::unchecked_reference<T, Dims> unchecked() const & {
return array::unchecked<T, Dims>();
}
/// Ensure that the argument is a NumPy array of the correct dtype (and if not, try to convert
/// it). In case of an error, nullptr is returned and the Python error is cleared.
static array_t ensure(handle h) {
auto result = reinterpret_steal<array_t>(raw_array_t(h.ptr()));
if (!result)
PyErr_Clear();
return result;
}
static bool check_(handle h) {
const auto &api = detail::npy_api::get();
return api.PyArray_Check_(h.ptr())
&& api.PyArray_EquivTypes_(detail::array_proxy(h.ptr())->descr, dtype::of<T>().ptr())
&& detail::check_flags(h.ptr(), ExtraFlags & (array::c_style | array::f_style));
}
protected:
/// Create array from any object -- always returns a new reference
static PyObject *raw_array_t(PyObject *ptr) {
if (ptr == nullptr) {
PyErr_SetString(PyExc_ValueError, "cannot create a pybind11::array_t from a nullptr");
return nullptr;
}
return detail::npy_api::get().PyArray_FromAny_(
ptr, dtype::of<T>().release().ptr(), 0, 0,
detail::npy_api::NPY_ARRAY_ENSUREARRAY_ | ExtraFlags, nullptr);
}
};
template <typename T>
struct format_descriptor<T, detail::enable_if_t<detail::is_pod_struct<T>::value>> {
static std::string format() {
return detail::npy_format_descriptor<typename std::remove_cv<T>::type>::format();
}
};
template <size_t N> struct format_descriptor<char[N]> {
static std::string format() { return std::to_string(N) + "s"; }
};
template <size_t N> struct format_descriptor<std::array<char, N>> {
static std::string format() { return std::to_string(N) + "s"; }
};
template <typename T>
struct format_descriptor<T, detail::enable_if_t<std::is_enum<T>::value>> {
static std::string format() {
return format_descriptor<
typename std::remove_cv<typename std::underlying_type<T>::type>::type>::format();
}
};
template <typename T>
struct format_descriptor<T, detail::enable_if_t<detail::array_info<T>::is_array>> {
static std::string format() {
using namespace detail;
static constexpr auto extents = _("(") + array_info<T>::extents + _(")");
return extents.text + format_descriptor<remove_all_extents_t<T>>::format();
}
};
PYBIND11_NAMESPACE_BEGIN(detail)
template <typename T, int ExtraFlags>
struct pyobject_caster<array_t<T, ExtraFlags>> {
using type = array_t<T, ExtraFlags>;
bool load(handle src, bool convert) {
if (!convert && !type::check_(src))
return false;
value = type::ensure(src);
return static_cast<bool>(value);
}
static handle cast(const handle &src, return_value_policy /* policy */, handle /* parent */) {
return src.inc_ref();
}
PYBIND11_TYPE_CASTER(type, handle_type_name<type>::name);
};
template <typename T>
struct compare_buffer_info<T, detail::enable_if_t<detail::is_pod_struct<T>::value>> {
static bool compare(const buffer_info& b) {
return npy_api::get().PyArray_EquivTypes_(dtype::of<T>().ptr(), dtype(b).ptr());
}
};
template <typename T, typename = void>
struct npy_format_descriptor_name;
template <typename T>
struct npy_format_descriptor_name<T, enable_if_t<std::is_integral<T>::value>> {
static constexpr auto name = _<std::is_same<T, bool>::value>(
_("bool"), _<std::is_signed<T>::value>("numpy.int", "numpy.uint") + _<sizeof(T)*8>()
);
};
template <typename T>
struct npy_format_descriptor_name<T, enable_if_t<std::is_floating_point<T>::value>> {
static constexpr auto name = _<std::is_same<T, float>::value || std::is_same<T, double>::value>(
_("numpy.float") + _<sizeof(T)*8>(), _("numpy.longdouble")
);
};
template <typename T>
struct npy_format_descriptor_name<T, enable_if_t<is_complex<T>::value>> {
static constexpr auto name = _<std::is_same<typename T::value_type, float>::value
|| std::is_same<typename T::value_type, double>::value>(
_("numpy.complex") + _<sizeof(typename T::value_type)*16>(), _("numpy.longcomplex")
);
};
template <typename T>
struct npy_format_descriptor<T, enable_if_t<satisfies_any_of<T, std::is_arithmetic, is_complex>::value>>
: npy_format_descriptor_name<T> {
private:
// NB: the order here must match the one in common.h
constexpr static const int values[15] = {
npy_api::NPY_BOOL_,
npy_api::NPY_BYTE_, npy_api::NPY_UBYTE_, npy_api::NPY_INT16_, npy_api::NPY_UINT16_,
npy_api::NPY_INT32_, npy_api::NPY_UINT32_, npy_api::NPY_INT64_, npy_api::NPY_UINT64_,
npy_api::NPY_FLOAT_, npy_api::NPY_DOUBLE_, npy_api::NPY_LONGDOUBLE_,
npy_api::NPY_CFLOAT_, npy_api::NPY_CDOUBLE_, npy_api::NPY_CLONGDOUBLE_
};
public:
static constexpr int value = values[detail::is_fmt_numeric<T>::index];
static pybind11::dtype dtype() {
if (auto ptr = npy_api::get().PyArray_DescrFromType_(value))
return reinterpret_steal<pybind11::dtype>(ptr);
pybind11_fail("Unsupported buffer format!");
}
};
#define PYBIND11_DECL_CHAR_FMT \
static constexpr auto name = _("S") + _<N>(); \
static pybind11::dtype dtype() { return pybind11::dtype(std::string("S") + std::to_string(N)); }
template <size_t N> struct npy_format_descriptor<char[N]> { PYBIND11_DECL_CHAR_FMT };
template <size_t N> struct npy_format_descriptor<std::array<char, N>> { PYBIND11_DECL_CHAR_FMT };
#undef PYBIND11_DECL_CHAR_FMT
template<typename T> struct npy_format_descriptor<T, enable_if_t<array_info<T>::is_array>> {
private:
using base_descr = npy_format_descriptor<typename array_info<T>::type>;
public:
static_assert(!array_info<T>::is_empty, "Zero-sized arrays are not supported");
static constexpr auto name = _("(") + array_info<T>::extents + _(")") + base_descr::name;
static pybind11::dtype dtype() {
list shape;
array_info<T>::append_extents(shape);
return pybind11::dtype::from_args(pybind11::make_tuple(base_descr::dtype(), shape));
}
};
template<typename T> struct npy_format_descriptor<T, enable_if_t<std::is_enum<T>::value>> {
private:
using base_descr = npy_format_descriptor<typename std::underlying_type<T>::type>;
public:
static constexpr auto name = base_descr::name;
static pybind11::dtype dtype() { return base_descr::dtype(); }
};
struct field_descriptor {
const char *name;
ssize_t offset;
ssize_t size;
std::string format;
dtype descr;
};
inline PYBIND11_NOINLINE void register_structured_dtype(
any_container<field_descriptor> fields,
const std::type_info& tinfo, ssize_t itemsize,
bool (*direct_converter)(PyObject *, void *&)) {
auto& numpy_internals = get_numpy_internals();
if (numpy_internals.get_type_info(tinfo, false))
pybind11_fail("NumPy: dtype is already registered");
// Use ordered fields because order matters as of NumPy 1.14:
// https://docs.scipy.org/doc/numpy/release.html#multiple-field-indexing-assignment-of-structured-arrays
std::vector<field_descriptor> ordered_fields(std::move(fields));
std::sort(ordered_fields.begin(), ordered_fields.end(),
[](const field_descriptor &a, const field_descriptor &b) { return a.offset < b.offset; });
list names, formats, offsets;
for (auto& field : ordered_fields) {
if (!field.descr)
pybind11_fail(std::string("NumPy: unsupported field dtype: `") +
field.name + "` @ " + tinfo.name());
names.append(PYBIND11_STR_TYPE(field.name));
formats.append(field.descr);
offsets.append(pybind11::int_(field.offset));
}
auto dtype_ptr = pybind11::dtype(names, formats, offsets, itemsize).release().ptr();
// There is an existing bug in NumPy (as of v1.11): trailing bytes are
// not encoded explicitly into the format string. This will supposedly
// get fixed in v1.12; for further details, see these:
// - https://github.com/numpy/numpy/issues/7797
// - https://github.com/numpy/numpy/pull/7798
// Because of this, we won't use numpy's logic to generate buffer format
// strings and will just do it ourselves.
ssize_t offset = 0;
std::ostringstream oss;
// mark the structure as unaligned with '^', because numpy and C++ don't
// always agree about alignment (particularly for complex), and we're
// explicitly listing all our padding. This depends on none of the fields
// overriding the endianness. Putting the ^ in front of individual fields
// isn't guaranteed to work due to https://github.com/numpy/numpy/issues/9049
oss << "^T{";
for (auto& field : ordered_fields) {
if (field.offset > offset)
oss << (field.offset - offset) << 'x';
oss << field.format << ':' << field.name << ':';
offset = field.offset + field.size;
}
if (itemsize > offset)
oss << (itemsize - offset) << 'x';
oss << '}';
auto format_str = oss.str();
// Sanity check: verify that NumPy properly parses our buffer format string
auto& api = npy_api::get();
auto arr = array(buffer_info(nullptr, itemsize, format_str, 1));
if (!api.PyArray_EquivTypes_(dtype_ptr, arr.dtype().ptr()))
pybind11_fail("NumPy: invalid buffer descriptor!");
auto tindex = std::type_index(tinfo);
numpy_internals.registered_dtypes[tindex] = { dtype_ptr, format_str };
get_internals().direct_conversions[tindex].push_back(direct_converter);
}
template <typename T, typename SFINAE> struct npy_format_descriptor {
static_assert(is_pod_struct<T>::value, "Attempt to use a non-POD or unimplemented POD type as a numpy dtype");
static constexpr auto name = make_caster<T>::name;
static pybind11::dtype dtype() {
return reinterpret_borrow<pybind11::dtype>(dtype_ptr());
}
static std::string format() {
static auto format_str = get_numpy_internals().get_type_info<T>(true)->format_str;
return format_str;
}
static void register_dtype(any_container<field_descriptor> fields) {
register_structured_dtype(std::move(fields), typeid(typename std::remove_cv<T>::type),
sizeof(T), &direct_converter);
}
private:
static PyObject* dtype_ptr() {
static PyObject* ptr = get_numpy_internals().get_type_info<T>(true)->dtype_ptr;
return ptr;
}
static bool direct_converter(PyObject *obj, void*& value) {
auto& api = npy_api::get();
if (!PyObject_TypeCheck(obj, api.PyVoidArrType_Type_))
return false;
if (auto descr = reinterpret_steal<object>(api.PyArray_DescrFromScalar_(obj))) {
if (api.PyArray_EquivTypes_(dtype_ptr(), descr.ptr())) {
value = ((PyVoidScalarObject_Proxy *) obj)->obval;
return true;
}
}
return false;
}
};
#ifdef __CLION_IDE__ // replace heavy macro with dummy code for the IDE (doesn't affect code)
# define PYBIND11_NUMPY_DTYPE(Type, ...) ((void)0)
# define PYBIND11_NUMPY_DTYPE_EX(Type, ...) ((void)0)
#else
#define PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, Name) \
::pybind11::detail::field_descriptor { \
Name, offsetof(T, Field), sizeof(decltype(std::declval<T>().Field)), \
::pybind11::format_descriptor<decltype(std::declval<T>().Field)>::format(), \
::pybind11::detail::npy_format_descriptor<decltype(std::declval<T>().Field)>::dtype() \
}
// Extract name, offset and format descriptor for a struct field
#define PYBIND11_FIELD_DESCRIPTOR(T, Field) PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, #Field)
// The main idea of this macro is borrowed from https://github.com/swansontec/map-macro
// (C) William Swanson, Paul Fultz
#define PYBIND11_EVAL0(...) __VA_ARGS__
#define PYBIND11_EVAL1(...) PYBIND11_EVAL0 (PYBIND11_EVAL0 (PYBIND11_EVAL0 (__VA_ARGS__)))
#define PYBIND11_EVAL2(...) PYBIND11_EVAL1 (PYBIND11_EVAL1 (PYBIND11_EVAL1 (__VA_ARGS__)))
#define PYBIND11_EVAL3(...) PYBIND11_EVAL2 (PYBIND11_EVAL2 (PYBIND11_EVAL2 (__VA_ARGS__)))
#define PYBIND11_EVAL4(...) PYBIND11_EVAL3 (PYBIND11_EVAL3 (PYBIND11_EVAL3 (__VA_ARGS__)))
#define PYBIND11_EVAL(...) PYBIND11_EVAL4 (PYBIND11_EVAL4 (PYBIND11_EVAL4 (__VA_ARGS__)))
#define PYBIND11_MAP_END(...)
#define PYBIND11_MAP_OUT
#define PYBIND11_MAP_COMMA ,
#define PYBIND11_MAP_GET_END() 0, PYBIND11_MAP_END
#define PYBIND11_MAP_NEXT0(test, next, ...) next PYBIND11_MAP_OUT
#define PYBIND11_MAP_NEXT1(test, next) PYBIND11_MAP_NEXT0 (test, next, 0)
#define PYBIND11_MAP_NEXT(test, next) PYBIND11_MAP_NEXT1 (PYBIND11_MAP_GET_END test, next)
#if defined(_MSC_VER) && !defined(__clang__) // MSVC is not as eager to expand macros, hence this workaround
#define PYBIND11_MAP_LIST_NEXT1(test, next) \
PYBIND11_EVAL0 (PYBIND11_MAP_NEXT0 (test, PYBIND11_MAP_COMMA next, 0))
#else
#define PYBIND11_MAP_LIST_NEXT1(test, next) \
PYBIND11_MAP_NEXT0 (test, PYBIND11_MAP_COMMA next, 0)
#endif
#define PYBIND11_MAP_LIST_NEXT(test, next) \
PYBIND11_MAP_LIST_NEXT1 (PYBIND11_MAP_GET_END test, next)
#define PYBIND11_MAP_LIST0(f, t, x, peek, ...) \
f(t, x) PYBIND11_MAP_LIST_NEXT (peek, PYBIND11_MAP_LIST1) (f, t, peek, __VA_ARGS__)
#define PYBIND11_MAP_LIST1(f, t, x, peek, ...) \
f(t, x) PYBIND11_MAP_LIST_NEXT (peek, PYBIND11_MAP_LIST0) (f, t, peek, __VA_ARGS__)
// PYBIND11_MAP_LIST(f, t, a1, a2, ...) expands to f(t, a1), f(t, a2), ...
#define PYBIND11_MAP_LIST(f, t, ...) \
PYBIND11_EVAL (PYBIND11_MAP_LIST1 (f, t, __VA_ARGS__, (), 0))
#define PYBIND11_NUMPY_DTYPE(Type, ...) \
::pybind11::detail::npy_format_descriptor<Type>::register_dtype \
(::std::vector<::pybind11::detail::field_descriptor> \
{PYBIND11_MAP_LIST (PYBIND11_FIELD_DESCRIPTOR, Type, __VA_ARGS__)})
#if defined(_MSC_VER) && !defined(__clang__)
#define PYBIND11_MAP2_LIST_NEXT1(test, next) \
PYBIND11_EVAL0 (PYBIND11_MAP_NEXT0 (test, PYBIND11_MAP_COMMA next, 0))
#else
#define PYBIND11_MAP2_LIST_NEXT1(test, next) \
PYBIND11_MAP_NEXT0 (test, PYBIND11_MAP_COMMA next, 0)
#endif
#define PYBIND11_MAP2_LIST_NEXT(test, next) \
PYBIND11_MAP2_LIST_NEXT1 (PYBIND11_MAP_GET_END test, next)
#define PYBIND11_MAP2_LIST0(f, t, x1, x2, peek, ...) \
f(t, x1, x2) PYBIND11_MAP2_LIST_NEXT (peek, PYBIND11_MAP2_LIST1) (f, t, peek, __VA_ARGS__)
#define PYBIND11_MAP2_LIST1(f, t, x1, x2, peek, ...) \
f(t, x1, x2) PYBIND11_MAP2_LIST_NEXT (peek, PYBIND11_MAP2_LIST0) (f, t, peek, __VA_ARGS__)
// PYBIND11_MAP2_LIST(f, t, a1, a2, ...) expands to f(t, a1, a2), f(t, a3, a4), ...
#define PYBIND11_MAP2_LIST(f, t, ...) \
PYBIND11_EVAL (PYBIND11_MAP2_LIST1 (f, t, __VA_ARGS__, (), 0))
#define PYBIND11_NUMPY_DTYPE_EX(Type, ...) \
::pybind11::detail::npy_format_descriptor<Type>::register_dtype \
(::std::vector<::pybind11::detail::field_descriptor> \
{PYBIND11_MAP2_LIST (PYBIND11_FIELD_DESCRIPTOR_EX, Type, __VA_ARGS__)})
#endif // __CLION_IDE__
class common_iterator {
public:
using container_type = std::vector<ssize_t>;
using value_type = container_type::value_type;
using size_type = container_type::size_type;
common_iterator() : p_ptr(0), m_strides() {}
common_iterator(void* ptr, const container_type& strides, const container_type& shape)
: p_ptr(reinterpret_cast<char*>(ptr)), m_strides(strides.size()) {
m_strides.back() = static_cast<value_type>(strides.back());
for (size_type i = m_strides.size() - 1; i != 0; --i) {
size_type j = i - 1;
auto s = static_cast<value_type>(shape[i]);
m_strides[j] = strides[j] + m_strides[i] - strides[i] * s;
}
}
void increment(size_type dim) {
p_ptr += m_strides[dim];
}
void* data() const {
return p_ptr;
}
private:
char* p_ptr;
container_type m_strides;
};
template <size_t N> class multi_array_iterator {
public:
using container_type = std::vector<ssize_t>;
multi_array_iterator(const std::array<buffer_info, N> &buffers,
const container_type &shape)
: m_shape(shape.size()), m_index(shape.size(), 0),
m_common_iterator() {
// Manual copy to avoid conversion warning if using std::copy
for (size_t i = 0; i < shape.size(); ++i)
m_shape[i] = shape[i];
container_type strides(shape.size());
for (size_t i = 0; i < N; ++i)
init_common_iterator(buffers[i], shape, m_common_iterator[i], strides);
}
multi_array_iterator& operator++() {
for (size_t j = m_index.size(); j != 0; --j) {
size_t i = j - 1;
if (++m_index[i] != m_shape[i]) {
increment_common_iterator(i);
break;
} else {
m_index[i] = 0;
}
}
return *this;
}
template <size_t K, class T = void> T* data() const {
return reinterpret_cast<T*>(m_common_iterator[K].data());
}
private:
using common_iter = common_iterator;
void init_common_iterator(const buffer_info &buffer,
const container_type &shape,
common_iter &iterator,
container_type &strides) {
auto buffer_shape_iter = buffer.shape.rbegin();
auto buffer_strides_iter = buffer.strides.rbegin();
auto shape_iter = shape.rbegin();
auto strides_iter = strides.rbegin();
while (buffer_shape_iter != buffer.shape.rend()) {
if (*shape_iter == *buffer_shape_iter)
*strides_iter = *buffer_strides_iter;
else
*strides_iter = 0;
++buffer_shape_iter;
++buffer_strides_iter;
++shape_iter;
++strides_iter;
}
std::fill(strides_iter, strides.rend(), 0);
iterator = common_iter(buffer.ptr, strides, shape);
}
void increment_common_iterator(size_t dim) {
for (auto &iter : m_common_iterator)
iter.increment(dim);
}
container_type m_shape;
container_type m_index;
std::array<common_iter, N> m_common_iterator;
};
enum class broadcast_trivial { non_trivial, c_trivial, f_trivial };
// Populates the shape and number of dimensions for the set of buffers. Returns a broadcast_trivial
// enum value indicating whether the broadcast is "trivial"--that is, has each buffer being either a
// singleton or a full-size, C-contiguous (`c_trivial`) or Fortran-contiguous (`f_trivial`) storage
// buffer; returns `non_trivial` otherwise.
template <size_t N>
broadcast_trivial broadcast(const std::array<buffer_info, N> &buffers, ssize_t &ndim, std::vector<ssize_t> &shape) {
ndim = std::accumulate(buffers.begin(), buffers.end(), ssize_t(0), [](ssize_t res, const buffer_info &buf) {
return std::max(res, buf.ndim);
});
shape.clear();
shape.resize((size_t) ndim, 1);
// Figure out the output size, and make sure all input arrays conform (i.e. are either size 1 or
// the full size).
for (size_t i = 0; i < N; ++i) {
auto res_iter = shape.rbegin();
auto end = buffers[i].shape.rend();
for (auto shape_iter = buffers[i].shape.rbegin(); shape_iter != end; ++shape_iter, ++res_iter) {
const auto &dim_size_in = *shape_iter;
auto &dim_size_out = *res_iter;
// Each input dimension can either be 1 or `n`, but `n` values must match across buffers
if (dim_size_out == 1)
dim_size_out = dim_size_in;
else if (dim_size_in != 1 && dim_size_in != dim_size_out)
pybind11_fail("pybind11::vectorize: incompatible size/dimension of inputs!");
}
}
bool trivial_broadcast_c = true;
bool trivial_broadcast_f = true;
for (size_t i = 0; i < N && (trivial_broadcast_c || trivial_broadcast_f); ++i) {
if (buffers[i].size == 1)
continue;
// Require the same number of dimensions:
if (buffers[i].ndim != ndim)
return broadcast_trivial::non_trivial;
// Require all dimensions be full-size:
if (!std::equal(buffers[i].shape.cbegin(), buffers[i].shape.cend(), shape.cbegin()))
return broadcast_trivial::non_trivial;
// Check for C contiguity (but only if previous inputs were also C contiguous)
if (trivial_broadcast_c) {
ssize_t expect_stride = buffers[i].itemsize;
auto end = buffers[i].shape.crend();
for (auto shape_iter = buffers[i].shape.crbegin(), stride_iter = buffers[i].strides.crbegin();
trivial_broadcast_c && shape_iter != end; ++shape_iter, ++stride_iter) {
if (expect_stride == *stride_iter)
expect_stride *= *shape_iter;
else
trivial_broadcast_c = false;
}
}
// Check for Fortran contiguity (if previous inputs were also F contiguous)
if (trivial_broadcast_f) {
ssize_t expect_stride = buffers[i].itemsize;
auto end = buffers[i].shape.cend();
for (auto shape_iter = buffers[i].shape.cbegin(), stride_iter = buffers[i].strides.cbegin();
trivial_broadcast_f && shape_iter != end; ++shape_iter, ++stride_iter) {
if (expect_stride == *stride_iter)
expect_stride *= *shape_iter;
else
trivial_broadcast_f = false;
}
}
}
return
trivial_broadcast_c ? broadcast_trivial::c_trivial :
trivial_broadcast_f ? broadcast_trivial::f_trivial :
broadcast_trivial::non_trivial;
}
template <typename T>
struct vectorize_arg {
static_assert(!std::is_rvalue_reference<T>::value, "Functions with rvalue reference arguments cannot be vectorized");
// The wrapped function gets called with this type:
using call_type = remove_reference_t<T>;
// Is this a vectorized argument?
static constexpr bool vectorize =
satisfies_any_of<call_type, std::is_arithmetic, is_complex, is_pod>::value &&
satisfies_none_of<call_type, std::is_pointer, std::is_array, is_std_array, std::is_enum>::value &&
(!std::is_reference<T>::value ||
(std::is_lvalue_reference<T>::value && std::is_const<call_type>::value));
// Accept this type: an array for vectorized types, otherwise the type as-is:
using type = conditional_t<vectorize, array_t<remove_cv_t<call_type>, array::forcecast>, T>;
};
// py::vectorize when a return type is present
template <typename Func, typename Return, typename... Args>
struct vectorize_returned_array {
using Type = array_t<Return>;
static Type create(broadcast_trivial trivial, const std::vector<ssize_t> &shape) {
if (trivial == broadcast_trivial::f_trivial)
return array_t<Return, array::f_style>(shape);
else
return array_t<Return>(shape);
}
static Return *mutable_data(Type &array) {
return array.mutable_data();
}
static Return call(Func &f, Args &... args) {
return f(args...);
}
static void call(Return *out, size_t i, Func &f, Args &... args) {
out[i] = f(args...);
}
};
// py::vectorize when a return type is not present
template <typename Func, typename... Args>
struct vectorize_returned_array<Func, void, Args...> {
using Type = none;
static Type create(broadcast_trivial, const std::vector<ssize_t> &) {
return none();
}
static void *mutable_data(Type &) {
return nullptr;
}
static detail::void_type call(Func &f, Args &... args) {
f(args...);
return {};
}
static void call(void *, size_t, Func &f, Args &... args) {
f(args...);
}
};
template <typename Func, typename Return, typename... Args>
struct vectorize_helper {
// NVCC for some reason breaks if NVectorized is private
#ifdef __CUDACC__
public:
#else
private:
#endif
static constexpr size_t N = sizeof...(Args);
static constexpr size_t NVectorized = constexpr_sum(vectorize_arg<Args>::vectorize...);
static_assert(NVectorized >= 1,
"pybind11::vectorize(...) requires a function with at least one vectorizable argument");
public:
template <typename T>
explicit vectorize_helper(T &&f) : f(std::forward<T>(f)) { }
object operator()(typename vectorize_arg<Args>::type... args) {
return run(args...,
make_index_sequence<N>(),
select_indices<vectorize_arg<Args>::vectorize...>(),
make_index_sequence<NVectorized>());
}
private:
remove_reference_t<Func> f;
// Internal compiler error in MSVC 19.16.27025.1 (Visual Studio 2017 15.9.4), when compiling with "/permissive-" flag
// when arg_call_types is manually inlined.
using arg_call_types = std::tuple<typename vectorize_arg<Args>::call_type...>;
template <size_t Index> using param_n_t = typename std::tuple_element<Index, arg_call_types>::type;
using returned_array = vectorize_returned_array<Func, Return, Args...>;
// Runs a vectorized function given arguments tuple and three index sequences:
// - Index is the full set of 0 ... (N-1) argument indices;
// - VIndex is the subset of argument indices with vectorized parameters, letting us access
// vectorized arguments (anything not in this sequence is passed through)
// - BIndex is a incremental sequence (beginning at 0) of the same size as VIndex, so that
// we can store vectorized buffer_infos in an array (argument VIndex has its buffer at
// index BIndex in the array).
template <size_t... Index, size_t... VIndex, size_t... BIndex> object run(
typename vectorize_arg<Args>::type &...args,
index_sequence<Index...> i_seq, index_sequence<VIndex...> vi_seq, index_sequence<BIndex...> bi_seq) {
// Pointers to values the function was called with; the vectorized ones set here will start
// out as array_t<T> pointers, but they will be changed them to T pointers before we make
// call the wrapped function. Non-vectorized pointers are left as-is.
std::array<void *, N> params{{ &args... }};
// The array of `buffer_info`s of vectorized arguments:
std::array<buffer_info, NVectorized> buffers{{ reinterpret_cast<array *>(params[VIndex])->request()... }};
/* Determine dimensions parameters of output array */
ssize_t nd = 0;
std::vector<ssize_t> shape(0);
auto trivial = broadcast(buffers, nd, shape);
auto ndim = (size_t) nd;
size_t size = std::accumulate(shape.begin(), shape.end(), (size_t) 1, std::multiplies<size_t>());
// If all arguments are 0-dimension arrays (i.e. single values) return a plain value (i.e.
// not wrapped in an array).
if (size == 1 && ndim == 0) {
PYBIND11_EXPAND_SIDE_EFFECTS(params[VIndex] = buffers[BIndex].ptr);
return cast(returned_array::call(f, *reinterpret_cast<param_n_t<Index> *>(params[Index])...));
}
auto result = returned_array::create(trivial, shape);
if (size == 0) return std::move(result);
/* Call the function */
auto mutable_data = returned_array::mutable_data(result);
if (trivial == broadcast_trivial::non_trivial)
apply_broadcast(buffers, params, mutable_data, size, shape, i_seq, vi_seq, bi_seq);
else
apply_trivial(buffers, params, mutable_data, size, i_seq, vi_seq, bi_seq);
return std::move(result);
}
template <size_t... Index, size_t... VIndex, size_t... BIndex>
void apply_trivial(std::array<buffer_info, NVectorized> &buffers,
std::array<void *, N> ¶ms,
Return *out,
size_t size,
index_sequence<Index...>, index_sequence<VIndex...>, index_sequence<BIndex...>) {
// Initialize an array of mutable byte references and sizes with references set to the
// appropriate pointer in `params`; as we iterate, we'll increment each pointer by its size
// (except for singletons, which get an increment of 0).
std::array<std::pair<unsigned char *&, const size_t>, NVectorized> vecparams{{
std::pair<unsigned char *&, const size_t>(
reinterpret_cast<unsigned char *&>(params[VIndex] = buffers[BIndex].ptr),
buffers[BIndex].size == 1 ? 0 : sizeof(param_n_t<VIndex>)
)...
}};
for (size_t i = 0; i < size; ++i) {
returned_array::call(out, i, f, *reinterpret_cast<param_n_t<Index> *>(params[Index])...);
for (auto &x : vecparams) x.first += x.second;
}
}
template <size_t... Index, size_t... VIndex, size_t... BIndex>
void apply_broadcast(std::array<buffer_info, NVectorized> &buffers,
std::array<void *, N> ¶ms,
Return *out,
size_t size,
const std::vector<ssize_t> &output_shape,
index_sequence<Index...>, index_sequence<VIndex...>, index_sequence<BIndex...>) {
multi_array_iterator<NVectorized> input_iter(buffers, output_shape);
for (size_t i = 0; i < size; ++i, ++input_iter) {
PYBIND11_EXPAND_SIDE_EFFECTS((
params[VIndex] = input_iter.template data<BIndex>()
));
returned_array::call(out, i, f, *reinterpret_cast<param_n_t<Index> *>(std::get<Index>(params))...);
}
}
};
template <typename Func, typename Return, typename... Args>
vectorize_helper<Func, Return, Args...>
vectorize_extractor(const Func &f, Return (*) (Args ...)) {
return detail::vectorize_helper<Func, Return, Args...>(f);
}
template <typename T, int Flags> struct handle_type_name<array_t<T, Flags>> {
static constexpr auto name = _("numpy.ndarray[") + npy_format_descriptor<T>::name + _("]");
};
PYBIND11_NAMESPACE_END(detail)
// Vanilla pointer vectorizer:
template <typename Return, typename... Args>
detail::vectorize_helper<Return (*)(Args...), Return, Args...>
vectorize(Return (*f) (Args ...)) {
return detail::vectorize_helper<Return (*)(Args...), Return, Args...>(f);
}
// lambda vectorizer:
template <typename Func, detail::enable_if_t<detail::is_lambda<Func>::value, int> = 0>
auto vectorize(Func &&f) -> decltype(
detail::vectorize_extractor(std::forward<Func>(f), (detail::function_signature_t<Func> *) nullptr)) {
return detail::vectorize_extractor(std::forward<Func>(f), (detail::function_signature_t<Func> *) nullptr);
}
// Vectorize a class method (non-const):
template <typename Return, typename Class, typename... Args,
typename Helper = detail::vectorize_helper<decltype(std::mem_fn(std::declval<Return (Class::*)(Args...)>())), Return, Class *, Args...>>
Helper vectorize(Return (Class::*f)(Args...)) {
return Helper(std::mem_fn(f));
}
// Vectorize a class method (const):
template <typename Return, typename Class, typename... Args,
typename Helper = detail::vectorize_helper<decltype(std::mem_fn(std::declval<Return (Class::*)(Args...) const>())), Return, const Class *, Args...>>
Helper vectorize(Return (Class::*f)(Args...) const) {
return Helper(std::mem_fn(f));
}
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
| [
"hanlinGao@outlook.com"
] | hanlinGao@outlook.com |
b78268754f00b66424597b2a609bf43e07b76ba9 | 73cfd700522885a3fec41127e1f87e1b78acd4d3 | /_Include/boost/random/detail/iterator_mixin.hpp | 8fd27c6c7fab3c9bc9536467b927e499ef2b441a | [] | no_license | pu2oqa/muServerDeps | 88e8e92fa2053960671f9f57f4c85e062c188319 | 92fcbe082556e11587887ab9d2abc93ec40c41e4 | refs/heads/master | 2023-03-15T12:37:13.995934 | 2019-02-04T10:07:14 | 2019-02-04T10:07:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,538 | hpp | /* boost random/detail/iterator_mixin.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* Revision history
*/
#ifndef BOOST_ITERATOR_MIXIN_HPP
#define BOOST_ITERATOR_MIXIN_HPP
#include <boost/operators.hpp>
namespace boost {
// must be in boost namespace, otherwise the inline friend trick fails
template<class Generator, class ResultType>
class generator_iterator_mixin_adapter
: incrementable<Generator>, equality_comparable<Generator>
{
public:
typedef std::input_iterator_tag iterator_category;
typedef ResultType value_type;
typedef std::ptrdiff_t difference_type;
typedef const value_type * pointer;
typedef const value_type & reference;
Generator& operator++() { v = cast()(); return cast(); }
const value_type& operator*() const { return v; }
protected:
// instantiate from derived classes only
generator_iterator_mixin_adapter() { }
void iterator_init() { operator++(); }
private:
Generator & cast() { return static_cast<Generator&>(*this); }
value_type v;
};
} // namespace boost
#endif // BOOST_ITERATOR_MIXIN_HPP
/////////////////////////////////////////////////
// vnDev.Games - Trong.LIVE - DAO VAN TRONG //
////////////////////////////////////////////////////////////////////////////////
| [
"langley.joshua@gmail.com"
] | langley.joshua@gmail.com |
ce6a3f9c1cdc98d25fcd93d1c24c8258968673d0 | 096961ee99272213aae979902aad0fed8b86a957 | /CodeForces/training/543A.cc | be30411908483f6ff4aed7aa4638a77bc3185ec3 | [] | no_license | yassin64b/competitive-programming | 2d92ee9878e33b5f40da4f0440e994beb595a21b | 180a309da3e12d00c9e4dc384a9aa95ec3e80938 | refs/heads/master | 2021-03-27T15:58:27.450505 | 2020-01-11T16:40:17 | 2020-01-11T16:40:17 | 53,347,417 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,565 | cc | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author yassin
*/
#include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstdlib>
#include <tuple>
#include <queue>
#include <functional>
#include <stack>
#include <numeric>
#include <cassert>
using namespace std;
class A543 {
public:
void solve(istream &in, ostream &out) {
int n, m, b, mod;
in >> n >> m >> b >> mod;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
in >> a[i];
}
vector<vector<int>> dp(m + 1, vector<int>(b + 1, 0));
dp[0][0] = 1;
for (int i = 0; i < n; ++i) {
for (int j = 0; j <= m; ++j) {
for (int k = 0; k <= b; ++k) {
if (j + 1 <= m && k + a[i] <= b) {
dp[j + 1][k + a[i]] += dp[j][k];
dp[j + 1][k + a[i]] %= mod;
}
//cout << dp[j][k] << " ";
}
//cout << endl;
}
//cout << endl;
}
int res = 0;
for (int k = 0; k <= b; ++k) {
res += dp[m][k];
res %= mod;
}
out << res << "\n";
}
};
int main() {
std::ios::sync_with_stdio(false); cin.tie(nullptr);
A543 solver;
std::istream& in(std::cin);
std::ostream& out(std::cout);
solver.solve(in, out);
return 0;
}
| [
"yassin.bahloul@gmx.de"
] | yassin.bahloul@gmx.de |
89202e50e8a84e523bd96e5b577967538011a4ea | 7a2425190626dd2e75dd6cbca9fe47727afbad42 | /src/nstd/hidden_names/log_completion.hpp | 764243fdc39a84c93d8b4f98bc7e87fd7f2c3e78 | [] | no_license | dietmarkuehl/kuhllib | fadd4073c9b09992479e92112ef34c367cb90fad | 482ddc2b910870398a9a2bcaa0a77a145e081f78 | refs/heads/main | 2023-08-31T22:13:02.079530 | 2023-08-21T22:14:14 | 2023-08-21T22:14:14 | 3,148,966 | 71 | 7 | null | 2023-08-21T22:14:15 | 2012-01-10T21:49:09 | C++ | UTF-8 | C++ | false | false | 7,301 | hpp | // nstd/hidden_names/log_completion.hpp -*-C++-*-
// ----------------------------------------------------------------------------
// Copyright (C) 2022 Dietmar Kuehl http://www.dietmar-kuehl.de
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify,
// merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// ----------------------------------------------------------------------------
#ifndef INCLUDED_NSTD_HIDDEN_NAMES_LOG_COMPLETION
#define INCLUDED_NSTD_HIDDEN_NAMES_LOG_COMPLETION
#include "nstd/execution/connect.hpp"
#include "nstd/execution/get_completion_signatures.hpp"
#include "nstd/execution/get_env.hpp"
#include "nstd/execution/receiver.hpp"
#include "nstd/execution/sender.hpp"
#include "nstd/execution/set_error.hpp"
#include "nstd/execution/set_stopped.hpp"
#include "nstd/execution/set_value.hpp"
#include "nstd/utility/forward.hpp"
#include "nstd/utility/move.hpp"
#include <ostream>
#include <string>
// ----------------------------------------------------------------------------
namespace nstd::hidden_names {
inline constexpr struct log_completion_t {
static auto default_stream() -> ::std::ostream&;
template <::nstd::execution::receiver Receiver>
struct receiver {
Receiver d_receiver;
::std::string d_msg;
::std::ostream& d_stream;
friend auto tag_invoke(::nstd::execution::get_env_t, receiver const& self) noexcept {
return ::nstd::execution::get_env(self.d_receiver);
}
template <typename... Args>
friend auto tag_invoke(::nstd::execution::set_value_t, receiver&& self, Args&&... args) noexcept -> void {
self.d_stream << self.d_msg << (self.d_msg.empty()? "": " ") << "set_value(...)\n";
::nstd::execution::set_value(::nstd::utility::move(self.d_receiver),
::nstd::utility::forward<Args>(args)...);
}
template <typename Error>
friend auto tag_invoke(::nstd::execution::set_error_t, receiver&& self, Error&& error) noexcept -> void {
self.d_stream << self.d_msg << (self.d_msg.empty()? "": " ") << "set_error(E)\n";
::nstd::execution::set_error(::nstd::utility::move(self.d_receiver),
::nstd::utility::forward<Error>(error));
}
friend auto tag_invoke(::nstd::execution::set_stopped_t, receiver&& self) noexcept -> void {
self.d_stream << self.d_msg << (self.d_msg.empty()? "": " ") << "set_stopped()\n";
::nstd::execution::set_stopped(::nstd::utility::move(self.d_receiver));
}
};
template <::nstd::execution::sender Sender>
struct sender
: ::nstd::execution::sender_tag {
Sender d_sender;
::std::string d_msg;
::std::ostream& d_stream;
template <::nstd::execution::receiver Receiver>
friend auto tag_invoke(::nstd::execution::connect_t, sender const& self, Receiver&& receiver) {
using receiver_t = ::nstd::hidden_names::log_completion_t::receiver<::nstd::type_traits::remove_cvref_t<Receiver>>;
return ::nstd::execution::connect(
self.d_sender,
receiver_t{
::nstd::utility::forward<Receiver>(receiver),
self.d_msg,
self.d_stream
}
);
}
template <::nstd::execution::receiver Receiver>
friend auto tag_invoke(::nstd::execution::connect_t, sender&& self, Receiver&& receiver) {
using receiver_t = ::nstd::hidden_names::log_completion_t::receiver<::nstd::type_traits::remove_cvref_t<Receiver>>;
return ::nstd::execution::connect(
::nstd::utility::move(self.d_sender),
receiver_t{
::nstd::utility::forward<Receiver>(receiver),
::nstd::utility::move(self.d_msg),
self.d_stream
}
);
}
template <typename Env>
friend auto tag_invoke(::nstd::execution::get_completion_signatures_t, sender const& self, Env env) noexcept {
return ::nstd::execution::get_completion_signatures(self.d_sender, env);
}
};
template <::nstd::execution::sender Sender>
auto operator()(Sender&& sender,
::std::string const& msg,
::std::ostream& stream = ::nstd::hidden_names::log_completion_t::default_stream()) const
-> ::nstd::hidden_names::log_completion_t::sender<::nstd::type_traits::remove_cvref_t<Sender>>
{
return { {}, ::nstd::utility::forward<Sender>(sender), msg, stream };
}
template <::nstd::execution::sender Sender>
auto operator()(Sender&& sender,
::std::ostream& stream = ::nstd::hidden_names::log_completion_t::default_stream()) const
{
return (*this)(::nstd::utility::forward<Sender>(sender), ::std::string(), stream);
}
struct closure
: ::nstd::execution::sender_tag {
::std::string msg;
::std::ostream& stream;
template <::nstd::execution::sender Sender>
auto operator()(Sender&& sender) const {
return ::nstd::hidden_names::log_completion_t()(::nstd::utility::forward<Sender>(sender),
this->msg, this->stream);
}
};
auto operator()(::std::ostream& stream = ::nstd::hidden_names::log_completion_t::default_stream()) const {
return closure{ {}, ::std::string(), stream };
}
auto operator()(::std::string const& msg, ::std::ostream& stream = ::nstd::hidden_names::log_completion_t::default_stream()) const {
return closure{ {}, msg, stream };
}
} log_completion;
}
// ----------------------------------------------------------------------------
#endif
| [
"dietmar.kuehl@me.com"
] | dietmar.kuehl@me.com |
c6022d160c847bd2bea5a9dfb03cf0efd53957f5 | 961714d4298245d9c762e59c716c070643af2213 | /ThirdParty-mod/tinyxml/tinyxml.cpp | 615187f0924e6632e33e9cb1a49084ab4d6d836f | [
"MIT",
"Zlib"
] | permissive | blockspacer/HQEngine | b072ff13d2c1373816b40c29edbe4b869b4c69b1 | 8125b290afa7c62db6cc6eac14e964d8138c7fd0 | refs/heads/master | 2023-04-22T06:11:44.953694 | 2018-10-02T15:24:43 | 2018-10-02T15:24:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 38,381 | cpp | /*
www.sourceforge.net/projects/tinyxml
Original code by Lee Thomason (www.grinninglizard.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#include <ctype.h>
#ifdef TIXML_USE_STL
#include <sstream>
#include <iostream>
#endif
#include "tinyxml.h"
//wrapper of stdio functions
static void stdio_seek (void* fileHandle, long offset, int origin)
{
fseek((FILE*)fileHandle, offset, origin);
}
static size_t stdio_tell (void* fileHandle)
{
return ftell((FILE*) fileHandle);
}
static size_t stdio_read ( void * ptr, size_t size, size_t count, void * stream )
{
return fread(ptr, size, count, (FILE*) stream);
}
/*----------------------*/
FILE* TiXmlFOpen( const char* filename, const char* mode );
bool TiXmlBase::condenseWhiteSpace = true;
// Microsoft compiler security
FILE* TiXmlFOpen( const char* filename, const char* mode )
{
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
FILE* fp = 0;
errno_t err = fopen_s( &fp, filename, mode );
if ( !err && fp )
return fp;
return 0;
#else
return fopen( filename, mode );
#endif
}
void TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString )
{
int i=0;
while( i<(int)str.length() )
{
unsigned char c = (unsigned char) str[i];
if ( c == '&'
&& i < ( (int)str.length() - 2 )
&& str[i+1] == '#'
&& str[i+2] == 'x' )
{
// Hexadecimal character reference.
// Pass through unchanged.
// © -- copyright symbol, for example.
//
// The -1 is a bug fix from Rob Laveaux. It keeps
// an overflow from happening if there is no ';'.
// There are actually 2 ways to exit this loop -
// while fails (error case) and break (semicolon found).
// However, there is no mechanism (currently) for
// this function to return an error.
while ( i<(int)str.length()-1 )
{
outString->append( str.c_str() + i, 1 );
++i;
if ( str[i] == ';' )
break;
}
}
else if ( c == '&' )
{
outString->append( entity[0].str, entity[0].strLength );
++i;
}
else if ( c == '<' )
{
outString->append( entity[1].str, entity[1].strLength );
++i;
}
else if ( c == '>' )
{
outString->append( entity[2].str, entity[2].strLength );
++i;
}
else if ( c == '\"' )
{
outString->append( entity[3].str, entity[3].strLength );
++i;
}
else if ( c == '\'' )
{
outString->append( entity[4].str, entity[4].strLength );
++i;
}
else if ( c < 32 )
{
// Easy pass at non-alpha/numeric/symbol
// Below 32 is symbolic.
char buf[ 32 ];
#if defined(TIXML_SNPRINTF)
TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) );
#else
sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) );
#endif
//*ME: warning C4267: convert 'size_t' to 'int'
//*ME: Int-Cast to make compiler happy ...
outString->append( buf, (int)strlen( buf ) );
++i;
}
else
{
//char realc = (char) c;
//outString->append( &realc, 1 );
*outString += (char) c; // somewhat more efficient function call.
++i;
}
}
}
TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase()
{
parent = 0;
type = _type;
firstChild = 0;
lastChild = 0;
prev = 0;
next = 0;
}
TiXmlNode::~TiXmlNode()
{
TiXmlNode* node = firstChild;
TiXmlNode* temp = 0;
while ( node )
{
temp = node;
node = node->next;
delete temp;
}
}
void TiXmlNode::CopyTo( TiXmlNode* target ) const
{
target->SetValue (value.c_str() );
target->userData = userData;
target->location = location;
}
void TiXmlNode::Clear()
{
TiXmlNode* node = firstChild;
TiXmlNode* temp = 0;
while ( node )
{
temp = node;
node = node->next;
delete temp;
}
firstChild = 0;
lastChild = 0;
}
TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node )
{
assert( node->parent == 0 || node->parent == this );
assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() );
if ( node->Type() == TiXmlNode::TINYXML_DOCUMENT )
{
delete node;
if ( GetDocument() )
GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
return 0;
}
node->parent = this;
node->prev = lastChild;
node->next = 0;
if ( lastChild )
lastChild->next = node;
else
firstChild = node; // it was an empty list.
lastChild = node;
return node;
}
TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis )
{
if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT )
{
if ( GetDocument() )
GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
return 0;
}
TiXmlNode* node = addThis.Clone();
if ( !node )
return 0;
return LinkEndChild( node );
}
TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis )
{
if ( !beforeThis || beforeThis->parent != this ) {
return 0;
}
if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT )
{
if ( GetDocument() )
GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
return 0;
}
TiXmlNode* node = addThis.Clone();
if ( !node )
return 0;
node->parent = this;
node->next = beforeThis;
node->prev = beforeThis->prev;
if ( beforeThis->prev )
{
beforeThis->prev->next = node;
}
else
{
assert( firstChild == beforeThis );
firstChild = node;
}
beforeThis->prev = node;
return node;
}
TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis )
{
if ( !afterThis || afterThis->parent != this ) {
return 0;
}
if ( addThis.Type() == TiXmlNode::TINYXML_DOCUMENT )
{
if ( GetDocument() )
GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
return 0;
}
TiXmlNode* node = addThis.Clone();
if ( !node )
return 0;
node->parent = this;
node->prev = afterThis;
node->next = afterThis->next;
if ( afterThis->next )
{
afterThis->next->prev = node;
}
else
{
assert( lastChild == afterThis );
lastChild = node;
}
afterThis->next = node;
return node;
}
TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis )
{
if ( !replaceThis )
return 0;
if ( replaceThis->parent != this )
return 0;
if ( withThis.ToDocument() ) {
// A document can never be a child. Thanks to Noam.
TiXmlDocument* document = GetDocument();
if ( document )
document->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
return 0;
}
TiXmlNode* node = withThis.Clone();
if ( !node )
return 0;
node->next = replaceThis->next;
node->prev = replaceThis->prev;
if ( replaceThis->next )
replaceThis->next->prev = node;
else
lastChild = node;
if ( replaceThis->prev )
replaceThis->prev->next = node;
else
firstChild = node;
delete replaceThis;
node->parent = this;
return node;
}
bool TiXmlNode::RemoveChild( TiXmlNode* removeThis )
{
if ( !removeThis ) {
return false;
}
if ( removeThis->parent != this )
{
assert( 0 );
return false;
}
if ( removeThis->next )
removeThis->next->prev = removeThis->prev;
else
lastChild = removeThis->prev;
if ( removeThis->prev )
removeThis->prev->next = removeThis->next;
else
firstChild = removeThis->next;
delete removeThis;
return true;
}
const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const
{
const TiXmlNode* node;
for ( node = firstChild; node; node = node->next )
{
if ( strcmp( node->Value(), _value ) == 0 )
return node;
}
return 0;
}
const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const
{
const TiXmlNode* node;
for ( node = lastChild; node; node = node->prev )
{
if ( strcmp( node->Value(), _value ) == 0 )
return node;
}
return 0;
}
const TiXmlNode* TiXmlNode::IterateChildren( const TiXmlNode* previous ) const
{
if ( !previous )
{
return FirstChild();
}
else
{
assert( previous->parent == this );
return previous->NextSibling();
}
}
const TiXmlNode* TiXmlNode::IterateChildren( const char * val, const TiXmlNode* previous ) const
{
if ( !previous )
{
return FirstChild( val );
}
else
{
assert( previous->parent == this );
return previous->NextSibling( val );
}
}
const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const
{
const TiXmlNode* node;
for ( node = next; node; node = node->next )
{
if ( strcmp( node->Value(), _value ) == 0 )
return node;
}
return 0;
}
const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const
{
const TiXmlNode* node;
for ( node = prev; node; node = node->prev )
{
if ( strcmp( node->Value(), _value ) == 0 )
return node;
}
return 0;
}
void TiXmlElement::RemoveAttribute( const char * name )
{
#ifdef TIXML_USE_STL
TIXML_STRING str( name );
TiXmlAttribute* node = attributeSet.Find( str );
#else
TiXmlAttribute* node = attributeSet.Find( name );
#endif
if ( node )
{
attributeSet.Remove( node );
delete node;
}
}
const TiXmlElement* TiXmlNode::FirstChildElement() const
{
const TiXmlNode* node;
for ( node = FirstChild();
node;
node = node->NextSibling() )
{
if ( node->ToElement() )
return node->ToElement();
}
return 0;
}
const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const
{
const TiXmlNode* node;
for ( node = FirstChild( _value );
node;
node = node->NextSibling( _value ) )
{
if ( node->ToElement() )
return node->ToElement();
}
return 0;
}
const TiXmlElement* TiXmlNode::NextSiblingElement() const
{
const TiXmlNode* node;
for ( node = NextSibling();
node;
node = node->NextSibling() )
{
if ( node->ToElement() )
return node->ToElement();
}
return 0;
}
const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const
{
const TiXmlNode* node;
for ( node = NextSibling( _value );
node;
node = node->NextSibling( _value ) )
{
if ( node->ToElement() )
return node->ToElement();
}
return 0;
}
const TiXmlDocument* TiXmlNode::GetDocument() const
{
const TiXmlNode* node;
for( node = this; node; node = node->parent )
{
if ( node->ToDocument() )
return node->ToDocument();
}
return 0;
}
TiXmlElement::TiXmlElement (const char * _value)
: TiXmlNode( TiXmlNode::TINYXML_ELEMENT )
{
firstChild = lastChild = 0;
value = _value;
}
#ifdef TIXML_USE_STL
TiXmlElement::TiXmlElement( const std::string& _value )
: TiXmlNode( TiXmlNode::TINYXML_ELEMENT )
{
firstChild = lastChild = 0;
value = _value;
}
#endif
TiXmlElement::TiXmlElement( const TiXmlElement& copy)
: TiXmlNode( TiXmlNode::TINYXML_ELEMENT )
{
firstChild = lastChild = 0;
copy.CopyTo( this );
}
TiXmlElement& TiXmlElement::operator=( const TiXmlElement& base )
{
ClearThis();
base.CopyTo( this );
return *this;
}
TiXmlElement::~TiXmlElement()
{
ClearThis();
}
void TiXmlElement::ClearThis()
{
Clear();
while( attributeSet.First() )
{
TiXmlAttribute* node = attributeSet.First();
attributeSet.Remove( node );
delete node;
}
}
const char* TiXmlElement::Attribute( const char* name ) const
{
const TiXmlAttribute* node = attributeSet.Find( name );
if ( node )
return node->Value();
return 0;
}
#ifdef TIXML_USE_STL
const std::string* TiXmlElement::Attribute( const std::string& name ) const
{
const TiXmlAttribute* attrib = attributeSet.Find( name );
if ( attrib )
return &attrib->ValueStr();
return 0;
}
#endif
const char* TiXmlElement::Attribute( const char* name, int* i ) const
{
const TiXmlAttribute* attrib = attributeSet.Find( name );
const char* result = 0;
if ( attrib ) {
result = attrib->Value();
if ( i ) {
attrib->QueryIntValue( i );
}
}
return result;
}
#ifdef TIXML_USE_STL
const std::string* TiXmlElement::Attribute( const std::string& name, int* i ) const
{
const TiXmlAttribute* attrib = attributeSet.Find( name );
const std::string* result = 0;
if ( attrib ) {
result = &attrib->ValueStr();
if ( i ) {
attrib->QueryIntValue( i );
}
}
return result;
}
#endif
const char* TiXmlElement::Attribute( const char* name, double* d ) const
{
const TiXmlAttribute* attrib = attributeSet.Find( name );
const char* result = 0;
if ( attrib ) {
result = attrib->Value();
if ( d ) {
attrib->QueryDoubleValue( d );
}
}
return result;
}
#ifdef TIXML_USE_STL
const std::string* TiXmlElement::Attribute( const std::string& name, double* d ) const
{
const TiXmlAttribute* attrib = attributeSet.Find( name );
const std::string* result = 0;
if ( attrib ) {
result = &attrib->ValueStr();
if ( d ) {
attrib->QueryDoubleValue( d );
}
}
return result;
}
#endif
int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const
{
const TiXmlAttribute* attrib = attributeSet.Find( name );
if ( !attrib )
return TIXML_NO_ATTRIBUTE;
return attrib->QueryIntValue( ival );
}
int TiXmlElement::QueryUnsignedAttribute( const char* name, unsigned* value ) const
{
const TiXmlAttribute* node = attributeSet.Find( name );
if ( !node )
return TIXML_NO_ATTRIBUTE;
int ival = 0;
int result = node->QueryIntValue( &ival );
*value = (unsigned)ival;
return result;
}
int TiXmlElement::QueryBoolAttribute( const char* name, bool* bval ) const
{
const TiXmlAttribute* node = attributeSet.Find( name );
if ( !node )
return TIXML_NO_ATTRIBUTE;
int result = TIXML_WRONG_TYPE;
if ( StringEqual( node->Value(), "true", true, TIXML_ENCODING_UNKNOWN )
|| StringEqual( node->Value(), "yes", true, TIXML_ENCODING_UNKNOWN )
|| StringEqual( node->Value(), "1", true, TIXML_ENCODING_UNKNOWN ) )
{
*bval = true;
result = TIXML_SUCCESS;
}
else if ( StringEqual( node->Value(), "false", true, TIXML_ENCODING_UNKNOWN )
|| StringEqual( node->Value(), "no", true, TIXML_ENCODING_UNKNOWN )
|| StringEqual( node->Value(), "0", true, TIXML_ENCODING_UNKNOWN ) )
{
*bval = false;
result = TIXML_SUCCESS;
}
return result;
}
#ifdef TIXML_USE_STL
int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const
{
const TiXmlAttribute* attrib = attributeSet.Find( name );
if ( !attrib )
return TIXML_NO_ATTRIBUTE;
return attrib->QueryIntValue( ival );
}
#endif
int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const
{
const TiXmlAttribute* attrib = attributeSet.Find( name );
if ( !attrib )
return TIXML_NO_ATTRIBUTE;
return attrib->QueryDoubleValue( dval );
}
#ifdef TIXML_USE_STL
int TiXmlElement::QueryDoubleAttribute( const std::string& name, double* dval ) const
{
const TiXmlAttribute* attrib = attributeSet.Find( name );
if ( !attrib )
return TIXML_NO_ATTRIBUTE;
return attrib->QueryDoubleValue( dval );
}
#endif
void TiXmlElement::SetAttribute( const char * name, int val )
{
TiXmlAttribute* attrib = attributeSet.FindOrCreate( name );
if ( attrib ) {
attrib->SetIntValue( val );
}
}
#ifdef TIXML_USE_STL
void TiXmlElement::SetAttribute( const std::string& name, int val )
{
TiXmlAttribute* attrib = attributeSet.FindOrCreate( name );
if ( attrib ) {
attrib->SetIntValue( val );
}
}
#endif
void TiXmlElement::SetDoubleAttribute( const char * name, double val )
{
TiXmlAttribute* attrib = attributeSet.FindOrCreate( name );
if ( attrib ) {
attrib->SetDoubleValue( val );
}
}
#ifdef TIXML_USE_STL
void TiXmlElement::SetDoubleAttribute( const std::string& name, double val )
{
TiXmlAttribute* attrib = attributeSet.FindOrCreate( name );
if ( attrib ) {
attrib->SetDoubleValue( val );
}
}
#endif
void TiXmlElement::SetAttribute( const char * cname, const char * cvalue )
{
TiXmlAttribute* attrib = attributeSet.FindOrCreate( cname );
if ( attrib ) {
attrib->SetValue( cvalue );
}
}
#ifdef TIXML_USE_STL
void TiXmlElement::SetAttribute( const std::string& _name, const std::string& _value )
{
TiXmlAttribute* attrib = attributeSet.FindOrCreate( _name );
if ( attrib ) {
attrib->SetValue( _value );
}
}
#endif
void TiXmlElement::Print( FILE* cfile, int depth ) const
{
int i;
assert( cfile );
for ( i=0; i<depth; i++ ) {
fprintf( cfile, " " );
}
fprintf( cfile, "<%s", value.c_str() );
const TiXmlAttribute* attrib;
for ( attrib = attributeSet.First(); attrib; attrib = attrib->Next() )
{
fprintf( cfile, " " );
attrib->Print( cfile, depth );
}
// There are 3 different formatting approaches:
// 1) An element without children is printed as a <foo /> node
// 2) An element with only a text child is printed as <foo> text </foo>
// 3) An element with children is printed on multiple lines.
TiXmlNode* node;
if ( !firstChild )
{
fprintf( cfile, " />" );
}
else if ( firstChild == lastChild && firstChild->ToText() )
{
fprintf( cfile, ">" );
firstChild->Print( cfile, depth + 1 );
fprintf( cfile, "</%s>", value.c_str() );
}
else
{
fprintf( cfile, ">" );
for ( node = firstChild; node; node=node->NextSibling() )
{
if ( !node->ToText() )
{
fprintf( cfile, "\n" );
}
node->Print( cfile, depth+1 );
}
fprintf( cfile, "\n" );
for( i=0; i<depth; ++i ) {
fprintf( cfile, " " );
}
fprintf( cfile, "</%s>", value.c_str() );
}
}
void TiXmlElement::CopyTo( TiXmlElement* target ) const
{
// superclass:
TiXmlNode::CopyTo( target );
// Element class:
// Clone the attributes, then clone the children.
const TiXmlAttribute* attribute = 0;
for( attribute = attributeSet.First();
attribute;
attribute = attribute->Next() )
{
target->SetAttribute( attribute->Name(), attribute->Value() );
}
TiXmlNode* node = 0;
for ( node = firstChild; node; node = node->NextSibling() )
{
target->LinkEndChild( node->Clone() );
}
}
bool TiXmlElement::Accept( TiXmlVisitor* visitor ) const
{
if ( visitor->VisitEnter( *this, attributeSet.First() ) )
{
for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() )
{
if ( !node->Accept( visitor ) )
break;
}
}
return visitor->VisitExit( *this );
}
TiXmlNode* TiXmlElement::Clone() const
{
TiXmlElement* clone = new TiXmlElement( Value() );
if ( !clone )
return 0;
CopyTo( clone );
return clone;
}
const char* TiXmlElement::GetText() const
{
const TiXmlNode* child = this->FirstChild();
if ( child ) {
const TiXmlText* childText = child->ToText();
if ( childText ) {
return childText->Value();
}
}
return 0;
}
TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT )
{
tabsize = 4;
useMicrosoftBOM = false;
ClearError();
}
TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT )
{
tabsize = 4;
useMicrosoftBOM = false;
value = documentName;
ClearError();
}
#ifdef TIXML_USE_STL
TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT )
{
tabsize = 4;
useMicrosoftBOM = false;
value = documentName;
ClearError();
}
#endif
TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::TINYXML_DOCUMENT )
{
copy.CopyTo( this );
}
TiXmlDocument& TiXmlDocument::operator=( const TiXmlDocument& copy )
{
Clear();
copy.CopyTo( this );
return *this;
}
bool TiXmlDocument::LoadFile( TiXmlEncoding encoding )
{
return LoadFile( Value(), encoding );
}
bool TiXmlDocument::SaveFile() const
{
return SaveFile( Value() );
}
bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding )
{
TIXML_STRING filename( _filename );
value = filename;
// reading in binary mode so that tinyxml can normalize the EOL
FILE* file = TiXmlFOpen( value.c_str (), "rb" );
if ( file )
{
bool result = LoadFile( file, encoding );
fclose( file );
return result;
}
else
{
SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
return false;
}
}
bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding )
{
TiXmlCustomFileStream stream;
stream.fileHandle = file;
stream.seek = &stdio_seek;
stream.tell = &stdio_tell;
stream.read = &stdio_read;
return LoadFile(stream, encoding);
}
bool TiXmlDocument::LoadFile( TiXmlCustomFileStream& fileStream, TiXmlEncoding encoding )
{
if ( !fileStream.fileHandle )
{
SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
return false;
}
// Delete the existing data:
Clear();
location.Clear();
// Get the file size, so we can pre-allocate the string. HUGE speed impact.
long length = 0;
fileStream.seek( fileStream.fileHandle, 0, SEEK_END );
length = fileStream.tell( fileStream.fileHandle );
fileStream.seek( fileStream.fileHandle, 0, SEEK_SET );
// Strange case, but good to handle up front.
if ( length <= 0 )
{
SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
return false;
}
// Subtle bug here. TinyXml did use fgets. But from the XML spec:
// 2.11 End-of-Line Handling
// <snip>
// <quote>
// ...the XML processor MUST behave as if it normalized all line breaks in external
// parsed entities (including the document entity) on input, before parsing, by translating
// both the two-character sequence #xD #xA and any #xD that is not followed by #xA to
// a single #xA character.
// </quote>
//
// It is not clear fgets does that, and certainly isn't clear it works cross platform.
// Generally, you expect fgets to translate from the convention of the OS to the c/unix
// convention, and not work generally.
/*
while( fgets( buf, sizeof(buf), file ) )
{
data += buf;
}
*/
char* buf = new char[ length+1 ];
buf[0] = 0;
if ( fileStream.read( buf, length, 1, fileStream.fileHandle ) != 1 ) {
delete [] buf;
SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
return false;
}
// Process the buffer in place to normalize new lines. (See comment above.)
// Copies from the 'p' to 'q' pointer, where p can advance faster if
// a newline-carriage return is hit.
//
// Wikipedia:
// Systems based on ASCII or a compatible character set use either LF (Line feed, '\n', 0x0A, 10 in decimal) or
// CR (Carriage return, '\r', 0x0D, 13 in decimal) individually, or CR followed by LF (CR+LF, 0x0D 0x0A)...
// * LF: Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others
// * CR+LF: DEC RT-11 and most other early non-Unix, non-IBM OSes, CP/M, MP/M, DOS, OS/2, Microsoft Windows, Symbian OS
// * CR: Commodore 8-bit machines, Apple II family, Mac OS up to version 9 and OS-9
const char* p = buf; // the read head
char* q = buf; // the write head
const char CR = 0x0d;
const char LF = 0x0a;
buf[length] = 0;
while( *p ) {
assert( p < (buf+length) );
assert( q <= (buf+length) );
assert( q <= p );
if ( *p == CR ) {
*q++ = LF;
p++;
if ( *p == LF ) { // check for CR+LF (and skip LF)
p++;
}
}
else {
*q++ = *p++;
}
}
assert( q <= (buf+length) );
*q = 0;
Parse( buf, 0, encoding );
delete [] buf;
return !Error();
}
bool TiXmlDocument::SaveFile( const char * filename ) const
{
// The old c stuff lives on...
FILE* fp = TiXmlFOpen( filename, "w" );
if ( fp )
{
bool result = SaveFile( fp );
fclose( fp );
return result;
}
return false;
}
bool TiXmlDocument::SaveFile( FILE* fp ) const
{
if ( useMicrosoftBOM )
{
const unsigned char TIXML_UTF_LEAD_0 = 0xefU;
const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;
const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;
fputc( TIXML_UTF_LEAD_0, fp );
fputc( TIXML_UTF_LEAD_1, fp );
fputc( TIXML_UTF_LEAD_2, fp );
}
Print( fp, 0 );
return (ferror(fp) == 0);
}
void TiXmlDocument::CopyTo( TiXmlDocument* target ) const
{
TiXmlNode::CopyTo( target );
target->error = error;
target->errorId = errorId;
target->errorDesc = errorDesc;
target->tabsize = tabsize;
target->errorLocation = errorLocation;
target->useMicrosoftBOM = useMicrosoftBOM;
TiXmlNode* node = 0;
for ( node = firstChild; node; node = node->NextSibling() )
{
target->LinkEndChild( node->Clone() );
}
}
TiXmlNode* TiXmlDocument::Clone() const
{
TiXmlDocument* clone = new TiXmlDocument();
if ( !clone )
return 0;
CopyTo( clone );
return clone;
}
void TiXmlDocument::Print( FILE* cfile, int depth ) const
{
assert( cfile );
for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() )
{
node->Print( cfile, depth );
fprintf( cfile, "\n" );
}
}
bool TiXmlDocument::Accept( TiXmlVisitor* visitor ) const
{
if ( visitor->VisitEnter( *this ) )
{
for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() )
{
if ( !node->Accept( visitor ) )
break;
}
}
return visitor->VisitExit( *this );
}
const TiXmlAttribute* TiXmlAttribute::Next() const
{
// We are using knowledge of the sentinel. The sentinel
// have a value or name.
if ( next->value.empty() && next->name.empty() )
return 0;
return next;
}
/*
TiXmlAttribute* TiXmlAttribute::Next()
{
// We are using knowledge of the sentinel. The sentinel
// have a value or name.
if ( next->value.empty() && next->name.empty() )
return 0;
return next;
}
*/
const TiXmlAttribute* TiXmlAttribute::Previous() const
{
// We are using knowledge of the sentinel. The sentinel
// have a value or name.
if ( prev->value.empty() && prev->name.empty() )
return 0;
return prev;
}
/*
TiXmlAttribute* TiXmlAttribute::Previous()
{
// We are using knowledge of the sentinel. The sentinel
// have a value or name.
if ( prev->value.empty() && prev->name.empty() )
return 0;
return prev;
}
*/
void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const
{
TIXML_STRING n, v;
EncodeString( name, &n );
EncodeString( value, &v );
if (value.find ('\"') == TIXML_STRING::npos) {
if ( cfile ) {
fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() );
}
if ( str ) {
(*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\"";
}
}
else {
if ( cfile ) {
fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() );
}
if ( str ) {
(*str) += n; (*str) += "='"; (*str) += v; (*str) += "'";
}
}
}
int TiXmlAttribute::QueryIntValue( int* ival ) const
{
if ( TIXML_SSCANF( value.c_str(), "%d", ival ) == 1 )
return TIXML_SUCCESS;
return TIXML_WRONG_TYPE;
}
int TiXmlAttribute::QueryDoubleValue( double* dval ) const
{
if ( TIXML_SSCANF( value.c_str(), "%lf", dval ) == 1 )
return TIXML_SUCCESS;
return TIXML_WRONG_TYPE;
}
void TiXmlAttribute::SetIntValue( int _value )
{
char buf [64];
#if defined(TIXML_SNPRINTF)
TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value);
#else
sprintf (buf, "%d", _value);
#endif
SetValue (buf);
}
void TiXmlAttribute::SetDoubleValue( double _value )
{
char buf [256];
#if defined(TIXML_SNPRINTF)
TIXML_SNPRINTF( buf, sizeof(buf), "%g", _value);
#else
sprintf (buf, "%g", _value);
#endif
SetValue (buf);
}
int TiXmlAttribute::IntValue() const
{
return atoi (value.c_str ());
}
double TiXmlAttribute::DoubleValue() const
{
return atof (value.c_str ());
}
TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::TINYXML_COMMENT )
{
copy.CopyTo( this );
}
TiXmlComment& TiXmlComment::operator=( const TiXmlComment& base )
{
Clear();
base.CopyTo( this );
return *this;
}
void TiXmlComment::Print( FILE* cfile, int depth ) const
{
assert( cfile );
for ( int i=0; i<depth; i++ )
{
fprintf( cfile, " " );
}
fprintf( cfile, "<!--%s-->", value.c_str() );
}
void TiXmlComment::CopyTo( TiXmlComment* target ) const
{
TiXmlNode::CopyTo( target );
}
bool TiXmlComment::Accept( TiXmlVisitor* visitor ) const
{
return visitor->Visit( *this );
}
TiXmlNode* TiXmlComment::Clone() const
{
TiXmlComment* clone = new TiXmlComment();
if ( !clone )
return 0;
CopyTo( clone );
return clone;
}
void TiXmlText::Print( FILE* cfile, int depth ) const
{
assert( cfile );
if ( cdata )
{
int i;
fprintf( cfile, "\n" );
for ( i=0; i<depth; i++ ) {
fprintf( cfile, " " );
}
fprintf( cfile, "<![CDATA[%s]]>\n", value.c_str() ); // unformatted output
}
else
{
TIXML_STRING buffer;
EncodeString( value, &buffer );
fprintf( cfile, "%s", buffer.c_str() );
}
}
void TiXmlText::CopyTo( TiXmlText* target ) const
{
TiXmlNode::CopyTo( target );
target->cdata = cdata;
}
bool TiXmlText::Accept( TiXmlVisitor* visitor ) const
{
return visitor->Visit( *this );
}
TiXmlNode* TiXmlText::Clone() const
{
TiXmlText* clone = 0;
clone = new TiXmlText( "" );
if ( !clone )
return 0;
CopyTo( clone );
return clone;
}
TiXmlDeclaration::TiXmlDeclaration( const char * _version,
const char * _encoding,
const char * _standalone )
: TiXmlNode( TiXmlNode::TINYXML_DECLARATION )
{
version = _version;
encoding = _encoding;
standalone = _standalone;
}
#ifdef TIXML_USE_STL
TiXmlDeclaration::TiXmlDeclaration( const std::string& _version,
const std::string& _encoding,
const std::string& _standalone )
: TiXmlNode( TiXmlNode::TINYXML_DECLARATION )
{
version = _version;
encoding = _encoding;
standalone = _standalone;
}
#endif
TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy )
: TiXmlNode( TiXmlNode::TINYXML_DECLARATION )
{
copy.CopyTo( this );
}
TiXmlDeclaration& TiXmlDeclaration::operator=( const TiXmlDeclaration& copy )
{
Clear();
copy.CopyTo( this );
return *this;
}
void TiXmlDeclaration::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const
{
if ( cfile ) fprintf( cfile, "<?xml " );
if ( str ) (*str) += "<?xml ";
if ( !version.empty() ) {
if ( cfile ) fprintf (cfile, "version=\"%s\" ", version.c_str ());
if ( str ) { (*str) += "version=\""; (*str) += version; (*str) += "\" "; }
}
if ( !encoding.empty() ) {
if ( cfile ) fprintf (cfile, "encoding=\"%s\" ", encoding.c_str ());
if ( str ) { (*str) += "encoding=\""; (*str) += encoding; (*str) += "\" "; }
}
if ( !standalone.empty() ) {
if ( cfile ) fprintf (cfile, "standalone=\"%s\" ", standalone.c_str ());
if ( str ) { (*str) += "standalone=\""; (*str) += standalone; (*str) += "\" "; }
}
if ( cfile ) fprintf( cfile, "?>" );
if ( str ) (*str) += "?>";
}
void TiXmlDeclaration::CopyTo( TiXmlDeclaration* target ) const
{
TiXmlNode::CopyTo( target );
target->version = version;
target->encoding = encoding;
target->standalone = standalone;
}
bool TiXmlDeclaration::Accept( TiXmlVisitor* visitor ) const
{
return visitor->Visit( *this );
}
TiXmlNode* TiXmlDeclaration::Clone() const
{
TiXmlDeclaration* clone = new TiXmlDeclaration();
if ( !clone )
return 0;
CopyTo( clone );
return clone;
}
void TiXmlUnknown::Print( FILE* cfile, int depth ) const
{
for ( int i=0; i<depth; i++ )
fprintf( cfile, " " );
fprintf( cfile, "<%s>", value.c_str() );
}
void TiXmlUnknown::CopyTo( TiXmlUnknown* target ) const
{
TiXmlNode::CopyTo( target );
}
bool TiXmlUnknown::Accept( TiXmlVisitor* visitor ) const
{
return visitor->Visit( *this );
}
TiXmlNode* TiXmlUnknown::Clone() const
{
TiXmlUnknown* clone = new TiXmlUnknown();
if ( !clone )
return 0;
CopyTo( clone );
return clone;
}
TiXmlAttributeSet::TiXmlAttributeSet()
{
sentinel.next = &sentinel;
sentinel.prev = &sentinel;
}
TiXmlAttributeSet::~TiXmlAttributeSet()
{
assert( sentinel.next == &sentinel );
assert( sentinel.prev == &sentinel );
}
void TiXmlAttributeSet::Add( TiXmlAttribute* addMe )
{
#ifdef TIXML_USE_STL
assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set.
#else
assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set.
#endif
addMe->next = &sentinel;
addMe->prev = sentinel.prev;
sentinel.prev->next = addMe;
sentinel.prev = addMe;
}
void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe )
{
TiXmlAttribute* node;
for( node = sentinel.next; node != &sentinel; node = node->next )
{
if ( node == removeMe )
{
node->prev->next = node->next;
node->next->prev = node->prev;
node->next = 0;
node->prev = 0;
return;
}
}
assert( 0 ); // we tried to remove a non-linked attribute.
}
#ifdef TIXML_USE_STL
TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) const
{
for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
{
if ( node->name == name )
return node;
}
return 0;
}
TiXmlAttribute* TiXmlAttributeSet::FindOrCreate( const std::string& _name )
{
TiXmlAttribute* attrib = Find( _name );
if ( !attrib ) {
attrib = new TiXmlAttribute();
Add( attrib );
attrib->SetName( _name );
}
return attrib;
}
#endif
TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const
{
for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
{
if ( strcmp( node->name.c_str(), name ) == 0 )
return node;
}
return 0;
}
TiXmlAttribute* TiXmlAttributeSet::FindOrCreate( const char* _name )
{
TiXmlAttribute* attrib = Find( _name );
if ( !attrib ) {
attrib = new TiXmlAttribute();
Add( attrib );
attrib->SetName( _name );
}
return attrib;
}
#ifdef TIXML_USE_STL
std::istream& operator>> (std::istream & in, TiXmlNode & base)
{
TIXML_STRING tag;
tag.reserve( 8 * 1000 );
base.StreamIn( &in, &tag );
base.Parse( tag.c_str(), 0, TIXML_DEFAULT_ENCODING );
return in;
}
#endif
#ifdef TIXML_USE_STL
std::ostream& operator<< (std::ostream & out, const TiXmlNode & base)
{
TiXmlPrinter printer;
printer.SetStreamPrinting();
base.Accept( &printer );
out << printer.Str();
return out;
}
std::string& operator<< (std::string& out, const TiXmlNode& base )
{
TiXmlPrinter printer;
printer.SetStreamPrinting();
base.Accept( &printer );
out.append( printer.Str() );
return out;
}
#endif
TiXmlHandle TiXmlHandle::FirstChild() const
{
if ( node )
{
TiXmlNode* child = node->FirstChild();
if ( child )
return TiXmlHandle( child );
}
return TiXmlHandle( 0 );
}
TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const
{
if ( node )
{
TiXmlNode* child = node->FirstChild( value );
if ( child )
return TiXmlHandle( child );
}
return TiXmlHandle( 0 );
}
TiXmlHandle TiXmlHandle::FirstChildElement() const
{
if ( node )
{
TiXmlElement* child = node->FirstChildElement();
if ( child )
return TiXmlHandle( child );
}
return TiXmlHandle( 0 );
}
TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const
{
if ( node )
{
TiXmlElement* child = node->FirstChildElement( value );
if ( child )
return TiXmlHandle( child );
}
return TiXmlHandle( 0 );
}
TiXmlHandle TiXmlHandle::Child( int count ) const
{
if ( node )
{
int i;
TiXmlNode* child = node->FirstChild();
for ( i=0;
child && i<count;
child = child->NextSibling(), ++i )
{
// nothing
}
if ( child )
return TiXmlHandle( child );
}
return TiXmlHandle( 0 );
}
TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const
{
if ( node )
{
int i;
TiXmlNode* child = node->FirstChild( value );
for ( i=0;
child && i<count;
child = child->NextSibling( value ), ++i )
{
// nothing
}
if ( child )
return TiXmlHandle( child );
}
return TiXmlHandle( 0 );
}
TiXmlHandle TiXmlHandle::ChildElement( int count ) const
{
if ( node )
{
int i;
TiXmlElement* child = node->FirstChildElement();
for ( i=0;
child && i<count;
child = child->NextSiblingElement(), ++i )
{
// nothing
}
if ( child )
return TiXmlHandle( child );
}
return TiXmlHandle( 0 );
}
TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const
{
if ( node )
{
int i;
TiXmlElement* child = node->FirstChildElement( value );
for ( i=0;
child && i<count;
child = child->NextSiblingElement( value ), ++i )
{
// nothing
}
if ( child )
return TiXmlHandle( child );
}
return TiXmlHandle( 0 );
}
bool TiXmlPrinter::VisitEnter( const TiXmlDocument& )
{
return true;
}
bool TiXmlPrinter::VisitExit( const TiXmlDocument& )
{
return true;
}
bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute )
{
DoIndent();
buffer += "<";
buffer += element.Value();
for( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() )
{
buffer += " ";
attrib->Print( 0, 0, &buffer );
}
if ( !element.FirstChild() )
{
buffer += " />";
DoLineBreak();
}
else
{
buffer += ">";
if ( element.FirstChild()->ToText()
&& element.LastChild() == element.FirstChild()
&& element.FirstChild()->ToText()->CDATA() == false )
{
simpleTextPrint = true;
// no DoLineBreak()!
}
else
{
DoLineBreak();
}
}
++depth;
return true;
}
bool TiXmlPrinter::VisitExit( const TiXmlElement& element )
{
--depth;
if ( !element.FirstChild() )
{
// nothing.
}
else
{
if ( simpleTextPrint )
{
simpleTextPrint = false;
}
else
{
DoIndent();
}
buffer += "</";
buffer += element.Value();
buffer += ">";
DoLineBreak();
}
return true;
}
bool TiXmlPrinter::Visit( const TiXmlText& text )
{
if ( text.CDATA() )
{
DoIndent();
buffer += "<![CDATA[";
buffer += text.Value();
buffer += "]]>";
DoLineBreak();
}
else if ( simpleTextPrint )
{
TIXML_STRING str;
TiXmlBase::EncodeString( text.ValueTStr(), &str );
buffer += str;
}
else
{
DoIndent();
TIXML_STRING str;
TiXmlBase::EncodeString( text.ValueTStr(), &str );
buffer += str;
DoLineBreak();
}
return true;
}
bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration )
{
DoIndent();
declaration.Print( 0, 0, &buffer );
DoLineBreak();
return true;
}
bool TiXmlPrinter::Visit( const TiXmlComment& comment )
{
DoIndent();
buffer += "<!--";
buffer += comment.Value();
buffer += "-->";
DoLineBreak();
return true;
}
bool TiXmlPrinter::Visit( const TiXmlUnknown& unknown )
{
DoIndent();
buffer += "<";
buffer += unknown.Value();
buffer += ">";
DoLineBreak();
return true;
}
| [
"lehoangq@gmail.com"
] | lehoangq@gmail.com |
3f06e1fb3edcb8dc4bf252a371af5f4b5de86e75 | 8dc84558f0058d90dfc4955e905dab1b22d12c08 | /third_party/android_ndk/sources/cxx-stl/stlport/stlport/typeinfo.h | 0cea71a57503e9923a20194ea544bc4c9fa742e2 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-mit-old-style",
"LicenseRef-scancode-stlport-4.5",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | permissive | meniossin/src | 42a95cc6c4a9c71d43d62bc4311224ca1fd61e03 | 44f73f7e76119e5ab415d4593ac66485e65d700a | refs/heads/master | 2022-12-16T20:17:03.747113 | 2020-09-03T10:43:12 | 2020-09-03T10:43:12 | 263,710,168 | 1 | 0 | BSD-3-Clause | 2020-05-13T18:20:09 | 2020-05-13T18:20:08 | null | UTF-8 | C++ | false | false | 2,665 | h | /*
* Copyright (c) 1999
* Boris Fomitchev
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/
// DMC has hardcoded inclusion of typeinfo.h at the begining of any translation unit.
// So inclusion of this header will directly reference the native header. This is not
// a problem as typeinfo.h is neither a C nor C++ Standard header, this header should
// never be used in user code.
#if defined (__DMC__)
// We define _STLP_OUTERMOST_HEADER_ID to signal to other STLport headers that inclusion
// is done from native typeinfo.h (see exception header).
# define _STLP_OUTERMOST_HEADER_ID 0x874
# include <../include/typeinfo.h>
# undef _STLP_OUTERMOST_HEADER_ID
#else
# ifndef _STLP_OLDSTD_typeinfo
# define _STLP_OLDSTD_typeinfo
# ifndef _STLP_OUTERMOST_HEADER_ID
# define _STLP_OUTERMOST_HEADER_ID 0x874
# include <stl/_prolog.h>
# endif
# ifndef _STLP_NO_TYPEINFO
# if defined (__GNUC__)
# undef _STLP_OLDSTD_typeinfo
# include <typeinfo>
# define _STLP_OLDSTD_typeinfo
# else
# if defined (_STLP_HAS_INCLUDE_NEXT)
# include_next <typeinfo.h>
# elif !defined (__BORLANDC__) || (__BORLANDC__ < 0x580)
# include _STLP_NATIVE_CPP_RUNTIME_HEADER(typeinfo.h)
# else
# include _STLP_NATIVE_CPP_C_HEADER(typeinfo.h)
# endif
# if defined (__BORLANDC__) && (__BORLANDC__ >= 0x580) || \
defined (__DMC__)
using std::type_info;
using std::bad_typeid;
using std::bad_cast;
# endif
# endif
// if <typeinfo> already included, do not import anything
# if defined (_STLP_USE_OWN_NAMESPACE) && !(defined (_STLP_TYPEINFO) && !defined (_STLP_NO_NEW_NEW_HEADER))
_STLP_BEGIN_NAMESPACE
using /*_STLP_VENDOR_EXCEPT_STD */ :: type_info;
# if !(defined(__MRC__) || (defined(__SC__) && !defined(__DMC__)))
using /* _STLP_VENDOR_EXCEPT_STD */ :: bad_typeid;
# endif
using /* _STLP_VENDOR_EXCEPT_STD */ :: bad_cast;
_STLP_END_NAMESPACE
# endif /* _STLP_OWN_NAMESPACE */
# endif /* _STLP_NO_TYPEINFO */
# if (_STLP_OUTERMOST_HEADER_ID == 0x874)
# include <stl/_epilog.h>
# undef _STLP_OUTERMOST_HEADER_ID
# endif
# endif /* _STLP_OLDSTD_typeinfo */
#endif /* __DMC__ */
// Local Variables:
// mode:C++
// End:
| [
"arnaud@geometry.ee"
] | arnaud@geometry.ee |
0391591597f0f49dc5d0f273400b230a3164bb23 | db01d410b680ee860bfd3b60b877248f787e7bc5 | /src/particle_filter.cpp | 8dda45246293317f419beb4ab892b0892eca687e | [
"MIT"
] | permissive | usedlobster/CarND-T2-P3 | 3baf5a476b0e43eba78748820a60218c73ca35f0 | 4c373854d1670abbb4d9446278d58f1641d21e70 | refs/heads/master | 2021-04-30T00:03:50.069051 | 2018-02-19T22:14:00 | 2018-02-19T22:14:00 | 121,568,064 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,869 | cpp | /*
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*/
// completed by usedlobster Feburary 2018.
#include <random>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <math.h>
#include <iostream>
#include <sstream>
#include <string>
#include <iterator>
#include <assert.h>
#include "particle_filter.h"
using namespace std;
void ParticleFilter::init(double x, double y, double theta, double std[]) {
// Set the number of initial particles, to use
// anything > 10 works , 200 seems a good trade off between time / accuracy
num_particles = 200 ;
//Initialize all particles to first position (based on estimates of
// x, y, theta and their uncertainties from GPS) and all weights to 1.
// Add random Gaussian noise to each particle.
// create a ( pseudo ) random number engine
default_random_engine generator ;
// create gaussian distribution generators for each standard deviation.
normal_distribution<double> dist_x( x, std[0] ) ;
normal_distribution<double> dist_y( y, std[1] ) ;
normal_distribution<double> dist_theta( theta, std[2] );
// reserve space for efficiency ,
particles.reserve( num_particles ) ;
// create a random particle - using generators above.
for ( int i=0; i<num_particles; i++) {
Particle a_random_particle ;
a_random_particle.id = i ;
a_random_particle.x = dist_x( generator ) ;
a_random_particle.y = dist_y( generator ) ;
a_random_particle.theta = dist_theta( generator ) ;
particles.push_back( a_random_particle ) ;
}
// need todo this
is_initialized = true ;
}
void ParticleFilter::prediction(double delta_t, double std_pos[], double velocity, double yaw_rate) {
default_random_engine generator ;
// create normal distribution generator with 0 mean , std_pos
normal_distribution<double> dist_x( 0.0, std_pos[0] );
normal_distribution<double> dist_y( 0.0, std_pos[1] );
normal_distribution<double> dist_theta( 0.0, std_pos[2] );
// apply velocity , and yaw change to each particle
for ( auto &p : particles ) {
// if yaw_rate is practically 0
// just move forward in current direction.
if ( fabs( yaw_rate) < 1e-5 ) {
p.x += velocity * delta_t * cos( p.theta ) ;
p.y += velocity * delta_t * sin( p.theta ) ;
} else {
p.x += ( velocity / yaw_rate ) * ( sin( p.theta + yaw_rate * delta_t ) - sin( p.theta )) ;
p.y += ( velocity / yaw_rate ) * ( cos( p.theta ) - cos( p.theta + yaw_rate * delta_t )) ;
p.theta += yaw_rate*delta_t ;
}
// add some noise to the position
p.x += dist_x( generator ) ;
p.y += dist_y( generator ) ;
p.theta += dist_theta( generator ) ;
}
}
void ParticleFilter::dataAssociation(std::vector<LandmarkObs> predicted, std::vector<LandmarkObs>& observations)
{
// go through each observation , and find which landmark is nearest.
; for ( auto &obs : observations ) {
double min_d2 ; // NB: no need to initialize
int nearest_id = -1 ;
for ( auto lm : predicted ) {
//
double d2 = ( obs.x - lm.x )*( obs.x - lm.x ) + ( obs.y - lm.y )*( obs.y - lm.y ) ;
if ( nearest_id < 0 || d2 < min_d2 ) {
nearest_id = lm.id ;
min_d2 = d2 ;
}
}
// record which landmark this observation was closest to.
obs.id = nearest_id ;
}
}
void ParticleFilter::updateWeights(double sensor_range, double std_landmark[],
const std::vector<LandmarkObs> &observations, const Map &map_landmarks) {
// Update the weights of each particle using a mult-variate Gaussian distribution.
// precompute these, as used for each particle.
double sigX = std_landmark[0] ; // sigma_x
double sigY = std_landmark[1] ; // sigma_y
double gNorm = 1.0 / ( 2.0 * M_PI * sigX * sigY ) ; // 1/( 2*pi*sigma_x*sigma_y )
double sig2XX = 2.0 * sigX * sigX ; // twice sigma_x squared
double sig2YY = 2.0 * sigY * sigY ; // twice sigma_y squared
// clear vector list of weights
weights.clear() ;
// for each particle we
for ( auto &p : particles ) {
// create a list of observation in real world space
// as if we had observed them from current particle p .
std::vector< LandmarkObs >real_world_obs ;
double cos_t = cos( p.theta ) ;
double sin_t = sin( p.theta ) ;
for ( auto obs : observations ) {
double mx = p.x + obs.x * cos_t - obs.y * sin_t ;
double my = p.y + obs.x * sin_t + obs.y * cos_t ;
real_world_obs.push_back( LandmarkObs{ obs.id, mx, my } ) ;
}
// create list of possible landmarks - in sensor range ( a square area )
std::vector< LandmarkObs >nearby_landmarks ;
for ( auto lm : map_landmarks.landmark_list ) {
if ( fabs( lm.x_f - p.x ) < sensor_range || fabs( lm.y_f - p.y ) < sensor_range )
nearby_landmarks.push_back( LandmarkObs{ lm.id_i, lm.x_f, lm.y_f } ) ;
}
// associate the real_world_obs with possible landmarks.
dataAssociation( nearby_landmarks, real_world_obs ) ;
// we can calculate the weight of each particle
p.associations.clear() ;
p.sense_x.clear() ;
p.sense_y.clear() ;
if ( nearby_landmarks.size() > 0 ) {
p.weight = 1.0 ;
for ( auto rwo : real_world_obs ) {
if ( rwo.id >= 0 ) {
// rwo.id gives us best landmark to use , its -1 if there is none
// we need to iterate to find it again,
// as we haven't assumed map_landmarks.landmark_lists[rwo.id-1] is the same landmark
// but it probably is. ( acctually is ).
// We have also assumed id's are always >=0
for ( int i=0; i < nearby_landmarks.size() ; i++ ) {
if ( nearby_landmarks[i].id == rwo.id ) {
double dx = rwo.x - nearby_landmarks[i].x ;
double dy = rwo.y - nearby_landmarks[i].y ;
//
p.weight *= gNorm * exp( - ( (( dx * dx ) / sig2XX ) + (( dy * dy ) / sig2YY ))) ;
// we might as well assign debug information here
// rather than create 3 more lists.
p.associations.push_back( rwo.id ) ;
p.sense_x.push_back( rwo.x ) ;
p.sense_y.push_back( rwo.y ) ;
break ;
}
}
}
}
} else
p.weight = 0.0 ; // set to 0 as no landmarks
// keep track of particle weights in a single vector list as well.
// helps with resampling
weights.push_back( p.weight ) ;
}
}
void ParticleFilter::resample() {
default_random_engine gen;
std::discrete_distribution<int> weight_distribution( weights.begin(), weights.end());
std::vector<Particle> resampled_particles ;
resampled_particles.clear() ; // not strictly necessary I know.
for (int i = 0; i < particles.size() ; i++)
resampled_particles.push_back( particles[weight_distribution(gen)] );
particles = resampled_particles ;
// I prefer old wheel method - works just as well , and you can see what its doing
/*
std::uniform_real_distribution<double> uniR(0.0, 1.0 );
double wMax = *std::max_element( weights.begin(), weights.end());
int N = weights.size() ;
double beta = 0.0 ;
int index = int(N*uniR(gen))%N ;
for ( int i=0; i<N; i++) {
beta = beta + 2.0 * uniR(gen) * wMax ;
while ( weights[index] < beta ) {
beta = beta - weights[index] ;
index = (index+1)%N ;
}
resampled_particles.push_back( particles[index] );
}
particles = resampled_particles ;
*/
}
Particle ParticleFilter::SetAssociations(Particle& particle, const std::vector<int>& associations,
const std::vector<double>& sense_x, const std::vector<double>& sense_y) {
//particle: the particle to assign each listed association, and association's (x,y) world coordinates mapping to
// associations: The landmark id that goes along with each listed association
// sense_x: the associations x mapping already converted to world coordinates
// sense_y: the associations y mapping already converted to world coordinates
particle.associations= associations;
particle.sense_x = sense_x;
particle.sense_y = sense_y;
}
string ParticleFilter::getAssociations(Particle best) {
vector<int> v = best.associations;
stringstream ss;
copy( v.begin(), v.end(), ostream_iterator<int>(ss, " "));
string s = ss.str();
s = s.substr(0, s.length()-1); // get rid of the trailing space
return s;
}
string ParticleFilter::getSenseX(Particle best) {
vector<double> v = best.sense_x;
stringstream ss;
copy( v.begin(), v.end(), ostream_iterator<float>(ss, " "));
string s = ss.str();
s = s.substr(0, s.length()-1); // get rid of the trailing space
return s;
}
string ParticleFilter::getSenseY(Particle best) {
vector<double> v = best.sense_y;
stringstream ss;
copy( v.begin(), v.end(), ostream_iterator<float>(ss, " "));
string s = ss.str();
s = s.substr(0, s.length()-1); // get rid of the trailing space
return s;
}
| [
"usedlobster@gmail.com"
] | usedlobster@gmail.com |
00619d34417ee89a8e9f47a1c1f1783b9bf564ed | 915c02dfc0485d8d406fe9f8d7fa287676beda08 | /Physics.cpp | 9bd30cca35f9a5d3d7bd96e20a29106f88fb82df | [] | no_license | rfloyd01/Golf_Physics | 0e801c1ff7e0b7ff266217b182d5a5bd4b3e0da8 | 035f593b9f28759ff1d68d3976ddbec04c3edc37 | refs/heads/main | 2023-06-21T17:25:59.899205 | 2021-08-08T18:37:29 | 2021-08-08T18:37:29 | 389,198,797 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 23,295 | cpp | #include "Physics.h"
#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#define PI 3.141592654
#define g 9.80665
#define MtoY 1.09361
std::pair<Vector_3d, Vector_3d> getBallVelocities(Golf_Club& club, Golf_Ball& ball, Golf_Swing& swing)
{
//This function takes club properties, ball properties and swing properties as input and returns two Vector_3d types
//The first contains the velocity of the golf ball after impact and the second contains the angular velocity of the ball after impact
//The +x axis is defined as from the golf ball to the intended targer
//The +y axis is defined as from the golfer to the golf ball
//The +z axis is defined as from the golf ball to the sky
//convert any value given in degrees to radians
//double pi = 3.14159;
double loft = club.loft * PI / 180.0;
double dynamic_loft = swing.clubhead_dynamic_loft * PI / 180.0;
double tilt = swing.clubhead_tilt * PI / 180.0;
double openness = swing.clubhead_openness * PI / 180.0;
double angle_of_attack = swing.angle_of_attack * PI / 180.0;
double target_angle = swing.target_line_angle * PI / 180.0;
//for now, assume that the contact point chosen on the clubface will be the origin and that the clubface doesn't have any loft or tilt applied to it yet and is just a rectangle sitting flat on the ground
//unit vectors describing the direction of the clubface normal, clubface tangent (side to side of face) and clubface parallel (top to bottom) directions will be defined as:
Vector_3d clubface_normal = { cos(loft), 0, sin(loft) };
Vector_3d clubface_tangent = { 0, 1, 0 };
Vector_3d clubface_parallel = { -sin(loft), 0, cos(loft) };
//define rotation quaternion that will translate the clubface normal, tangent and parallel vectors from initial orientation to orientation with dynamic loft, openess and tilt applied to clubhead
double q0 = cos(tilt / 2.0) * cos(dynamic_loft / 2.0) * cos(openness / 2.0) + sin(tilt / 2.0) * sin(dynamic_loft / 2.0) * sin(openness / 2.0);
double q1 = sin(tilt / 2.0) * cos(dynamic_loft / 2.0) * cos(openness / 2.0) - cos(tilt / 2.0) * sin(dynamic_loft / 2.0) * sin(openness / 2.0);
double q2 = cos(tilt / 2.0) * sin(dynamic_loft / 2.0) * cos(openness / 2.0) + sin(tilt / 2.0) * cos(dynamic_loft / 2.0) * sin(openness / 2.0);
double q3 = cos(tilt / 2.0) * cos(dynamic_loft / 2.0) * sin(openness / 2.0) - sin(tilt / 2.0) * sin(dynamic_loft / 2.0) * cos(openness / 2.0);
glm::dquat rotation_quaternion = { q0, q1, q2, q3 };
//rotate the clubface normal, parallel and tangent vectors so that they now point in the correct x, y and z directions
QuatRotate(rotation_quaternion, clubface_normal);
QuatRotate(rotation_quaternion, clubface_tangent);
QuatRotate(rotation_quaternion, clubface_parallel);
//Create a vector describing the initial velocity of the clubhead in [X, Y, Z] coordinates
Vector_3d initial_clubhead_velocity = { swing.swing_speed * cos(angle_of_attack) * cos(target_angle) , swing.swing_speed * cos(angle_of_attack) * sin(target_angle) , -swing.swing_speed * sin(angle_of_attack) };
//Project the [X, Y, Z] initial velocity vector onto the rotated normal, parallel and tangent vectors of the club face. This gives the [X, Y, Z] components of the velocity in [N, P, T] space
Vector_3d clubface_normal_velocity = VectorProjection(initial_clubhead_velocity, clubface_normal); //the projection of the clubhead velocity onto the clubface normal vector
Vector_3d clubface_parallel_velocity = VectorProjection(initial_clubhead_velocity, clubface_parallel); //the projection of the clubhead velocity onto the clubface parallel vector
Vector_3d clubface_tangent_velocity = VectorProjection(initial_clubhead_velocity, clubface_tangent); //the projection of the clubhead velocity onto the clubface tangent vector
Vector_3d Vci; //This vector represents the initial velocity of the clubhead in [N, P, T] coordinates
//Check whether the components of the initial velocity vector are pointing in the positive or negative N, P and T directions
//Need to check if the magnitude of any component of the velocity is 0 to avoid division by 0.
if (VectorMagnitude(clubface_normal_velocity) != 0)
Vci.x = VectorMagnitude(clubface_normal_velocity) * DotProduct(clubface_normal_velocity, clubface_normal) / VectorMagnitude(clubface_normal_velocity); //the dot product will be -1 if the values are 180 degrees from eachother
if (VectorMagnitude(clubface_parallel_velocity) != 0)
Vci.y = VectorMagnitude(clubface_parallel_velocity) * DotProduct(clubface_parallel_velocity, clubface_parallel) / VectorMagnitude(clubface_parallel_velocity); //the dot product will be -1 if the values are 180 degrees from eachother
if (VectorMagnitude(clubface_tangent_velocity) != 0)
Vci.z = VectorMagnitude(clubface_tangent_velocity) * DotProduct(clubface_tangent_velocity, clubface_tangent) / VectorMagnitude(clubface_tangent_velocity); //the dot product will be -1 if the values are 180 degrees from eachother
//Calculate the coefficient of restitution for the collision based on the initial velocity of the clubhead along the clubface normal vector. This equation for e is based on research found online
//TODO: The research I read for the calculation of e was only based on driver swings, need to do some more research to see if it differs by club at all. Not getting nearly enough velocity on a sandwedge
double coefficient_of_restitution;
coefficient_of_restitution = 0.86 - 0.0029 * Vci.x; //this value taken from a research paper, the less directly the clubface impacts the ball the less the ball will compress so more energy is conserved
//Since ball contact is always made on the vector from the clubface normal to the center of the ball, the normal component of the r vector is rb and the tangent and parallel components are 0
//Likewise, no matter how the clubface is rotated in the cartesian frame the contact point on the club face will never move away from the center of mass in the normal, parallel and tangent from
///i.e. the normal component from contact point to center of mass will always be -clubhead_width / 2, along the parallel will be - impact_height and along the tangent will always be -impact_length.
Vector_3d r = { -ball.radius, 0, 0 }; //these are [N, P, T] coordinates
Vector_3d R = { club.clubhead_width / 2.0, swing.contact_height + club.clubhead_height * club.clubhead_cm_height, swing.contact_length };
//TODO: Altering the contact height isn't currently having an effect on final ball velocity or spin rate which seems wrong, take a look into this at some point
//We currently have 15 unknown variables to solve for and 15 different equations of motion that govern the impact so the values can be obtained using a linear equation module named Eigen
//The unknown variables are: Pn, Pp, Pt, Vcfn, Vcfp, Vcft, Vbfn, Vbfp, Vbft, Wcfn, Wcfp, Wcft, Wbfn, Wbfp and Wbft where P is Impulse, V is velocity and W is angular velocity (c and b mean club and ball)
Eigen::MatrixXf Values(15, 15);
Eigen::MatrixXf Answers(15, 1);
//My own equations which include orbital momentum
Values <<
-1, 0, 0, club.mass, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, -1, 0, 0, club.mass, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, -1, 0, 0, club.mass, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, ball.mass, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, ball.mass, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, ball.mass, 0, 0, 0, 0, 0, 0,
0, R.z, -R.y, 0, -R.z * club.mass, R.y * club.mass, 0, 0, 0, club.Moment_of_Inertia.x, 0, 0, 0, 0, 0,
-R.z, 0, R.x, R.z * club.mass, 0, -R.x * club.mass, 0, 0, 0, 0, club.Moment_of_Inertia.y, 0, 0, 0, 0,
R.y, -R.x, 0, -R.y * club.mass, R.x* club.mass, 0, 0, 0, 0, 0, 0, club.Moment_of_Inertia.z, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ball.Moment_of_Inertia, 0, 0,
0, 0, -r.x, 0, 0, 0, 0, 0, r.x* ball.mass, 0, 0, 0, 0, ball.Moment_of_Inertia, 0,
0, r.x, 0, 0, 0, 0, 0, -r.x * ball.mass, 0, 0, 0, 0, 0, 0, ball.Moment_of_Inertia,
0, 0, 0, -1, 0, 0, 1, 0, 0, 0, -R.z, R.y, 0, 0, 0,
0, 0, 0, 0, -1, 0, 0, 1, 0, R.z, 0, -R.x, 0, 0, r.x,
0, 0, 0, 0, 0, -1, 0, 0, 1, -R.y, R.x, 0, 0, -r.x, 0;
Answers <<
club.mass * Vci.x, club.mass * Vci.y, club.mass * Vci.z,
0, 0, 0,
R.y * club.mass * Vci.z - R.z * club.mass * Vci.y,
R.z * club.mass * Vci.x - R.x * club.mass * Vci.z,
R.x * club.mass * Vci.y - R.y * club.mass * Vci.x,
0, 0, 0, coefficient_of_restitution * Vci.x, 0, 0;
//Equations from Research Paper, orbital momentum not included
/*
Values <<
-1, 0, 0, club.mass, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, -1, 0, 0, club.mass, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, -1, 0, 0, club.mass, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, ball.mass, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, ball.mass, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, ball.mass, 0, 0, 0, 0, 0, 0,
0, -R.z, R.y, 0, 0, 0, 0, 0, 0, -club.Moment_of_Inertia.x, 0, 0, 0, 0, 0,
R.z, 0, -R.x, 0, 0, 0, 0, 0, 0, 0, -club.Moment_of_Inertia.y, 0, 0, 0, 0,
-R.y, R.x, 0, 0, 0, 0, 0, 0, 0, 0, 0, -club.Moment_of_Inertia.z, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -ball.Moment_of_Inertia, 0, 0,
0, 0, r.x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -ball.Moment_of_Inertia, 0,
0, -r.x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -ball.Moment_of_Inertia,
0, 0, 0, -1, 0, 0, 1, 0, 0, 0, -R.z, R.y, 0, 0, 0,
0, 0, 0, 0, -1, 0, 0, 1, 0, R.z, 0, -R.x, 0, 0, r.x,
0, 0, 0, 0, 0, -1, 0, 0, 1, -R.y, R.x, 0, 0, -r.x, 0;
Answers <<
club.mass * Vci.x, club.mass * Vci.y, club.mass * Vci.z,
0, 0, 0, 0, 0, 0, 0, 0, 0, coefficient_of_restitution * Vci.x, 0, 0;
*/
Eigen::MatrixXf Unknowns = Values.colPivHouseholderQr().solve(Answers);
//The unknown collision variables have now been acquired in [N, P, T] coordinates
Vector_3d Impulse = { Unknowns(0), Unknowns(1), Unknowns(2) };
Vector_3d Vfc = { Unknowns(3), Unknowns(4), Unknowns(5) };
Vector_3d Vfb = { Unknowns(6), Unknowns(7), Unknowns(8) };
Vector_3d Wfc = { Unknowns(9), Unknowns(10), Unknowns(11) };
Vector_3d Wfb = { Unknowns(12), Unknowns(13), Unknowns(14) };
//Convert Ball linear and angular velocity back into [X, Y, Z] coordinates
Vector_3d Ball_Velocity, Ball_Spin;
Ball_Velocity.x = clubface_normal.x * Vfb.x + clubface_parallel.x * Vfb.y + clubface_tangent.x * Vfb.z;
Ball_Velocity.y = clubface_normal.y * Vfb.x + clubface_parallel.y * Vfb.y + clubface_tangent.y * Vfb.z;
Ball_Velocity.z = clubface_normal.z * Vfb.x + clubface_parallel.z * Vfb.y + clubface_tangent.z * Vfb.z;
Ball_Spin.x = (clubface_normal.x * Wfb.x + clubface_parallel.x * Wfb.y + clubface_tangent.x * Wfb.z) / (2.0 * PI) * 60; //convert spin rate from rad/s to RPM
Ball_Spin.y = (clubface_normal.y * Wfb.x + clubface_parallel.y * Wfb.y + clubface_tangent.y * Wfb.z) / (2.0 * PI) * 60; //convert spin rate from rad/s to RPM
Ball_Spin.z = (clubface_normal.z * Wfb.x + clubface_parallel.z * Wfb.y + clubface_tangent.z * Wfb.z) / (2.0 * PI) * 60; //convert spin rate from rad/s to RPM
//Uncomment this section to see details on the final velocity and spin of the club, useful when debugging
/*
Vector_3d Club_Velocity, Club_Spin;
Club_Velocity.x = clubface_normal.x * Vfc.x + clubface_parallel.x * Vfc.y + clubface_tangent.x * Vfc.z;
Club_Velocity.y = clubface_normal.y * Vfc.x + clubface_parallel.y * Vfc.y + clubface_tangent.y * Vfc.z;
Club_Velocity.z = clubface_normal.z * Vfc.x + clubface_parallel.z * Vfc.y + clubface_tangent.z * Vfc.z;
Club_Spin.x = (clubface_normal.x * Wfc.x + clubface_parallel.x * Wfc.y + clubface_tangent.x * Wfc.z) / (2.0 * PI) * 60; //convert spin rate from rad/s to RPM
Club_Spin.y = (clubface_normal.y * Wfc.x + clubface_parallel.y * Wfc.y + clubface_tangent.y * Wfc.z) / (2.0 * PI) * 60; //convert spin rate from rad/s to RPM
Club_Spin.z = (clubface_normal.z * Wfc.x + clubface_parallel.z * Wfc.y + clubface_tangent.z * Wfc.z) / (2.0 * PI) * 60; //convert spin rate from rad/s to RPM
std::cout << "Final Club Velocity [X, Y, Z] = {" << Club_Velocity.x << ", " << Club_Velocity.y << ", " << Club_Velocity.z << "}" << std::endl;
std::cout << "Final Club Speed = " << VectorMagnitude(Club_Velocity) << " m/s" << std::endl << std::endl;
std::cout << "Final Club Angular Velocity [X, Y, Z] = {" << Club_Spin.x << ", " << Club_Spin.y << ", " << Club_Spin.z << "}" << std::endl;
std::cout << "Final Club Angular Speed = " << VectorMagnitude(Club_Spin) << " RPM" << std::endl << std::endl;
*/
return { Ball_Velocity, Ball_Spin };
}
void calculateBallFlight(std::pair<Vector_3d, Vector_3d> bi, Golf_Ball &ball, double delta_t)
{
//takes the initial velocity and angular velocity of ball after impact in vector form and calculates the trajectory
//the position data will be written to an external file so it can be graphed at a later point
//TODO: Currently doesn't take wind into account, add this functionality eventually
//TODO: Something seems a little off with the acceleration caused from air and magnus, they seem too high, look into this. Can't get decent ball flight without really lowering Cd value
//Need to convert ball angular velocity from RPM back to rad/s
bi.second.x *= (2 * PI / 60.0);
bi.second.y *= (2 * PI / 60.0);
bi.second.z *= (2 * PI / 60.0);
double acceleration[3][2], velocity[3][2]; //arrays to hold most recent and current values for acceleration and velocity in x, y, z directions for integration
Vector_3d S = CrossProduct(bi.first, bi.second);
Normalize(S); //S is a unit vector representing the direction of the Magnus force
Vector_3d B = bi.first, W = bi.second;
Normalize(B); //B is a unit vector representing the current direction of the ball's velocity
Normalize(W); //W is a unit vector representing the ball's angular velocity, it's assumed that the direction of the angular velocity won't change during flight
//std::cout << W.x << ", " << W.y << ", " << W.z << std::endl;
//std::cout << B.x << ", " << B.y << ", " << B.z << std::endl;
//std::cout << S.x << ", " << S.y << ", " << S.z << std::endl;
//Info on drag coefficient of golfball found here https://www.scirp.org/journal/paperinformation.aspx?paperid=85529
//Info on lift coefficient of golfball found here https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwiwktq7tv7xAhXzRTABHcKYASkQFjABegQIFRAD&url=https%3A%2F%2Fwww.mdpi.com%2F2504-3900%2F2%2F6%2F238%2Fpdf%23%3A~%3Atext%3DThe%2520coefficient%2520of%2520drag%2520for%2Ccarry%2520distance%2520(18%2520m).&usg=AOvVaw13OhhShGEQ25dm9SYdc8wW
double rho = 1.205; //density of air in kg/m^3 TODO: wan't to include a weather conditions struct that will incorporate this values as well as wind conditions separately
double Cd = 0.15; //Drag coefficient for golf ball obtained form experimental values TODO: would like to tie this into the golfball struct at some point as this value should change with dimple condition
double spin_factor = VectorMagnitude(bi.second) * ball.radius / VectorMagnitude(bi.first);
double Cl = -3.25 * spin_factor * spin_factor + 1.99 * spin_factor; //Lift coefficient for golf ball obtained form experimental values TODO: would like to tie this into the golfball struct at some point as this value should change with dimple condition
double ball_area_factor = 0.5 * rho * PI * ball.radius * ball.radius; //define this variable to avoid repeat multiplication
double angular_decel = 0.0;
double Reynolds_Number; //Gives an idea of how turbulent the airflow is around the ball, more turbulent air will reduce the amount of drag the ball experiences
//std::cout << "Coefficient of lift: " << Cl << std::endl;
//set initial velocity and acceleration values from input velocity of ball
velocity[0][1] = bi.first.x;
velocity[1][1] = bi.first.y;
velocity[2][1] = bi.first.z;
velocity[0][0] = 0;
velocity[1][0] = 0;
velocity[2][0] = 0;
double magnitude_velocity_squared = velocity[0][1] * velocity[0][1] + velocity[1][1] * velocity[1][1] + velocity[2][1] * velocity[2][1];
double air_force = ball_area_factor * magnitude_velocity_squared;
acceleration[0][1] = air_force * (Cl * S.x - Cd * B.x) / ball.mass; //acceleration caused by magnus affect and drag in the x direction
acceleration[1][1] = air_force * (Cl * S.y - Cd * B.y) / ball.mass; //acceleration caused by magnus affect and drag in the y direction
acceleration[2][1] = (air_force * (Cl * S.z - Cd * B.z) - ball.mass * g) / ball.mass; //acceleration caused by magnus affect, drag and gravity in the z direction
//vector to hold position data in x, y and z dimensions
std::vector<std::vector<double> > position;
for (int i = 0; i < 3; i++)
{
std::vector<double> yo;
position.push_back(yo);
}
//ball starts at the origin and moves along the +x direction
position[0].push_back(0);
position[1].push_back(0);
position[2].push_back(0);
double flight_time = 0.0;
//Simulate the flight of the golf ball by stepping forward in increments of delta_t until the z value is less than 0
while (position[2].back() >= 0)
{
//calculate the current Reynold's number based on the ball's velocity
Reynolds_Number = sqrt(magnitude_velocity_squared) * 2 * ball.radius / 0.00001527; //TODO: this is just down and dirty for now, work in better velocity magnitude, kinematic air viscocity and ball diameter numbers
//recalculate the drag coefficient based on the new Reynold's Number
if (Reynolds_Number <= 7500) Cd = 0.000000000129 * Reynolds_Number * Reynolds_Number - .0000259 * Reynolds_Number + 1.50;
else Cd = 0.0000000000191 * Reynolds_Number * Reynolds_Number - 0.0000054 * Reynolds_Number + 0.56;
flight_time += delta_t;
//std::cout << "Current Ball Location: {" << position[0].back() << ", " << position[1].back() << ", " << position[2].back() << "}" << std::endl;
//std::cout << "Current Ball Angular Velocity [X, Y, Z] = {" << bi.second.x << ", " << bi.second.y << ", " << bi.second.z << "}" << std::endl;
//first move the position of the current velocity and acceleration (element 1 of the arrays) to the position of past velocity and acceleration (element 0)
velocity[0][0] = velocity[0][1];
velocity[1][0] = velocity[1][1];
velocity[2][0] = velocity[2][1];
acceleration[0][0] = acceleration[0][1];
acceleration[1][0] = acceleration[1][1];
acceleration[2][0] = acceleration[2][1];
//next calculate the angular deceleration of the ball based on the current angular and linear velocity over time interval delta_t
angular_decel = -0.00002 / ball.radius * sqrt(magnitude_velocity_squared) * VectorMagnitude(bi.second) * delta_t;
//apply the angular deceleration to the current angular velocity
bi.second.x += angular_decel * W.x;
bi.second.y += angular_decel * W.y;
bi.second.z += angular_decel * W.z;
//calculate the new direction of S based on new velocity vector obtained in last iteration of loop
//S = CrossProduct(bi.first, bi.second);
S = CrossProduct(bi.first, bi.second);
Normalize(S);
//std::cout << "t = " << flight_time << ", height = " << position[2].back() << std::endl;
//std::cout << S.x << ", " << S.y << ", " << S.z << " current x = " << position[0].back() << std::endl << std::endl;
//calculate new accceleration values
acceleration[0][1] = air_force * (Cl * S.x - Cd * B.x) / ball.mass; //acceleration caused by magnus affect and drag in the x direction
acceleration[1][1] = air_force * (Cl * S.y - Cd * B.y) / ball.mass; //acceleration caused by magnus affect and drag in the y direction
acceleration[2][1] = (air_force * (Cl * S.z - Cd * B.z) - ball.mass * g) / ball.mass; //acceleration caused by magnus affect, drag and gravity in the z direction
//std::cout << acceleration[0][1] << ", " << acceleration[1][1] << ", " << acceleration[2][1] << ", " << flight_time << std::endl;
//std::cout << "X Accelerations: " << air_force * Cl * S.x / ball.mass << " N lift force, " << air_force * -Cd * B.x / ball.mass << " N drag force" << std::endl;
//std::cout << "Z Accelerations: " << air_force * Cl * S.z / ball.mass << " N lift acc., " << air_force * -Cd * B.z / ball.mass << " N drag acc., " << -g << "grav. acc." << std::endl << std::endl;
//integrate current and previous acceleration values to get current velocity values
velocity[0][1] = velocity[0][0] + Integrate(acceleration[0][1], acceleration[0][0], delta_t);
velocity[1][1] = velocity[1][0] + Integrate(acceleration[1][1], acceleration[1][0], delta_t);
velocity[2][1] = velocity[2][0] + Integrate(acceleration[2][1], acceleration[2][0], delta_t);
//std::cout << flight_time << std::endl;
//std::cout << velocity[0][0] << ", " << velocity[1][0] << ", " << velocity[2][0] << std::endl;
//std::cout << velocity[0][1] << ", " << velocity[1][1] << ", " << velocity[2][1] << std::endl << std::endl;
//integrate current and previous velocity values to get current position values
position[0].push_back(position[0].back() + Integrate(velocity[0][1], velocity[0][0], delta_t)); //convert meter readings to yards for better golfer readability
position[1].push_back(position[1].back() + Integrate(velocity[1][1], velocity[1][0], delta_t)); //convert meter readings to yards for better golfer readability
position[2].push_back(position[2].back() + Integrate(velocity[2][1], velocity[2][0], delta_t)); //convert meter readings to yards for better golfer readability
//std::cout << flight_time << std::endl;
//std::cout << position[2][position[2].size() - 2] << std::endl;
//std::cout << position[2][position[2].size() - 1] << std::endl << std::endl;
//update velocity vector, velocity magnitude squared value, Lift Coefficient and air_force effect based on current velocity
bi.first.x = velocity[0][1];
bi.first.y = velocity[1][1];
bi.first.z = velocity[2][1];
spin_factor = VectorMagnitude(bi.second) * ball.radius / VectorMagnitude(bi.first);
Cl = -3.25 * spin_factor * spin_factor + 1.99 * spin_factor;
//std::cout << Cl << std::endl;
magnitude_velocity_squared = velocity[0][1] * velocity[0][1] + velocity[1][1] * velocity[1][1] + velocity[2][1] * velocity[2][1];
air_force = ball_area_factor * magnitude_velocity_squared;
B = bi.first;
Normalize(B);
}
//std::cout << "Final Final Ball Angular Velocity [X, Y, Z] = {" << bi.second.x << ", " << bi.second.y << ", " << bi.second.z << "}" << std::endl;
//std::cout << "Final Final Angular Speed = " << VectorMagnitude(bi.second) << " rad/s" << std::endl << std::endl;
//std::cout << "Final Final Ball Velocity [X, Y, Z] = {" << bi.first.x << ", " << bi.first.y << ", " << bi.first.z << "}" << std::endl;
//std::cout << "Final Final Speed = " << VectorMagnitude(bi.first) << " m/s" << std::endl << std::endl;
std::cout << "Final Ball Location (Yards): {" << position[0].back() << ", " << position[1].back() << ", " << position[2].back() << "}" << std::endl;
std::cout << "Total flight time = " << flight_time << " seconds." << std::endl;
//having issues with the y-axis being inverted in gnuplot so just manually invert all y-position dimensions
for (int i = 0; i < position[1].size(); i++) position[1][i] *= -1;
//write all position data to an external file
std::ofstream myFile;
myFile.open("ball_flight.dat");
for (int i = 0; i < position[0].size(); i++)
{
myFile << position[0][i] << " " << position[1][i] << " " << position[2][i] << '\n';
}
myFile.close();
}
| [
"noreply@github.com"
] | rfloyd01.noreply@github.com |
8e8ad98d86052d1cccc0020065b31da96e811e90 | c0ddf9d6d7ec34872e061b87ef8ad0b603e54efe | /DaramLib/DaramLib/DaramInput.cpp | 44b006137d0cd344e4e3dfbc8ab1da299727fd3d | [] | no_license | daramkun/ProjectPavilion | 945a4f6956800dc28a07205a047b2201ac2a2faf | a112ba4551c821521700854d15642db64cbdefd6 | refs/heads/master | 2020-08-16T00:07:10.505436 | 2019-10-16T01:16:42 | 2019-10-16T01:16:42 | 215,427,712 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 6,875 | cpp | #define DLLEXPORT
#include "DaramInput.h"
void DaramInput::CreateInput(HWND Handle, bool ExclusiveMode, bool BackgroundMode, bool keyboardUse, bool mouseUse, bool joyUse)
{
HRESULT result;
DWORD exMode, bgMode;
win = Handle;
result = DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION,
IID_IDirectInput8, (VOID**)&input, NULL);
if(FAILED(result))
{
MessageBox(NULL, "Direct Input 생성 오류", "인풋 장치 오류", NULL);
PostQuitMessage(0);
return;
}
this->keyboardUse = keyboardUse;
this->mouseUse = mouseUse;
this->joyUse = joyUse;
if(keyboardUse)
input->CreateDevice(GUID_SysKeyboard, &keyboard, NULL);
if(mouseUse)
input->CreateDevice(GUID_SysMouse, &mouse, NULL);
if(joyUse)
input->CreateDevice(GUID_Joystick, &joystick, NULL);
if(ExclusiveMode)
exMode = DISCL_EXCLUSIVE;
else
exMode = DISCL_NONEXCLUSIVE;
if(BackgroundMode)
bgMode = DISCL_BACKGROUND;
else
bgMode = DISCL_FOREGROUND;
if(keyboard != NULL && keyboardUse)
result = keyboard->SetCooperativeLevel(Handle, exMode | bgMode);
if(mouse != NULL && mouseUse)
result = mouse->SetCooperativeLevel(Handle, exMode | bgMode);
if(joystick != NULL && joyUse)
result = joystick->SetCooperativeLevel(Handle, exMode | bgMode);
if(keyboard != NULL && keyboardUse)
result = keyboard->SetDataFormat(&c_dfDIKeyboard);
if(mouse != NULL && mouseUse)
result = mouse->SetDataFormat(&c_dfDIMouse);
if(joystick != NULL && joyUse)
result = joystick->SetDataFormat(&c_dfDIJoystick);
if(keyboard != NULL && keyboardUse)
keyboard->Acquire();
if(mouse != NULL && mouseUse)
mouse->Acquire();
if(joystick != NULL && joyUse)
joystick->Acquire();
}
bool DaramInput::KeyDown(int key)
{
if(!keyboardUse) return false;
if(diks[key] & 0x80)
{
if(keylast[key])
return false;
else
{
keylast[key] = true;
return true;
}
}
else
{
keylast[key] = false;
return false;
}
}
bool DaramInput::KeyPress(int key)
{
if(!keyboardUse) return false;
return (diks[key] & 0x80) ? true : false;
}
bool DaramInput::KeyUp(int key)
{
if(!keyboardUse) return false;
if(!(diks[key] & 0x80))
{
if(!keylast[key])
return false;
else
{
keylast[key] = false;
return true;
}
}
else
return false;
}
BYTE* DaramInput::GetPressedKey()
{
return diks;
}
bool DaramInput::AnyKeyDown()
{
for(int i = 0; i < 256; i++)
{
if(KeyDown(i))
return true;
}
return false;
}
bool DaramInput::AnyKeyPress()
{
for(int i = 0; i < 256; i++)
{
if(KeyPress(i))
return true;
}
return false;
}
bool DaramInput::AnyKeyUp()
{
for(int i = 0; i < 256; i++)
{
if(KeyUp(i))
return true;
}
return false;
}
bool DaramInput::MouseDown(int mouseKey)
{
if(!mouseUse) return false;
if(mstate.rgbButtons[mouseKey] & 0x80)
{
if(mouselast[mouseKey])
return false;
else
{
mouselast[mouseKey] = true;
return true;
}
}
else
{
mouselast[mouseKey] = false;
return false;
}
}
bool DaramInput::MousePress(int mouseKey)
{
if(!mouseUse) return false;
return (mstate.rgbButtons[mouseKey] & 0x80) ? true : false;
}
bool DaramInput::MouseUp(int mouseKey)
{
if(!mouseUse) return false;
if(!(mstate.rgbButtons[mouseKey] & 0x80))
{
if(!mouselast[mouseKey])
return false;
else
{
mouselast[mouseKey] = false;
return true;
}
}
else
return false;
}
bool DaramInput::AnyMouseDown()
{
for(int i = 0; i < 4; i++)
{
if(MouseDown(i))
return true;
}
return false;
}
bool DaramInput::AnyMousePress()
{
for(int i = 0; i < 4; i++)
{
if(MousePress(i))
return true;
}
return false;
}
bool DaramInput::AnyMouseUp()
{
for(int i = 0; i < 4; i++)
{
if(MouseUp(i))
return true;
}
return false;
}
int DaramInput::GetMouseX()
{
if(!mouseUse) return 0;
return mstate.lX;
}
int DaramInput::GetMouseY()
{
if(!mouseUse) return 0;
return mstate.lY;
}
int DaramInput::GetMouseZ()
{
if(!mouseUse) return 0;
return mstate.lZ;
}
bool DaramInput::JoystickDown(int joykey)
{
if(!joyUse) return false;
if(jstate.rgbButtons[joykey] & 0x80)
{
if(joylast[joykey])
return false;
else
{
joylast[joykey] = true;
return true;
}
}
else
{
joylast[joykey] = false;
return false;
}
}
bool DaramInput::JoystickPress(int joykey)
{
if(!joyUse) return false;
return (jstate.rgbButtons[joykey] & 0x80) ? true : false;
}
bool DaramInput::JoystickUp(int joykey)
{
if(!joyUse) return false;
if(!(jstate.rgbButtons[joykey] & 0x80))
{
if(!joylast[joykey])
return false;
else
{
joylast[joykey] = false;
return true;
}
}
else
return false;
}
bool DaramInput::AnyJoystickDown()
{
for(int i = 0; i < 32; i++)
{
if(JoystickDown(i))
return true;
}
return false;
}
bool DaramInput::AnyJoystickPress()
{
for(int i = 0; i < 32; i++)
{
if(JoystickPress(i))
return true;
}
return false;
}
bool DaramInput::AnyJoystickUp()
{
for(int i = 0; i < 32; i++)
{
if(JoystickUp(i))
return true;
}
return false;
}
int DaramInput::GetJoyX()
{
if(!joyUse) return 0;
return jstate.lX;
}
int DaramInput::GetJoyY()
{
if(!joyUse) return 0;
return jstate.lY;
}
int DaramInput::GetJoyZ()
{
if(!joyUse) return 0;
return jstate.lZ;
}
void DaramInput::UpdateData()
{
if(keyboard != NULL && keyboardUse)
{
ZeroMemory(diks, sizeof(diks));
keyboard->GetDeviceState(sizeof(diks), diks);
}
if(mouse != NULL && mouseUse)
{
ZeroMemory(&mstate, sizeof(mstate));
mouse->GetDeviceState(sizeof(mstate), &mstate);
}
if(joystick != NULL && joyUse)
{
ZeroMemory(&jstate, sizeof(jstate));
joystick->GetDeviceState(sizeof(jstate), &jstate);
}
}
bool DaramInput::IsKeyConn()
{
if(!keyboardUse || keyboard == NULL)
return false;
else
return true;
}
bool DaramInput::IsMsConn()
{
if(!mouseUse || mouse == NULL)
return false;
else
return true;
}
bool DaramInput::IsJoyConn()
{
if(!joyUse || joystick == NULL)
return false;
else
return true;
}
int DaramInput::GetMouseXFromWindow()
{
POINT pt;
GetCursorPos(&pt);
ScreenToClient(win, &pt);
return pt.x;
}
int DaramInput::GetMouseYFromWindow()
{
POINT pt;
GetCursorPos(&pt);
ScreenToClient(win, &pt);
return pt.y;
}
void DaramInput::SetMouseXToWindow(int x)
{
POINT pt;
GetCursorPos(&pt);
ScreenToClient(win, &pt);
pt.x = x;
ClientToScreen(win, &pt);
SetCursorPos(pt.x, pt.y);
}
void DaramInput::SetMouseYToWindow(int y)
{
POINT pt;
GetCursorPos(&pt);
ScreenToClient(win, &pt);
pt.y = y;
ClientToScreen(win, &pt);
SetCursorPos(pt.x, pt.y);
}
void DaramInput::SetMousePositionToWindow(int x, int y)
{
POINT pt;
pt.x = x;
pt.y = y;
ClientToScreen(win, &pt);
SetCursorPos(pt.x, pt.y);
}
void DaramInput::Dispose()
{
if(joyUse || joystick != NULL)
joystick->Release();
if(mouseUse || mouse != NULL)
mouse->Release();
if(keyboardUse || keyboard != NULL)
keyboard->Release();
if(input != NULL)
input->Release();
} | [
"daramkun@live.com"
] | daramkun@live.com |
67d9aa3f8c76185ab9b5d752ccb7f20769039251 | 1ea09659821c663353ff3d23a91dfe62e5896022 | /examples/SimpleReceive.cpp | a170e68cf423b9109dfa6c14fa22bcaaa5ff855c | [
"MIT"
] | permissive | Multimedia-Orchestra/SimpleOSCMyoHack | de23dc21943c17b2e7781825b38d6d1ef1d0e1fb | efd0b1c52d1bb72a40e2108d9a5e9a877b64e272 | refs/heads/master | 2021-01-01T18:11:11.995894 | 2014-04-06T23:32:46 | 2014-04-06T23:32:46 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,011 | cpp | /*
Example of two different ways to process received OSC messages using oscpack.
Receives the messages from the SimpleSend.cpp example.
*/
#include <iostream>
#include <cstring>
#if defined(__BORLANDC__) // workaround for BCB4 release build intrinsics bug
namespace std {
using ::__strcmp__; // avoid error: E2316 '__strcmp__' is not a member of 'std'.
}
#endif
#include "osc/OscReceivedElements.h"
#include "osc/OscPacketListener.h"
#include "ip/UdpSocket.h"
#define PORT 7000
class ExamplePacketListener : public osc::OscPacketListener {
protected:
virtual void ProcessMessage( const osc::ReceivedMessage& m,
const IpEndpointName& remoteEndpoint )
{
(void) remoteEndpoint; // suppress unused parameter warning
try{
// example of parsing single messages. osc::OsckPacketListener
// handles the bundle traversal.
if( std::strcmp( m.AddressPattern(), "/test1" ) == 0 ){
// example #1 -- argument stream interface
osc::ReceivedMessageArgumentStream args = m.ArgumentStream();
bool a1;
osc::int32 a2;
float a3;
const char *a4;
args >> a1 >> a2 >> a3 >> a4 >> osc::EndMessage;
std::cout << "received '/test1' message with arguments: "
<< a1 << " " << a2 << " " << a3 << " " << a4 << "\n";
}else if( std::strcmp( m.AddressPattern(), "/test2" ) == 0 ){
// example #2 -- argument iterator interface, supports
// reflection for overloaded messages (eg you can call
// (*arg)->IsBool() to check if a bool was passed etc).
osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin();
bool a1 = (arg++)->AsBool();
int a2 = (arg++)->AsInt32();
float a3 = (arg++)->AsFloat();
const char *a4 = (arg++)->AsString();
if( arg != m.ArgumentsEnd() )
throw osc::ExcessArgumentException();
std::cout << "received '/test2' message with arguments: "
<< a1 << " " << a2 << " " << a3 << " " << a4 << "\n";
}
}catch( osc::Exception& e ){
// any parsing errors such as unexpected argument types, or
// missing arguments get thrown as exceptions.
std::cout << "error while parsing message: "
<< m.AddressPattern() << ": " << e.what() << "\n";
}
}
};
int main(int argc, char* argv[])
{
(void) argc; // suppress unused parameter warnings
(void) argv; // suppress unused parameter warnings
ExamplePacketListener listener;
UdpListeningReceiveSocket s(
IpEndpointName( IpEndpointName::ANY_ADDRESS, PORT ),
&listener );
std::cout << "press ctrl-c to end\n";
s.RunUntilSigInt();
return 0;
}
| [
"niko@mcn.org"
] | niko@mcn.org |
0fc33f7ea56265adefed3695ae79dce132012ae5 | 1eb2cca85359013f47a476e91f48ab8d8e15dcae | /radion/MvaComputation.h | 4ec841ae11ec8f6f4c2ea20fa1ad4132f314bc01 | [] | no_license | hebda/ggAnalysis | 8acc293deebd63ff01b8662611f0bb697b1e21c2 | ddbaa495a6f5446b75ad993a9fe6c0a92edff553 | refs/heads/master | 2020-03-28T01:03:55.048680 | 2013-10-30T16:31:25 | 2013-10-30T16:31:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,775 | h | #include "xAna_allAna.h"
#include "VertexSelection.h"
#include "TMVA/Tools.h"
#include "TMVA/Reader.h"
#include <string>
float xAna::sumTrackPtInCone(int phoID, int vtxID, float minPt,
float outerConeRadius, float innerConeRadius,
float etaStripHalfWidth, float dzMax, float d0Max) {
if(vtxID < 0)return -999;
TVector3 vtxpos(vtx[vtxID][0],vtx[vtxID][1],vtx[vtxID][2]);
float sum = 0;
for(int i = 0; i < nTrk; i++){
TVector3 trackp(trkP[i][0],trkP[i][1],trkP[i][2]);
if(trackp.Pt() < minPt)continue;
TVector3 trkVtxVec(trkVtx[i][0],trkVtx[i][1],trkVtx[i][2]);
double deltaz = fabs((vtxpos.Z() - trkVtxVec.Z()) -
( (trkVtxVec.X()-vtxpos.X())*trackp.Px() + (trkVtxVec.Y()-vtxpos.Y())*trackp.Py() )/trackp.Pt() * trackp.Pz()/trackp.Pt() );
if(deltaz > dzMax)continue;
double dxy = (-(trkVtxVec.X() - vtxpos.X())*trackp.Py() + (trkVtxVec.Y() - vtxpos.Y())*trackp.Px())/trackp.Pt();
if(fabs(dxy) > d0Max)continue;
double deta = fabs(phoEtaVtx[phoID][vtxID] - trackp.Eta());
double dphi = fabs(phoPhiVtx[phoID][vtxID] - trackp.Phi());
if(dphi > TMath::Pi())dphi = TMath::TwoPi() - dphi;
double dR = sqrt(deta*deta + dphi*dphi);
if(dR < outerConeRadius && dR >= innerConeRadius && deta >= etaStripHalfWidth)sum += trackp.Pt();
}
return sum;
}
float xAna::worstSumTrackPtInCone(int phoID, int &vtxID, float minPt,
float outerConeRadius, float innerConeRadius,
float etaStripHalfWidth, float dzMax, float d0Max) {
int worstvtxID = -1;
float maxisosum = -1;
for(int i = 0; i < nVtx; i++){
float isosum = sumTrackPtInCone(phoID,i,minPt,outerConeRadius,innerConeRadius,etaStripHalfWidth,dzMax,d0Max);
if(isosum > maxisosum){
maxisosum = isosum;
worstvtxID = i;
}
}
vtxID = worstvtxID;
return maxisosum;
}
//////////////////////
//Setup PhotonID MVA//
//////////////////////
void xAna::Setup_MVA( ) {
/// ------ setup 2011 mva phoID ------ ///
string mvamethod = "BDT";
cout << " Booking 2011 MVA Barrel photon ID with method: " << mvamethod << endl;
phoID_2011[0]->AddVariable("HoE",&phoID_HoE);
phoID_2011[0]->AddVariable("covIEtaIEta",&phoID_covIEtaIEta);
phoID_2011[0]->AddVariable("tIso1abs",&phoID_tIso1abs);
phoID_2011[0]->AddVariable("tIso3abs",&phoID_tIso3abs);
phoID_2011[0]->AddVariable("tIso2abs",&phoID_tIso2abs);
phoID_2011[0]->AddVariable("R9",&phoID_R9);
phoID_2011[0]->AddVariable("absIsoEcal",&phoID_absIsoEcal);
phoID_2011[0]->AddVariable("absIsoHcal",&phoID_absIsoHcal);
phoID_2011[0]->AddVariable("NVertexes",&phoID_NVertexes);
phoID_2011[0]->AddVariable("ScEta",&phoID_ScEta);
phoID_2011[0]->AddVariable("EtaWidth",&phoID_EtaWidth);
phoID_2011[0]->AddVariable("PhiWidth",&phoID_PhiWidth);
phoID_2011[0]->BookMVA(mvamethod.c_str(),"mvaDiscriInputs/PhotonID_Barrel_Weights.xml");
cout << " Booking 2011 MVA Endcap photon ID with method: " << mvamethod << endl;
phoID_2011[1]->AddVariable("HoE",&phoID_HoE);
phoID_2011[1]->AddVariable("covIEtaIEta",&phoID_covIEtaIEta);
phoID_2011[1]->AddVariable("tIso1abs",&phoID_tIso1abs);
phoID_2011[1]->AddVariable("tIso3abs",&phoID_tIso3abs);
phoID_2011[1]->AddVariable("tIso2abs",&phoID_tIso2abs);
phoID_2011[1]->AddVariable("R9",&phoID_R9);
phoID_2011[1]->AddVariable("absIsoEcal",&phoID_absIsoEcal);
phoID_2011[1]->AddVariable("absIsoHcal",&phoID_absIsoHcal);
phoID_2011[1]->AddVariable("NVertexes",&phoID_NVertexes);
phoID_2011[1]->AddVariable("ScEta",&phoID_ScEta);
phoID_2011[1]->AddVariable("EtaWidth",&phoID_EtaWidth);
phoID_2011[1]->AddVariable("PhiWidth",&phoID_PhiWidth);
phoID_2011[1]->BookMVA(mvamethod.c_str(),"mvaDiscriInputs/PhotonID_Endcap_Weights.xml");
/// ---------------------------- ///
/// ------ setup 2012 mva phoID ------ ///
cout << " Booking 2012 MVA Barrel photon ID with method: " << mvamethod << endl;
phoID_2012[0] = new TMVA::Reader("!Color:Silent");
phoID_2012[0]->AddVariable("ph.r9", &phoID_R9 );
phoID_2012[0]->AddVariable("ph.sigietaieta", &phoID_covIEtaIEta );
phoID_2012[0]->AddVariable("ph.scetawidth", &phoID_EtaWidth);
phoID_2012[0]->AddVariable("ph.scphiwidth", &phoID_PhiWidth);
phoID_2012[0]->AddVariable("ph.idmva_CoviEtaiPhi", &phoID_covIEtaIPhi);
phoID_2012[0]->AddVariable("ph.idmva_s4ratio", &phoID_S4);
phoID_2012[0]->AddVariable("ph.idmva_GammaIso", &phoID_pfPhoIso03 );
phoID_2012[0]->AddVariable("ph.idmva_ChargedIso_selvtx", &phoID_pfChIso03 );
phoID_2012[0]->AddVariable("ph.idmva_ChargedIso_worstvtx",&phoID_pfChIso03worst );
phoID_2012[0]->AddVariable("ph.sceta", &phoID_ScEta );
phoID_2012[0]->AddVariable("rho", &phoID_rho);
phoID_2012[0]->BookMVA(mvamethod.c_str(),"mvaDiscriInputs/2012ICHEP_PhotonID_Barrel_BDT.weights.xml");
cout << " Booking 2012 MVA Endcap photon ID with method: " << mvamethod << endl;
phoID_2012[1]->AddVariable("ph.r9", &phoID_R9 );
phoID_2012[1]->AddVariable("ph.sigietaieta", &phoID_covIEtaIEta );
phoID_2012[1]->AddVariable("ph.scetawidth", &phoID_EtaWidth);
phoID_2012[1]->AddVariable("ph.scphiwidth", &phoID_PhiWidth);
phoID_2012[1]->AddVariable("ph.idmva_CoviEtaiPhi", &phoID_covIEtaIPhi);
phoID_2012[1]->AddVariable("ph.idmva_s4ratio", &phoID_S4);
phoID_2012[1]->AddVariable("ph.idmva_GammaIso", &phoID_pfPhoIso03 );
phoID_2012[1]->AddVariable("ph.idmva_ChargedIso_selvtx", &phoID_pfChIso03 );
phoID_2012[1]->AddVariable("ph.idmva_ChargedIso_worstvtx", &phoID_pfChIso03worst );
phoID_2012[1]->AddVariable("ph.sceta", &phoID_ScEta );
phoID_2012[1]->AddVariable("rho", &phoID_rho);
phoID_2012[1]->AddVariable("ph.idmva_PsEffWidthSigmaRR", &phoID_ESEffSigmaRR );
phoID_2012[1]->BookMVA(mvamethod.c_str(),"mvaDiscriInputs/2012ICHEP_PhotonID_Endcap_BDT.weights_PSCorr.xml");
/// ---------------------------- ///
/// --- setup 2011 MVA dipho ---///
cout << " Booking 2011 MVA diphoton dicriminant" << endl;
DiscriDiPho_2011->AddVariable("masserrsmeared/mass",&Ddipho_masserr);
DiscriDiPho_2011->AddVariable("masserrsmearedwrongvtx/mass",&Ddipho_masserrwrongvtx);
DiscriDiPho_2011->AddVariable("vtxprob",&Ddipho_vtxprob);
DiscriDiPho_2011->AddVariable("ph1.pt/mass",&Ddipho_piT1);
DiscriDiPho_2011->AddVariable("ph2.pt/mass",&Ddipho_piT2);
DiscriDiPho_2011->AddVariable("ph1.eta",&Ddipho_eta1);
DiscriDiPho_2011->AddVariable("ph2.eta",&Ddipho_eta2);
DiscriDiPho_2011->AddVariable("TMath::Cos(ph1.phi-ph2.phi)",&Ddipho_cosdPhi);
DiscriDiPho_2011->AddVariable("ph1.idmva",&Ddipho_id1);
DiscriDiPho_2011->AddVariable("ph2.idmva",&Ddipho_id2);
// DiscriDiPho_2011->BookMVA("BDTG","mvaDiscriInputs/MITDiPhotonWeights.xml");
DiscriDiPho_2011->BookMVA("BDTG","mvaDiscriInputs/HggBambu_SMDipho_Jan16_BDTG.weights.xml");
cout << " Booking 2012 MVA diphoton dicriminant" << endl;
DiscriDiPho_2012->AddVariable("masserrsmeared/mass",&Ddipho_masserr);
DiscriDiPho_2012->AddVariable("masserrsmearedwrongvtx/mass",&Ddipho_masserrwrongvtx);
DiscriDiPho_2012->AddVariable("vtxprob",&Ddipho_vtxprob);
DiscriDiPho_2012->AddVariable("ph1.pt/mass",&Ddipho_piT1);
DiscriDiPho_2012->AddVariable("ph2.pt/mass",&Ddipho_piT2);
DiscriDiPho_2012->AddVariable("ph1.eta",&Ddipho_eta1);
DiscriDiPho_2012->AddVariable("ph2.eta",&Ddipho_eta2);
DiscriDiPho_2012->AddVariable("TMath::Cos(ph1.phi-ph2.phi)",&Ddipho_cosdPhi);
DiscriDiPho_2012->AddVariable("ph1.idmva",&Ddipho_id1);
DiscriDiPho_2012->AddVariable("ph2.idmva",&Ddipho_id2);
// DiscriDiPho_2012->BookMVA("BDTG","mvaDiscriInputs/HggBambu_SMDipho_Jun19_BDTG.weights.xml");
DiscriDiPho_2012->BookMVA("BDTG","mvaDiscriInputs/HggBambu_SMDipho_Jul07_BDTG.weights.xml");
/// ------------------------------///
/// ----- setup 2012 MVA VBF -----///
DiscriVBF = new TMVA::Reader("!Color:Silent");
string tmvaVbfMvaWeights = "mvaDiscriInputs/TMVA_vbf_6var_mjj100_diphopt_phopt_BDTG.weights.xml";
DiscriVBF_Method = "BDTG";
cout << " Booking 2012 MVA vbf dicriminant" << endl;
DiscriVBF = new TMVA::Reader( "!Color:!Silent" );
DiscriVBF->AddVariable("jet1pt", &myVBFLeadJPt);
DiscriVBF->AddVariable("jet2pt", &myVBFSubJPt);
DiscriVBF->AddVariable("abs(jet1eta-jet2eta)", &myVBFdEta);
DiscriVBF->AddVariable("mj1j2", &myVBF_Mjj);
DiscriVBF->AddVariable("zepp" , &myVBFZep);
DiscriVBF->AddVariable("dphi" , &myVBFdPhi);
if( DiscriVBF_UseDiPhoPt ) DiscriVBF->AddVariable("diphopt/diphoM", &myVBFDiPhoPtOverM);
if( DiscriVBF_UsePhoPt ) {
DiscriVBF->AddVariable("pho1pt/diphoM", &myVBFLeadPhoPtOverM);
DiscriVBF->AddVariable("pho2pt/diphoM", &myVBFSubPhoPtOverM);
}
DiscriVBF->BookMVA( DiscriVBF_Method, tmvaVbfMvaWeights );
// end of MVA VBF
//setup of MVA for b-jet energy regression
if(doJetRegression==1){
cout<<" Booking b-jet energy regression" << endl;
jetRegres->AddVariable( "jet_eta", &jetRegEta);
jetRegres->AddVariable( "jet_emfrac", &jetRegEMFrac);
jetRegres->AddVariable( "jet_hadfrac", &jetRegHadFrac);
jetRegres->AddVariable( "jet_nconstituents", &jetRegNConstituents);
jetRegres->AddVariable( "jet_vtx3dL", &jetRegVtx3dL);
jetRegres->AddVariable( "MET", &jetRegMET);
jetRegres->AddVariable( "jet_dPhiMETJet", &jetRegDPhiMETJet);
jetRegres->BookMVA("BDTG0","jetRegressionWeights/TMVARegression_Cat0_BDTG.weights.xml");
jetRegres->BookMVA("BDTG1","jetRegressionWeights/TMVARegression_Cat1_BDTG.weights.xml");
}
//end of setup for b-jet energy regression
/// -------------------------------///
/// ----- setup vertex finder -----///
vector<string> tmvaPerVtxVariables;
tmvaPerVtxVariables.push_back("ptbal");
tmvaPerVtxVariables.push_back("ptasym");
tmvaPerVtxVariables.push_back("logsumpt2");
tmvaPerVtxVariables.push_back("limPullToConv");
tmvaPerVtxVariables.push_back("nConv");
string perVtxMvaWeights = "mvaDiscriInputs/TMVAClassification_BDTCat_conversions_tmva_407.weights.xml";
_perVtxMvaMethod = "BDTCat_conversions";
string perEvtMvaWeights = "mvaDiscriInputs/TMVAClassification_evtBDTG_conversions_tmva_407.weights.xml";
_perEvtMvaMethod = "evtBDTG";
string vertexsetup = "configFilesDir/vertex_selection_7TeV.dat";
if( _config->setup().find("2012") != string::npos ) {
perEvtMvaWeights = "mvaDiscriInputs/TMVAClassification_BDTvtxprob2012.weights.xml";
vertexsetup = "configFilesDir/vertex_selection_hcp2012.dat";
_perEvtMvaMethod = "BDTvtxprob2012";
}
_vtxAlgoParams = VertexAlgoParametersReader(vertexsetup);
_vtxAna = new HggVertexAnalyzer(_vtxAlgoParams);
_perVtxReader = 0;
_perEvtReader = 0;
if( perVtxMvaWeights != "" ) {
_perVtxReader = new TMVA::Reader( "!Color:!Silent" );
HggVertexAnalyzer::bookVariables( *_perVtxReader, tmvaPerVtxVariables );
_perVtxReader->BookMVA( _perVtxMvaMethod, perVtxMvaWeights );
}
if( perEvtMvaWeights != "" ) {
_perEvtReader = new TMVA::Reader( "!Color:!Silent" );
HggVertexAnalyzer::bookPerEventVariables( *_perEvtReader );
_perEvtReader->BookMVA( _perEvtMvaMethod, perEvtMvaWeights );
}
cout << " Booking Vertex discriminants" << endl;
cout << " - use conversions : " << _vtxAlgoParams.useAllConversions << endl;
cout << " - single leg sigma1Pix: " << _vtxAlgoParams.singlelegsigma1Pix << endl;
cout << " - check that if use single leg conversion (option=3) then sigma1Pix has meaningful value "
<< endl;
// end of Vertex MVA
}
float xAna::PhoID_MVA( int i, int selVtx ) {
////////////////////
//do photon id mva//
////////////////////
phoID_HoE = phoHoverE[i];
phoID_covIEtaIEta = phoSigmaIEtaIEta[i];
phoID_R9 = phoR9[i];
phoID_absIsoEcal = phoEcalIsoDR03[i] - 0.17*rho25;
phoID_absIsoHcal = phoHcalIsoDR04[i] - 0.17*rho25;
phoID_NVertexes = nVtx;
phoID_ScEta = phoSCEta[i];
phoID_EtaWidth = phoSCEtaWidth[i];
phoID_PhiWidth = phoSCPhiWidth[i];
if( _config->setup() == "Prompt2012_ichep" ) {
phoID_covIEtaIPhi = phoSigmaIEtaIPhi[i];
phoID_S4 = phoS4ratio[i];
phoID_ESEffSigmaRR = phoESEffSigmaRR[i][0];
phoID_rho = rho2012;
phoID_pfPhoIso03 = phoCiCPF4phopfIso03[i];
phoID_pfChIso03 = phoCiCPF4chgpfIso03[i][selVtx];
phoID_pfChIso03worst = -99;
for( int iv=0; iv<nVtxBS ; iv++)
if( phoCiCPF4chgpfIso03[i][iv] > phoID_pfChIso03worst )
phoID_pfChIso03worst = phoCiCPF4chgpfIso03[i][iv];
} else {
int badvtx;
float pho_tkiso_badvtx = worstSumTrackPtInCone(i,badvtx,0,0.4,0.02,0.0,1.0,0.1);
float pho_tkiso_goodvtx = sumTrackPtInCone(i,selVtx,0,0.3,0.02,0.0,1.0,0.1);
phoID_tIso1abs = (pho_tkiso_goodvtx + phoEcalIsoDR03[i] + phoHcalIsoDR04[i] - 0.17*rho25);
phoID_tIso2abs = (pho_tkiso_badvtx + phoEcalIsoDR04[i] + phoHcalIsoDR04[i] - 0.52*rho25);
phoID_tIso3abs = pho_tkiso_goodvtx;
}
return -1;
}
float xAna::DiPhoID_MVA( const TLorentzVector &glead, const TLorentzVector >rail, const TLorentzVector &hcand,
const MassResolution & massResoCalc, float vtxProb,
const float &idlead, const float &idtrail) {
// Ddipho_masserr = massResoCalc.relativeMassResolutionCorrVertex();
Ddipho_masserr = massResoCalc.relativeMassResolutionFab_energy();
Ddipho_masserrwrongvtx = massResoCalc.relativeMassResolutionWrongVertex();
Ddipho_vtxprob = vtxProb;
Ddipho_piT1 = glead.Pt()/hcand.M();
Ddipho_piT2 = gtrail.Pt()/hcand.M();
Ddipho_eta1 = glead.Eta();
Ddipho_eta2 = gtrail.Eta();
Ddipho_cosdPhi = TMath::Cos(glead.Phi()-gtrail.Phi());
Ddipho_id1 = idlead;
Ddipho_id2 = idtrail;
float diphomva = -1;
if( Ddipho_id1 > -0.3 && Ddipho_id2 > -0.3 )
diphomva = Ddipho_mva->EvaluateMVA("BDTG");
/// fill minitree with dipho inputs
_minitree->mtree_massResoRightVtx = Ddipho_masserr;
_minitree->mtree_massResoRandVtx = Ddipho_masserrwrongvtx;
_minitree->mtree_vtxProb = Ddipho_vtxprob;
_minitree->mtree_diphoMva = diphomva;
return diphomva;
}
float xAna::JetRegression(int iJet){
jetRegPt = jetPt[iJet];
jetRegEta = jetEta[iJet];
jetRegEMFrac = jetCEF[iJet]+jetNEF[iJet]+jetMEF[iJet];
jetRegHadFrac = jetCHF[iJet]+jetNHF[iJet];
jetRegNConstituents = jetNConstituents[iJet];
jetRegVtx3dL = jetVtx3dL[iJet];
jetRegMET = recoPfMET;
float tmpPi = 3.1415927, tmpDPhi=fabs(jetPhi[iJet]-recoPfMETPhi);
if(tmpDPhi>tmpPi) tmpDPhi=2*tmpPi-tmpDPhi;
jetRegDPhiMETJet = tmpDPhi;
if(doJetRegression==1){
if(jetPt[iJet]<90) return jetPt[iJet]*jetRegres->EvaluateRegression("BDTG0")[0];
if(jetPt[iJet]>90) return jetPt[iJet]*jetRegres->EvaluateRegression("BDTG1")[0];
}
else return jetPt[iJet];
}
| [
"phebda@princeton.edu"
] | phebda@princeton.edu |
d90f1df8d6731e325e08a7057d4026cba8d0e347 | 4243054350a33a5cca74e8fdba792e62766d2380 | /src/abnf/Rule_decimal_uchar.cpp | 6d48b218b0003f814ab5273589a5d9d6eeaa3c17 | [
"MIT"
] | permissive | zhangfang/sdp-cpp | f40afb7f25ff2cbeb592f6e1dc12a037c5df4020 | 4bf23de4cf6ade65fedb68a8c8a5baf4bd6a3e6d | refs/heads/master | 2023-02-23T04:27:23.832845 | 2021-01-25T11:47:40 | 2021-01-25T11:47:40 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,850 | cpp | /* -----------------------------------------------------------------------------
* Rule_decimal_uchar.cpp
* -----------------------------------------------------------------------------
*
* Producer : com.parse2.aparse.Parser 2.5
* Produced : Mon Jan 08 13:30:55 CET 2018
*
* -----------------------------------------------------------------------------
*/
#include <string>
using std::string;
#include <vector>
using std::vector;
#include "Rule_decimal_uchar.hpp"
#include "Visitor.hpp"
#include "ParserAlternative.hpp"
#include "ParserContext.hpp"
#include "Rule_DIGIT.hpp"
#include "Rule_POS_DIGIT.hpp"
#include "Rule_decimal_uchar_2xx.hpp"
#include "Rule_decimal_uchar_1xx.hpp"
#include "Rule_decimal_uchar_25x.hpp"
using namespace abnf;
Rule_decimal_uchar::Rule_decimal_uchar(
const string& spelling,
const vector<Rule*>& rules) : Rule(spelling, rules)
{
}
Rule_decimal_uchar::Rule_decimal_uchar(const Rule_decimal_uchar& rule) : Rule(rule)
{
}
Rule_decimal_uchar& Rule_decimal_uchar::operator=(const Rule_decimal_uchar& rule)
{
Rule::operator=(rule);
return *this;
}
Rule* Rule_decimal_uchar::clone() const
{
return new Rule_decimal_uchar(this->spelling, this->rules);
}
void* Rule_decimal_uchar::accept(Visitor& visitor)
{
return visitor.visit(this);
}
Rule_decimal_uchar* Rule_decimal_uchar::parse(ParserContext& context)
{
context.push("decimal-uchar");
bool parsed = true;
int s0 = context.index;
ParserAlternative a0(s0);
vector<const ParserAlternative*> as1;
parsed = false;
{
int s1 = context.index;
ParserAlternative a1(s1);
parsed = true;
if (parsed)
{
bool f1 = true;
int c1 = 0;
Rule* rule = Rule_decimal_uchar_25x::parse(context);
if ((f1 = rule != NULL))
{
a1.add(rule, context.index);
c1++;
}
parsed = c1 == 1;
}
if (parsed)
{
as1.push_back(new ParserAlternative(a1));
}
context.index = s1;
}
{
int s1 = context.index;
ParserAlternative a1(s1);
parsed = true;
if (parsed)
{
bool f1 = true;
int c1 = 0;
Rule* rule = Rule_decimal_uchar_2xx::parse(context);
if ((f1 = rule != NULL))
{
a1.add(rule, context.index);
c1++;
}
parsed = c1 == 1;
}
if (parsed)
{
as1.push_back(new ParserAlternative(a1));
}
context.index = s1;
}
{
int s1 = context.index;
ParserAlternative a1(s1);
parsed = true;
if (parsed)
{
bool f1 = true;
int c1 = 0;
Rule* rule = Rule_decimal_uchar_1xx::parse(context);
if ((f1 = rule != NULL))
{
a1.add(rule, context.index);
c1++;
}
parsed = c1 == 1;
}
if (parsed)
{
as1.push_back(new ParserAlternative(a1));
}
context.index = s1;
}
{
int s1 = context.index;
ParserAlternative a1(s1);
parsed = true;
if (parsed)
{
bool f1 = true;
int c1 = 0;
Rule* rule = Rule_POS_DIGIT::parse(context);
if ((f1 = rule != NULL))
{
a1.add(rule, context.index);
c1++;
}
parsed = c1 == 1;
}
if (parsed)
{
bool f1 = true;
int c1 = 0;
Rule* rule = Rule_DIGIT::parse(context);
if ((f1 = rule != NULL))
{
a1.add(rule, context.index);
c1++;
}
parsed = c1 == 1;
}
if (parsed)
{
as1.push_back(new ParserAlternative(a1));
}
context.index = s1;
}
{
int s1 = context.index;
ParserAlternative a1(s1);
parsed = true;
if (parsed)
{
bool f1 = true;
int c1 = 0;
Rule* rule = Rule_DIGIT::parse(context);
if ((f1 = rule != NULL))
{
a1.add(rule, context.index);
c1++;
}
parsed = c1 == 1;
}
if (parsed)
{
as1.push_back(new ParserAlternative(a1));
}
context.index = s1;
}
const ParserAlternative* b = ParserAlternative::getBest(as1);
if ((parsed = b != NULL))
{
a0.add(b->rules, b->end);
context.index = b->end;
}
for (vector<const ParserAlternative*>::const_iterator a = as1.begin(); a != as1.end(); a++)
{
delete *a;
}
Rule* rule = NULL;
if (parsed)
{
rule = new Rule_decimal_uchar(context.text.substr(a0.start, a0.end - a0.start), a0.rules);
}
else
{
context.index = s0;
}
context.pop("decimal-uchar", parsed);
return (Rule_decimal_uchar*)rule;
}
/* -----------------------------------------------------------------------------
* eof
* -----------------------------------------------------------------------------
*/
| [
"sergio.garcia.murillo@gmail.com"
] | sergio.garcia.murillo@gmail.com |
1085c15742ca6bb41ba700eca87d2cb9c5a7d8d8 | 199620098f209fdfcb27313b540ffdf4073a9e03 | /sample_code/pngshow.cxx | 49c3c50d81167d456f03f86272d8527d5e75af20 | [] | no_license | marksun2015/fltk | d48011a3924a796d058cc6be09b58bcd4e078987 | 1f5280334dc595b5faa2d354bd94dc4661f25fca | refs/heads/master | 2021-06-02T23:03:57.479323 | 2018-09-11T07:28:20 | 2018-09-11T07:28:44 | 58,979,413 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 802 | cxx | /* makeinclude add $((LINKFLTKIMG))
* $(CXX) $(ARCHFLAGS) $(LDFLAGS) $< $(LINKFLTK) $(LINKFLTKIMG) $(LDLIBS) -o $@
*
*
*/
#include <FL/Fl_PNG_Image.H>
#include <FL/Fl_Box.H>
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Image.H>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
class Mywin : public Fl_Window {
void resize(int X, int Y, int W, int H) {
Fl_Window::resize(X,Y,W,H);
redraw();
Fl::check();
}
public:
Mywin(int x,int y,int w, int h) : Fl_Window(x,y,w,h) {
}
};
int main() {
Mywin* win = new Mywin(20,20,600,400);
Fl_Box* box = new Fl_Box(100,100,300,200);//for example
Fl_PNG_Image* pngImg = new Fl_PNG_Image("main.png");
box->image(pngImg);
box->show();
win->end();
win->show();
return (Fl::run());
}
| [
"mark@weintek.com"
] | mark@weintek.com |
48283814481c0ef9fcc8fbc10151aba205e1f9da | 7873fa1647bab7ecac2bc5a98367aa96f32fb94a | /AMR12D.cpp | 09132271150109e97624290e366f241b3481426d | [] | no_license | pegasus1/SPOJ | 81158badc827e978db0e9c429dc34181f0bfe1ee | eff901d039b63b6a337148dfbe37c1536918bbf8 | refs/heads/master | 2021-01-10T05:32:37.535098 | 2015-06-05T18:20:38 | 2015-06-05T18:20:38 | 36,937,530 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 511 | cpp | #include<stdio.h>
#include<string.h>
#include<algorithm>
int check(char * a,int l)
{
int s = 0;
int x = l-1;
while(s<x)
if(a[s]!=a[x])
return 0;
else
{
s++;
x--;
}
return 1;
}
int main()
{
int t,l;
char s[11];
scanf("%d",&t);
while(t--)
{
int u;
scanf("%s",s);
l = strlen(s);
u = check(s,l);
if(u==1)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
| [
"ayush.rajoria@outlook.com"
] | ayush.rajoria@outlook.com |
2dbd5fde17b69c00dcaba318bc5ce1b0632b0461 | dd80a584130ef1a0333429ba76c1cee0eb40df73 | /external/chromium_org/third_party/WebKit/Source/wtf/testing/RunAllTests.cpp | 5d27780e99d586068c6249d6eff297fda1cbd7d9 | [
"BSD-3-Clause",
"MIT",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"Apache-2.0"
] | permissive | karunmatharu/Android-4.4-Pay-by-Data | 466f4e169ede13c5835424c78e8c30ce58f885c1 | fcb778e92d4aad525ef7a995660580f948d40bc9 | refs/heads/master | 2021-03-24T13:33:01.721868 | 2017-02-18T17:48:49 | 2017-02-18T17:48:49 | 81,847,777 | 0 | 2 | MIT | 2020-03-09T00:02:12 | 2017-02-13T16:47:00 | null | UTF-8 | C++ | false | false | 2,103 | cpp | /*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "wtf/CryptographicallyRandomNumber.h"
#include "wtf/MainThread.h"
#include "wtf/WTF.h"
#include <base/test/test_suite.h>
#include <string.h>
static double CurrentTime()
{
return 0.0;
}
static void AlwaysZeroNumberSource(unsigned char* buf, size_t len)
{
memset(buf, '\0', len);
}
int main(int argc, char** argv)
{
WTF::setRandomSource(AlwaysZeroNumberSource);
WTF::initialize(CurrentTime, 0);
WTF::initializeMainThread(0);
return base::RunUnitTestsUsingBaseTestSuite(argc, argv);
}
| [
"karun.matharu@gmail.com"
] | karun.matharu@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.