blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1882272d9c7e34b7f0a8596f54597c3a9a8e4283 | de8eee85da47af00423c95d72834f9c7bb63aed7 | /sample/service/test_zk_s/main/trade_server.h | e439f2ac704458cdfc17a6f1f7689c486ccbb0cb | [] | no_license | ZooRey/lspf | 1dac0c238934e8ecc37831f8063011be342feeb1 | c644115a32372c12cf994d1d6a6f8c86be149f76 | refs/heads/master | 2021-01-19T15:46:32.173933 | 2018-01-03T02:15:54 | 2018-01-03T02:15:54 | 88,228,338 | 0 | 1 | null | 2017-04-20T13:00:27 | 2017-04-14T03:15:18 | C++ | UTF-8 | C++ | false | false | 2,061 | h | #ifndef __RPC_SERVER_H__
#define __RPC_SERVER_H__
// This autogenerated skeleton file illustrates how to build a server.
// You should copy it to another filename to avoid overwriting it.
#include "gen-server/CupsChannel.h"
#include <thrift/transport/TSocket.h>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/server/TThreadedServer.h>
#include <thrift/transport/TServerSocket.h>
#include <thrift/transport/TBufferTransports.h>
#include <iostream>
#include <string>
using namespace ::apache::thrift;
using namespace ::apache::thrift::protocol;
using namespace ::apache::thrift::transport;
using namespace ::apache::thrift::server;
using namespace std;
using namespace ::payment_channel;
class CupsChannelHandler : virtual public CupsChannelIf
{
public:
CupsChannelHandler()
{
// Your initialization goes here
}
void DoTrans(std::string& _return, const std::string& logid, const std::string& request);
};
/*
DemoCloneFactory is code generated.
DemoCloneFactory is useful for getting access to the server side of the
transport. It is also useful for making per-connection state. Without this
CloneFactory, all connections will end up sharing the same handler instance.
*/
class CupsChannelCloneFactory : virtual public CupsChannelIfFactory
{
public:
CupsChannelCloneFactory()
{
}
virtual ~CupsChannelCloneFactory() {}
virtual CupsChannelIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo)
{
boost::shared_ptr<TSocket> sock = boost::dynamic_pointer_cast<TSocket>(connInfo.transport);
std::cout << "Incoming connection\n";
std::cout << "\tSocketInfo: " << sock->getSocketInfo() << "\n";
std::cout << "\tPeerHost: " << sock->getPeerHost() << "\n";
std::cout << "\tPeerAddress: " << sock->getPeerAddress() << "\n";
std::cout << "\tPeerPort: " << sock->getPeerPort() << "\n";
return new CupsChannelHandler();
}
virtual void releaseHandler(CupsChannelIf* handler)
{
delete handler;
}
};
#endif // __RPC_SERVER_H__
| [
"lizuorui@126.com"
] | lizuorui@126.com |
1cf6c7505b7bbecb33b3259548176822c1e5c578 | 4d385239adf7d1e19d734290d97a57e03eb97cdb | /User.hpp | 52dc33cf5658c961aa90f7f743340ef44fabfbab | [] | no_license | 00kar/SignUp | fc8293cbeacb7aa3807eefab43ed9e073ff74093 | c5c1b21ee1fb8e796c6235361cd53750c0579d1f | refs/heads/main | 2023-07-25T11:14:29.234265 | 2021-09-08T14:00:08 | 2021-09-08T14:00:08 | 383,681,701 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 688 | hpp | #ifndef _USER_HPP_
#define _USER_HPP_
#include <iostream>
#include <string>
#include "Date.hpp"
class User
{
private:
std::string password;
std::string username;
std::string surname;
std::string name;
Date birth;
public:
// Get Functions
std::string getPaswd();
std::string getUsrnm();
std::string getSurnm();
std::string getName();
std::string getBirth();
// Set Functions
void setPaswd(std::string);
void setUsrnm(std::string);
void setName(std::string);
void setSname(std::string);
void setBirth(std::string);
// Friend Functions
friend std::ostream& operator<<(std::ostream&, const User&);
friend std::istream& operator>>(std::istream&, User&);
};
#endif
| [
"kar.hakobian.00@gmail.com"
] | kar.hakobian.00@gmail.com |
ddeeffddccdac5fa04163affd50832857346afbe | 7dd09a74907c67db9da95f5c2265ac8a7d97131c | /ejemplo_4_02.cpp | e0d23c0f2685e82f55c90cdf6209602e2a51061e | [
"MIT"
] | permissive | kikeqt/Curso_CPP | d86334631f45aed58af4e017a67172b37a66aabe | f67ceb64975905d64beff70b1248016b4e578e10 | refs/heads/master | 2022-12-01T12:01:40.631656 | 2020-08-15T02:04:07 | 2020-08-15T02:04:07 | 284,873,621 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 493 | cpp | #include <iostream>
int main(void) {
std::cout << "char -> " << sizeof(char) << std::endl; // 1
std::cout << "unsigned short -> " << sizeof(unsigned short) << std::endl; // 2
std::cout << "unsigned -> " << sizeof(unsigned) << std::endl; // 4
std::cout << "int -> " << sizeof(int) << std::endl; // 4
std::cout << "double -> " << sizeof(double) << std::endl; // 8
std::cout << "long double -> " << sizeof(long double) << std::endl; // ?
return EXIT_SUCCESS;
} | [
"kike.qt@gmail.com"
] | kike.qt@gmail.com |
f906c3cf04688d1f81e8fe4100c9f48ba7bd3f60 | 8a18743c793563d39790f17242e6027dfa22e3ec | /cpp/src/main/recommender_data/RecommenderDataIterator.cpp | c9f1de9089a93069be260d8096e3d65e998bf8bf | [
"Apache-2.0"
] | permissive | fbobee/Alpenglow | f218cae67b409e5191a12fdec8c5b21490a2a4a8 | 5f956511017c1bee72390aaecd964c04d8ad4b45 | refs/heads/master | 2022-01-24T22:26:58.817574 | 2019-08-09T08:34:38 | 2019-08-09T08:34:38 | 104,466,570 | 0 | 0 | Apache-2.0 | 2019-08-09T08:34:41 | 2017-09-22T11:22:19 | C++ | UTF-8 | C++ | false | false | 37 | cpp | #include "RecommenderDataIterator.h"
| [
"fbobee@info.ilab.sztaki.hu"
] | fbobee@info.ilab.sztaki.hu |
2a49000a0ebaa9f5d78571c53366fafe437cbb48 | 829b0a557d3cc43a108f9b76d748e923fba8d928 | /lldb/unittests/Expression/CppModuleConfigurationTest.cpp | 0babf766a3a7a0df4354d6d455362e1010a76647 | [
"NCSA",
"Apache-2.0",
"LLVM-exception"
] | permissive | ljh740/llvm-project | 31766f1f687939a679531d372d56755dbb5c415b | 89295aa3f2aebcd930e5ee7272ca47349bb7767d | refs/heads/sbingner/master | 2023-04-06T14:15:22.003403 | 2020-01-07T08:36:49 | 2020-01-07T08:36:49 | 255,562,403 | 0 | 0 | Apache-2.0 | 2021-04-15T14:56:23 | 2020-04-14T09:12:17 | null | UTF-8 | C++ | false | false | 7,059 | cpp | //===-- CppModuleConfigurationTest.cpp ---------------------------*- C++-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "Plugins/ExpressionParser/Clang/CppModuleConfiguration.h"
#include "Plugins/ExpressionParser/Clang/ClangHost.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/HostInfo.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
using namespace lldb_private;
namespace {
struct CppModuleConfigurationTest : public testing::Test {
static void SetUpTestCase() {
// Getting the resource directory uses those subsystems, so we should
// initialize them.
FileSystem::Initialize();
HostInfo::Initialize();
}
static void TearDownTestCase() {
HostInfo::Terminate();
FileSystem::Terminate();
}
};
} // namespace
/// Returns the Clang resource include directory.
static std::string ResourceInc() {
llvm::SmallString<256> resource_dir;
llvm::sys::path::append(resource_dir, GetClangResourceDir().GetPath(),
"include");
return resource_dir.str().str();
}
/// Utility function turningn a list of paths into a FileSpecList.
static FileSpecList makeFiles(llvm::ArrayRef<std::string> paths) {
FileSpecList result;
for (const std::string &path : paths)
result.Append(FileSpec(path, FileSpec::Style::posix));
return result;
}
TEST_F(CppModuleConfigurationTest, Linux) {
// Test the average Linux configuration.
std::string libcpp = "/usr/include/c++/v1";
std::string usr = "/usr/include";
CppModuleConfiguration config(
makeFiles({usr + "/bits/types.h", libcpp + "/vector"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
EXPECT_THAT(config.GetIncludeDirs(),
testing::ElementsAre(libcpp, ResourceInc(), usr));
}
TEST_F(CppModuleConfigurationTest, Sysroot) {
// Test that having a sysroot for the whole system works fine.
std::string libcpp = "/home/user/sysroot/usr/include/c++/v1";
std::string usr = "/home/user/sysroot/usr/include";
CppModuleConfiguration config(
makeFiles({usr + "/bits/types.h", libcpp + "/vector"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
EXPECT_THAT(config.GetIncludeDirs(),
testing::ElementsAre(libcpp, ResourceInc(), usr));
}
TEST_F(CppModuleConfigurationTest, LinuxLocalLibCpp) {
// Test that a locally build libc++ is detected.
std::string libcpp = "/home/user/llvm-build/include/c++/v1";
std::string usr = "/usr/include";
CppModuleConfiguration config(
makeFiles({usr + "/bits/types.h", libcpp + "/vector"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
EXPECT_THAT(config.GetIncludeDirs(),
testing::ElementsAre(libcpp, ResourceInc(), usr));
}
TEST_F(CppModuleConfigurationTest, UnrelatedLibrary) {
// Test that having an unrelated library in /usr/include doesn't break.
std::string libcpp = "/home/user/llvm-build/include/c++/v1";
std::string usr = "/usr/include";
CppModuleConfiguration config(makeFiles(
{usr + "/bits/types.h", libcpp + "/vector", usr + "/boost/vector"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
EXPECT_THAT(config.GetIncludeDirs(),
testing::ElementsAre(libcpp, ResourceInc(), usr));
}
TEST_F(CppModuleConfigurationTest, Xcode) {
// Test detection of libc++ coming from Xcode with generic platform names.
std::string p = "/Applications/Xcode.app/Contents/Developer/";
std::string libcpp = p + "Toolchains/B.xctoolchain/usr/include/c++/v1";
std::string usr =
p + "Platforms/A.platform/Developer/SDKs/OSVers.sdk/usr/include";
CppModuleConfiguration config(
makeFiles({libcpp + "/unordered_map", usr + "/stdio.h"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
EXPECT_THAT(config.GetIncludeDirs(),
testing::ElementsAre(libcpp, ResourceInc(), usr));
}
TEST_F(CppModuleConfigurationTest, LibCppV2) {
// Test that a "v2" of libc++ is still correctly detected.
CppModuleConfiguration config(
makeFiles({"/usr/include/bits/types.h", "/usr/include/c++/v2/vector"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
EXPECT_THAT(config.GetIncludeDirs(),
testing::ElementsAre("/usr/include/c++/v2", ResourceInc(),
"/usr/include"));
}
TEST_F(CppModuleConfigurationTest, UnknownLibCppFile) {
// Test that having some unknown file in the libc++ path doesn't break
// anything.
CppModuleConfiguration config(makeFiles(
{"/usr/include/bits/types.h", "/usr/include/c++/v1/non_existing_file"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre("std"));
EXPECT_THAT(config.GetIncludeDirs(),
testing::ElementsAre("/usr/include/c++/v1", ResourceInc(),
"/usr/include"));
}
TEST_F(CppModuleConfigurationTest, MissingUsrInclude) {
// Test that we don't load 'std' if we can't find the C standard library.
CppModuleConfiguration config(makeFiles({"/usr/include/c++/v1/vector"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
}
TEST_F(CppModuleConfigurationTest, MissingLibCpp) {
// Test that we don't load 'std' if we don't have a libc++.
CppModuleConfiguration config(makeFiles({"/usr/include/bits/types.h"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
}
TEST_F(CppModuleConfigurationTest, IgnoreLibStdCpp) {
// Test that we don't do anything bad when we encounter libstdc++ paths.
CppModuleConfiguration config(makeFiles(
{"/usr/include/bits/types.h", "/usr/include/c++/8.0.1/vector"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
}
TEST_F(CppModuleConfigurationTest, AmbiguousCLib) {
// Test that we don't do anything when we are not sure where the
// right C standard library is.
CppModuleConfiguration config(
makeFiles({"/usr/include/bits/types.h", "/usr/include/c++/v1/vector",
"/sysroot/usr/include/bits/types.h"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
}
TEST_F(CppModuleConfigurationTest, AmbiguousLibCpp) {
// Test that we don't do anything when we are not sure where the
// right libc++ is.
CppModuleConfiguration config(
makeFiles({"/usr/include/bits/types.h", "/usr/include/c++/v1/vector",
"/usr/include/c++/v2/vector"}));
EXPECT_THAT(config.GetImportedModules(), testing::ElementsAre());
EXPECT_THAT(config.GetIncludeDirs(), testing::ElementsAre());
}
| [
"teemperor@gmail.com"
] | teemperor@gmail.com |
27b5eb65755c3683ca45b1a10b05c38ed95205be | b11b140ef2fbb3e3e2d0eb53fdbe4c8943ad5ebb | /SRM/144/550.cpp | 87150ab811817d6172129ee436f1b1ef4db70df5 | [] | no_license | jer22/OI | ea953208ab43542c51eada3c62ef529a6c14588e | 545c2424f277a6626b0f22fb666edd8c37e7328b | refs/heads/master | 2021-04-18T22:57:05.678732 | 2017-11-02T15:40:34 | 2017-11-02T15:40:34 | 27,431,322 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,326 | cpp | #include <bits/stdc++.h>
using namespace std;
class BinaryCode{
public :
vector<string> decode(string s) {
vector<string> ans;
if (s.size() == 1) {
string a = "0", b = "1";
if (s[0] == '0') b = "NONE";
else if (s[0] == '1') a = "NONE";
else {
a = "NONE";
b = "NONE";
}
ans.push_back(a);
ans.push_back(b);
return ans;
}
string a = "0";
int tot = s[0] - '0';
a += '0' + tot;
if (tot && tot != 1) {
a = "NONE";
} else {
for (int i = 1; i < s.size() - 1; i++) {
tot = s[i] - '0' - (a[i - 1] - '0' + a[i] - '0');
a += '0' + tot;
if (tot && tot != 1) {
a = "NONE";
break;
}
}
int t = s.size() - 1;
if (a[t] - '0' + a[t - 1] - '0' != s[t] - '0') {
a = "NONE";
}
}
string b = "1";
tot = s[0] - '1';
b += '0' + tot;
if (tot && tot != 1) {
b = "NONE";
} else {
for (int i = 1; i < s.size() - 1; i++) {
tot = s[i] - '0' - (b[i - 1] - '0' + b[i] - '0');
b += '0' + tot;
if (tot && tot != 1) {
b = "NONE";
break;
}
}
int t = s.size() - 1;
if (b[t] - '0' + b[t - 1] - '0' != s[t] - '0') {
b = "NONE";
}
}
// cout << a << endl;
ans.push_back(a);
ans.push_back(b);
return ans;
}
};
int main() {
BinaryCode b;
vector<string> ans = b.decode("123210120");
return 0;
}
| [
"shijieyywd@gmail.com"
] | shijieyywd@gmail.com |
edcf38b965f0de1b5e314310d94bf87174d1c8ea | 4bf4802f31e67e3d60f6ca2ce517a2783acc2acc | /SDK/CvMessageControl.cpp | d9709e1db19a74ddbd07b2a8e9e1157e8d9e1ccb | [] | no_license | enepomnyaschih/MyMod | 6613c00cf17f761050568490ad4c1f1f497905d7 | f26e5884faa58fd1fe311bc25fe5f56e0d63bf6a | refs/heads/master | 2021-01-10T12:35:41.095386 | 2015-11-17T05:29:58 | 2015-11-17T05:29:58 | 46,324,726 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,780 | cpp | #include "CvGameCoreDLL.h"
#include "CvMessageControl.h"
#include "CvMessageData.h"
#include "CvDLLUtilityIFaceBase.h"
CvMessageControl& CvMessageControl::getInstance()
{
static CvMessageControl m_sInstance;
return m_sInstance;
}
void CvMessageControl::sendExtendedGame()
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetExtendedGame(GC.getGameINLINE().getActivePlayer()));
}
}
void CvMessageControl::sendAutoMoves()
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetAutoMoves(GC.getGameINLINE().getActivePlayer()));
}
}
void CvMessageControl::sendTurnComplete()
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetTurnComplete(GC.getGameINLINE().getActivePlayer()));
}
}
void CvMessageControl::sendPushOrder(int iCityID, OrderTypes eOrder, int iData, bool bAlt, bool bShift, bool bCtrl)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetPushOrder(GC.getGameINLINE().getActivePlayer(), iCityID, eOrder, iData, bAlt, bShift, bCtrl));
}
}
void CvMessageControl::sendPopOrder(int iCity, int iNum)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetPopOrder(GC.getGameINLINE().getActivePlayer(), iCity, iNum));
}
}
void CvMessageControl::sendDoTask(int iCity, TaskTypes eTask, int iData1, int iData2, bool bOption, bool bAlt, bool bShift, bool bCtrl)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetDoTask(GC.getGameINLINE().getActivePlayer(), iCity, eTask, iData1, iData2, bOption, bAlt, bShift, bCtrl));
}
}
void CvMessageControl::sendUpdateCivics(const std::vector<CivicTypes>& aeCivics)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetUpdateCivics(GC.getGameINLINE().getActivePlayer(), aeCivics));
}
}
void CvMessageControl::sendResearch(TechTypes eTech, int iDiscover, bool bShift)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetResearch(GC.getGameINLINE().getActivePlayer(), eTech, iDiscover, bShift));
}
}
void CvMessageControl::sendEspionageSpendingWeightChange(TeamTypes eTargetTeam, int iChange)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetEspionageChange(GC.getGameINLINE().getActivePlayer(), eTargetTeam, iChange));
}
}
void CvMessageControl::sendAdvancedStartAction(AdvancedStartActionTypes eAction, PlayerTypes ePlayer, int iX, int iY, int iData, bool bAdd)
{
gDLL->sendMessageData(new CvNetAdvancedStartAction(eAction, ePlayer, iX, iY, iData, bAdd));
}
void CvMessageControl::sendModNetMessage(int iData1, int iData2, int iData3, int iData4, int iData5)
{
gDLL->sendMessageData(new CvNetModNetMessage(iData1, iData2, iData3, iData4, iData5));
}
void CvMessageControl::sendConvert(ReligionTypes eReligion)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetConvert(GC.getGameINLINE().getActivePlayer(), eReligion));
}
}
void CvMessageControl::sendEmpireSplit(PlayerTypes ePlayer, int iAreaId)
{
gDLL->sendMessageData(new CvNetEmpireSplit(ePlayer, iAreaId));
}
void CvMessageControl::sendFoundReligion(PlayerTypes ePlayer, ReligionTypes eReligion, ReligionTypes eSlotReligion)
{
gDLL->sendMessageData(new CvNetFoundReligion(ePlayer, eReligion, eSlotReligion));
}
void CvMessageControl::sendLaunch(PlayerTypes ePlayer, VictoryTypes eVictory)
{
gDLL->sendMessageData(new CvNetLaunchSpaceship(ePlayer, eVictory));
}
void CvMessageControl::sendEventTriggered(PlayerTypes ePlayer, EventTypes eEvent, int iEventTriggeredId)
{
gDLL->sendMessageData(new CvNetEventTriggered(ePlayer, eEvent, iEventTriggeredId));
}
void CvMessageControl::sendJoinGroup(int iUnitID, int iHeadID)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetJoinGroup(GC.getGameINLINE().getActivePlayer(), iUnitID, iHeadID));
}
}
void CvMessageControl::sendPushMission(int iUnitID, MissionTypes eMission, int iData1, int iData2, int iFlags, bool bShift)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetPushMission(GC.getGameINLINE().getActivePlayer(), iUnitID, eMission, iData1, iData2, iFlags, bShift));
}
}
void CvMessageControl::sendAutoMission(int iUnitID)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetAutoMission(GC.getGameINLINE().getActivePlayer(), iUnitID));
}
}
void CvMessageControl::sendDoCommand(int iUnitID, CommandTypes eCommand, int iData1, int iData2, bool bAlt)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetDoCommand(GC.getGameINLINE().getActivePlayer(), iUnitID, eCommand, iData1, iData2, bAlt));
}
}
void CvMessageControl::sendPercentChange(CommerceTypes eCommerce, int iChange)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetPercentChange(GC.getGameINLINE().getActivePlayer(), eCommerce, iChange));
}
}
void CvMessageControl::sendChangeVassal(TeamTypes eMasterTeam, bool bVassal, bool bCapitulated)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetChangeVassal(GC.getGameINLINE().getActivePlayer(), eMasterTeam, bVassal, bCapitulated));
}
}
void CvMessageControl::sendChooseElection(int iSelection, int iVoteId)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetChooseElection(GC.getGameINLINE().getActivePlayer(), iSelection, iVoteId));
}
}
void CvMessageControl::sendDiploVote(int iVoteId, PlayerVoteTypes eChoice)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetDiploVote(GC.getGameINLINE().getActivePlayer(), iVoteId, eChoice));
}
}
void CvMessageControl::sendChangeWar(TeamTypes eRivalTeam, bool bWar)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetChangeWar(GC.getGameINLINE().getActivePlayer(), eRivalTeam, bWar));
}
}
void CvMessageControl::sendPing(int iX, int iY)
{
if (NO_PLAYER != GC.getGameINLINE().getActivePlayer())
{
gDLL->sendMessageData(new CvNetPing(GC.getGameINLINE().getActivePlayer(), iX, iY));
}
}
// BUG - Reminder Mod - start
void CvMessageControl::sendAddReminder(PlayerTypes ePlayer, int iGameTurn, CvWString szMessage)
{
gDLL->sendMessageData(new CvNetAddReminder(ePlayer, iGameTurn, szMessage));
}
// BUG - Reminder Mod - end
| [
"enepomnyaschih@issart.com"
] | enepomnyaschih@issart.com |
8da277a9d1e4ce9223070ffb5fe3fd5f1ab91b88 | af610ff952d1eaa0f435fb733c44ac49f901c47b | /Codechef/January Cook-Off 2019 Division 2 /new ADAKNG.cpp | b5c8458af4016092a0c2d17b5fc4384928b46c29 | [] | no_license | rishabh0102/Competitive-Coding | 14a70470ca63b9ab473f4ad9ce80ed3abbbe59b6 | c8a4648cd72d0b1b91f8f23bb4b25c1b1d1ac89f | refs/heads/master | 2020-04-24T11:47:27.921265 | 2019-03-30T14:01:40 | 2019-03-30T14:01:40 | 171,937,371 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,661 | cpp | #include <bits/stdc++.h>
using namespace std;
#include<bits/stdc++.h>
#define io ios_base::sync_with_stdio(false)
#define mp make_pair
#define pb push_back
using namespace std;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
cerr << *it << " = " << a << endl;
err(++it, args...);
}
typedef long long int ll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<int,int> ii;
bool isSafe(int r, int c){
if(r<1 || c<1 || r>8 || c>8) return false;
return true;
}
void calculate(vector<vector<bool>> &visited,vector<vector<bool>> &r_visited, int r, int c, int k, int current){
if(current >= k)
return;
int dx[8] = {1, 1, 1, 0, 0, -1, -1, -1};
int dy[8] = {0, -1, 1, -1, 1, 1, 0, -1};
for(int i = 0; i<8; i++){
int x = r+dx[i];
int y = c+dy[i];
// cout << "before safe " << x << " "<< y<<endl;
if(isSafe(x, y) && !visited[x][y]){
// cout << "safe " << x << " "<< y<<endl;
visited[x][y] = true;
r_visited[x][y] = true;
calculate(visited,r_visited, x, y, k, current+1);
visited[x][y] = false;
}
}
}
int main(int argc, char const *argv[])
{
io;
int t;
cin >> t;
while(t--){
int r,c,k;
cin >> r >>c>>k;
int x_max = min(r+k, 8);
int x_min = max(1,r-k);
int y_max = min(c+k, 8);
int y_min = max(1,c-k);
// cout <<"x_max " << x_max <<x_min<<endl;
// cout<< "y" << y_max << y_min<<endl;
cout << (x_max-x_min+1)*(y_max-y_min+1)<<endl;
}
return 0;
} | [
"rishabh@petasense.com"
] | rishabh@petasense.com |
547db3d8e416558ae2422826d230450907cf28c1 | 672810d7cfdafdb271024d86dbf6846706d70488 | /Workshops/WS3/DIY/cstring.cpp | 98cc900d86badf9af34f0d3ab02758f55b5837cf | [] | no_license | ogi28/OOP244 | 4e75329c59538660f336ba2da8b7627a8341b86b | 495d2e2cc50e528bf64aedb86c3c5c59a45c284c | refs/heads/main | 2023-07-11T09:55:56.657858 | 2021-08-13T17:48:31 | 2021-08-13T17:48:31 | 395,737,829 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,136 | cpp | //Ogulcan Tayhan
//104472204
//6.2.2021
//otayhan@myseneca.ca
//I have done all the coding by myself and only copied the code that my professor provided to complete my workshops and assignments.
#include "cstring.h"
namespace sdds
{
// Copies the srouce character string into the destination
void strCpy(char* des, const char* src)
{
int i = 0;
while (src[i])
{
des[i] = src[i];
i++;
}
des[i] = '\0';
return;
}
// Copies the source character string into the destination upto "len"
// characters. The destination will be null terminated only if the number
// of the characters copied is less than "len"
void strnCpy(char* des, const char* src, int len)
{
int i = 0;
while (len > i)
{
len > i ? des[i] = src[i] : des[i] = '\0';
i++;
}
des[i] = '\0';
return;
}
// Compares two C-strings
// returns 0 i thare the same
// return > 0 if s1 > s2
// return < 0 if s1 < s2
int strCmp(const char* s1, const char* s2)
{
int i = 0, x = 0;
while (s1[i] != '\0' || s2[i] != '\0')
{ // I just wanted to use the nested ?: that I learned from Prof. Fardad's sunday lecture.
s1[i] > s2[i] ? x = 1 : (s1[i] < s2[i] ? x = -1 : x = 0);
i++;
}
return x;
}
// returns 0 i thare the same
// return > 0 if s1 > s2
// return < 0 if s1 < s2
int strnCmp(const char* s1, const char* s2, int len)
{
int i = 0, x = 0;
while (len > i)
{
s1[i] > s2[i] ? x = 1 : (s1[i] < s2[i] ? x = -1 : x = 0);
i++;
}
return x;
}
// returns the lenght of the C-string in characters
int strLen(const char* s)
{
int i = 0, Len;
while (s[i]) i++;
Len = i;
return Len;
}
// returns the address of first occurance of "str2" in "str1"
// returns nullptr if no match is found
const char* strStr(const char* str1, const char* str2)
{
//const char* ret = nullptr;
int str2Len = strLen(str2);
int numCharsMatched = 0;
const char* pStr1 = str1;
const char* pStr2 = str2;
while (*pStr1)
{
//printf("checking %c\n", *pStr1);
if (*(pStr1 + numCharsMatched) != *(pStr2))
{
pStr1++;
pStr2 = str2;
numCharsMatched = 0;
}
else
{
/* chars match*/
numCharsMatched++;
if (numCharsMatched == str2Len)
return pStr1;
else
pStr2++;
}
}
return nullptr;
}
void strCat(char* des, const char* src)
{
int i = 0, j;
while (des[i]) i++;
for (j = 0; src[j] != '\0'; j++, i++) des[i] = src[j];
des[i] = '\0';
return;
}
}
// if ( s1[i] > s2[i] ? x = 1 : (s1[i] < s2[i] ? x = -1 : x = 0); | [
"ogulcantayhan@hotmail.com"
] | ogulcantayhan@hotmail.com |
903f77ae9128fd5ec864173b30c0170b3ae45137 | bcea31607a7f71243b70d497813d814a99f0a159 | /Module1/code_file.cpp | 09f6c98ad10d7c089e0b053835fb385017ad28f0 | [] | no_license | aldonald/SIT315 | 67be7cc929a8dd881629bf0494c5cde169e9f0cb | 4c4d37eef4e7a951308205480c2b6efb6ff43f93 | refs/heads/master | 2022-11-18T13:17:30.301883 | 2020-07-22T08:25:51 | 2020-07-22T08:25:51 | 281,612,792 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 328 | cpp | void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
pinMode(4, INPUT);
digitalWrite(13, LOW);
}
void loop()
{
if(digitalRead(4) == 1)
{
digitalWrite(13, HIGH);
Serial.println("Sensor activated.");
delay(100);
}
else
{
digitalWrite(13, LOW);
Serial.println("Sensor NOT active.");
}
}
| [
"noreply@github.com"
] | noreply@github.com |
31c422abd233b1a9e3234c11514d3347f5805f81 | 9102703aba869548fe26414c0757e40ded4e8629 | /soj3503.cpp | 649fd158c8f5cd8b7d7d2dc5b9820a58e76bd5a4 | [] | no_license | twocoldz/sojcode | e04e4b92ea4b6bce3bcaeb935efbdc62216d48ca | 4ea12c7126e5297d823d620b35dd90585b825c41 | refs/heads/master | 2021-01-10T19:09:24.909558 | 2013-04-02T12:00:55 | 2013-04-02T12:00:55 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 870 | cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
struct node
{
int w,c;
}box[1005];
bool cmp(node a,node b)
{
return a.c+a.w<b.c+b.w;
}
int dp[1005];
int main()
{
int n;
while(scanf("%d",&n)==1&&n)
{
for(int i=1;i<=n;i++)
scanf("%d",&box[i].w);
for(int i=1;i<=n;i++)
scanf("%d",&box[i].c);
sort(box+1,box+1+n,cmp);
dp[0]=0;
int ans=0;
for(int i=1;i<=n;i++)
{
if(box[i].c>=dp[ans])
{
dp[ans+1]=dp[ans]+box[i].w;
ans++;
}
for(int j=ans-1;j>=0;j--)
{
if(dp[j]<=box[i].c&&dp[j+1]>dp[j]+box[i].w)
dp[j+1]=dp[j]+box[i].w;
}
}
printf("%d\n",ans);
}
return 0;
}
| [
"twocoldz007@gmail.com"
] | twocoldz007@gmail.com |
433a91895b0f2e67fe82444687bc191f3b28ab1d | b0eee769ed1fde3b965b66cb4eaabc56b3f4efad | /test/slice.h | 1550f32bea3220327785cbf3240c88a98e3af7f9 | [
"BSD-2-Clause"
] | permissive | DamonXu/libevlite | df2d4bf0276cc6be6b720631e403079dfdc7cc68 | 36de7af8256b71f9a02c5fb26887f20c65fde5f8 | refs/heads/master | 2020-11-29T21:21:06.359573 | 2019-10-14T08:56:36 | 2019-10-14T08:56:36 | 150,943,062 | 1 | 0 | BSD-2-Clause | 2018-09-30T07:31:42 | 2018-09-30T07:31:42 | null | UTF-8 | C++ | false | false | 2,808 | h |
#ifndef __SRC_UTILS_SLICE_H__
#define __SRC_UTILS_SLICE_H__
#include <stdint.h>
#include <vector>
#include <string>
#include <cassert>
#include <cstring>
class Slice
{
public:
// Create an empty slice.
Slice()
: m_Data(""),
m_Size(0)
{}
// Create a slice that refers to d[0,n-1].
Slice( const char * d, size_t n )
: m_Data(d),
m_Size(n)
{}
// Create a slice that refers to the contents of "s"
Slice( const std::string & s )
: m_Data( s.data() ),
m_Size( s.size() )
{}
// Create a slice that refers to s[0,strlen(s)-1]
Slice( const char * s )
: m_Data( s ),
m_Size( std::strlen(s) )
{}
// Return a pointer to the beginning of the referenced data
const char * data() const { return m_Data; }
// Return the length (in bytes) of the referenced data
size_t size() const { return m_Size; }
// Return true iff the length of the referenced data is zero
bool empty() const { return m_Size == 0; }
// Return the ith byte in the referenced data.
// REQUIRES: n < size()
char operator[](size_t n) const
{
assert( n < size() );
return m_Data[ n ];
}
// Change this slice to refer to an empty array
void clear() { m_Data = ""; m_Size = 0; }
// Drop the first "n" bytes from this slice.
void remove( size_t n )
{
assert( n <= size() );
m_Data += n;
m_Size -= n;
}
// Return a string that contains the copy of the referenced data.
std::string ToString() const
{
return std::string( m_Data, m_Size );
}
// Three-way comparison. Returns value:
// < 0 iff "*this" < "b",
// == 0 iff "*this" == "b",
// > 0 iff "*this" > "b"
int32_t compare( const Slice & b ) const;
// Return true iff "x" is a prefix of "*this"
bool startwith( const Slice & x ) const
{
return ( (m_Size >= x.m_Size)
&& (std::memcmp(m_Data, x.m_Data, x.m_Size) == 0) );
}
private:
const char * m_Data;
size_t m_Size;
};
inline bool operator== ( const Slice & x, const Slice & y )
{
return ( (x.size() == y.size())
&& (std::memcmp(x.data(), y.data(), x.size()) == 0) );
}
inline bool operator!= ( const Slice & x, const Slice & y)
{
return !(x == y);
}
inline int32_t Slice::compare( const Slice & b ) const
{
const int32_t min_len = (m_Size < b.m_Size) ? m_Size : b.m_Size;
int32_t r = std::memcmp(m_Data, b.m_Data, min_len);
if ( r == 0 )
{
if ( m_Size < b.m_Size )
{
r = -1;
}
else if ( m_Size > b.m_Size )
{
r = +1;
}
}
return r;
}
typedef std::vector<Slice> Slices;
#endif
| [
"spriteray@gmail.com"
] | spriteray@gmail.com |
e851180b467546448b1c4eb8ae913bf8a400092d | 7ebae5ec0378642a1d2c181184460e76c73debbd | /UVA Online Judge/467/467/stdafx.cpp | 6d799547c479ae8053e97db0f861b1dacd9f3391 | [] | no_license | tonyli00000/Competition-Code | a4352b6b6835819a0f19f7f5cc67e46d2a200906 | 7f5767e3cb997fd15ae6f72145bcb8394f50975f | refs/heads/master | 2020-06-17T23:04:10.367762 | 2019-12-28T22:08:25 | 2019-12-28T22:08:25 | 196,091,038 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 282 | cpp | // stdafx.cpp : source file that includes just the standard includes
// 467.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
| [
"tonyli2002@live.com"
] | tonyli2002@live.com |
f76b79085a53b1a4cc1bd9116b4744ab1710e1dc | c794cd15cd922bf11b1b3b2dbc9c9cda79b0164a | /UnnamedEngine/Sources/Engine/Graphics/VulkanDriver/VulkanApplicationFactory.h | 4b08a3d696e07442a00f11c0ad55ec069e50df0d | [
"MIT"
] | permissive | kevinchen2015/UnnamedEngine | 906312f504f36e0a92284c6e0ca07eb81c6c9e25 | ce906886c381291ce6bac259d929a627ce8cad01 | refs/heads/master | 2021-05-05T15:52:17.722074 | 2018-01-10T14:58:02 | 2018-01-10T14:58:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,658 | h | #pragma once
#include "Engine/Base/Common/Common.h"
#include "Engine/Graphics/VulkanDriver/VulkanApplication.h"
class VulkanDriver;
// This class has the intent of keeping the Vulkan initialization boilerplate
// out of VulkanDriver for a clean interface and compilation time reasons.
class VulkanApplicationFactory : public NonCopyable
{
public:
VulkanApplicationFactory(VulkanDriver* driver);
VulkanApplication CreateApplication();
private:
VulkanDriver* mDriver;
VulkanApplication* mApplication; // This is set everytime CreateApplication is called. Dirty hack to reduce the number of method args.
void SetupPhysicalDevice();
size_t RatePhysicalDevice(VkPhysicalDevice device);
QueueFamilyIndices GetQueueFamilyIndices(VkPhysicalDevice device);
void SetupLogicalDevice();
void SetupSurface();
void CreatePipeline();
void SetupCommandBuffers();
void RecordCommandBuffers();
void SetupMemoryPools();
void SetupSwapchainImageViews();
VulkanVertexBuffer CreateVertexBuffer(VkDeviceSize size);
void SetupVulkanInstance();
void SetupValidationLayers();
bool CheckValidationLayerSupport();
bool CheckExtensionSupport(VkPhysicalDevice device);
SwapChainSupportDetails CheckSwapChainSupport(VkPhysicalDevice device);
VkPresentModeKHR SelectSwapPresentMode(const std::vector<VkPresentModeKHR> availablePresentModes);
VkSurfaceFormatKHR SelectSwapSurfaceFormat(const std::vector<VkSurfaceFormatKHR>& availableFormats);
VkExtent2D SelectSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities);
void SetupDefaultSwapchain();
std::vector<char*> GetRequiredInstanceExtensions();
std::vector<char*> GetRequiredDeviceExtensions();
}; | [
"tinnymint@gmail.com"
] | tinnymint@gmail.com |
c220c2395ce5f9653fd18aa4d8f3b1228796bbf3 | 2c539291cc5f424b4c1bbc4f7be7f2a5a59f4949 | /LeetCode/lc90.cpp | c49b241f39eda7b58a4f3e461910f6d161757d16 | [] | no_license | CaptainTPS/LeetCodeRep | cd9d15b54f0f14cb214b8f6cbf07b641e7b97e27 | 2ae1696ff2fe226f283933cb6b1bbd6a2bd252f5 | refs/heads/master | 2020-06-20T02:35:26.481909 | 2017-10-25T14:24:34 | 2017-10-25T14:24:34 | 74,888,511 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,210 | cpp | #include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <iostream>
using namespace std;
class Solution90 {
public:
struct cmp
{
bool operator()(vector<int> a, vector<int> b){
for (size_t i = 0; i < a.size(); i++)
{
if (b.size() == i)
{
return false;
}
if (a[i] > b[i])
{
return true;
}
else if (a[i] < b[i])
{
return false;
}
}
return true;
}
};
set<vector<int>> all;
void dfs(vector<int>& nums, vector<int>& temp, int now){
if (now == nums.size())
{
vector<int> store(temp);
sort(store.begin(), store.end());
all.insert(store);
return;
}
temp.push_back(nums[now]);
dfs(nums, temp, now + 1);
temp.pop_back();
dfs(nums, temp, now + 1);
}
vector<vector<int>> subsetsWithDup(vector<int>& nums) {
vector<int> ttt;
dfs(nums, ttt, 0);
vector<vector<int>> result;
for (auto i = all.begin(); i != all.end(); i++)
{
vector<int> temp(i->begin(), i->end());
result.push_back(temp);
}
return result;
}
};
int main90(){
vector<int> nums;
nums.push_back(0);
nums.push_back(1);
nums.push_back(1);
Solution90 ss;
ss.subsetsWithDup(nums);
return 0;
} | [
"none"
] | none |
e9cbda7da1563cc19e3493ed0c518be916deb2cd | 32c99a6283773b195fabf76df1e756cb3ca8bc5a | /5일차/sosuengine/sosuengine/SceneManager.h | 10c90bbcb3d094fb553a199950dbb1a3a1a57a55 | [] | no_license | parkgmin/2020-Sunrin-DirectX | 2a534d4207ce42a364aa3390d4ec64fcdcef0797 | 196574f22aa3104b6879ef84795a5aed27993e0a | refs/heads/master | 2022-12-01T07:56:44.357895 | 2020-08-16T07:47:29 | 2020-08-16T07:47:29 | 286,416,220 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 210 | h | #pragma once
#include "Scene.h"
class SceneManager
{
private:
Scene* currentScene;
public:
SceneManager();
~SceneManager();
void Render();
void Update(float dTime);
void ChangeScene(Scene* scene);
};
| [
"rudlas0114@naver.com"
] | rudlas0114@naver.com |
eec1b90536493f4a1ccd22539dcc183e26afb9fc | 1fa7109fa66f01c03effd7ed1aecf4526b7bb66e | /src/trusted/validator_arm/gen/arm32_decode_baselines_3.h | b27cf120ac1c96c8d4f93f1ec5fa3f556d419d41 | [
"LGPL-2.0-or-later",
"LicenseRef-scancode-philippe-de-muyter",
"LicenseRef-scancode-intel-osl-1993",
"HPND-sell-variant",
"ICU",
"LicenseRef-scancode-python-cwi",
"LicenseRef-scancode-generic-exception",
"LGPL-2.1-or-later",
"SMLNJ",
"BSD-3-Clause",
"GFDL-1.1-or-later",
"HP-1986",
"LicenseRe... | permissive | Lind-Project/native_client | 2bd32d9515c561d7f60cca10d309a18059b67006 | 842a4f87bf9ba46914a6efe74a94d7168d33b4b2 | refs/heads/main | 2023-08-30T02:38:29.827132 | 2023-07-08T17:16:56 | 2023-07-08T17:16:56 | 11,289,145 | 5 | 4 | BSD-3-Clause | 2023-08-30T19:04:07 | 2013-07-09T17:38:40 | C | UTF-8 | C++ | false | false | 224,498 | h | /*
* Copyright 2013 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
// DO NOT EDIT: GENERATED CODE
#ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_GEN_ARM32_DECODE_BASELINES_3_H_
#define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_GEN_ARM32_DECODE_BASELINES_3_H_
#include "native_client/src/trusted/validator_arm/arm_helpers.h"
#include "native_client/src/trusted/validator_arm/inst_classes.h"
namespace nacl_arm_dec {
// VLD1_multiple_single_elements_111101000d10nnnnddddttttssaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// align: align(5:4),
// alignment: 1
// if align(5:4)=00
// else 4 << align,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// type(11:8),
// size(7:6),
// align(5:4),
// Rm(3:0)],
// m: Rm,
// n: Rn,
// pattern: 111101000d10nnnnddddttttssaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// regs: 1
// if type(11:8)=0111
// else 2
// if type(11:8)=1010
// else 3
// if type(11:8)=0110
// else 4
// if type(11:8)=0010
// else 0,
// rule: VLD1_multiple_single_elements,
// safety: [type(11:8)=0111 &&
// align(1)=1 => UNDEFINED,
// type(11:8)=1010 &&
// align(5:4)=11 => UNDEFINED,
// type(11:8)=0110 &&
// align(1)=1 => UNDEFINED,
// not type in bitset {'0111', '1010', '0110', '0010'} => DECODER_ERROR,
// n ==
// Pc ||
// d + regs >
// 32 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// type: type(11:8),
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD1_multiple_single_elements_111101000d10nnnnddddttttssaammmm_case_0
: public ClassDecoder {
public:
VLD1_multiple_single_elements_111101000d10nnnnddddttttssaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD1_multiple_single_elements_111101000d10nnnnddddttttssaammmm_case_0);
};
// VLD1_single_element_to_all_lanes_111101001d10nnnndddd1100sstammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// T: T(5),
// Vd: Vd(15:12),
// a: a(4),
// alignment: 1
// if a(4)=0
// else ebytes,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(7:6),
// T(5),
// a(4),
// Rm(3:0)],
// m: Rm,
// n: Rn,
// pattern: 111101001d10nnnndddd1100sstammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// regs: 1
// if T(5)=0
// else 2,
// rule: VLD1_single_element_to_all_lanes,
// safety: [size(7:6)=11 ||
// (size(7:6)=00 &&
// a(4)=1) => UNDEFINED,
// n ==
// Pc ||
// d + regs >
// 32 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD1_single_element_to_all_lanes_111101001d10nnnndddd1100sstammmm_case_0
: public ClassDecoder {
public:
VLD1_single_element_to_all_lanes_111101001d10nnnndddd1100sstammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD1_single_element_to_all_lanes_111101001d10nnnndddd1100sstammmm_case_0);
};
// VLD1_single_element_to_one_lane_111101001d10nnnnddddss00aaaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// alignment: 1
// if size(11:10)=00
// else (1
// if index_align(0)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(1:0)=00
// else 4)
// if size(11:10)=10
// else 0,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(11:10),
// index_align(7:4),
// Rm(3:0)],
// inc: 1
// if size(11:10)=00
// else (1
// if index_align(1)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(2)=0
// else 2)
// if size(11:10)=10
// else 0,
// index: index_align(3:1)
// if size(11:10)=00
// else index_align(3:2)
// if size(11:10)=01
// else index_align(3)
// if size(11:10)=10
// else 0,
// index_align: index_align(7:4),
// m: Rm,
// n: Rn,
// pattern: 111101001d10nnnnddddss00aaaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VLD1_single_element_to_one_lane,
// safety: [size(11:10)=11 => UNDEFINED,
// size(11:10)=00 &&
// index_align(0)=~0 => UNDEFINED,
// size(11:10)=01 &&
// index_align(1)=~0 => UNDEFINED,
// size(11:10)=10 &&
// index_align(2)=~0 => UNDEFINED,
// size(11:10)=10 &&
// index_align(1:0)=~00 &&
// index_align(1:0)=~11 => UNDEFINED,
// n ==
// Pc => UNPREDICTABLE],
// size: size(11:10),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD1_single_element_to_one_lane_111101001d10nnnnddddss00aaaammmm_case_0
: public ClassDecoder {
public:
VLD1_single_element_to_one_lane_111101001d10nnnnddddss00aaaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD1_single_element_to_one_lane_111101001d10nnnnddddss00aaaammmm_case_0);
};
// VLD2_multiple_2_element_structures_111101000d10nnnnddddttttssaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// align: align(5:4),
// alignment: 1
// if align(5:4)=00
// else 4 << align,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// type(11:8),
// size(7:6),
// align(5:4),
// Rm(3:0)],
// inc: 1
// if type(11:8)=1000
// else 2,
// m: Rm,
// n: Rn,
// pattern: 111101000d10nnnnddddttttssaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// regs: 1
// if type in bitset {'1000', '1001'}
// else 2,
// rule: VLD2_multiple_2_element_structures,
// safety: [size(7:6)=11 => UNDEFINED,
// type in bitset {'1000', '1001'} &&
// align(5:4)=11 => UNDEFINED,
// not type in bitset {'1000', '1001', '0011'} => DECODER_ERROR,
// n ==
// Pc ||
// d2 + regs >
// 32 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// type: type(11:8),
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD2_multiple_2_element_structures_111101000d10nnnnddddttttssaammmm_case_0
: public ClassDecoder {
public:
VLD2_multiple_2_element_structures_111101000d10nnnnddddttttssaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD2_multiple_2_element_structures_111101000d10nnnnddddttttssaammmm_case_0);
};
// VLD2_single_2_element_structure_to_all_lanes_111101001d10nnnndddd1101sstammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// T: T(5),
// Vd: Vd(15:12),
// a: a(4),
// alignment: 1
// if a(4)=0
// else 2 * ebytes,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(7:6),
// T(5),
// a(4),
// Rm(3:0)],
// inc: 1
// if T(5)=0
// else 2,
// m: Rm,
// n: Rn,
// pattern: 111101001d10nnnndddd1101sstammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VLD2_single_2_element_structure_to_all_lanes,
// safety: [size(7:6)=11 => UNDEFINED,
// n ==
// Pc ||
// d2 >
// 31 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD2_single_2_element_structure_to_all_lanes_111101001d10nnnndddd1101sstammmm_case_0
: public ClassDecoder {
public:
VLD2_single_2_element_structure_to_all_lanes_111101001d10nnnndddd1101sstammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD2_single_2_element_structure_to_all_lanes_111101001d10nnnndddd1101sstammmm_case_0);
};
// VLD2_single_2_element_structure_to_one_lane_111101001d10nnnnddddss01aaaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// alignment: (1
// if index_align(0)=0
// else 2)
// if size(11:10)=00
// else (1
// if index_align(0)=0
// else 4)
// if size(11:10)=01
// else (1
// if index_align(0)=0
// else 8)
// if size(11:10)=10
// else 0,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(11:10),
// index_align(7:4),
// Rm(3:0)],
// inc: 1
// if size(11:10)=00
// else (1
// if index_align(1)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(2)=0
// else 2)
// if size(11:10)=10
// else 0,
// index: index_align(3:1)
// if size(11:10)=00
// else index_align(3:2)
// if size(11:10)=01
// else index_align(3)
// if size(11:10)=10
// else 0,
// index_align: index_align(7:4),
// m: Rm,
// n: Rn,
// pattern: 111101001d10nnnnddddss01aaaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VLD2_single_2_element_structure_to_one_lane,
// safety: [size(11:10)=11 => UNDEFINED,
// size(11:10)=10 &&
// index_align(1)=~0 => UNDEFINED,
// n ==
// Pc ||
// d2 >
// 31 => UNPREDICTABLE],
// size: size(11:10),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD2_single_2_element_structure_to_one_lane_111101001d10nnnnddddss01aaaammmm_case_0
: public ClassDecoder {
public:
VLD2_single_2_element_structure_to_one_lane_111101001d10nnnnddddss01aaaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD2_single_2_element_structure_to_one_lane_111101001d10nnnnddddss01aaaammmm_case_0);
};
// VLD3_multiple_3_element_structures_111101000d10nnnnddddttttssaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// align: align(5:4),
// alignment: 1
// if align(0)=0
// else 8,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// type(11:8),
// size(7:6),
// align(5:4),
// Rm(3:0)],
// inc: 1
// if type(11:8)=0100
// else 2,
// m: Rm,
// n: Rn,
// pattern: 111101000d10nnnnddddttttssaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VLD3_multiple_3_element_structures,
// safety: [size(7:6)=11 ||
// align(1)=1 => UNDEFINED,
// not type in bitset {'0100', '0101'} => DECODER_ERROR,
// n ==
// Pc ||
// d3 >
// 31 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// type: type(11:8),
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD3_multiple_3_element_structures_111101000d10nnnnddddttttssaammmm_case_0
: public ClassDecoder {
public:
VLD3_multiple_3_element_structures_111101000d10nnnnddddttttssaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD3_multiple_3_element_structures_111101000d10nnnnddddttttssaammmm_case_0);
};
// VLD3_single_3_element_structure_to_all_lanes_111101001d10nnnndddd1110sstammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// T: T(5),
// Vd: Vd(15:12),
// a: a(4),
// alignment: 1,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(7:6),
// T(5),
// a(4),
// Rm(3:0)],
// inc: 1
// if T(5)=0
// else 2,
// m: Rm,
// n: Rn,
// pattern: 111101001d10nnnndddd1110sstammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VLD3_single_3_element_structure_to_all_lanes,
// safety: [size(7:6)=11 ||
// a(4)=1 => UNDEFINED,
// n ==
// Pc ||
// d3 >
// 31 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD3_single_3_element_structure_to_all_lanes_111101001d10nnnndddd1110sstammmm_case_0
: public ClassDecoder {
public:
VLD3_single_3_element_structure_to_all_lanes_111101001d10nnnndddd1110sstammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD3_single_3_element_structure_to_all_lanes_111101001d10nnnndddd1110sstammmm_case_0);
};
// VLD3_single_3_element_structure_to_one_lane_111101001d10nnnnddddss10aaaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// alignment: 1,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(11:10),
// index_align(7:4),
// Rm(3:0)],
// inc: 1
// if size(11:10)=00
// else (1
// if index_align(1)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(2)=0
// else 2)
// if size(11:10)=10
// else 0,
// index: index_align(3:1)
// if size(11:10)=00
// else index_align(3:2)
// if size(11:10)=01
// else index_align(3)
// if size(11:10)=10
// else 0,
// index_align: index_align(7:4),
// m: Rm,
// n: Rn,
// pattern: 111101001d10nnnnddddss10aaaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VLD3_single_3_element_structure_to_one_lane,
// safety: [size(11:10)=11 => UNDEFINED,
// size(11:10)=00 &&
// index_align(0)=~0 => UNDEFINED,
// size(11:10)=01 &&
// index_align(0)=~0 => UNDEFINED,
// size(11:10)=10 &&
// index_align(1:0)=~00 => UNDEFINED,
// n ==
// Pc ||
// d3 >
// 31 => UNPREDICTABLE],
// size: size(11:10),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD3_single_3_element_structure_to_one_lane_111101001d10nnnnddddss10aaaammmm_case_0
: public ClassDecoder {
public:
VLD3_single_3_element_structure_to_one_lane_111101001d10nnnnddddss10aaaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD3_single_3_element_structure_to_one_lane_111101001d10nnnnddddss10aaaammmm_case_0);
};
// VLD4_multiple_4_element_structures_111101000d10nnnnddddttttssaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// align: align(5:4),
// alignment: 1
// if align(5:4)=00
// else 4 << align,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// d4: d3 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// type(11:8),
// size(7:6),
// align(5:4),
// Rm(3:0)],
// inc: 1
// if type(11:8)=0000
// else 2,
// m: Rm,
// n: Rn,
// pattern: 111101000d10nnnnddddttttssaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VLD4_multiple_4_element_structures,
// safety: [size(7:6)=11 => UNDEFINED,
// not type in bitset {'0000', '0001'} => DECODER_ERROR,
// n ==
// Pc ||
// d4 >
// 31 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// type: type(11:8),
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD4_multiple_4_element_structures_111101000d10nnnnddddttttssaammmm_case_0
: public ClassDecoder {
public:
VLD4_multiple_4_element_structures_111101000d10nnnnddddttttssaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD4_multiple_4_element_structures_111101000d10nnnnddddttttssaammmm_case_0);
};
// VLD4_single_4_element_structure_to_all_lanes_111101001d10nnnndddd1111sstammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// T: T(5),
// Vd: Vd(15:12),
// a: a(4),
// alignment: 16
// if size(7:6)=11
// else (1
// if a(4)=0
// else 8)
// if size(7:6)=10
// else (1
// if a(4)=0
// else 4 * ebytes),
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// d4: d3 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(7:6),
// T(5),
// a(4),
// Rm(3:0)],
// inc: 1
// if T(5)=0
// else 2,
// m: Rm,
// n: Rn,
// pattern: 111101001d10nnnndddd1111sstammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VLD4_single_4_element_structure_to_all_lanes,
// safety: [size(7:6)=11 &&
// a(4)=0 => UNDEFINED,
// n ==
// Pc ||
// d4 >
// 31 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD4_single_4_element_structure_to_all_lanes_111101001d10nnnndddd1111sstammmm_case_0
: public ClassDecoder {
public:
VLD4_single_4_element_structure_to_all_lanes_111101001d10nnnndddd1111sstammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD4_single_4_element_structure_to_all_lanes_111101001d10nnnndddd1111sstammmm_case_0);
};
// VLD4_single_4_element_structure_to_one_lane_111101001d10nnnnddddss11aaaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// alignment: (1
// if index_align(0)=0
// else 4)
// if size(11:10)=00
// else (1
// if index_align(0)=0
// else 8)
// if size(11:10)=01
// else (1
// if index_align(1:0)=00
// else 4 << index_align(1:0))
// if size(11:10)=10
// else 0,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// d4: d3 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(11:10),
// index_align(7:4),
// Rm(3:0)],
// inc: 1
// if size(11:10)=00
// else (1
// if index_align(1)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(2)=0
// else 2)
// if size(11:10)=10
// else 0,
// index: index_align(3:1)
// if size(11:10)=00
// else index_align(3:2)
// if size(11:10)=01
// else index_align(3)
// if size(11:10)=10
// else 0,
// index_align: index_align(7:4),
// m: Rm,
// n: Rn,
// pattern: 111101001d10nnnnddddss11aaaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VLD4_single_4_element_structure_to_one_lane,
// safety: [size(11:10)=11 => UNDEFINED,
// size(11:10)=10 &&
// index_align(1:0)=11 => UNDEFINED,
// n ==
// Pc ||
// d4 >
// 31 => UNPREDICTABLE],
// size: size(11:10),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VLD4_single_4_element_structure_to_one_lane_111101001d10nnnnddddss11aaaammmm_case_0
: public ClassDecoder {
public:
VLD4_single_4_element_structure_to_one_lane_111101001d10nnnnddddss11aaaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLD4_single_4_element_structure_to_one_lane_111101001d10nnnnddddss11aaaammmm_case_0);
};
// VLDM_cccc110pudw1nnnndddd1010iiiiiiii_case_0:
//
// {D: D(22),
// None: 32,
// P: P(24),
// Pc: 15,
// Rn: Rn(19:16),
// Sp: 13,
// U: U(23),
// Vd: Vd(15:12),
// W: W(21),
// add: U(23)=1,
// arch: VFPv2,
// base: Rn,
// cond: cond(31:28),
// d: Vd:D,
// defs: {Rn
// if wback
// else None},
// fields: [cond(31:28),
// P(24),
// U(23),
// D(22),
// W(21),
// Rn(19:16),
// Vd(15:12),
// imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// is_literal_load: Rn ==
// Pc,
// n: Rn,
// pattern: cccc110pudw1nnnndddd1010iiiiiiii,
// regs: imm8,
// rule: VLDM,
// safety: [P(24)=0 &&
// U(23)=0 &&
// W(21)=0 => DECODER_ERROR,
// P(24)=1 &&
// W(21)=0 => DECODER_ERROR,
// P ==
// U &&
// W(21)=1 => UNDEFINED,
// n ==
// Pc &&
// wback => UNPREDICTABLE,
// P(24)=0 &&
// U(23)=1 &&
// W(21)=1 &&
// Rn ==
// Sp => DECODER_ERROR,
// regs ==
// 0 ||
// d + regs >
// 32 => UNPREDICTABLE],
// single_regs: true,
// small_imm_base_wb: wback,
// true: true,
// uses: {Rn},
// violations: [implied by 'base'],
// wback: W(21)=1}
class VLDM_cccc110pudw1nnnndddd1010iiiiiiii_case_0
: public ClassDecoder {
public:
VLDM_cccc110pudw1nnnndddd1010iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual bool is_literal_load(Instruction i) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLDM_cccc110pudw1nnnndddd1010iiiiiiii_case_0);
};
// VLDM_cccc110pudw1nnnndddd1011iiiiiiii_case_0:
//
// {D: D(22),
// None: 32,
// P: P(24),
// Pc: 15,
// Rn: Rn(19:16),
// Sp: 13,
// U: U(23),
// Vd: Vd(15:12),
// W: W(21),
// add: U(23)=1,
// arch: ['VFPv2', 'AdvSIMD'],
// base: Rn,
// cond: cond(31:28),
// d: D:Vd,
// defs: {Rn
// if wback
// else None},
// false: false,
// fields: [cond(31:28),
// P(24),
// U(23),
// D(22),
// W(21),
// Rn(19:16),
// Vd(15:12),
// imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// is_literal_load: Rn ==
// Pc,
// n: Rn,
// pattern: cccc110pudw1nnnndddd1011iiiiiiii,
// regs: imm8 / 2,
// rule: VLDM,
// safety: [P(24)=0 &&
// U(23)=0 &&
// W(21)=0 => DECODER_ERROR,
// P(24)=1 &&
// W(21)=0 => DECODER_ERROR,
// P ==
// U &&
// W(21)=1 => UNDEFINED,
// n ==
// Pc &&
// wback => UNPREDICTABLE,
// P(24)=0 &&
// U(23)=1 &&
// W(21)=1 &&
// Rn ==
// Sp => DECODER_ERROR,
// regs ==
// 0 ||
// regs >
// 16 ||
// d + regs >
// 32 => UNPREDICTABLE,
// VFPSmallRegisterBank() &&
// d + regs >
// 16 => UNPREDICTABLE,
// imm8(0) ==
// 1 => DEPRECATED],
// single_regs: false,
// small_imm_base_wb: wback,
// uses: {Rn},
// violations: [implied by 'base'],
// wback: W(21)=1}
class VLDM_cccc110pudw1nnnndddd1011iiiiiiii_case_0
: public ClassDecoder {
public:
VLDM_cccc110pudw1nnnndddd1011iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual bool is_literal_load(Instruction i) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLDM_cccc110pudw1nnnndddd1011iiiiiiii_case_0);
};
// VLDR_cccc1101ud01nnnndddd1010iiiiiiii_case_0:
//
// {D: D(22),
// Pc: 15,
// Rn: Rn(19:16),
// U: U(23),
// Vd: Vd(15:12),
// add: U(23)=1,
// arch: VFPv2,
// base: Rn,
// cond: cond(31:28),
// d: D:Vd,
// defs: {},
// fields: [cond(31:28), U(23), D(22), Rn(19:16), Vd(15:12), imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// is_literal_load: Rn ==
// Pc,
// n: Rn,
// pattern: cccc1101ud01nnnndddd1010iiiiiiii,
// rule: VLDR,
// single_reg: true,
// true: true,
// uses: {Rn},
// violations: [implied by 'base']}
class VLDR_cccc1101ud01nnnndddd1010iiiiiiii_case_0
: public ClassDecoder {
public:
VLDR_cccc1101ud01nnnndddd1010iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual bool is_literal_load(Instruction i) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLDR_cccc1101ud01nnnndddd1010iiiiiiii_case_0);
};
// VLDR_cccc1101ud01nnnndddd1011iiiiiiii_case_0:
//
// {D: D(22),
// Pc: 15,
// Rn: Rn(19:16),
// U: U(23),
// Vd: Vd(15:12),
// add: U(23)=1,
// arch: ['VFPv2', 'AdvSIMD'],
// base: Rn,
// cond: cond(31:28),
// d: D:Vd,
// defs: {},
// false: false,
// fields: [cond(31:28), U(23), D(22), Rn(19:16), Vd(15:12), imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// is_literal_load: Rn ==
// Pc,
// n: Rn,
// pattern: cccc1101ud01nnnndddd1011iiiiiiii,
// rule: VLDR,
// single_reg: false,
// uses: {Rn},
// violations: [implied by 'base']}
class VLDR_cccc1101ud01nnnndddd1011iiiiiiii_case_0
: public ClassDecoder {
public:
VLDR_cccc1101ud01nnnndddd1011iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual bool is_literal_load(Instruction i) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VLDR_cccc1101ud01nnnndddd1011iiiiiiii_case_0);
};
// VMAX_1111001u0dssnnnndddd0110nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd0110nqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMAX,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(21:20)=11 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VMAX_1111001u0dssnnnndddd0110nqm0mmmm_case_0
: public ClassDecoder {
public:
VMAX_1111001u0dssnnnndddd0110nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMAX_1111001u0dssnnnndddd0110nqm0mmmm_case_0);
};
// VMAX_floating_point_111100100dssnnnndddd1111nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100100dssnnnndddd1111nqm0mmmm,
// rule: VMAX_floating_point,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(0)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VMAX_floating_point_111100100dssnnnndddd1111nqm0mmmm_case_0
: public ClassDecoder {
public:
VMAX_floating_point_111100100dssnnnndddd1111nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMAX_floating_point_111100100dssnnnndddd1111nqm0mmmm_case_0);
};
// VMIN_1111001u0dssnnnndddd0110nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd0110nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMIN,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(21:20)=11 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VMIN_1111001u0dssnnnndddd0110nqm1mmmm_case_0
: public ClassDecoder {
public:
VMIN_1111001u0dssnnnndddd0110nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMIN_1111001u0dssnnnndddd0110nqm1mmmm_case_0);
};
// VMIN_floating_point_111100100dssnnnndddd1111nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100100dssnnnndddd1111nqm0mmmm,
// rule: VMIN_floating_point,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(0)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VMIN_floating_point_111100100dssnnnndddd1111nqm0mmmm_case_0
: public ClassDecoder {
public:
VMIN_floating_point_111100100dssnnnndddd1111nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMIN_floating_point_111100100dssnnnndddd1111nqm0mmmm_case_0);
};
// VMLAL_VMLSL_integer_A2_1111001u1dssnnnndddd10p0n0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(8),
// pattern: 1111001u1dssnnnndddd10p0n0m0mmmm,
// rule: VMLAL_VMLSL_integer_A2,
// safety: [size(21:20)=11 => DECODER_ERROR, Vd(0)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VMLAL_VMLSL_integer_A2_1111001u1dssnnnndddd10p0n0m0mmmm_case_0
: public ClassDecoder {
public:
VMLAL_VMLSL_integer_A2_1111001u1dssnnnndddd10p0n0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLAL_VMLSL_integer_A2_1111001u1dssnnnndddd10p0n0m0mmmm_case_0);
};
// VMLAL_by_scalar_A2_1111001u1dssnnnndddd0p10n1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001u1dssnnnndddd0p10n1m0mmmm,
// regs: 1,
// rule: VMLAL_by_scalar_A2,
// safety: [size(21:20)=11 => DECODER_ERROR,
// (size(21:20)=00 ||
// Vd(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: Q(24)=1,
// uses: {}}
class VMLAL_by_scalar_A2_1111001u1dssnnnndddd0p10n1m0mmmm_case_0
: public ClassDecoder {
public:
VMLAL_by_scalar_A2_1111001u1dssnnnndddd0p10n1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLAL_by_scalar_A2_1111001u1dssnnnndddd0p10n1m0mmmm_case_0);
};
// VMLA_VMLS_floating_point_cccc11100d00nnnndddd101snom0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// add: op(6)=0,
// advsimd: false,
// arch: VFPv2,
// cond: cond(31:28),
// d: D:Vd
// if dp_operation
// else Vd:D,
// defs: {},
// dp_operation: sz(8)=1,
// false: false,
// fields: [cond(31:28),
// D(22),
// Vn(19:16),
// Vd(15:12),
// sz(8),
// N(7),
// op(6),
// M(5),
// Vm(3:0)],
// m: M:Vm
// if dp_operation
// else Vm:M,
// n: N:Vn
// if dp_operation
// else Vn:N,
// op: op(6),
// pattern: cccc11100d00nnnndddd101snom0mmmm,
// rule: VMLA_VMLS_floating_point,
// safety: [cond(31:28)=1111 => DECODER_ERROR],
// sz: sz(8),
// uses: {}}
class VMLA_VMLS_floating_point_cccc11100d00nnnndddd101snom0mmmm_case_0
: public ClassDecoder {
public:
VMLA_VMLS_floating_point_cccc11100d00nnnndddd101snom0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLA_VMLS_floating_point_cccc11100d00nnnndddd101snom0mmmm_case_0);
};
// VMLA_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M,
// m: Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001q1dssnnnndddd0p0fn1m0mmmm,
// regs: 1
// if Q(24)=0
// else 2,
// rule: VMLA_by_scalar_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// (size(21:20)=00 ||
// size(21:20)=01) => UNDEFINED,
// Q(24)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VMLA_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_0
: public ClassDecoder {
public:
VMLA_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLA_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_0);
};
// VMLA_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_1:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001q1dssnnnndddd0p0fn1m0mmmm,
// regs: 1
// if Q(24)=0
// else 2,
// rule: VMLA_by_scalar_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// size(21:20)=00 => UNDEFINED,
// Q(24)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VMLA_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_1
: public ClassDecoder {
public:
VMLA_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_1()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLA_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_1);
};
// VMLA_floating_point_A1_111100100dpsnnnndddd1101nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100100dpsnnnndddd1101nqm1mmmm,
// rule: VMLA_floating_point_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(0)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VMLA_floating_point_A1_111100100dpsnnnndddd1101nqm1mmmm_case_0
: public ClassDecoder {
public:
VMLA_floating_point_A1_111100100dpsnnnndddd1101nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLA_floating_point_A1_111100100dpsnnnndddd1101nqm1mmmm_case_0);
};
// VMLA_integer_A1_1111001u0dssnnnndddd1001nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd1001nqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMLA_integer_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(21:20)=11 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VMLA_integer_A1_1111001u0dssnnnndddd1001nqm0mmmm_case_0
: public ClassDecoder {
public:
VMLA_integer_A1_1111001u0dssnnnndddd1001nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLA_integer_A1_1111001u0dssnnnndddd1001nqm0mmmm_case_0);
};
// VMLSL_by_scalar_A2_1111001u1dssnnnndddd0p10n1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001u1dssnnnndddd0p10n1m0mmmm,
// regs: 1,
// rule: VMLSL_by_scalar_A2,
// safety: [size(21:20)=11 => DECODER_ERROR,
// (size(21:20)=00 ||
// Vd(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: Q(24)=1,
// uses: {}}
class VMLSL_by_scalar_A2_1111001u1dssnnnndddd0p10n1m0mmmm_case_0
: public ClassDecoder {
public:
VMLSL_by_scalar_A2_1111001u1dssnnnndddd0p10n1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLSL_by_scalar_A2_1111001u1dssnnnndddd0p10n1m0mmmm_case_0);
};
// VMLS_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M,
// m: Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001q1dssnnnndddd0p0fn1m0mmmm,
// regs: 1
// if Q(24)=0
// else 2,
// rule: VMLS_by_scalar_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// (size(21:20)=00 ||
// size(21:20)=01) => UNDEFINED,
// Q(24)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VMLS_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_0
: public ClassDecoder {
public:
VMLS_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLS_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_0);
};
// VMLS_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_1:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001q1dssnnnndddd0p0fn1m0mmmm,
// regs: 1
// if Q(24)=0
// else 2,
// rule: VMLS_by_scalar_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// size(21:20)=00 => UNDEFINED,
// Q(24)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VMLS_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_1
: public ClassDecoder {
public:
VMLS_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_1()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLS_by_scalar_A1_1111001q1dssnnnndddd0p0fn1m0mmmm_case_1);
};
// VMLS_floating_point_A1_111100100dpsnnnndddd1101nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100100dpsnnnndddd1101nqm1mmmm,
// rule: VMLS_floating_point_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(0)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VMLS_floating_point_A1_111100100dpsnnnndddd1101nqm1mmmm_case_0
: public ClassDecoder {
public:
VMLS_floating_point_A1_111100100dpsnnnndddd1101nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLS_floating_point_A1_111100100dpsnnnndddd1101nqm1mmmm_case_0);
};
// VMLS_integer_A1_1111001u0dssnnnndddd1001nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd1001nqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMLS_integer_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(21:20)=11 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VMLS_integer_A1_1111001u0dssnnnndddd1001nqm0mmmm_case_0
: public ClassDecoder {
public:
VMLS_integer_A1_1111001u0dssnnnndddd1001nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMLS_integer_A1_1111001u0dssnnnndddd1001nqm0mmmm_case_0);
};
// VMOVN_111100111d11ss10dddd001000m0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss10dddd001000m0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMOVN,
// safety: [size(19:18)=11 => UNDEFINED, Vm(0)=1 => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VMOVN_111100111d11ss10dddd001000m0mmmm_case_0
: public ClassDecoder {
public:
VMOVN_111100111d11ss10dddd001000m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMOVN_111100111d11ss10dddd001000m0mmmm_case_0);
};
// VMOV_ARM_core_register_to_scalar_cccc11100ii0ddddtttt1011dii10000_case_0:
//
// {D: D(7),
// Pc: 15,
// Rt: Rt(15:12),
// Vd: Vd(19:16),
// advsimd: sel in bitset {'1xxx', '0xx1'},
// arch: ['VFPv2', 'AdvSIMD'],
// cond: cond(31:28),
// d: D:Vd,
// defs: {},
// esize: 8
// if opc1:opc2(3:0)=1xxx
// else 16
// if opc1:opc2(3:0)=0xx1
// else 32
// if opc1:opc2(3:0)=0x00
// else 0,
// fields: [cond(31:28),
// opc1(22:21),
// Vd(19:16),
// Rt(15:12),
// D(7),
// opc2(6:5)],
// index: opc1(0):opc2
// if opc1:opc2(3:0)=1xxx
// else opc1(0):opc2(1)
// if opc1:opc2(3:0)=0xx1
// else opc1(0)
// if opc1:opc2(3:0)=0x00
// else 0,
// opc1: opc1(22:21),
// opc2: opc2(6:5),
// pattern: cccc11100ii0ddddtttt1011dii10000,
// rule: VMOV_ARM_core_register_to_scalar,
// safety: [opc1:opc2(3:0)=0x10 => UNDEFINED,
// t ==
// Pc => UNPREDICTABLE],
// sel: opc1:opc2,
// t: Rt,
// uses: {Rt}}
class VMOV_ARM_core_register_to_scalar_cccc11100ii0ddddtttt1011dii10000_case_0
: public ClassDecoder {
public:
VMOV_ARM_core_register_to_scalar_cccc11100ii0ddddtttt1011dii10000_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMOV_ARM_core_register_to_scalar_cccc11100ii0ddddtttt1011dii10000_case_0);
};
// VMOV_between_ARM_core_register_and_single_precision_register_cccc1110000onnnntttt1010n0010000_case_0:
//
// {N: N(7),
// None: 32,
// Pc: 15,
// Rt: Rt(15:12),
// Vn: Vn(19:16),
// arch: VFPv2,
// cond: cond(31:28),
// defs: {Rt
// if to_arm_register
// else None},
// fields: [cond(31:28), op(20), Vn(19:16), Rt(15:12), N(7)],
// n: Vn:N,
// op: op(20),
// pattern: cccc1110000onnnntttt1010n0010000,
// rule: VMOV_between_ARM_core_register_and_single_precision_register,
// safety: [t ==
// Pc => UNPREDICTABLE],
// t: Rt,
// to_arm_register: op(20)=1,
// uses: {Rt
// if not to_arm_register
// else None}}
class VMOV_between_ARM_core_register_and_single_precision_register_cccc1110000onnnntttt1010n0010000_case_0
: public ClassDecoder {
public:
VMOV_between_ARM_core_register_and_single_precision_register_cccc1110000onnnntttt1010n0010000_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMOV_between_ARM_core_register_and_single_precision_register_cccc1110000onnnntttt1010n0010000_case_0);
};
// VMOV_between_ARM_core_register_and_single_precision_register_cccc1110000xnnnntttt1010n0010000_case_0:
//
// {N: N(7),
// None: 32,
// Pc: 15,
// Rt: Rt(15:12),
// Vn: Vn(19:16),
// arch: VFPv2,
// cond: cond(31:28),
// defs: {Rt
// if to_arm_register
// else None},
// fields: [cond(31:28), op(20), Vn(19:16), Rt(15:12), N(7)],
// n: Vn:N,
// op: op(20),
// pattern: cccc1110000xnnnntttt1010n0010000,
// rule: VMOV_between_ARM_core_register_and_single_precision_register,
// safety: [t ==
// Pc => UNPREDICTABLE],
// t: Rt,
// to_arm_register: op(20)=1,
// uses: {Rt
// if not to_arm_register
// else None}}
class VMOV_between_ARM_core_register_and_single_precision_register_cccc1110000xnnnntttt1010n0010000_case_0
: public ClassDecoder {
public:
VMOV_between_ARM_core_register_and_single_precision_register_cccc1110000xnnnntttt1010n0010000_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMOV_between_ARM_core_register_and_single_precision_register_cccc1110000xnnnntttt1010n0010000_case_0);
};
// VMOV_between_two_ARM_core_registers_and_a_doubleword_extension_register_cccc1100010otttttttt101100m1mmmm_case_0:
//
// {M: M(5),
// Pc: 15,
// Rt: Rt(15:12),
// Rt2: Rt2(19:16),
// Vm: Vm(3:0),
// arch: ['VFPv2', 'AdvSIMD'],
// cond: cond(31:28),
// defs: {Rt, Rt2}
// if to_arm_registers
// else {},
// fields: [cond(31:28), op(20), Rt2(19:16), Rt(15:12), M(5), Vm(3:0)],
// m: M:Vm,
// op: op(20),
// pattern: cccc1100010otttttttt101100m1mmmm,
// rule: VMOV_between_two_ARM_core_registers_and_a_doubleword_extension_register,
// safety: [Pc in {t, t2} => UNPREDICTABLE,
// to_arm_registers &&
// t ==
// t2 => UNPREDICTABLE],
// t: Rt,
// t2: Rt2,
// to_arm_registers: op(20)=1,
// uses: {}
// if to_arm_registers
// else {Rt, Rt2}}
class VMOV_between_two_ARM_core_registers_and_a_doubleword_extension_register_cccc1100010otttttttt101100m1mmmm_case_0
: public ClassDecoder {
public:
VMOV_between_two_ARM_core_registers_and_a_doubleword_extension_register_cccc1100010otttttttt101100m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMOV_between_two_ARM_core_registers_and_a_doubleword_extension_register_cccc1100010otttttttt101100m1mmmm_case_0);
};
// VMOV_between_two_ARM_core_registers_and_two_single_precision_registers_cccc1100010otttttttt101000m1mmmm_case_0:
//
// {M: M(5),
// Pc: 15,
// Rt: Rt(15:12),
// Rt2: Rt2(19:16),
// Vm: Vm(3:0),
// arch: ['VFPv2'],
// cond: cond(31:28),
// defs: {Rt, Rt2}
// if to_arm_registers
// else {},
// fields: [cond(31:28), op(20), Rt2(19:16), Rt(15:12), M(5), Vm(3:0)],
// m: Vm:M,
// op: op(20),
// pattern: cccc1100010otttttttt101000m1mmmm,
// rule: VMOV_between_two_ARM_core_registers_and_two_single_precision_registers,
// safety: [Pc in {t, t2} ||
// m ==
// 31 => UNPREDICTABLE,
// to_arm_registers &&
// t ==
// t2 => UNPREDICTABLE],
// t: Rt,
// t2: Rt2,
// to_arm_registers: op(20)=1,
// uses: {}
// if to_arm_registers
// else {Rt, Rt2}}
class VMOV_between_two_ARM_core_registers_and_two_single_precision_registers_cccc1100010otttttttt101000m1mmmm_case_0
: public ClassDecoder {
public:
VMOV_between_two_ARM_core_registers_and_two_single_precision_registers_cccc1100010otttttttt101000m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMOV_between_two_ARM_core_registers_and_two_single_precision_registers_cccc1100010otttttttt101000m1mmmm_case_0);
};
// VMOV_immediate_A1_1111001m1d000mmmddddcccc0qp1mmmm_case_0:
//
// {D: D(22),
// Q: Q(6),
// Vd: Vd(15:12),
// arch: ASIMD,
// cmode: cmode(11:8),
// d: D:Vd,
// defs: {},
// false: false,
// fields: [i(24),
// D(22),
// imm3(18:16),
// Vd(15:12),
// cmode(11:8),
// Q(6),
// op(5),
// imm4(3:0)],
// i: i(24),
// imm3: imm3(18:16),
// imm4: imm4(3:0),
// imm64: AdvSIMDExpandImm(op, cmode, i:imm3:imm4),
// op: op(5),
// pattern: 1111001m1d000mmmddddcccc0qp1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMOV_immediate_A1,
// safety: [op(5)=0 &&
// cmode(0)=1 &&
// cmode(3:2)=~11 => DECODER_ERROR,
// op(5)=1 &&
// cmode(11:8)=~1110 => DECODER_ERROR,
// Q(6)=1 &&
// Vd(0)=1 => UNDEFINED],
// single_register: false,
// uses: {}}
class VMOV_immediate_A1_1111001m1d000mmmddddcccc0qp1mmmm_case_0
: public ClassDecoder {
public:
VMOV_immediate_A1_1111001m1d000mmmddddcccc0qp1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMOV_immediate_A1_1111001m1d000mmmddddcccc0qp1mmmm_case_0);
};
// VMOV_immediate_cccc11101d11iiiidddd101s0000iiii_case_0:
//
// {D: D(22),
// Vd: Vd(15:12),
// advsimd: false,
// arch: VFPv3,
// cond: cond(31:28),
// d: Vd:D
// if sz(8)=0
// else D:Vd,
// defs: {},
// false: false,
// fields: [cond(31:28),
// D(22),
// imm4H(19:16),
// Vd(15:12),
// sz(8),
// imm4L(3:0)],
// imm32: VFPExpandImm(imm4H:imm4L, 32),
// imm4H: imm4H(19:16),
// imm4L: imm4L(3:0),
// imm64: VFPExpandImm(imm4H:imm4L, 64),
// pattern: cccc11101d11iiiidddd101s0000iiii,
// regs: 1,
// rule: VMOV_immediate,
// safety: [true => MAY_BE_SAFE],
// single_register: sz(8)=0,
// sz: sz(8),
// true: true,
// uses: {}}
class VMOV_immediate_cccc11101d11iiiidddd101s0000iiii_case_0
: public ClassDecoder {
public:
VMOV_immediate_cccc11101d11iiiidddd101s0000iiii_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMOV_immediate_cccc11101d11iiiidddd101s0000iiii_case_0);
};
// VMOV_register_cccc11101d110000dddd101s01m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// advsimd: false,
// arch: VFPv2,
// cond: cond(31:28),
// d: Vd:D
// if sz(8)=0
// else D:Vd,
// defs: {},
// false: false,
// fields: [cond(31:28), D(22), Vd(15:12), sz(8), M(5), Vm(3:0)],
// m: Vm:D
// if sz(8)=0
// else M:Vm,
// pattern: cccc11101d110000dddd101s01m0mmmm,
// regs: 1,
// rule: VMOV_register,
// safety: [true => MAY_BE_SAFE],
// single_register: sz(8)=0,
// sz: sz(8),
// true: true,
// uses: {}}
class VMOV_register_cccc11101d110000dddd101s01m0mmmm_case_0
: public ClassDecoder {
public:
VMOV_register_cccc11101d110000dddd101s01m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMOV_register_cccc11101d110000dddd101s01m0mmmm_case_0);
};
// VMRS_cccc111011110001tttt101000010000_case_0:
//
// {NZCV: 16,
// Pc: 15,
// Rt: Rt(15:12),
// arch: ['VFPv2', 'AdvSIMD'],
// cond: cond(31:28),
// defs: {NZCV
// if t ==
// Pc
// else Rt},
// fields: [cond(31:28), Rt(15:12)],
// pattern: cccc111011110001tttt101000010000,
// rule: VMRS,
// t: Rt}
class VMRS_cccc111011110001tttt101000010000_case_0
: public ClassDecoder {
public:
VMRS_cccc111011110001tttt101000010000_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMRS_cccc111011110001tttt101000010000_case_0);
};
// VMSR_cccc111011100001tttt101000010000_case_0:
//
// {Pc: 15,
// Rt: Rt(15:12),
// arch: ['VFPv2', 'AdvSIMD'],
// cond: cond(31:28),
// defs: {},
// fields: [cond(31:28), Rt(15:12)],
// pattern: cccc111011100001tttt101000010000,
// rule: VMSR,
// safety: [t ==
// Pc => UNPREDICTABLE],
// t: Rt,
// uses: {Rt}}
class VMSR_cccc111011100001tttt101000010000_case_0
: public ClassDecoder {
public:
VMSR_cccc111011100001tttt101000010000_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMSR_cccc111011100001tttt101000010000_case_0);
};
// VMULL_by_scalar_A2_1111001u1dssnnnndddd1010n1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001u1dssnnnndddd1010n1m0mmmm,
// regs: 1,
// rule: VMULL_by_scalar_A2,
// safety: [size(21:20)=11 => DECODER_ERROR,
// (size(21:20)=00 ||
// Vd(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: Q(24)=1,
// uses: {}}
class VMULL_by_scalar_A2_1111001u1dssnnnndddd1010n1m0mmmm_case_0
: public ClassDecoder {
public:
VMULL_by_scalar_A2_1111001u1dssnnnndddd1010n1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMULL_by_scalar_A2_1111001u1dssnnnndddd1010n1m0mmmm_case_0);
};
// VMULL_integer_A2_1111001u1dssnnnndddd11p0n0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(8),
// pattern: 1111001u1dssnnnndddd11p0n0m0mmmm,
// rule: VMULL_integer_A2,
// safety: [size(21:20)=11 => DECODER_ERROR, Vd(0)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VMULL_integer_A2_1111001u1dssnnnndddd11p0n0m0mmmm_case_0
: public ClassDecoder {
public:
VMULL_integer_A2_1111001u1dssnnnndddd11p0n0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMULL_integer_A2_1111001u1dssnnnndddd11p0n0m0mmmm_case_0);
};
// VMULL_polynomial_A2_1111001u1dssnnnndddd11p0n0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(8),
// pattern: 1111001u1dssnnnndddd11p0n0m0mmmm,
// rule: VMULL_polynomial_A2,
// safety: [size(21:20)=11 => DECODER_ERROR,
// U(24)=1 ||
// size(21:20)=~00 => UNDEFINED,
// Vd(0)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VMULL_polynomial_A2_1111001u1dssnnnndddd11p0n0m0mmmm_case_0
: public ClassDecoder {
public:
VMULL_polynomial_A2_1111001u1dssnnnndddd11p0n0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMULL_polynomial_A2_1111001u1dssnnnndddd11p0n0m0mmmm_case_0);
};
// VMUL_by_scalar_A1_1111001q1dssnnnndddd100fn1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M,
// m: Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001q1dssnnnndddd100fn1m0mmmm,
// regs: 1
// if Q(24)=0
// else 2,
// rule: VMUL_by_scalar_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// (size(21:20)=00 ||
// size(21:20)=01) => UNDEFINED,
// Q(24)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VMUL_by_scalar_A1_1111001q1dssnnnndddd100fn1m0mmmm_case_0
: public ClassDecoder {
public:
VMUL_by_scalar_A1_1111001q1dssnnnndddd100fn1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMUL_by_scalar_A1_1111001q1dssnnnndddd100fn1m0mmmm_case_0);
};
// VMUL_by_scalar_A1_1111001q1dssnnnndddd100fn1m0mmmm_case_1:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001q1dssnnnndddd100fn1m0mmmm,
// regs: 1
// if Q(24)=0
// else 2,
// rule: VMUL_by_scalar_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// size(21:20)=00 => UNDEFINED,
// Q(24)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VMUL_by_scalar_A1_1111001q1dssnnnndddd100fn1m0mmmm_case_1
: public ClassDecoder {
public:
VMUL_by_scalar_A1_1111001q1dssnnnndddd100fn1m0mmmm_case_1()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMUL_by_scalar_A1_1111001q1dssnnnndddd100fn1m0mmmm_case_1);
};
// VMUL_floating_point_A1_111100110d0snnnndddd1101nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100110d0snnnndddd1101nqm1mmmm,
// rule: VMUL_floating_point_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(0)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VMUL_floating_point_A1_111100110d0snnnndddd1101nqm1mmmm_case_0
: public ClassDecoder {
public:
VMUL_floating_point_A1_111100110d0snnnndddd1101nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMUL_floating_point_A1_111100110d0snnnndddd1101nqm1mmmm_case_0);
};
// VMUL_floating_point_cccc11100d10nnnndddd101sn0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// advsimd: false,
// arch: VFPv2,
// cond: cond(31:28),
// d: D:Vd
// if dp_operation
// else Vd:D,
// defs: {},
// dp_operation: sz(8)=1,
// false: false,
// fields: [cond(31:28),
// D(22),
// Vn(19:16),
// Vd(15:12),
// sz(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: M:Vm
// if dp_operation
// else Vm:M,
// n: N:Vn
// if dp_operation
// else Vn:N,
// pattern: cccc11100d10nnnndddd101sn0m0mmmm,
// rule: VMUL_floating_point,
// safety: [cond(31:28)=1111 => DECODER_ERROR],
// sz: sz(8),
// uses: {}}
class VMUL_floating_point_cccc11100d10nnnndddd101sn0m0mmmm_case_0
: public ClassDecoder {
public:
VMUL_floating_point_cccc11100d10nnnndddd101sn0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMUL_floating_point_cccc11100d10nnnndddd101sn0m0mmmm_case_0);
};
// VMUL_integer_A1_1111001u0dssnnnndddd1001nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd1001nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMUL_integer_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(21:20)=11 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VMUL_integer_A1_1111001u0dssnnnndddd1001nqm1mmmm_case_0
: public ClassDecoder {
public:
VMUL_integer_A1_1111001u0dssnnnndddd1001nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMUL_integer_A1_1111001u0dssnnnndddd1001nqm1mmmm_case_0);
};
// VMUL_polynomial_A1_1111001u0dssnnnndddd1001nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// false: false,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd1001nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMUL_polynomial_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(21:20)=~00 => UNDEFINED],
// size: size(21:20),
// unsigned: false,
// uses: {}}
class VMUL_polynomial_A1_1111001u0dssnnnndddd1001nqm1mmmm_case_0
: public ClassDecoder {
public:
VMUL_polynomial_A1_1111001u0dssnnnndddd1001nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMUL_polynomial_A1_1111001u0dssnnnndddd1001nqm1mmmm_case_0);
};
// VMVN_immediate_1111001i1d000mmmddddcccc0q11mmmm_case_0:
//
// {D: D(22),
// Q: Q(6),
// Vd: Vd(15:12),
// arch: ASIMD,
// cmode: cmode(11:8),
// d: D:Vd,
// defs: {},
// fields: [i(24),
// D(22),
// imm3(18:16),
// Vd(15:12),
// cmode(11:8),
// Q(6),
// op(5),
// imm4(3:0)],
// i: i(24),
// imm3: imm3(18:16),
// imm4: imm4(3:0),
// imm64: AdvSIMDExpandImm(op, cmode, i:imm3:imm4),
// op: op(5),
// pattern: 1111001i1d000mmmddddcccc0q11mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMVN_immediate,
// safety: [(cmode(0)=1 &&
// cmode(3:2)=~11) ||
// cmode(3:1)=111 => DECODER_ERROR,
// Q(6)=1 &&
// Vd(0)=1 => UNDEFINED],
// uses: {}}
class VMVN_immediate_1111001i1d000mmmddddcccc0q11mmmm_case_0
: public ClassDecoder {
public:
VMVN_immediate_1111001i1d000mmmddddcccc0q11mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMVN_immediate_1111001i1d000mmmddddcccc0q11mmmm_case_0);
};
// VMVN_register_111100111d11ss00dddd01011qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss00dddd01011qm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VMVN_register,
// safety: [size(19:18)=~00 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VMVN_register_111100111d11ss00dddd01011qm0mmmm_case_0
: public ClassDecoder {
public:
VMVN_register_111100111d11ss00dddd01011qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VMVN_register_111100111d11ss00dddd01011qm0mmmm_case_0);
};
// VNEG_111100111d11ss01dddd0f111qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss01dddd0f111qm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VNEG,
// safety: [size(19:18)=11 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VNEG_111100111d11ss01dddd0f111qm0mmmm_case_0
: public ClassDecoder {
public:
VNEG_111100111d11ss01dddd0f111qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VNEG_111100111d11ss01dddd0f111qm0mmmm_case_0);
};
// VNEG_111100111d11ss01dddd0f111qm0mmmm_case_1:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss01dddd0f111qm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VNEG,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(19:18)=~10 => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VNEG_111100111d11ss01dddd0f111qm0mmmm_case_1
: public ClassDecoder {
public:
VNEG_111100111d11ss01dddd0f111qm0mmmm_case_1()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VNEG_111100111d11ss01dddd0f111qm0mmmm_case_1);
};
// VNEG_cccc11101d110001dddd101s01m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// advsimd: false,
// arch: VFPv2,
// cond: cond(31:28),
// d: Vd:D
// if sz(8)=0
// else D:Vd,
// defs: {},
// dp_operation: sz(8)=1,
// false: false,
// fields: [cond(31:28), D(22), Vd(15:12), sz(8), M(5), Vm(3:0)],
// m: Vm:D
// if sz(8)=0
// else M:Vm,
// pattern: cccc11101d110001dddd101s01m0mmmm,
// rule: VNEG,
// safety: [true => MAY_BE_SAFE],
// sz: sz(8),
// true: true,
// uses: {}}
class VNEG_cccc11101d110001dddd101s01m0mmmm_case_0
: public ClassDecoder {
public:
VNEG_cccc11101d110001dddd101s01m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VNEG_cccc11101d110001dddd101s01m0mmmm_case_0);
};
// VNMLA_VNMLS_cccc11100d01nnnndddd101snom0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// VFPNegMul_VNMLA: 1,
// VFPNegMul_VNMLS: 2,
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: VFPv2,
// cond: cond(31:28),
// d: D:Vd
// if dp_operation
// else Vd:D,
// defs: {},
// dp_operation: sz(8)=1,
// fields: [cond(31:28),
// D(22),
// Vn(19:16),
// Vd(15:12),
// sz(8),
// N(7),
// op(6),
// M(5),
// Vm(3:0)],
// m: M:Vm
// if dp_operation
// else Vm:M,
// n: N:Vn
// if dp_operation
// else Vn:N,
// op: op(6),
// pattern: cccc11100d01nnnndddd101snom0mmmm,
// rule: VNMLA_VNMLS,
// safety: [cond(31:28)=1111 => DECODER_ERROR],
// sz: sz(8),
// type: VFPNegMul_VNMLA
// if op(6)=1
// else VFPNegMul_VNMLS,
// uses: {}}
class VNMLA_VNMLS_cccc11100d01nnnndddd101snom0mmmm_case_0
: public ClassDecoder {
public:
VNMLA_VNMLS_cccc11100d01nnnndddd101snom0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VNMLA_VNMLS_cccc11100d01nnnndddd101snom0mmmm_case_0);
};
// VNMUL_cccc11100d10nnnndddd101sn1m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// VFPNegMul_VNMUL: 3,
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: VFPv2,
// cond: cond(31:28),
// d: D:Vd
// if dp_operation
// else Vd:D,
// defs: {},
// dp_operation: sz(8)=1,
// fields: [cond(31:28),
// D(22),
// Vn(19:16),
// Vd(15:12),
// sz(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: M:Vm
// if dp_operation
// else Vm:M,
// n: N:Vn
// if dp_operation
// else Vn:N,
// pattern: cccc11100d10nnnndddd101sn1m0mmmm,
// rule: VNMUL,
// safety: [cond(31:28)=1111 => DECODER_ERROR],
// sz: sz(8),
// type: VFPNegMul_VNMUL,
// uses: {}}
class VNMUL_cccc11100d10nnnndddd101sn1m0mmmm_case_0
: public ClassDecoder {
public:
VNMUL_cccc11100d10nnnndddd101sn1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VNMUL_cccc11100d10nnnndddd101sn1m0mmmm_case_0);
};
// VORN_register_111100100d11nnnndddd0001nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 111100100d11nnnndddd0001nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VORN_register,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VORN_register_111100100d11nnnndddd0001nqm1mmmm_case_0
: public ClassDecoder {
public:
VORN_register_111100100d11nnnndddd0001nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VORN_register_111100100d11nnnndddd0001nqm1mmmm_case_0);
};
// VORR_immediate_1111001i1d000mmmddddcccc0q01mmmm_case_0:
//
// {D: D(22),
// Q: Q(6),
// Vd: Vd(15:12),
// arch: ASIMD,
// cmode: cmode(11:8),
// d: D:Vd,
// defs: {},
// fields: [i(24),
// D(22),
// imm3(18:16),
// Vd(15:12),
// cmode(11:8),
// Q(6),
// op(5),
// imm4(3:0)],
// i: i(24),
// imm3: imm3(18:16),
// imm4: imm4(3:0),
// imm64: AdvSIMDExpandImm(op, cmode, i:imm3:imm4),
// op: op(5),
// pattern: 1111001i1d000mmmddddcccc0q01mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VORR_immediate,
// safety: [cmode(0)=0 ||
// cmode(3:2)=11 => DECODER_ERROR,
// Q(6)=1 &&
// Vd(0)=1 => UNDEFINED],
// uses: {}}
class VORR_immediate_1111001i1d000mmmddddcccc0q01mmmm_case_0
: public ClassDecoder {
public:
VORR_immediate_1111001i1d000mmmddddcccc0q01mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VORR_immediate_1111001i1d000mmmddddcccc0q01mmmm_case_0);
};
// VORR_register_or_VMOV_register_A1_111100100d10nnnndddd0001nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 111100100d10nnnndddd0001nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VORR_register_or_VMOV_register_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VORR_register_or_VMOV_register_A1_111100100d10nnnndddd0001nqm1mmmm_case_0
: public ClassDecoder {
public:
VORR_register_or_VMOV_register_A1_111100100d10nnnndddd0001nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VORR_register_or_VMOV_register_A1_111100100d10nnnndddd0001nqm1mmmm_case_0);
};
// VPADAL_111100111d11ss00dddd0110p1m0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss00dddd0110p1m0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VPADAL,
// safety: [size(19:18)=11 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// unsigned: (op(0)=1),
// uses: {}}
class VPADAL_111100111d11ss00dddd0110p1m0mmmm_case_0
: public ClassDecoder {
public:
VPADAL_111100111d11ss00dddd0110p1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPADAL_111100111d11ss00dddd0110p1m0mmmm_case_0);
};
// VPADDL_111100111d11ss00dddd0010p1m0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss00dddd0010p1m0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VPADDL,
// safety: [size(19:18)=11 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// unsigned: (op(0)=1),
// uses: {}}
class VPADDL_111100111d11ss00dddd0010p1m0mmmm_case_0
: public ClassDecoder {
public:
VPADDL_111100111d11ss00dddd0010p1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPADDL_111100111d11ss00dddd0010p1m0mmmm_case_0);
};
// VPADD_floating_point_111100110d0snnnndddd1101nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100110d0snnnndddd1101nqm0mmmm,
// rule: VPADD_floating_point,
// safety: [size(0)=1 ||
// Q(6)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VPADD_floating_point_111100110d0snnnndddd1101nqm0mmmm_case_0
: public ClassDecoder {
public:
VPADD_floating_point_111100110d0snnnndddd1101nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPADD_floating_point_111100110d0snnnndddd1101nqm0mmmm_case_0);
};
// VPADD_integer_111100100dssnnnndddd1011n0m1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 111100100dssnnnndddd1011n0m1mmmm,
// rule: VPADD_integer,
// safety: [size(21:20)=11 => UNDEFINED, Q(6)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VPADD_integer_111100100dssnnnndddd1011n0m1mmmm_case_0
: public ClassDecoder {
public:
VPADD_integer_111100100dssnnnndddd1011n0m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPADD_integer_111100100dssnnnndddd1011n0m1mmmm_case_0);
};
// VPMAX_111100110dssnnnndddd1111nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100110dssnnnndddd1111nqm0mmmm,
// rule: VPMAX,
// safety: [size(0)=1 ||
// Q(6)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VPMAX_111100110dssnnnndddd1111nqm0mmmm_case_0
: public ClassDecoder {
public:
VPMAX_111100110dssnnnndddd1111nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPMAX_111100110dssnnnndddd1111nqm0mmmm_case_0);
};
// VPMAX_1111001u0dssnnnndddd1010n0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd1010n0m0mmmm,
// rule: VPMAX,
// safety: [size(21:20)=11 => UNDEFINED, Q(6)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VPMAX_1111001u0dssnnnndddd1010n0m0mmmm_case_0
: public ClassDecoder {
public:
VPMAX_1111001u0dssnnnndddd1010n0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPMAX_1111001u0dssnnnndddd1010n0m0mmmm_case_0);
};
// VPMIN_111100110dssnnnndddd1111nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100110dssnnnndddd1111nqm0mmmm,
// rule: VPMIN,
// safety: [size(0)=1 ||
// Q(6)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VPMIN_111100110dssnnnndddd1111nqm0mmmm_case_0
: public ClassDecoder {
public:
VPMIN_111100110dssnnnndddd1111nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPMIN_111100110dssnnnndddd1111nqm0mmmm_case_0);
};
// VPMIN_1111001u0dssnnnndddd1010n0m1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd1010n0m1mmmm,
// rule: VPMIN,
// safety: [size(21:20)=11 => UNDEFINED, Q(6)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VPMIN_1111001u0dssnnnndddd1010n0m1mmmm_case_0
: public ClassDecoder {
public:
VPMIN_1111001u0dssnnnndddd1010n0m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPMIN_1111001u0dssnnnndddd1010n0m1mmmm_case_0);
};
// VPOP_cccc11001d111101dddd1010iiiiiiii_case_0:
//
// {D: D(22),
// Sp: 13,
// Vd: Vd(15:12),
// arch: VFPv2,
// base: Sp,
// cond: cond(31:28),
// d: Vd:D,
// defs: {Sp},
// fields: [cond(31:28), D(22), Vd(15:12), imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// pattern: cccc11001d111101dddd1010iiiiiiii,
// regs: imm8,
// rule: VPOP,
// safety: [regs ==
// 0 ||
// d + regs >
// 32 => UNPREDICTABLE],
// single_regs: true,
// small_imm_base_wb: true,
// true: true,
// uses: {Sp},
// violations: [implied by 'base']}
class VPOP_cccc11001d111101dddd1010iiiiiiii_case_0
: public ClassDecoder {
public:
VPOP_cccc11001d111101dddd1010iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPOP_cccc11001d111101dddd1010iiiiiiii_case_0);
};
// VPOP_cccc11001d111101dddd1011iiiiiiii_case_0:
//
// {D: D(22),
// Sp: 13,
// Vd: Vd(15:12),
// arch: ['VFPv2', 'AdvSIMD'],
// base: Sp,
// cond: cond(31:28),
// d: D:Vd,
// defs: {Sp},
// false: false,
// fields: [cond(31:28), D(22), Vd(15:12), imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// pattern: cccc11001d111101dddd1011iiiiiiii,
// regs: imm8 / 2,
// rule: VPOP,
// safety: [regs ==
// 0 ||
// regs >
// 16 ||
// d + regs >
// 32 => UNPREDICTABLE,
// VFPSmallRegisterBank() &&
// d + regs >
// 16 => UNPREDICTABLE,
// imm8(0) ==
// 1 => DEPRECATED],
// single_regs: false,
// small_imm_base_wb: true,
// true: true,
// uses: {Sp},
// violations: [implied by 'base']}
class VPOP_cccc11001d111101dddd1011iiiiiiii_case_0
: public ClassDecoder {
public:
VPOP_cccc11001d111101dddd1011iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPOP_cccc11001d111101dddd1011iiiiiiii_case_0);
};
// VPUSH_cccc11010d101101dddd1010iiiiiiii_case_0:
//
// {D: D(22),
// Sp: 13,
// Vd: Vd(15:12),
// arch: VFPv2,
// base: Sp,
// cond: cond(31:28),
// d: Vd:D,
// defs: {Sp},
// fields: [cond(31:28), D(22), Vd(15:12), imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// pattern: cccc11010d101101dddd1010iiiiiiii,
// regs: imm8,
// rule: VPUSH,
// safety: [regs ==
// 0 ||
// d + regs >
// 32 => UNPREDICTABLE],
// single_regs: true,
// small_imm_base_wb: true,
// true: true,
// uses: {Sp},
// violations: [implied by 'base']}
class VPUSH_cccc11010d101101dddd1010iiiiiiii_case_0
: public ClassDecoder {
public:
VPUSH_cccc11010d101101dddd1010iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPUSH_cccc11010d101101dddd1010iiiiiiii_case_0);
};
// VPUSH_cccc11010d101101dddd1011iiiiiiii_case_0:
//
// {D: D(22),
// Sp: 13,
// Vd: Vd(15:12),
// arch: ['VFPv2', 'AdvSIMD'],
// base: Sp,
// cond: cond(31:28),
// d: D:Vd,
// defs: {Sp},
// false: false,
// fields: [cond(31:28), D(22), Vd(15:12), imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// pattern: cccc11010d101101dddd1011iiiiiiii,
// regs: imm8 / 2,
// rule: VPUSH,
// safety: [regs ==
// 0 ||
// regs >
// 16 ||
// d + regs >
// 32 => UNPREDICTABLE,
// VFPSmallRegisterBank() &&
// d + regs >
// 16 => UNPREDICTABLE,
// imm8(0) ==
// 1 => DEPRECATED],
// single_regs: false,
// small_imm_base_wb: true,
// true: true,
// uses: {Sp},
// violations: [implied by 'base']}
class VPUSH_cccc11010d101101dddd1011iiiiiiii_case_0
: public ClassDecoder {
public:
VPUSH_cccc11010d101101dddd1011iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VPUSH_cccc11010d101101dddd1011iiiiiiii_case_0);
};
// VQABS_111100111d11ss00dddd01110qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss00dddd01110qm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQABS,
// safety: [size(19:18)=11 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VQABS_111100111d11ss00dddd01110qm0mmmm_case_0
: public ClassDecoder {
public:
VQABS_111100111d11ss00dddd01110qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQABS_111100111d11ss00dddd01110qm0mmmm_case_0);
};
// VQADD_1111001u0dssnnnndddd0000nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd0000nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQADD,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VQADD_1111001u0dssnnnndddd0000nqm1mmmm_case_0
: public ClassDecoder {
public:
VQADD_1111001u0dssnnnndddd0000nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQADD_1111001u0dssnnnndddd0000nqm1mmmm_case_0);
};
// VQDMLAL_A1_111100101dssnnnndddd0p11n1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 111100101dssnnnndddd0p11n1m0mmmm,
// regs: 1,
// rule: VQDMLAL_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// (size(21:20)=00 ||
// Vd(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: Q(24)=1,
// uses: {}}
class VQDMLAL_A1_111100101dssnnnndddd0p11n1m0mmmm_case_0
: public ClassDecoder {
public:
VQDMLAL_A1_111100101dssnnnndddd0p11n1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQDMLAL_A1_111100101dssnnnndddd0p11n1m0mmmm_case_0);
};
// VQDMLAL_VQDMLSL_A1_111100101dssnnnndddd10p1n0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// add: op(8)=0,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(8),
// pattern: 111100101dssnnnndddd10p1n0m0mmmm,
// rule: VQDMLAL_VQDMLSL_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// size(21:20)=00 ||
// Vd(0)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VQDMLAL_VQDMLSL_A1_111100101dssnnnndddd10p1n0m0mmmm_case_0
: public ClassDecoder {
public:
VQDMLAL_VQDMLSL_A1_111100101dssnnnndddd10p1n0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQDMLAL_VQDMLSL_A1_111100101dssnnnndddd10p1n0m0mmmm_case_0);
};
// VQDMLSL_A1_111100101dssnnnndddd0p11n1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 111100101dssnnnndddd0p11n1m0mmmm,
// regs: 1,
// rule: VQDMLSL_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// (size(21:20)=00 ||
// Vd(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: Q(24)=1,
// uses: {}}
class VQDMLSL_A1_111100101dssnnnndddd0p11n1m0mmmm_case_0
: public ClassDecoder {
public:
VQDMLSL_A1_111100101dssnnnndddd0p11n1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQDMLSL_A1_111100101dssnnnndddd0p11n1m0mmmm_case_0);
};
// VQDMULH_A1_111100100dssnnnndddd1011nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 111100100dssnnnndddd1011nqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQDMULH_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// (size(21:20)=11 ||
// size(21:20)=00) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VQDMULH_A1_111100100dssnnnndddd1011nqm0mmmm_case_0
: public ClassDecoder {
public:
VQDMULH_A1_111100100dssnnnndddd1011nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQDMULH_A1_111100100dssnnnndddd1011nqm0mmmm_case_0);
};
// VQDMULH_A2_1111001q1dssnnnndddd1100n1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001q1dssnnnndddd1100n1m0mmmm,
// regs: 1
// if Q(24)=0
// else 2,
// rule: VQDMULH_A2,
// safety: [size(21:20)=11 => DECODER_ERROR,
// size(21:20)=00 => UNDEFINED,
// Q(24)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VQDMULH_A2_1111001q1dssnnnndddd1100n1m0mmmm_case_0
: public ClassDecoder {
public:
VQDMULH_A2_1111001q1dssnnnndddd1100n1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQDMULH_A2_1111001q1dssnnnndddd1100n1m0mmmm_case_0);
};
// VQDMULL_A1_111100101dssnnnndddd1101n0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// add: op(8)=0,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(8),
// pattern: 111100101dssnnnndddd1101n0m0mmmm,
// rule: VQDMULL_A1,
// safety: [size(21:20)=11 => DECODER_ERROR,
// size(21:20)=00 ||
// Vd(0)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VQDMULL_A1_111100101dssnnnndddd1101n0m0mmmm_case_0
: public ClassDecoder {
public:
VQDMULL_A1_111100101dssnnnndddd1101n0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQDMULL_A1_111100101dssnnnndddd1101n0m0mmmm_case_0);
};
// VQDMULL_A2_111100101dssnnnndddd1011n1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 111100101dssnnnndddd1011n1m0mmmm,
// regs: 1,
// rule: VQDMULL_A2,
// safety: [size(21:20)=11 => DECODER_ERROR,
// (size(21:20)=00 ||
// Vd(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: Q(24)=1,
// uses: {}}
class VQDMULL_A2_111100101dssnnnndddd1011n1m0mmmm_case_0
: public ClassDecoder {
public:
VQDMULL_A2_111100101dssnnnndddd1011n1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQDMULL_A2_111100101dssnnnndddd1011n1m0mmmm_case_0);
};
// VQMOVN_111100111d11ss10dddd0010ppm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// dest_unsigned: op(0)=1,
// fields: [D(22), size(19:18), Vd(15:12), op(7:6), M(5), Vm(3:0)],
// m: M:Vm,
// op: op(7:6),
// pattern: 111100111d11ss10dddd0010ppm0mmmm,
// rule: VQMOVN,
// safety: [op(7:6)=00 => DECODER_ERROR,
// size(19:18)=11 ||
// Vm(0)=1 => UNDEFINED],
// size: size(19:18),
// src_unsigned: op(7:6)=11,
// uses: {}}
class VQMOVN_111100111d11ss10dddd0010ppm0mmmm_case_0
: public ClassDecoder {
public:
VQMOVN_111100111d11ss10dddd0010ppm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQMOVN_111100111d11ss10dddd0010ppm0mmmm_case_0);
};
// VQMOVUN_111100111d11ss10dddd0010ppm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// dest_unsigned: op(0)=1,
// fields: [D(22), size(19:18), Vd(15:12), op(7:6), M(5), Vm(3:0)],
// m: M:Vm,
// op: op(7:6),
// pattern: 111100111d11ss10dddd0010ppm0mmmm,
// rule: VQMOVUN,
// safety: [op(7:6)=00 => DECODER_ERROR,
// size(19:18)=11 ||
// Vm(0)=1 => UNDEFINED],
// size: size(19:18),
// src_unsigned: op(7:6)=11,
// uses: {}}
class VQMOVUN_111100111d11ss10dddd0010ppm0mmmm_case_0
: public ClassDecoder {
public:
VQMOVUN_111100111d11ss10dddd0010ppm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQMOVUN_111100111d11ss10dddd0010ppm0mmmm_case_0);
};
// VQNEG_111100111d11ss00dddd01111qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss00dddd01111qm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQNEG,
// safety: [size(19:18)=11 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VQNEG_111100111d11ss00dddd01111qm0mmmm_case_0
: public ClassDecoder {
public:
VQNEG_111100111d11ss00dddd01111qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQNEG_111100111d11ss00dddd01111qm0mmmm_case_0);
};
// VQRDMULH_1111001q1dssnnnndddd1101n1m0mmmm_case_0:
//
// {D: D(22),
// F: F(8),
// M: M(5),
// N: N(7),
// Q: Q(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [Q(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(10),
// F(8),
// N(7),
// M(5),
// Vm(3:0)],
// index: M:Vm(3)
// if size(21:20)=01
// else M,
// m: Vm(2:0)
// if size(21:20)=01
// else Vm,
// n: N:Vn,
// op: op(10),
// pattern: 1111001q1dssnnnndddd1101n1m0mmmm,
// regs: 1
// if Q(24)=0
// else 2,
// rule: VQRDMULH,
// safety: [size(21:20)=11 => DECODER_ERROR,
// size(21:20)=00 => UNDEFINED,
// Q(24)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1) => UNDEFINED],
// size: size(21:20),
// uses: {}}
class VQRDMULH_1111001q1dssnnnndddd1101n1m0mmmm_case_0
: public ClassDecoder {
public:
VQRDMULH_1111001q1dssnnnndddd1101n1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQRDMULH_1111001q1dssnnnndddd1101n1m0mmmm_case_0);
};
// VQRDMULH_A1_111100110dssnnnndddd1011nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 111100110dssnnnndddd1011nqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQRDMULH_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// (size(21:20)=11 ||
// size(21:20)=00) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VQRDMULH_A1_111100110dssnnnndddd1011nqm0mmmm_case_0
: public ClassDecoder {
public:
VQRDMULH_A1_111100110dssnnnndddd1011nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQRDMULH_A1_111100110dssnnnndddd1011nqm0mmmm_case_0);
};
// VQRSHL_1111001u0dssnnnndddd0101nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd0101nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQRSHL,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VQRSHL_1111001u0dssnnnndddd0101nqm1mmmm_case_0
: public ClassDecoder {
public:
VQRSHL_1111001u0dssnnnndddd0101nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQRSHL_1111001u0dssnnnndddd0101nqm1mmmm_case_0);
};
// VQRSHRN_1111001u1diiiiiidddd100p01m1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// dest_unsigned: U(24)=1,
// elements: 8
// if imm6(21:16)=001xxx
// else 4
// if imm6(21:16)=01xxxx
// else 2
// if imm6(21:16)=1xxxxx
// else 0,
// esize: 8
// if imm6(21:16)=001xxx
// else 16
// if imm6(21:16)=01xxxx
// else 32
// if imm6(21:16)=1xxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd100p01m1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQRSHRN,
// safety: [imm6(21:16)=000xxx => DECODER_ERROR,
// Vm(0)=1 => UNDEFINED,
// U(24)=0 &&
// op(8)=0 => DECODER_ERROR],
// shift_amount: 16 - imm6
// if imm6(21:16)=001xxx
// else 32 - imm6
// if imm6(21:16)=01xxxx
// else 64 - imm6
// if imm6(21:16)=1xxxxx
// else 0,
// src_unsigned: U(24)=1 &&
// op(8)=1,
// uses: {}}
class VQRSHRN_1111001u1diiiiiidddd100p01m1mmmm_case_0
: public ClassDecoder {
public:
VQRSHRN_1111001u1diiiiiidddd100p01m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQRSHRN_1111001u1diiiiiidddd100p01m1mmmm_case_0);
};
// VQRSHRUN_1111001u1diiiiiidddd100p00m1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// dest_unsigned: U(24)=1,
// elements: 8
// if imm6(21:16)=001xxx
// else 4
// if imm6(21:16)=01xxxx
// else 2
// if imm6(21:16)=1xxxxx
// else 0,
// esize: 8
// if imm6(21:16)=001xxx
// else 16
// if imm6(21:16)=01xxxx
// else 32
// if imm6(21:16)=1xxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd100p00m1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQRSHRUN,
// safety: [imm6(21:16)=000xxx => DECODER_ERROR,
// Vm(0)=1 => UNDEFINED,
// U(24)=0 &&
// op(8)=0 => DECODER_ERROR],
// shift_amount: 16 - imm6
// if imm6(21:16)=001xxx
// else 32 - imm6
// if imm6(21:16)=01xxxx
// else 64 - imm6
// if imm6(21:16)=1xxxxx
// else 0,
// src_unsigned: U(24)=1 &&
// op(8)=1,
// uses: {}}
class VQRSHRUN_1111001u1diiiiiidddd100p00m1mmmm_case_0
: public ClassDecoder {
public:
VQRSHRUN_1111001u1diiiiiidddd100p00m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQRSHRUN_1111001u1diiiiiidddd100p00m1mmmm_case_0);
};
// VQRSHRUN_1111001u1diiiiiidddd100p01m1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// dest_unsigned: U(24)=1,
// elements: 8
// if imm6(21:16)=001xxx
// else 4
// if imm6(21:16)=01xxxx
// else 2
// if imm6(21:16)=1xxxxx
// else 0,
// esize: 8
// if imm6(21:16)=001xxx
// else 16
// if imm6(21:16)=01xxxx
// else 32
// if imm6(21:16)=1xxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd100p01m1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQRSHRUN,
// safety: [imm6(21:16)=000xxx => DECODER_ERROR,
// Vm(0)=1 => UNDEFINED,
// U(24)=0 &&
// op(8)=0 => DECODER_ERROR],
// shift_amount: 16 - imm6
// if imm6(21:16)=001xxx
// else 32 - imm6
// if imm6(21:16)=01xxxx
// else 64 - imm6
// if imm6(21:16)=1xxxxx
// else 0,
// src_unsigned: U(24)=1 &&
// op(8)=1,
// uses: {}}
class VQRSHRUN_1111001u1diiiiiidddd100p01m1mmmm_case_0
: public ClassDecoder {
public:
VQRSHRUN_1111001u1diiiiiidddd100p01m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQRSHRUN_1111001u1diiiiiidddd100p01m1mmmm_case_0);
};
// VQSHL_VQSHLU_immediate_1111001u1diiiiiidddd011plqm1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// dest_unsigned: U(24)=1,
// elements: 8
// if L:imm6(6:0)=0001xxx
// else 4
// if L:imm6(6:0)=001xxxx
// else 2
// if L:imm6(6:0)=01xxxxx
// else 1
// if L:imm6(6:0)=1xxxxxx
// else 0,
// esize: 8
// if L:imm6(6:0)=0001xxx
// else 16
// if L:imm6(6:0)=001xxxx
// else 32
// if L:imm6(6:0)=01xxxxx
// else 64
// if L:imm6(6:0)=1xxxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd011plqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQSHL_VQSHLU_immediate,
// safety: [L:imm6(6:0)=0000xxx => DECODER_ERROR,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// U(24)=0 &&
// op(8)=0 => UNDEFINED],
// shift_amount: imm6 - 8
// if L:imm6(6:0)=0001xxx
// else imm6 - 16
// if L:imm6(6:0)=001xxxx
// else imm6 - 32
// if L:imm6(6:0)=01xxxxx
// else imm6
// if L:imm6(6:0)=1xxxxxx
// else 0,
// src_unsigned: U(24)=1 &&
// op(8)=1,
// unsigned: U(24)=1,
// uses: {}}
class VQSHL_VQSHLU_immediate_1111001u1diiiiiidddd011plqm1mmmm_case_0
: public ClassDecoder {
public:
VQSHL_VQSHLU_immediate_1111001u1diiiiiidddd011plqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQSHL_VQSHLU_immediate_1111001u1diiiiiidddd011plqm1mmmm_case_0);
};
// VQSHL_register_1111001u0dssnnnndddd0100nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd0100nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQSHL_register,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VQSHL_register_1111001u0dssnnnndddd0100nqm1mmmm_case_0
: public ClassDecoder {
public:
VQSHL_register_1111001u0dssnnnndddd0100nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQSHL_register_1111001u0dssnnnndddd0100nqm1mmmm_case_0);
};
// VQSHRN_1111001u1diiiiiidddd100p00m1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// dest_unsigned: U(24)=1,
// elements: 8
// if imm6(21:16)=001xxx
// else 4
// if imm6(21:16)=01xxxx
// else 2
// if imm6(21:16)=1xxxxx
// else 0,
// esize: 8
// if imm6(21:16)=001xxx
// else 16
// if imm6(21:16)=01xxxx
// else 32
// if imm6(21:16)=1xxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd100p00m1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQSHRN,
// safety: [imm6(21:16)=000xxx => DECODER_ERROR,
// Vm(0)=1 => UNDEFINED,
// U(24)=0 &&
// op(8)=0 => DECODER_ERROR],
// shift_amount: 16 - imm6
// if imm6(21:16)=001xxx
// else 32 - imm6
// if imm6(21:16)=01xxxx
// else 64 - imm6
// if imm6(21:16)=1xxxxx
// else 0,
// src_unsigned: U(24)=1 &&
// op(8)=1,
// uses: {}}
class VQSHRN_1111001u1diiiiiidddd100p00m1mmmm_case_0
: public ClassDecoder {
public:
VQSHRN_1111001u1diiiiiidddd100p00m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQSHRN_1111001u1diiiiiidddd100p00m1mmmm_case_0);
};
// VQSHRUN_1111001u1diiiiiidddd100p00m1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// dest_unsigned: U(24)=1,
// elements: 8
// if imm6(21:16)=001xxx
// else 4
// if imm6(21:16)=01xxxx
// else 2
// if imm6(21:16)=1xxxxx
// else 0,
// esize: 8
// if imm6(21:16)=001xxx
// else 16
// if imm6(21:16)=01xxxx
// else 32
// if imm6(21:16)=1xxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd100p00m1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQSHRUN,
// safety: [imm6(21:16)=000xxx => DECODER_ERROR,
// Vm(0)=1 => UNDEFINED,
// U(24)=0 &&
// op(8)=0 => DECODER_ERROR],
// shift_amount: 16 - imm6
// if imm6(21:16)=001xxx
// else 32 - imm6
// if imm6(21:16)=01xxxx
// else 64 - imm6
// if imm6(21:16)=1xxxxx
// else 0,
// src_unsigned: U(24)=1 &&
// op(8)=1,
// uses: {}}
class VQSHRUN_1111001u1diiiiiidddd100p00m1mmmm_case_0
: public ClassDecoder {
public:
VQSHRUN_1111001u1diiiiiidddd100p00m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQSHRUN_1111001u1diiiiiidddd100p00m1mmmm_case_0);
};
// VQSUB_1111001u0dssnnnndddd0010nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd0010nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VQSUB,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VQSUB_1111001u0dssnnnndddd0010nqm1mmmm_case_0
: public ClassDecoder {
public:
VQSUB_1111001u0dssnnnndddd0010nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VQSUB_1111001u0dssnnnndddd0010nqm1mmmm_case_0);
};
// VRADDHN_111100111dssnnnndddd0100n0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(8),
// pattern: 111100111dssnnnndddd0100n0m0mmmm,
// rule: VRADDHN,
// safety: [size(21:20)=11 => DECODER_ERROR,
// Vn(0)=1 ||
// Vm(0)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VRADDHN_111100111dssnnnndddd0100n0m0mmmm_case_0
: public ClassDecoder {
public:
VRADDHN_111100111dssnnnndddd0100n0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRADDHN_111100111dssnnnndddd0100n0m0mmmm_case_0);
};
// VRECPE_111100111d11ss11dddd010f0qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// floating_point: F(10)=1,
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss11dddd010f0qm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VRECPE,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(19:18)=~10 => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VRECPE_111100111d11ss11dddd010f0qm0mmmm_case_0
: public ClassDecoder {
public:
VRECPE_111100111d11ss11dddd010f0qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRECPE_111100111d11ss11dddd010f0qm0mmmm_case_0);
};
// VRECPS_111100100d0snnnndddd1111nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100100d0snnnndddd1111nqm1mmmm,
// rule: VRECPS,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(0)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VRECPS_111100100d0snnnndddd1111nqm1mmmm_case_0
: public ClassDecoder {
public:
VRECPS_111100100d0snnnndddd1111nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRECPS_111100100d0snnnndddd1111nqm1mmmm_case_0);
};
// VREV16_111100111d11ss00dddd000ppqm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// groupsize: rev_groupsize(op, size),
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss00dddd000ppqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// reverse_mask: rev_mask(groupsize, esize),
// rule: VREV16,
// safety: [op + size >=
// 3 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VREV16_111100111d11ss00dddd000ppqm0mmmm_case_0
: public ClassDecoder {
public:
VREV16_111100111d11ss00dddd000ppqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VREV16_111100111d11ss00dddd000ppqm0mmmm_case_0);
};
// VREV32_111100111d11ss00dddd000ppqm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// groupsize: rev_groupsize(op, size),
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss00dddd000ppqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// reverse_mask: rev_mask(groupsize, esize),
// rule: VREV32,
// safety: [op + size >=
// 3 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VREV32_111100111d11ss00dddd000ppqm0mmmm_case_0
: public ClassDecoder {
public:
VREV32_111100111d11ss00dddd000ppqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VREV32_111100111d11ss00dddd000ppqm0mmmm_case_0);
};
// VREV64_111100111d11ss00dddd000ppqm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// groupsize: rev_groupsize(op, size),
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss00dddd000ppqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// reverse_mask: rev_mask(groupsize, esize),
// rule: VREV64,
// safety: [op + size >=
// 3 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VREV64_111100111d11ss00dddd000ppqm0mmmm_case_0
: public ClassDecoder {
public:
VREV64_111100111d11ss00dddd000ppqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VREV64_111100111d11ss00dddd000ppqm0mmmm_case_0);
};
// VRHADD_1111001u0dssnnnndddd0001nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd0001nqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VRHADD,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(21:20)=11 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VRHADD_1111001u0dssnnnndddd0001nqm0mmmm_case_0
: public ClassDecoder {
public:
VRHADD_1111001u0dssnnnndddd0001nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRHADD_1111001u0dssnnnndddd0001nqm0mmmm_case_0);
};
// VRSHL_1111001u0dssnnnndddd0101nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd0101nqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VRSHL,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VRSHL_1111001u0dssnnnndddd0101nqm0mmmm_case_0
: public ClassDecoder {
public:
VRSHL_1111001u0dssnnnndddd0101nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRSHL_1111001u0dssnnnndddd0101nqm0mmmm_case_0);
};
// VRSHRN_111100101diiiiiidddd100001m1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if imm6(21:16)=001xxx
// else 4
// if imm6(21:16)=01xxxx
// else 2
// if imm6(21:16)=1xxxxx
// else 0,
// esize: 8
// if imm6(21:16)=001xxx
// else 16
// if imm6(21:16)=01xxxx
// else 32
// if imm6(21:16)=1xxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 111100101diiiiiidddd100001m1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VRSHRN,
// safety: [imm6(21:16)=000xxx => DECODER_ERROR, Vm(0)=1 => UNDEFINED],
// shift_amount: 16 - imm6
// if imm6(21:16)=001xxx
// else 32 - imm6
// if imm6(21:16)=01xxxx
// else 64 - imm6
// if imm6(21:16)=1xxxxx
// else 0,
// uses: {}}
class VRSHRN_111100101diiiiiidddd100001m1mmmm_case_0
: public ClassDecoder {
public:
VRSHRN_111100101diiiiiidddd100001m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRSHRN_111100101diiiiiidddd100001m1mmmm_case_0);
};
// VRSHR_1111001u1diiiiiidddd0010lqm1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if L:imm6(6:0)=0001xxx
// else 4
// if L:imm6(6:0)=001xxxx
// else 2
// if L:imm6(6:0)=01xxxxx
// else 1
// if L:imm6(6:0)=1xxxxxx
// else 0,
// esize: 8
// if L:imm6(6:0)=0001xxx
// else 16
// if L:imm6(6:0)=001xxxx
// else 32
// if L:imm6(6:0)=01xxxxx
// else 64
// if L:imm6(6:0)=1xxxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd0010lqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VRSHR,
// safety: [L:imm6(6:0)=0000xxx => DECODER_ERROR,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// shift_amount: 16 - imm6
// if L:imm6(6:0)=0001xxx
// else 32 - imm6
// if L:imm6(6:0)=001xxxx
// else 64 - imm6,
// unsigned: U(24)=1,
// uses: {}}
class VRSHR_1111001u1diiiiiidddd0010lqm1mmmm_case_0
: public ClassDecoder {
public:
VRSHR_1111001u1diiiiiidddd0010lqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRSHR_1111001u1diiiiiidddd0010lqm1mmmm_case_0);
};
// VRSQRTE_111100111d11ss11dddd010f1qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// floating_point: F(10)=1,
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss11dddd010f1qm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VRSQRTE,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(19:18)=~10 => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VRSQRTE_111100111d11ss11dddd010f1qm0mmmm_case_0
: public ClassDecoder {
public:
VRSQRTE_111100111d11ss11dddd010f1qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRSQRTE_111100111d11ss11dddd010f1qm0mmmm_case_0);
};
// VRSQRTS_111100100d1snnnndddd1111nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100100d1snnnndddd1111nqm1mmmm,
// rule: VRSQRTS,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(0)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VRSQRTS_111100100d1snnnndddd1111nqm1mmmm_case_0
: public ClassDecoder {
public:
VRSQRTS_111100100d1snnnndddd1111nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRSQRTS_111100100d1snnnndddd1111nqm1mmmm_case_0);
};
// VRSRA_1111001u1diiiiiidddd0011lqm1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if L:imm6(6:0)=0001xxx
// else 4
// if L:imm6(6:0)=001xxxx
// else 2
// if L:imm6(6:0)=01xxxxx
// else 1
// if L:imm6(6:0)=1xxxxxx
// else 0,
// esize: 8
// if L:imm6(6:0)=0001xxx
// else 16
// if L:imm6(6:0)=001xxxx
// else 32
// if L:imm6(6:0)=01xxxxx
// else 64
// if L:imm6(6:0)=1xxxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd0011lqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VRSRA,
// safety: [L:imm6(6:0)=0000xxx => DECODER_ERROR,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// shift_amount: 16 - imm6
// if L:imm6(6:0)=0001xxx
// else 32 - imm6
// if L:imm6(6:0)=001xxxx
// else 64 - imm6,
// unsigned: U(24)=1,
// uses: {}}
class VRSRA_1111001u1diiiiiidddd0011lqm1mmmm_case_0
: public ClassDecoder {
public:
VRSRA_1111001u1diiiiiidddd0011lqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRSRA_1111001u1diiiiiidddd0011lqm1mmmm_case_0);
};
// VRSUBHN_111100111dssnnnndddd0110n0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(8),
// pattern: 111100111dssnnnndddd0110n0m0mmmm,
// rule: VRSUBHN,
// safety: [size(21:20)=11 => DECODER_ERROR,
// Vn(0)=1 ||
// Vm(0)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VRSUBHN_111100111dssnnnndddd0110n0m0mmmm_case_0
: public ClassDecoder {
public:
VRSUBHN_111100111dssnnnndddd0110n0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VRSUBHN_111100111dssnnnndddd0110n0m0mmmm_case_0);
};
// VSHLL_A1_or_VMOVL_1111001u1diiiiiidddd101000m1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if imm6(21:16)=001xxx
// else 4
// if imm6(21:16)=01xxxx
// else 2
// if imm6(21:16)=1xxxxx
// else 0,
// esize: 8
// if imm6(21:16)=001xxx
// else 16
// if imm6(21:16)=01xxxx
// else 32
// if imm6(21:16)=1xxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd101000m1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSHLL_A1_or_VMOVL,
// safety: [imm6(21:16)=000xxx => DECODER_ERROR, Vd(0)=1 => UNDEFINED],
// shift_amount: imm6 - 8
// if imm6(21:16)=001xxx
// else imm6 - 16
// if imm6(21:16)=01xxxx
// else imm6 - 32
// if imm6(21:16)=1xxxxx
// else 0,
// uses: {}}
class VSHLL_A1_or_VMOVL_1111001u1diiiiiidddd101000m1mmmm_case_0
: public ClassDecoder {
public:
VSHLL_A1_or_VMOVL_1111001u1diiiiiidddd101000m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSHLL_A1_or_VMOVL_1111001u1diiiiiidddd101000m1mmmm_case_0);
};
// VSHLL_A2_111100111d11ss10dddd001100m0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss10dddd001100m0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSHLL_A2,
// safety: [size(19:18)=11 ||
// Vd(0)=1 => UNDEFINED],
// shift_amount: esize,
// size: size(19:18),
// uses: {}}
class VSHLL_A2_111100111d11ss10dddd001100m0mmmm_case_0
: public ClassDecoder {
public:
VSHLL_A2_111100111d11ss10dddd001100m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSHLL_A2_111100111d11ss10dddd001100m0mmmm_case_0);
};
// VSHL_immediate_111100101diiiiiidddd0101lqm1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if L:imm6(6:0)=0001xxx
// else 4
// if L:imm6(6:0)=001xxxx
// else 2
// if L:imm6(6:0)=01xxxxx
// else 1
// if L:imm6(6:0)=1xxxxxx
// else 0,
// esize: 8
// if L:imm6(6:0)=0001xxx
// else 16
// if L:imm6(6:0)=001xxxx
// else 32
// if L:imm6(6:0)=01xxxxx
// else 64
// if L:imm6(6:0)=1xxxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 111100101diiiiiidddd0101lqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSHL_immediate,
// safety: [L:imm6(6:0)=0000xxx => DECODER_ERROR,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// shift_amount: imm6 - 8
// if L:imm6(6:0)=0001xxx
// else imm6 - 16
// if L:imm6(6:0)=001xxxx
// else imm6 - 32
// if L:imm6(6:0)=01xxxxx
// else imm6
// if L:imm6(6:0)=1xxxxxx
// else 0,
// unsigned: U(24)=1,
// uses: {}}
class VSHL_immediate_111100101diiiiiidddd0101lqm1mmmm_case_0
: public ClassDecoder {
public:
VSHL_immediate_111100101diiiiiidddd0101lqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSHL_immediate_111100101diiiiiidddd0101lqm1mmmm_case_0);
};
// VSHL_register_1111001u0dssnnnndddd0100nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 1111001u0dssnnnndddd0100nqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSHL_register,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VSHL_register_1111001u0dssnnnndddd0100nqm0mmmm_case_0
: public ClassDecoder {
public:
VSHL_register_1111001u0dssnnnndddd0100nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSHL_register_1111001u0dssnnnndddd0100nqm0mmmm_case_0);
};
// VSHRN_111100101diiiiiidddd100000m1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if imm6(21:16)=001xxx
// else 4
// if imm6(21:16)=01xxxx
// else 2
// if imm6(21:16)=1xxxxx
// else 0,
// esize: 8
// if imm6(21:16)=001xxx
// else 16
// if imm6(21:16)=01xxxx
// else 32
// if imm6(21:16)=1xxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 111100101diiiiiidddd100000m1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSHRN,
// safety: [imm6(21:16)=000xxx => DECODER_ERROR, Vm(0)=1 => UNDEFINED],
// shift_amount: 16 - imm6
// if imm6(21:16)=001xxx
// else 32 - imm6
// if imm6(21:16)=01xxxx
// else 64 - imm6
// if imm6(21:16)=1xxxxx
// else 0,
// uses: {}}
class VSHRN_111100101diiiiiidddd100000m1mmmm_case_0
: public ClassDecoder {
public:
VSHRN_111100101diiiiiidddd100000m1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSHRN_111100101diiiiiidddd100000m1mmmm_case_0);
};
// VSHR_1111001u1diiiiiidddd0000lqm1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if L:imm6(6:0)=0001xxx
// else 4
// if L:imm6(6:0)=001xxxx
// else 2
// if L:imm6(6:0)=01xxxxx
// else 1
// if L:imm6(6:0)=1xxxxxx
// else 0,
// esize: 8
// if L:imm6(6:0)=0001xxx
// else 16
// if L:imm6(6:0)=001xxxx
// else 32
// if L:imm6(6:0)=01xxxxx
// else 64
// if L:imm6(6:0)=1xxxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd0000lqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSHR,
// safety: [L:imm6(6:0)=0000xxx => DECODER_ERROR,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// shift_amount: 16 - imm6
// if L:imm6(6:0)=0001xxx
// else 32 - imm6
// if L:imm6(6:0)=001xxxx
// else 64 - imm6,
// unsigned: U(24)=1,
// uses: {}}
class VSHR_1111001u1diiiiiidddd0000lqm1mmmm_case_0
: public ClassDecoder {
public:
VSHR_1111001u1diiiiiidddd0000lqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSHR_1111001u1diiiiiidddd0000lqm1mmmm_case_0);
};
// VSLI_111100111diiiiiidddd0101lqm1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if L:imm6(6:0)=0001xxx
// else 4
// if L:imm6(6:0)=001xxxx
// else 2
// if L:imm6(6:0)=01xxxxx
// else 1
// if L:imm6(6:0)=1xxxxxx
// else 0,
// esize: 8
// if L:imm6(6:0)=0001xxx
// else 16
// if L:imm6(6:0)=001xxxx
// else 32
// if L:imm6(6:0)=01xxxxx
// else 64
// if L:imm6(6:0)=1xxxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 111100111diiiiiidddd0101lqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSLI,
// safety: [L:imm6(6:0)=0000xxx => DECODER_ERROR,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// shift_amount: imm6 - 8
// if L:imm6(6:0)=0001xxx
// else imm6 - 16
// if L:imm6(6:0)=001xxxx
// else imm6 - 32
// if L:imm6(6:0)=01xxxxx
// else imm6
// if L:imm6(6:0)=1xxxxxx
// else 0,
// unsigned: U(24)=1,
// uses: {}}
class VSLI_111100111diiiiiidddd0101lqm1mmmm_case_0
: public ClassDecoder {
public:
VSLI_111100111diiiiiidddd0101lqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSLI_111100111diiiiiidddd0101lqm1mmmm_case_0);
};
// VSQRT_cccc11101d110001dddd101s11m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// advsimd: false,
// arch: VFPv2,
// cond: cond(31:28),
// d: Vd:D
// if sz(8)=0
// else D:Vd,
// defs: {},
// dp_operation: sz(8)=1,
// false: false,
// fields: [cond(31:28), D(22), Vd(15:12), sz(8), M(5), Vm(3:0)],
// m: Vm:D
// if sz(8)=0
// else M:Vm,
// pattern: cccc11101d110001dddd101s11m0mmmm,
// rule: VSQRT,
// safety: [true => MAY_BE_SAFE],
// sz: sz(8),
// true: true,
// uses: {}}
class VSQRT_cccc11101d110001dddd101s11m0mmmm_case_0
: public ClassDecoder {
public:
VSQRT_cccc11101d110001dddd101s11m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSQRT_cccc11101d110001dddd101s11m0mmmm_case_0);
};
// VSRA_1111001u1diiiiiidddd0001lqm1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if L:imm6(6:0)=0001xxx
// else 4
// if L:imm6(6:0)=001xxxx
// else 2
// if L:imm6(6:0)=01xxxxx
// else 1
// if L:imm6(6:0)=1xxxxxx
// else 0,
// esize: 8
// if L:imm6(6:0)=0001xxx
// else 16
// if L:imm6(6:0)=001xxxx
// else 32
// if L:imm6(6:0)=01xxxxx
// else 64
// if L:imm6(6:0)=1xxxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 1111001u1diiiiiidddd0001lqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSRA,
// safety: [L:imm6(6:0)=0000xxx => DECODER_ERROR,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// shift_amount: 16 - imm6
// if L:imm6(6:0)=0001xxx
// else 32 - imm6
// if L:imm6(6:0)=001xxxx
// else 64 - imm6,
// unsigned: U(24)=1,
// uses: {}}
class VSRA_1111001u1diiiiiidddd0001lqm1mmmm_case_0
: public ClassDecoder {
public:
VSRA_1111001u1diiiiiidddd0001lqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSRA_1111001u1diiiiiidddd0001lqm1mmmm_case_0);
};
// VSRI_111100111diiiiiidddd0100lqm1mmmm_case_0:
//
// {D: D(22),
// L: L(7),
// M: M(5),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 8
// if L:imm6(6:0)=0001xxx
// else 4
// if L:imm6(6:0)=001xxxx
// else 2
// if L:imm6(6:0)=01xxxxx
// else 1
// if L:imm6(6:0)=1xxxxxx
// else 0,
// esize: 8
// if L:imm6(6:0)=0001xxx
// else 16
// if L:imm6(6:0)=001xxxx
// else 32
// if L:imm6(6:0)=01xxxxx
// else 64
// if L:imm6(6:0)=1xxxxxx
// else 0,
// fields: [U(24),
// D(22),
// imm6(21:16),
// Vd(15:12),
// op(8),
// L(7),
// Q(6),
// M(5),
// Vm(3:0)],
// imm6: imm6(21:16),
// n: M:Vm,
// op: op(8),
// pattern: 111100111diiiiiidddd0100lqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSRI,
// safety: [L:imm6(6:0)=0000xxx => DECODER_ERROR,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// shift_amount: 16 - imm6
// if L:imm6(6:0)=0001xxx
// else 32 - imm6
// if L:imm6(6:0)=001xxxx
// else 64 - imm6,
// unsigned: U(24)=1,
// uses: {}}
class VSRI_111100111diiiiiidddd0100lqm1mmmm_case_0
: public ClassDecoder {
public:
VSRI_111100111diiiiiidddd0100lqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSRI_111100111diiiiiidddd0100lqm1mmmm_case_0);
};
// VST1_multiple_single_elements_111101000d00nnnnddddttttssaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// align: align(5:4),
// alignment: 1
// if align(5:4)=00
// else 4 << align,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// type(11:8),
// size(7:6),
// align(5:4),
// Rm(3:0)],
// m: Rm,
// n: Rn,
// pattern: 111101000d00nnnnddddttttssaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// regs: 1
// if type(11:8)=0111
// else 2
// if type(11:8)=1010
// else 3
// if type(11:8)=0110
// else 4
// if type(11:8)=0010
// else 0,
// rule: VST1_multiple_single_elements,
// safety: [type(11:8)=0111 &&
// align(1)=1 => UNDEFINED,
// type(11:8)=1010 &&
// align(5:4)=11 => UNDEFINED,
// type(11:8)=0110 &&
// align(1)=1 => UNDEFINED,
// not type in bitset {'0111', '1010', '0110', '0010'} => DECODER_ERROR,
// n ==
// Pc ||
// d + regs >
// 32 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// type: type(11:8),
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VST1_multiple_single_elements_111101000d00nnnnddddttttssaammmm_case_0
: public ClassDecoder {
public:
VST1_multiple_single_elements_111101000d00nnnnddddttttssaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VST1_multiple_single_elements_111101000d00nnnnddddttttssaammmm_case_0);
};
// VST1_single_element_from_one_lane_111101001d00nnnnddddss00aaaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// alignment: 1
// if size(11:10)=00
// else (1
// if index_align(0)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(1:0)=00
// else 4)
// if size(11:10)=10
// else 0,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(11:10),
// index_align(7:4),
// Rm(3:0)],
// inc: 1
// if size(11:10)=00
// else (1
// if index_align(1)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(2)=0
// else 2)
// if size(11:10)=10
// else 0,
// index: index_align(3:1)
// if size(11:10)=00
// else index_align(3:2)
// if size(11:10)=01
// else index_align(3)
// if size(11:10)=10
// else 0,
// index_align: index_align(7:4),
// m: Rm,
// n: Rn,
// pattern: 111101001d00nnnnddddss00aaaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VST1_single_element_from_one_lane,
// safety: [size(11:10)=11 => UNDEFINED,
// size(11:10)=00 &&
// index_align(0)=~0 => UNDEFINED,
// size(11:10)=01 &&
// index_align(1)=~0 => UNDEFINED,
// size(11:10)=10 &&
// index_align(2)=~0 => UNDEFINED,
// size(11:10)=10 &&
// index_align(1:0)=~00 &&
// index_align(1:0)=~11 => UNDEFINED,
// n ==
// Pc => UNPREDICTABLE],
// size: size(11:10),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VST1_single_element_from_one_lane_111101001d00nnnnddddss00aaaammmm_case_0
: public ClassDecoder {
public:
VST1_single_element_from_one_lane_111101001d00nnnnddddss00aaaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VST1_single_element_from_one_lane_111101001d00nnnnddddss00aaaammmm_case_0);
};
// VST2_multiple_2_element_structures_111101000d00nnnnddddttttssaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// align: align(5:4),
// alignment: 1
// if align(5:4)=00
// else 4 << align,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// type(11:8),
// size(7:6),
// align(5:4),
// Rm(3:0)],
// inc: 1
// if type(11:8)=1000
// else 2,
// m: Rm,
// n: Rn,
// pattern: 111101000d00nnnnddddttttssaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// regs: 1
// if type in bitset {'1000', '1001'}
// else 2,
// rule: VST2_multiple_2_element_structures,
// safety: [size(7:6)=11 => UNDEFINED,
// type in bitset {'1000', '1001'} &&
// align(5:4)=11 => UNDEFINED,
// not type in bitset {'1000', '1001', '0011'} => DECODER_ERROR,
// n ==
// Pc ||
// d2 + regs >
// 32 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// type: type(11:8),
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VST2_multiple_2_element_structures_111101000d00nnnnddddttttssaammmm_case_0
: public ClassDecoder {
public:
VST2_multiple_2_element_structures_111101000d00nnnnddddttttssaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VST2_multiple_2_element_structures_111101000d00nnnnddddttttssaammmm_case_0);
};
// VST2_single_2_element_structure_from_one_lane_111101001d00nnnnddddss01aaaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// alignment: (1
// if index_align(0)=0
// else 2)
// if size(11:10)=00
// else (1
// if index_align(0)=0
// else 4)
// if size(11:10)=01
// else (1
// if index_align(0)=0
// else 8)
// if size(11:10)=10
// else 0,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(11:10),
// index_align(7:4),
// Rm(3:0)],
// inc: 1
// if size(11:10)=00
// else (1
// if index_align(1)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(2)=0
// else 2)
// if size(11:10)=10
// else 0,
// index: index_align(3:1)
// if size(11:10)=00
// else index_align(3:2)
// if size(11:10)=01
// else index_align(3)
// if size(11:10)=10
// else 0,
// index_align: index_align(7:4),
// m: Rm,
// n: Rn,
// pattern: 111101001d00nnnnddddss01aaaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VST2_single_2_element_structure_from_one_lane,
// safety: [size(11:10)=11 => UNDEFINED,
// size(11:10)=10 &&
// index_align(1)=~0 => UNDEFINED,
// n ==
// Pc ||
// d2 >
// 31 => UNPREDICTABLE],
// size: size(11:10),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VST2_single_2_element_structure_from_one_lane_111101001d00nnnnddddss01aaaammmm_case_0
: public ClassDecoder {
public:
VST2_single_2_element_structure_from_one_lane_111101001d00nnnnddddss01aaaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VST2_single_2_element_structure_from_one_lane_111101001d00nnnnddddss01aaaammmm_case_0);
};
// VST3_multiple_3_element_structures_111101000d00nnnnddddttttssaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// align: align(5:4),
// alignment: 1
// if align(0)=0
// else 8,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// type(11:8),
// size(7:6),
// align(5:4),
// Rm(3:0)],
// inc: 1
// if type(11:8)=0100
// else 2,
// m: Rm,
// n: Rn,
// pattern: 111101000d00nnnnddddttttssaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VST3_multiple_3_element_structures,
// safety: [size(7:6)=11 ||
// align(1)=1 => UNDEFINED,
// not type in bitset {'0100', '0101'} => DECODER_ERROR,
// n ==
// Pc ||
// d3 >
// 31 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// type: type(11:8),
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VST3_multiple_3_element_structures_111101000d00nnnnddddttttssaammmm_case_0
: public ClassDecoder {
public:
VST3_multiple_3_element_structures_111101000d00nnnnddddttttssaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VST3_multiple_3_element_structures_111101000d00nnnnddddttttssaammmm_case_0);
};
// VST3_single_3_element_structure_from_one_lane_111101001d00nnnnddddss10aaaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// alignment: 1,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(11:10),
// index_align(7:4),
// Rm(3:0)],
// inc: 1
// if size(11:10)=00
// else (1
// if index_align(1)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(2)=0
// else 2)
// if size(11:10)=10
// else 0,
// index: index_align(3:1)
// if size(11:10)=00
// else index_align(3:2)
// if size(11:10)=01
// else index_align(3)
// if size(11:10)=10
// else 0,
// index_align: index_align(7:4),
// m: Rm,
// n: Rn,
// pattern: 111101001d00nnnnddddss10aaaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VST3_single_3_element_structure_from_one_lane,
// safety: [size(11:10)=11 => UNDEFINED,
// size(11:10)=00 &&
// index_align(0)=~0 => UNDEFINED,
// size(11:10)=01 &&
// index_align(0)=~0 => UNDEFINED,
// size(11:10)=10 &&
// index_align(1:0)=~00 => UNDEFINED,
// n ==
// Pc ||
// d3 >
// 31 => UNPREDICTABLE],
// size: size(11:10),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VST3_single_3_element_structure_from_one_lane_111101001d00nnnnddddss10aaaammmm_case_0
: public ClassDecoder {
public:
VST3_single_3_element_structure_from_one_lane_111101001d00nnnnddddss10aaaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VST3_single_3_element_structure_from_one_lane_111101001d00nnnnddddss10aaaammmm_case_0);
};
// VST4_multiple_4_element_structures_111101000d00nnnnddddttttssaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// align: align(5:4),
// alignment: 1
// if align(5:4)=00
// else 4 << align,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// d4: d3 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// elements: 8 / ebytes,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// type(11:8),
// size(7:6),
// align(5:4),
// Rm(3:0)],
// inc: 1
// if type(11:8)=0000
// else 2,
// m: Rm,
// n: Rn,
// pattern: 111101000d00nnnnddddttttssaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VST4_multiple_4_element_structures,
// safety: [size(7:6)=11 => UNDEFINED,
// not type in bitset {'0000', '0001'} => DECODER_ERROR,
// n ==
// Pc ||
// d4 >
// 31 => UNPREDICTABLE],
// size: size(7:6),
// small_imm_base_wb: wback &&
// not register_index,
// type: type(11:8),
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VST4_multiple_4_element_structures_111101000d00nnnnddddttttssaammmm_case_0
: public ClassDecoder {
public:
VST4_multiple_4_element_structures_111101000d00nnnnddddttttssaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VST4_multiple_4_element_structures_111101000d00nnnnddddttttssaammmm_case_0);
};
// VST4_single_4_element_structure_form_one_lane_111101001d00nnnnddddss11aaaammmm_case_0:
//
// {D: D(22),
// None: 32,
// Pc: 15,
// Rm: Rm(3:0),
// Rn: Rn(19:16),
// Sp: 13,
// Vd: Vd(15:12),
// alignment: (1
// if index_align(0)=0
// else 4)
// if size(11:10)=00
// else (1
// if index_align(0)=0
// else 8)
// if size(11:10)=01
// else (1
// if index_align(1:0)=00
// else 4 << index_align(1:0))
// if size(11:10)=10
// else 0,
// arch: ASIMD,
// base: n,
// d: D:Vd,
// d2: d + inc,
// d3: d2 + inc,
// d4: d3 + inc,
// defs: {base}
// if wback
// else {},
// ebytes: 1 << size,
// esize: 8 * ebytes,
// fields: [D(22),
// Rn(19:16),
// Vd(15:12),
// size(11:10),
// index_align(7:4),
// Rm(3:0)],
// inc: 1
// if size(11:10)=00
// else (1
// if index_align(1)=0
// else 2)
// if size(11:10)=01
// else (1
// if index_align(2)=0
// else 2)
// if size(11:10)=10
// else 0,
// index: index_align(3:1)
// if size(11:10)=00
// else index_align(3:2)
// if size(11:10)=01
// else index_align(3)
// if size(11:10)=10
// else 0,
// index_align: index_align(7:4),
// m: Rm,
// n: Rn,
// pattern: 111101001d00nnnnddddss11aaaammmm,
// register_index: (m !=
// Pc &&
// m !=
// Sp),
// rule: VST4_single_4_element_structure_form_one_lane,
// safety: [size(11:10)=11 => UNDEFINED,
// size(11:10)=10 &&
// index_align(1:0)=11 => UNDEFINED,
// n ==
// Pc ||
// d4 >
// 31 => UNPREDICTABLE],
// size: size(11:10),
// small_imm_base_wb: wback &&
// not register_index,
// uses: {m
// if wback
// else None, n},
// violations: [implied by 'base'],
// wback: (m !=
// Pc)}
class VST4_single_4_element_structure_form_one_lane_111101001d00nnnnddddss11aaaammmm_case_0
: public ClassDecoder {
public:
VST4_single_4_element_structure_form_one_lane_111101001d00nnnnddddss11aaaammmm_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VST4_single_4_element_structure_form_one_lane_111101001d00nnnnddddss11aaaammmm_case_0);
};
// VSTM_cccc110pudw0nnnndddd1010iiiiiiii_case_0:
//
// {D: D(22),
// None: 32,
// P: P(24),
// Pc: 15,
// Rn: Rn(19:16),
// Sp: 13,
// U: U(23),
// Vd: Vd(15:12),
// W: W(21),
// add: U(23)=1,
// arch: VFPv2,
// base: Rn,
// cond: cond(31:28),
// d: Vd:D,
// defs: {Rn
// if wback
// else None},
// fields: [cond(31:28),
// P(24),
// U(23),
// D(22),
// W(21),
// Rn(19:16),
// Vd(15:12),
// imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// n: Rn,
// pattern: cccc110pudw0nnnndddd1010iiiiiiii,
// regs: imm8,
// rule: VSTM,
// safety: [P(24)=0 &&
// U(23)=0 &&
// W(21)=0 => DECODER_ERROR,
// P(24)=1 &&
// W(21)=0 => DECODER_ERROR,
// P ==
// U &&
// W(21)=1 => UNDEFINED,
// n ==
// Pc &&
// wback => UNPREDICTABLE,
// P(24)=1 &&
// U(23)=0 &&
// W(21)=1 &&
// Rn ==
// Sp => DECODER_ERROR,
// Rn ==
// Pc => FORBIDDEN_OPERANDS,
// regs ==
// 0 ||
// d + regs >
// 32 => UNPREDICTABLE],
// single_regs: true,
// small_imm_base_wb: wback,
// true: true,
// uses: {Rn},
// violations: [implied by 'base'],
// wback: W(21)=1}
class VSTM_cccc110pudw0nnnndddd1010iiiiiiii_case_0
: public ClassDecoder {
public:
VSTM_cccc110pudw0nnnndddd1010iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSTM_cccc110pudw0nnnndddd1010iiiiiiii_case_0);
};
// VSTM_cccc110pudw0nnnndddd1011iiiiiiii_case_0:
//
// {D: D(22),
// None: 32,
// P: P(24),
// Pc: 15,
// Rn: Rn(19:16),
// Sp: 13,
// U: U(23),
// Vd: Vd(15:12),
// W: W(21),
// add: U(23)=1,
// arch: ['VFPv2', 'AdvSIMD'],
// base: Rn,
// cond: cond(31:28),
// d: D:Vd,
// defs: {Rn
// if wback
// else None},
// false: false,
// fields: [cond(31:28),
// P(24),
// U(23),
// D(22),
// W(21),
// Rn(19:16),
// Vd(15:12),
// imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// n: Rn,
// pattern: cccc110pudw0nnnndddd1011iiiiiiii,
// regs: imm8 / 2,
// rule: VSTM,
// safety: [P(24)=0 &&
// U(23)=0 &&
// W(21)=0 => DECODER_ERROR,
// P(24)=1 &&
// W(21)=0 => DECODER_ERROR,
// P ==
// U &&
// W(21)=1 => UNDEFINED,
// n ==
// Pc &&
// wback => UNPREDICTABLE,
// P(24)=1 &&
// U(23)=0 &&
// W(21)=1 &&
// Rn ==
// Sp => DECODER_ERROR,
// Rn ==
// Pc => FORBIDDEN_OPERANDS,
// regs ==
// 0 ||
// regs >
// 16 ||
// d + regs >
// 32 => UNPREDICTABLE,
// VFPSmallRegisterBank() &&
// d + regs >
// 16 => UNPREDICTABLE,
// imm8(0) ==
// 1 => DEPRECATED],
// single_regs: false,
// small_imm_base_wb: wback,
// uses: {Rn},
// violations: [implied by 'base'],
// wback: W(21)=1}
class VSTM_cccc110pudw0nnnndddd1011iiiiiiii_case_0
: public ClassDecoder {
public:
VSTM_cccc110pudw0nnnndddd1011iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual bool base_address_register_writeback_small_immediate(
Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSTM_cccc110pudw0nnnndddd1011iiiiiiii_case_0);
};
// VSTR_cccc1101ud00nnnndddd1010iiiiiiii_case_0:
//
// {D: D(22),
// Pc: 15,
// Rn: Rn(19:16),
// U: U(23),
// Vd: Vd(15:12),
// add: U(23)=1,
// arch: VFPv2,
// base: Rn,
// cond: cond(31:28),
// d: Vd:D,
// defs: {},
// fields: [cond(31:28), U(23), D(22), Rn(19:16), Vd(15:12), imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// n: Rn,
// pattern: cccc1101ud00nnnndddd1010iiiiiiii,
// rule: VSTR,
// safety: [n ==
// Pc => FORBIDDEN_OPERANDS],
// single_reg: true,
// true: true,
// uses: {Rn},
// violations: [implied by 'base']}
class VSTR_cccc1101ud00nnnndddd1010iiiiiiii_case_0
: public ClassDecoder {
public:
VSTR_cccc1101ud00nnnndddd1010iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSTR_cccc1101ud00nnnndddd1010iiiiiiii_case_0);
};
// VSTR_cccc1101ud00nnnndddd1011iiiiiiii_case_0:
//
// {D: D(22),
// Pc: 15,
// Rn: Rn(19:16),
// U: U(23),
// Vd: Vd(15:12),
// add: U(23)=1,
// arch: ['VFPv2', 'AdvSIMD'],
// base: Rn,
// cond: cond(31:28),
// d: D:Vd,
// defs: {},
// false: false,
// fields: [cond(31:28), U(23), D(22), Rn(19:16), Vd(15:12), imm8(7:0)],
// imm32: ZeroExtend(imm8:'00'(1:0), 32),
// imm8: imm8(7:0),
// n: Rn,
// pattern: cccc1101ud00nnnndddd1011iiiiiiii,
// rule: VSTR,
// safety: [n ==
// Pc => FORBIDDEN_OPERANDS],
// single_reg: false,
// uses: {Rn},
// violations: [implied by 'base']}
class VSTR_cccc1101ud00nnnndddd1011iiiiiiii_case_0
: public ClassDecoder {
public:
VSTR_cccc1101ud00nnnndddd1011iiiiiiii_case_0()
: ClassDecoder() {}
virtual Register base_address_register(Instruction i) const;
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
virtual ViolationSet get_violations(
const nacl_arm_val::DecodedInstruction& first,
const nacl_arm_val::DecodedInstruction& second,
const nacl_arm_val::SfiValidator& sfi,
nacl_arm_val::AddressSet* branches,
nacl_arm_val::AddressSet* critical,
uint32_t* next_inst_addr) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSTR_cccc1101ud00nnnndddd1011iiiiiiii_case_0);
};
// VSUBHN_111100101dssnnnndddd0110n0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(8),
// pattern: 111100101dssnnnndddd0110n0m0mmmm,
// rule: VSUBHN,
// safety: [size(21:20)=11 => DECODER_ERROR,
// Vn(0)=1 ||
// Vm(0)=1 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VSUBHN_111100101dssnnnndddd0110n0m0mmmm_case_0
: public ClassDecoder {
public:
VSUBHN_111100101dssnnnndddd0110n0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSUBHN_111100101dssnnnndddd0110n0m0mmmm_case_0);
};
// VSUBL_VSUBW_1111001u1dssnnnndddd001pn0m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(8),
// N(7),
// M(5),
// Vm(3:0)],
// is_w: op(8)=1,
// m: M:Vm,
// n: N:Vn,
// op: op(8),
// pattern: 1111001u1dssnnnndddd001pn0m0mmmm,
// rule: VSUBL_VSUBW,
// safety: [size(21:20)=11 => DECODER_ERROR,
// Vd(0)=1 ||
// (op(8)=1 &&
// Vn(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VSUBL_VSUBW_1111001u1dssnnnndddd001pn0m0mmmm_case_0
: public ClassDecoder {
public:
VSUBL_VSUBW_1111001u1dssnnnndddd001pn0m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSUBL_VSUBW_1111001u1dssnnnndddd001pn0m0mmmm_case_0);
};
// VSUB_floating_point_A1_111100100d1snnnndddd1101nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 2,
// esize: 32,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// op1_neg: size(1),
// pattern: 111100100d1snnnndddd1101nqm0mmmm,
// rule: VSUB_floating_point_A1,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(0)=1 => UNDEFINED],
// size: size(21:20),
// sz: size(0),
// uses: {}}
class VSUB_floating_point_A1_111100100d1snnnndddd1101nqm0mmmm_case_0
: public ClassDecoder {
public:
VSUB_floating_point_A1_111100100d1snnnndddd1101nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSUB_floating_point_A1_111100100d1snnnndddd1101nqm0mmmm_case_0);
};
// VSUB_floating_point_cccc11100d11nnnndddd101sn1m0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// advsimd: false,
// arch: VFPv2,
// cond: cond(31:28),
// d: D:Vd
// if dp_operation
// else Vd:D,
// defs: {},
// dp_operation: sz(8)=1,
// false: false,
// fields: [cond(31:28),
// D(22),
// Vn(19:16),
// Vd(15:12),
// sz(8),
// N(7),
// M(5),
// Vm(3:0)],
// m: M:Vm
// if dp_operation
// else Vm:M,
// n: N:Vn
// if dp_operation
// else Vn:N,
// pattern: cccc11100d11nnnndddd101sn1m0mmmm,
// rule: VSUB_floating_point,
// safety: [cond(31:28)=1111 => DECODER_ERROR],
// sz: sz(8),
// uses: {}}
class VSUB_floating_point_cccc11100d11nnnndddd101sn1m0mmmm_case_0
: public ClassDecoder {
public:
VSUB_floating_point_cccc11100d11nnnndddd101sn1m0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSUB_floating_point_cccc11100d11nnnndddd101sn1m0mmmm_case_0);
};
// VSUB_integer_111100110dssnnnndddd1000nqm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 111100110dssnnnndddd1000nqm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSUB_integer,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VSUB_integer_111100110dssnnnndddd1000nqm0mmmm_case_0
: public ClassDecoder {
public:
VSUB_integer_111100110dssnnnndddd1000nqm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSUB_integer_111100110dssnnnndddd1000nqm0mmmm_case_0);
};
// VSWP_111100111d11ss10dddd00000qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss10dddd00000qm0mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VSWP,
// safety: [d ==
// m => UNKNOWN,
// size(19:18)=~00 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VSWP_111100111d11ss10dddd00000qm0mmmm_case_0
: public ClassDecoder {
public:
VSWP_111100111d11ss10dddd00000qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VSWP_111100111d11ss10dddd00000qm0mmmm_case_0);
};
// VTBL_VTBX_111100111d11nnnndddd10ccnpm0mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// d: D:Vd,
// defs: {},
// fields: [D(22),
// Vn(19:16),
// Vd(15:12),
// len(9:8),
// N(7),
// op(6),
// M(5),
// Vm(3:0)],
// is_vtbl: op(6)=0,
// len: len(9:8),
// length: len + 1,
// m: M:Vm,
// n: N:Vn,
// op: op(6),
// pattern: 111100111d11nnnndddd10ccnpm0mmmm,
// rule: VTBL_VTBX,
// safety: [n + length >
// 32 => UNPREDICTABLE],
// uses: {}}
class VTBL_VTBX_111100111d11nnnndddd10ccnpm0mmmm_case_0
: public ClassDecoder {
public:
VTBL_VTBX_111100111d11nnnndddd10ccnpm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VTBL_VTBX_111100111d11nnnndddd10ccnpm0mmmm_case_0);
};
// VTRN_111100111d11ss10dddd00001qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss10dddd00001qm0mmmm,
// quadword_operation: Q(6)=1,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VTRN,
// safety: [d ==
// m => UNKNOWN,
// size(19:18)=11 => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VTRN_111100111d11ss10dddd00001qm0mmmm_case_0
: public ClassDecoder {
public:
VTRN_111100111d11ss10dddd00001qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VTRN_111100111d11ss10dddd00001qm0mmmm_case_0);
};
// VTST_111100100dssnnnndddd1000nqm1mmmm_case_0:
//
// {D: D(22),
// M: M(5),
// N: N(7),
// Q: Q(6),
// U: U(24),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// Vn: Vn(19:16),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [U(24),
// D(22),
// size(21:20),
// Vn(19:16),
// Vd(15:12),
// op(9),
// N(7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// n: N:Vn,
// op: op(9),
// pattern: 111100100dssnnnndddd1000nqm1mmmm,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VTST,
// safety: [Q(6)=1 &&
// (Vd(0)=1 ||
// Vn(0)=1 ||
// Vm(0)=1) => UNDEFINED,
// size(21:20)=11 => UNDEFINED],
// size: size(21:20),
// unsigned: U(24)=1,
// uses: {}}
class VTST_111100100dssnnnndddd1000nqm1mmmm_case_0
: public ClassDecoder {
public:
VTST_111100100dssnnnndddd1000nqm1mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VTST_111100100dssnnnndddd1000nqm1mmmm_case_0);
};
// VUZP_111100111d11ss10dddd00010qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss10dddd00010qm0mmmm,
// quadword_operation: Q(6)=1,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VUZP,
// safety: [d ==
// m => UNKNOWN,
// size(19:18)=11 ||
// (Q(6)=0 &&
// size(19:18)=10) => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VUZP_111100111d11ss10dddd00010qm0mmmm_case_0
: public ClassDecoder {
public:
VUZP_111100111d11ss10dddd00010qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VUZP_111100111d11ss10dddd00010qm0mmmm_case_0);
};
// VZIP_111100111d11ss10dddd00011qm0mmmm_case_0:
//
// {D: D(22),
// F: F(10),
// M: M(5),
// Q: Q(6),
// Vd: Vd(15:12),
// Vm: Vm(3:0),
// arch: ASIMD,
// d: D:Vd,
// defs: {},
// elements: 64 / esize,
// esize: 8 << size,
// fields: [D(22),
// size(19:18),
// Vd(15:12),
// F(10),
// op(8:7),
// Q(6),
// M(5),
// Vm(3:0)],
// m: M:Vm,
// op: op(8:7),
// pattern: 111100111d11ss10dddd00011qm0mmmm,
// quadword_operation: Q(6)=1,
// regs: 1
// if Q(6)=0
// else 2,
// rule: VZIP,
// safety: [d ==
// m => UNKNOWN,
// size(19:18)=11 ||
// (Q(6)=0 &&
// size(19:18)=10) => UNDEFINED,
// Q(6)=1 &&
// (Vd(0)=1 ||
// Vm(0)=1) => UNDEFINED],
// size: size(19:18),
// uses: {}}
class VZIP_111100111d11ss10dddd00011qm0mmmm_case_0
: public ClassDecoder {
public:
VZIP_111100111d11ss10dddd00011qm0mmmm_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
VZIP_111100111d11ss10dddd00011qm0mmmm_case_0);
};
// WFE_cccc0011001000001111000000000010_case_0:
//
// {arch: v6K,
// defs: {},
// pattern: cccc0011001000001111000000000010,
// rule: WFE,
// safety: [true => FORBIDDEN],
// true: true,
// uses: {}}
class WFE_cccc0011001000001111000000000010_case_0
: public ClassDecoder {
public:
WFE_cccc0011001000001111000000000010_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
WFE_cccc0011001000001111000000000010_case_0);
};
// WFI_cccc0011001000001111000000000011_case_0:
//
// {arch: v6K,
// defs: {},
// pattern: cccc0011001000001111000000000011,
// rule: WFI,
// safety: [true => FORBIDDEN],
// true: true,
// uses: {}}
class WFI_cccc0011001000001111000000000011_case_0
: public ClassDecoder {
public:
WFI_cccc0011001000001111000000000011_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
WFI_cccc0011001000001111000000000011_case_0);
};
// YIELD_cccc0011001000001111000000000001_case_0:
//
// {arch: v6K,
// defs: {},
// pattern: cccc0011001000001111000000000001,
// rule: YIELD,
// uses: {}}
class YIELD_cccc0011001000001111000000000001_case_0
: public ClassDecoder {
public:
YIELD_cccc0011001000001111000000000001_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
YIELD_cccc0011001000001111000000000001_case_0);
};
// extra_load_store_instructions_unpriviledged_cccc0000xx1xxxxxxxxxxxxx1xx1xxxx_case_0:
//
// {defs: {},
// pattern: cccc0000xx1xxxxxxxxxxxxx1xx1xxxx,
// rule: extra_load_store_instructions_unpriviledged,
// safety: [true => FORBIDDEN],
// true: true,
// uses: {}}
class extra_load_store_instructions_unpriviledged_cccc0000xx1xxxxxxxxxxxxx1xx1xxxx_case_0
: public ClassDecoder {
public:
extra_load_store_instructions_unpriviledged_cccc0000xx1xxxxxxxxxxxxx1xx1xxxx_case_0()
: ClassDecoder() {}
virtual RegisterList defs(Instruction inst) const;
virtual SafetyLevel safety(Instruction i) const;
virtual RegisterList uses(Instruction i) const;
private:
NACL_DISALLOW_COPY_AND_ASSIGN(
extra_load_store_instructions_unpriviledged_cccc0000xx1xxxxxxxxxxxxx1xx1xxxx_case_0);
};
} // namespace nacl_arm_test
#endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_GEN_ARM32_DECODE_BASELINES_3_H_
| [
"alexatnt@gmail.com"
] | alexatnt@gmail.com |
779c8612278076f85f7c9f5c6bff5638b25def9d | c6bddd88916e6c8697a9e02485bd22c58d76bcec | /GeneratedPlaceholders/Engine/PoseWatch.h | 35e62e9cc127a6fe266c38c2fd27035b78e8dd42 | [] | no_license | GIRU-GIRU/Mordhau-Unofficial-SDK | 18d13d62d746a838820e387907d13b0a37aed654 | f831d7355cf553b81fb6e82468b3abf68f7955aa | refs/heads/master | 2020-07-06T03:36:48.908227 | 2020-04-22T13:54:00 | 2020-04-22T13:54:00 | 202,872,898 | 7 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 321 | h | #pragma once
#include "CoreMinimal.h"
#include "PoseWatch.generated.h"
UCLASS()
class UPoseWatch : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(Replicated, EditAnywhere, BlueprintReadWrite)
class UEdGraphNode* Node;
UPROPERTY(Replicated, EditAnywhere, BlueprintReadWrite)
struct FColor PoseWatchColour;
}; | [
"45307738+crypdos@users.noreply.github.com"
] | 45307738+crypdos@users.noreply.github.com |
d2f628313461efe6cc269b06c029113732f30c09 | 1a4161fd6721e382c2f170b6dae2e15987ac52aa | /main.cpp | e99b3b9052f29b832b949172472620cf32ccdc00 | [] | no_license | sk28/ticTacToe | 943b01eaf0a13a7f60c45e511050e9f429984123 | 1da697e37e798f89d2c1429ad1ca6becba18e52c | refs/heads/master | 2021-01-02T08:31:18.769285 | 2017-08-01T15:38:58 | 2017-08-01T15:38:58 | 99,017,078 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 10,928 | cpp | //
// main.cpp
// ticTacToe
//
// Created by Sohan Bellam on 7/31/17.
// Copyright © 2017 Sohan Bellam. All rights reserved.
//
char value[9];
#include <iostream>
#include <stdlib.h>
using namespace std;
class board{
public:
void print(){
cout << endl << " " << value[0] << " " << value[1] << " " << value[2] << endl;
cout << " "<< endl;
cout << " " <<value[3] << " " << value[4] << " " << value[5] << endl;
cout << " "<< endl;
cout << " " <<value[6] << " " << value[7] << " " << value[8] << endl <<endl;
}
int check(){
int win = 0;
if ( value[0] == value[1] and value[1] == value[2]){
if (value[0] == 'X'){
win = 1;
} else {
win = 2;
}
}
if ( value[3] == value[4] and value[4] == value[5]){
if (value[3] == 'X'){
win = 1;
} else {
win = 2;
}
}
if ( value[6] == value[7] and value[7] == value[8]){
if (value[6] == 'X'){
win = 1;
} else {
win = 2;
}
}
if ( value[0] == value[3] and value[3] == value[6]){
if (value[0] == 'X'){
win = 1;
} else {
win = 2;
}
}
if ( value[1] == value[4] and value[4] == value[7]){
if (value[1] == 'X'){
win = 1;
} else {
win = 2;
}
}
if ( value[2] == value[5] and value[5] == value[8]){
if (value[2] == 'X'){
win = 1;
} else {
win = 2;
}
}
if ( value[0] == value[4] and value[4] == value[8]){
if (value[0] == 'X'){
win = 1;
} else {
win = 2;
}
}
if ( value[2] == value[4] and value[4] == value[6]){
if (value[2] == 'X'){
win = 1;
} else {
win = 2;
}
}
return win;
}
};
class player{
public:
int input(){
int stat = 1;
char number = '0';
while (stat == 1){
stat = 0;
cout << " Enter number: ";
cin >> number;
if(number < '0' or number > '9'){
cout << " That is a letter, not a number!. Please try again."<< endl;
stat = 1;
}
else if(number == '0'){
cout << " That number is not allowed. Please try again."<< endl;
stat = 1;
}
if(value[number-'1'] == 'X' or value[number-'1'] == 'O'){
cout<< " This number is already taken! Please try again." << endl;
stat = 1;
}
}
return number;
}
};
class ai{
public:
int input(int turn){
int number = 0;
if(turn == 0){
number = 4;
}
else if (turn == 1){
if (value[4] == 'X'){
number = 1;
} else if (value[1] == 'X' or value[3] == 'X' or value[5] == 'X' or value[7] == 'X'){
number = 5;
} else {
number = 5;
}
}
else if (number ==2){
if (value[5] == 'O' or value[7] == 'O'){
number = 8;
}
else{
number = 0;
}
}
else if (value[0] == value [1] and value[2] == '3'){
number = 3;
}
else if (value[0] == value [2] and value[1] == '2'){
number = 2;
}
else if (value[2] == value [1] and value[0] == '1'){
number = 1;
}
else if (value[3] == value [4] and value[5] == '6'){
number = 6;
}
else if (value[3] == value [5] and value[4] == '5'){
number = 5;
}
else if (value[4] == value [5] and value[3] == '4'){
number = 4;
}
else if (value[6] == value [7] and value[8] == '9'){
number = 9;
}
else if (value[6] == value [8] and value[7] == '8'){
number = 8;
}
else if (value[7] == value [8] and value[6] == '7'){
number = 7;
}
else if (value[0] == value [3] and value[6] == '7'){
number = 7;
}
else if (value[0] == value [6] and value[3] == '4'){
number = 4;
}
else if (value[3] == value [6] and value[0] == '1'){
number = 1;
}
else if (value[1] == value [4] and value[7] == '8'){
number = 8;
}
else if (value[1] == value [7] and value[3] == '5'){
number = 5;
}
else if (value[4] == value [7] and value[0] == '2'){
number = 2;
}
else if (value[2] == value [5] and value[8] == '9'){
number = 9;
}
else if (value[2] == value [8] and value[5] == '6'){
number = 6;
}
else if (value[5] == value [8] and value[2] == '3'){
number = 3;
}
else if (value[0] == value [4] and value[8] == '9'){
number = 9;
}
else if (value[0] == value [8] and value[4] == '5'){
number = 5;
}
else if (value[4] == value [8] and value[0] == '1'){
number = 1;
}
else if (value[2] == value [4] and value[6] == '7'){
number = 7;
}
else if (value[2] == value [6] and value[4] == '5'){
number = 5;
}
else if (value[4] == value [6] and value[2] == '3'){
number = 3;
}
else {
if((value[1] == 'X' or 'O') && (value[2] == 'X' or 'O') && (value[3] == 'X' or 'O') && (value[4] == 'X' or 'O') && (value[5] == 'X' or 'O') && (value[6] == 'X' or 'O') && (value[7] == 'X' or 'O') && (value[8] == 'X' or 'O')){
number = 100;
}
}
return number;
}
};
int main() {
int run = 0;
while(run == 0){
int mode;
cout << " For a two player game, please select 0. To play against the computer using AI, please select 1." << endl << " ";
cin >> mode;
string player1Name;
string player2Name;
if(mode == 0){
cout << " Please enter Player 1's Name: ";
cin>>player1Name;
cout << endl;
cout << " Please enter Player 2's Name: ";
cin>>player2Name;
cout << endl;
}
int turn = 0;
for (int i=0; i<9 ; i++){
value[i] = i+'1';
}
int number;
int win = 0;
board board;
player player1;
player player2;
ai ai;
board.print();
while (win == 0 and turn < 9){
cout << " Player's 1 turn!" << endl;
number = player1.input();
value[number - '1'] = 'X';
board.print();
win = board.check();
turn ++;
if(win == 0 and turn < 9){
if (mode ==0){
cout << " Player's 2 turn!" << endl;
number = player2.input();
value[number-'1'] = 'O';
board.print();
win = board.check();
} else {
number = ai.input(turn);
if(number == 10){
cout << " AI rage quitted!!" << endl;
win =1;
} else {
value[number-1] = 'O';
cout << " AI picked number " << number <<endl;
board.print();
win = board.check();
}
}
}
turn ++;
}
if(win == 1){
cout << " Player 1 wins!" << endl;
}
else if (win == 2){
cout << " Player 2 wins!" << endl;
}
else{
if(mode == 0){
cout << " It's a cat game. Please play again." << endl;
} else {
cout << " It's a cat game, the computer wins!" << endl;
}
}
cout << " If you would like to play again, please select 0. To end the program please type 1" << endl;
cin >> run;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
68242500cc764feb39c1f8755302d30d7cb078ad | 1f3106b1b846646f051a5ff60d3f01a9e8e23212 | /src/06_GoochShading/GoochShading.cpp | d6204ea72967297c68e344882f2c0cbce77ef403 | [
"Unlicense"
] | permissive | 3Dsamples/TheForgeExamples | 5f0205af9906e0bb50b3aedc6b14f08ed074075f | 1ba70666016f1b94fad4f00758664e9004fa202d | refs/heads/master | 2021-02-28T04:53:40.484072 | 2019-11-04T10:54:53 | 2019-11-04T10:54:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 23,601 | cpp | #include "../common.h"
#include "Common_3/OS/Interfaces/IProfiler.h"
#include "Middleware_3/UI/AppUI.h"
//EASTL includes
#include "Common_3/ThirdParty/OpenSource/EASTL/vector.h"
#include "Common_3/ThirdParty/OpenSource/EASTL/string.h"
//asimp importer
#include "Common_3/Tools/AssimpImporter/AssimpImporter.h"
#include "Common_3/OS/Interfaces/IMemory.h"
constexpr size_t gPointLights = 1;
constexpr size_t gMaxPointLights = 8;
static_assert(gPointLights <= gMaxPointLights, "");
const uint32_t gImageCount = 3;
uint32_t gNumModelPoints;
Renderer* pRenderer = NULL;
Queue* pGraphicsQueue = NULL;
CmdPool* pCmdPool = NULL;
Cmd** ppCmds = NULL;
Sampler* pSampler = NULL;
RasterizerState* pRastState = NULL;
RasterizerState* pSecondRastState = NULL;
DepthState* pDepthState = NULL;
RenderTarget* pDepthBuffer = NULL;
Fence* pRenderCompleteFences[gImageCount] = { NULL };
Semaphore* pRenderCompleteSemaphores[gImageCount] = { NULL };
Semaphore* pImageAquiredSemaphore = NULL;
SwapChain* pSwapChain = NULL;
Pipeline* pGraphicsPipeline = NULL;
RootSignature* pRootSignature = NULL;
Shader* pModelShader = NULL;
Texture* pTexture = NULL;
Texture* pSpecularTexture = NULL;
Pipeline* pModelPipeline = NULL;
Pipeline* pModelPipeline2 = NULL;
uint32_t gFrameIndex = 0;
DescriptorBinder* pDescriptorBinder = NULL;
bool gMicroProfiler = false;
bool bPrevToggleMicroProfiler = false;
UIApp gAppUI;
GuiComponent* pGui = NULL;
VirtualJoystickUI gVirtualJoystick;
GpuProfiler* pGpuProfiler = NULL;
ICameraController* pCameraController = NULL;
TextDrawDesc gFrameTimeDraw = TextDrawDesc(0, 0xff00ffff, 18);
Buffer* pUniformBuffers[gImageCount] = { NULL };
struct MeshBatch
{
Buffer* pPositionStream;
Buffer* pNormalStream;
Buffer* pUVStream;
Buffer* pIndicesStream;
size_t mCountIndices;
};
struct SceneData
{
eastl::vector<MeshBatch*> meshes;
} sceneData;
struct UniformBuffer
{
mat4 view;
mat4 proj;
mat4 pToWorld;
} uniformData;
struct PointLight
{
float3 position;
};
Buffer* pPointLightsBuffer = NULL;
PointLight pointLights[gPointLights];
struct LightBuffer
{
int numPointLights;
float3 viewPos;
} lightData;
Buffer* pLightBuffer = NULL;
const char* pTexturesFileNames[] =
{
"lion/lion_albedo",
"lion/lion_specular"
};
const char* pszBases[FSR_Count] = {
"../../../../src/06_GoochShading/", // FSR_BinShaders
"../../../../src/06_GoochShading/", // FSR_SrcShaders
"../../../../art/", // FSR_Textures
"../../../../art/", // FSR_Meshes
"../../../../../The-Forge/Examples_3/Unit_Tests/UnitTestResources/", // FSR_Builtin_Fonts
"../../../../../The-Forge/Examples_3/Unit_Tests/src/01_Transformations/", // FSR_GpuConfig
"", // FSR_Animation
"", // FSR_Audio
"", // FSR_OtherFiles
"../../../../../The-Forge/Middleware_3/Text/", // FSR_MIDDLEWARE_TEXT
"../../../../../The-Forge/Middleware_3/UI/", // FSR_MIDDLEWARE_UI
};
AssimpImporter::Model gModel;
class GoochShading : public IApp
{
public:
GoochShading()
{
}
bool Init()
{
// window and render setup
RendererDesc settings = { 0 };
initRenderer(GetName(), &settings, &pRenderer);
// check for init success
if (!pRenderer)
return false;
QueueDesc queueDesc = {};
queueDesc.mType = CMD_POOL_DIRECT;
queueDesc.mFlag = QUEUE_FLAG_NONE;
addQueue(pRenderer, &queueDesc, &pGraphicsQueue);
addCmdPool(pRenderer, pGraphicsQueue, false, &pCmdPool);
addCmd_n(pCmdPool, false, gImageCount, &ppCmds);
for (uint32_t i = 0; i < gImageCount; ++i)
{
addFence(pRenderer, &pRenderCompleteFences[i]);
addSemaphore(pRenderer, &pRenderCompleteSemaphores[i]);
}
addSemaphore(pRenderer, &pImageAquiredSemaphore);
// Resource Loading
initResourceLoaderInterface(pRenderer);
// Initialize profile
initProfiler(pRenderer);
addGpuProfiler(pRenderer, pGraphicsQueue, &pGpuProfiler, "GpuProfiler");
// Shader
ShaderLoadDesc cubeShaderDesc = {};
cubeShaderDesc.mStages[0] = { "basic.vert", NULL, 0, FSR_SrcShaders };
cubeShaderDesc.mStages[1] = { "basic.frag", NULL, 0, FSR_SrcShaders };
addShader(pRenderer, &cubeShaderDesc, &pModelShader);
// Sampler
SamplerDesc samplerDesc = { FILTER_LINEAR,
FILTER_LINEAR,
MIPMAP_MODE_NEAREST,
ADDRESS_MODE_CLAMP_TO_EDGE,
ADDRESS_MODE_CLAMP_TO_EDGE,
ADDRESS_MODE_CLAMP_TO_EDGE };
addSampler(pRenderer, &samplerDesc, &pSampler);
// Resource Binding
const char* pStaticSamplers[] = { "uSampler0" };
RootSignatureDesc rootDesc = {};
rootDesc.mShaderCount = 1;
rootDesc.ppShaders = &pModelShader;
rootDesc.mStaticSamplerCount = 1;
rootDesc.ppStaticSamplers = &pSampler;
rootDesc.ppStaticSamplerNames = pStaticSamplers;
addRootSignature(pRenderer, &rootDesc, &pRootSignature);
DescriptorBinderDesc descriptorBinderDescs[1] = { { pRootSignature } };
addDescriptorBinder(pRenderer, 0, 1, descriptorBinderDescs, &pDescriptorBinder);
BufferLoadDesc bufferDesc = {};
// Uniform Buffer
bufferDesc = {};
bufferDesc.mDesc.mDescriptors = DESCRIPTOR_TYPE_UNIFORM_BUFFER;
bufferDesc.mDesc.mMemoryUsage = RESOURCE_MEMORY_USAGE_CPU_TO_GPU;
bufferDesc.mDesc.mSize = sizeof(UniformBuffer);
bufferDesc.mDesc.mFlags = BUFFER_CREATION_FLAG_PERSISTENT_MAP_BIT;
bufferDesc.pData = NULL;
for (uint32_t i = 0; i < gImageCount; ++i)
{
bufferDesc.ppBuffer = &pUniformBuffers[i];
addResource(&bufferDesc);
}
CreateLightsBuffer();
if (!LoadModels())
{
finishResourceLoading();
return false;
}
// Rasterizer State
RasterizerStateDesc rasterizerStateDesc = {};
rasterizerStateDesc.mCullMode = CULL_MODE_FRONT;
addRasterizerState(pRenderer, &rasterizerStateDesc, &pRastState);
// Rasterizer State
rasterizerStateDesc.mCullMode = CULL_MODE_BACK;
addRasterizerState(pRenderer, &rasterizerStateDesc, &pSecondRastState);
// Depth State
DepthStateDesc depthStateDesc = {};
depthStateDesc.mDepthTest = true;
depthStateDesc.mDepthWrite = true;
depthStateDesc.mDepthFunc = CMP_LEQUAL;
addDepthState(pRenderer, &depthStateDesc, &pDepthState);
finishResourceLoading();
// GUI
if (!gAppUI.Init(pRenderer))
return false;
gAppUI.LoadFont("TitilliumText/TitilliumText-Bold.otf", FSR_Builtin_Fonts);
GuiDesc guiDesc = {};
float dpiScale = getDpiScale().x;
guiDesc.mStartSize = vec2(140.0f, 320.0f);
guiDesc.mStartPosition = vec2(mSettings.mWidth / dpiScale - guiDesc.mStartSize.getX() * 1.1f, guiDesc.mStartSize.getY() * 0.5f);
pGui = gAppUI.AddGuiComponent("Micro profiler", &guiDesc);
pGui->AddWidget(CheckboxWidget("Toggle Micro Profiler", &gMicroProfiler));
// Camera
CameraMotionParameters cmp{ 40.0f, 30.0f, 100.0f };
vec3 camPos{ 0.0f, 0.0f, 0.8f };
vec3 lookAt{ 0.0f, 0.0f, 5.0f };
pCameraController = createFpsCameraController(camPos, lookAt);
pCameraController->setMotionParameters(cmp);
if (!initInputSystem(pWindow))
return false;
// Microprofiler Actions
// #TODO: Remove this once the profiler UI is ported to use our UI system
InputActionDesc actionDesc = { InputBindings::FLOAT_LEFTSTICK, [](InputActionContext* ctx) { onProfilerButton(false, &ctx->mFloat2, true); return !gMicroProfiler; } };
addInputAction(&actionDesc);
actionDesc = { InputBindings::BUTTON_SOUTH, [](InputActionContext* ctx) { onProfilerButton(ctx->mBool, ctx->pPosition, false); return true; } };
addInputAction(&actionDesc);
// App Actions
actionDesc = { InputBindings::BUTTON_FULLSCREEN, [](InputActionContext* ctx) { toggleFullscreen(((IApp*)ctx->pUserData)->pWindow); return true; }, this };
addInputAction(&actionDesc);
actionDesc = { InputBindings::BUTTON_EXIT, [](InputActionContext* ctx) { requestShutdown(); return true; } };
addInputAction(&actionDesc);
actionDesc =
{
InputBindings::BUTTON_ANY, [](InputActionContext* ctx)
{
bool capture = gAppUI.OnButton(ctx->mBinding, ctx->mBool, ctx->pPosition, !gMicroProfiler);
setEnableCaptureInput(capture && INPUT_ACTION_PHASE_CANCELED != ctx->mPhase);
return true;
}, this
};
addInputAction(&actionDesc);
typedef bool (*CameraInputHandler)(InputActionContext * ctx, uint32_t index);
static CameraInputHandler onCameraInput = [](InputActionContext* ctx, uint32_t index)
{
if (!gMicroProfiler && !gAppUI.IsFocused() && *ctx->pCaptured)
{
gVirtualJoystick.OnMove(index, ctx->mPhase != INPUT_ACTION_PHASE_CANCELED, ctx->pPosition);
index ? pCameraController->onRotate(ctx->mFloat2) : pCameraController->onMove(ctx->mFloat2);
}
return true;
};
actionDesc = { InputBindings::FLOAT_RIGHTSTICK, [](InputActionContext* ctx) { return onCameraInput(ctx, 1); }, NULL, 20.0f, 200.0f, 0.5f };
addInputAction(&actionDesc);
actionDesc = { InputBindings::FLOAT_LEFTSTICK, [](InputActionContext* ctx) { return onCameraInput(ctx, 0); }, NULL, 20.0f, 200.0f, 1.0f };
addInputAction(&actionDesc);
actionDesc = { InputBindings::BUTTON_NORTH, [](InputActionContext* ctx) { pCameraController->resetView(); return true; } };
addInputAction(&actionDesc);
return true;
}
void Exit()
{
waitQueueIdle(pGraphicsQueue);
exitInputSystem();
destroyCameraController(pCameraController);
gVirtualJoystick.Exit();
gAppUI.Exit();
// Exit profile
exitProfiler();
for (uint32_t i = 0; i < gImageCount; ++i)
{
removeResource(pUniformBuffers[i]);
}
removeResource(pLightBuffer);
removeResource(pPointLightsBuffer);
removeResource(pTexture);
removeResource(pSpecularTexture);
for (size_t i = 0; i < sceneData.meshes.size(); ++i)
{
removeResource(sceneData.meshes[i]->pPositionStream);
removeResource(sceneData.meshes[i]->pUVStream);
removeResource(sceneData.meshes[i]->pNormalStream);
removeResource(sceneData.meshes[i]->pIndicesStream);
}
removeDescriptorBinder(pRenderer, pDescriptorBinder);
removeSampler(pRenderer, pSampler);
removeShader(pRenderer, pModelShader);
removeRootSignature(pRenderer, pRootSignature);
removeDepthState(pDepthState);
removeRasterizerState(pSecondRastState);
for (uint32_t i = 0; i < gImageCount; ++i)
{
removeFence(pRenderer, pRenderCompleteFences[i]);
removeSemaphore(pRenderer, pRenderCompleteSemaphores[i]);
}
removeSemaphore(pRenderer, pImageAquiredSemaphore);
removeCmd_n(pCmdPool, gImageCount, ppCmds);
removeCmdPool(pRenderer, pCmdPool);
removeResourceLoaderInterface(pRenderer);
removeQueue(pGraphicsQueue);
removeRenderer(pRenderer);
}
bool Load()
{
if (!addSwapChain())
return false;
if (!addDepthBuffer())
return false;
if (!gAppUI.Load(pSwapChain->ppSwapchainRenderTargets))
return false;
if (!gVirtualJoystick.Load(pSwapChain->ppSwapchainRenderTargets[0]))
return false;
loadProfiler(pSwapChain->ppSwapchainRenderTargets[0]);
//layout and pipeline for sphere draw
VertexLayout vertexLayout = {};
vertexLayout.mAttribCount = 3;
vertexLayout.mAttribs[0].mSemantic = SEMANTIC_POSITION;
vertexLayout.mAttribs[0].mFormat = ImageFormat::RGB32F;
vertexLayout.mAttribs[0].mBinding = 0;
vertexLayout.mAttribs[0].mLocation = 0;
vertexLayout.mAttribs[0].mOffset = 0;
vertexLayout.mAttribs[1].mSemantic = SEMANTIC_NORMAL;
vertexLayout.mAttribs[1].mFormat = ImageFormat::RGB32F;
vertexLayout.mAttribs[1].mBinding = 1;
vertexLayout.mAttribs[1].mLocation = 1;
vertexLayout.mAttribs[1].mOffset = 0;
vertexLayout.mAttribs[2].mSemantic = SEMANTIC_TEXCOORD0;
vertexLayout.mAttribs[2].mFormat = ImageFormat::RG32F;
vertexLayout.mAttribs[2].mBinding = 2;
vertexLayout.mAttribs[2].mLocation = 2;
vertexLayout.mAttribs[2].mOffset = 0;
PipelineDesc desc = {};
desc.mType = PIPELINE_TYPE_GRAPHICS;
GraphicsPipelineDesc& pipelineSettings = desc.mGraphicsDesc;
pipelineSettings.mPrimitiveTopo = PRIMITIVE_TOPO_TRI_LIST;
pipelineSettings.mRenderTargetCount = 1;
pipelineSettings.pDepthState = pDepthState;
pipelineSettings.pColorFormats = &pSwapChain->ppSwapchainRenderTargets[0]->mDesc.mFormat;
pipelineSettings.pSrgbValues = &pSwapChain->ppSwapchainRenderTargets[0]->mDesc.mSrgb;
pipelineSettings.mSampleCount = pSwapChain->ppSwapchainRenderTargets[0]->mDesc.mSampleCount;
pipelineSettings.mSampleQuality = pSwapChain->ppSwapchainRenderTargets[0]->mDesc.mSampleQuality;
pipelineSettings.mDepthStencilFormat = pDepthBuffer->mDesc.mFormat;
pipelineSettings.pRootSignature = pRootSignature;
pipelineSettings.pShaderProgram = pModelShader;
pipelineSettings.pVertexLayout = &vertexLayout;
pipelineSettings.pRasterizerState = pRastState;
addPipeline(pRenderer, &desc, &pModelPipeline);
pipelineSettings.pRasterizerState = pSecondRastState;
addPipeline(pRenderer, &desc, &pModelPipeline2);
return true;
}
void Unload()
{
waitQueueIdle(pGraphicsQueue);
unloadProfiler();
gAppUI.Unload();
gVirtualJoystick.Unload();
removePipeline(pRenderer, pModelPipeline);
removeSwapChain(pRenderer, pSwapChain);
removeRenderTarget(pRenderer, pDepthBuffer);
}
void Update(float deltaTime)
{
updateInputSystem(mSettings.mWidth, mSettings.mHeight);
pCameraController->update(deltaTime);
static float currentTime;
currentTime += deltaTime;
// update camera with time
mat4 viewMat = pCameraController->getViewMatrix();
const float aspectInverse = (float)mSettings.mHeight / (float)mSettings.mWidth;
const float horizontal_fov = PI / 2.0f;
mat4 projMat = mat4::perspective(horizontal_fov, aspectInverse, 0.1f, 1000.0f);
uniformData.view = viewMat;
uniformData.proj = projMat;
// Update Instance Data
uniformData.pToWorld = mat4::translation(Vector3(0.0f, -1, 5)) *
mat4::rotationY(currentTime) *
mat4::scale(Vector3(1.5f));
pointLights[0].position = float3{ 3.0f, 3.0f, 3.0f };
lightData.numPointLights = gPointLights;
lightData.viewPos = v3ToF3(pCameraController->getViewPosition());
viewMat.setTranslation(vec3(0));
// ProfileSetDisplayMode()
// TODO: need to change this better way
if (gMicroProfiler != bPrevToggleMicroProfiler)
{
Profile& S = *ProfileGet();
int nValue = gMicroProfiler ? 1 : 0;
nValue = nValue >= 0 && nValue < P_DRAW_SIZE ? nValue : S.nDisplay;
S.nDisplay = nValue;
bPrevToggleMicroProfiler = gMicroProfiler;
}
/************************************************************************/
// Update GUI
/************************************************************************/
gAppUI.Update(deltaTime);
}
void Draw()
{
acquireNextImage(pRenderer, pSwapChain, pImageAquiredSemaphore, NULL, &gFrameIndex);
RenderTarget* pRenderTarget = pSwapChain->ppSwapchainRenderTargets[gFrameIndex];
Semaphore* pRenderCompleteSemaphore = pRenderCompleteSemaphores[gFrameIndex];
Fence* pRenderCompleteFence = pRenderCompleteFences[gFrameIndex];
FenceStatus fenceStatus;
getFenceStatus(pRenderer, pRenderCompleteFence, &fenceStatus);
if (fenceStatus == FENCE_STATUS_INCOMPLETE)
waitForFences(pRenderer, 1, &pRenderCompleteFence);
// Update uniform buffers
BufferUpdateDesc viewProjCbv = { pUniformBuffers[gFrameIndex], &uniformData };
updateResource(&viewProjCbv);
// Update light uniform buffers
BufferUpdateDesc lightBuffUpdate = { pLightBuffer, &lightData };
updateResource(&lightBuffUpdate);
BufferUpdateDesc pointLightBuffUpdate = { pPointLightsBuffer, &pointLights };
updateResource(&pointLightBuffUpdate);
// Load Actions
LoadActionsDesc loadActions = {};
loadActions.mLoadActionsColor[0] = LOAD_ACTION_CLEAR;
loadActions.mClearColorValues[0].r = 0.0f;
loadActions.mClearColorValues[0].g = 0.0f;
loadActions.mClearColorValues[0].b = 0.0f;
loadActions.mClearColorValues[0].a = 0.0f;
loadActions.mLoadActionDepth = LOAD_ACTION_CLEAR;
loadActions.mClearDepth.depth = 1.0f;
loadActions.mClearDepth.stencil = 0;
Cmd* cmd = ppCmds[gFrameIndex];
beginCmd(cmd);
cmdBeginGpuFrameProfile(cmd, pGpuProfiler);
TextureBarrier textureBarriers[2] = {
{ pRenderTarget->pTexture, RESOURCE_STATE_RENDER_TARGET },
{ pDepthBuffer->pTexture, RESOURCE_STATE_DEPTH_WRITE }
};
cmdResourceBarrier(cmd, 0, nullptr, 2, textureBarriers, false);
cmdBindRenderTargets(cmd, 1, &pRenderTarget, pDepthBuffer, &loadActions, NULL, NULL, -1, -1);
cmdSetViewport(cmd, 0.0f, 0.0f, (float)pRenderTarget->mDesc.mWidth, (float)pRenderTarget->mDesc.mHeight, 0.0f, 1.0f);
cmdSetScissor(cmd, 0, 0, pRenderTarget->mDesc.mWidth, pRenderTarget->mDesc.mHeight);
cmdBeginGpuTimestampQuery(cmd, pGpuProfiler, "Draw Model", true);
{
DescriptorData params[3] = {};
params[0].pName = "UniformData";
params[0].ppBuffers = &pUniformBuffers[gFrameIndex];
params[1].pName = "LightData";
params[1].ppBuffers = &pLightBuffer;
params[2].pName = "PointLights";
params[2].ppBuffers = &pPointLightsBuffer;
cmdBindPipeline(cmd, pModelPipeline);
{
cmdBindDescriptors(cmd, pDescriptorBinder, pRootSignature, 3, params);
Buffer* pVertexBuffers[] = { sceneData.meshes[0]->pPositionStream, sceneData.meshes[0]->pNormalStream, sceneData.meshes[0]->pUVStream };
cmdBindVertexBuffer(cmd, 3, pVertexBuffers, NULL);
cmdBindIndexBuffer(cmd, sceneData.meshes[0]->pIndicesStream, 0);
cmdDrawIndexed(cmd, sceneData.meshes[0]->mCountIndices, 0, 0);
}
}
cmdEndGpuTimestampQuery(cmd, pGpuProfiler);
loadActions = {};
loadActions.mLoadActionsColor[0] = LOAD_ACTION_LOAD;
cmdBindRenderTargets(cmd, 1, &pRenderTarget, NULL, &loadActions, NULL, NULL, -1, -1);
cmdBeginGpuTimestampQuery(cmd, pGpuProfiler, "Draw UI", true);
{
static HiresTimer gTimer;
gTimer.GetUSec(true);
gVirtualJoystick.Draw(cmd, { 1.0f, 1.0f, 1.0f, 1.0f });
gAppUI.DrawText(cmd, float2(8, 15), eastl::string().sprintf("CPU %f ms", gTimer.GetUSecAverage() / 1000.0f).c_str(), &gFrameTimeDraw);
#if !defined(__ANDROID__)
gAppUI.DrawText(
cmd, float2(8, 40), eastl::string().sprintf("GPU %f ms", (float)pGpuProfiler->mCumulativeTime * 1000.0f).c_str(),
&gFrameTimeDraw);
gAppUI.DrawDebugGpuProfile(cmd, float2(8, 65), pGpuProfiler, NULL);
#endif
gAppUI.Gui(pGui);
cmdDrawProfiler(cmd);
gAppUI.Draw(cmd);
cmdBindRenderTargets(cmd, 0, NULL, NULL, NULL, NULL, NULL, -1, -1);
}
cmdEndGpuTimestampQuery(cmd, pGpuProfiler);
textureBarriers[0] = { pRenderTarget->pTexture, RESOURCE_STATE_PRESENT };
cmdResourceBarrier(cmd, 0, NULL, 1, textureBarriers, true);
cmdEndGpuFrameProfile(cmd, pGpuProfiler);
endCmd(cmd);
queueSubmit(pGraphicsQueue, 1, &cmd, pRenderCompleteFence, 1, &pImageAquiredSemaphore, 1, &pRenderCompleteSemaphore);
queuePresent(pGraphicsQueue, pSwapChain, gFrameIndex, 1, &pRenderCompleteSemaphore);
flipProfiler();
}
bool addSwapChain()
{
SwapChainDesc swapChainDesc = {};
swapChainDesc.mWindowHandle = pWindow->handle;
swapChainDesc.mPresentQueueCount = 1;
swapChainDesc.ppPresentQueues = &pGraphicsQueue;
swapChainDesc.mImageCount = gImageCount;
swapChainDesc.mSampleCount = SAMPLE_COUNT_1;
swapChainDesc.mEnableVsync = true;
swapChainDesc.mWidth = mSettings.mWidth;
swapChainDesc.mHeight = mSettings.mHeight;
swapChainDesc.mColorFormat = getRecommendedSwapchainFormat(true);
::addSwapChain(pRenderer, &swapChainDesc, &pSwapChain);
return pSwapChain != NULL;
}
bool addDepthBuffer()
{
RenderTargetDesc depthRT = {};
depthRT.mArraySize = 1;
depthRT.mClearValue.depth = 1.0f;
depthRT.mClearValue.stencil = 0.0f;
depthRT.mFormat = ImageFormat::D32F;
depthRT.mDepth = 1;
depthRT.mWidth = mSettings.mWidth;
depthRT.mHeight = mSettings.mHeight;
depthRT.mSampleCount = SAMPLE_COUNT_1;
depthRT.mSampleQuality = 0;
::addRenderTarget(pRenderer, &depthRT, &pDepthBuffer);
return pDepthBuffer != NULL;
}
const char* GetName() { return "06_GoochShading"; }
void RecenterCameraView(float maxDistance, vec3 lookAt = vec3(0))
{
vec3 p = pCameraController->getViewPosition();
vec3 d = p - lookAt;
float lenSqr = lengthSqr(d);
if (lenSqr > (maxDistance * maxDistance))
{
d *= (maxDistance / sqrtf(lenSqr));
}
p = d + lookAt;
pCameraController->moveTo(p);
pCameraController->lookAt(lookAt);
}
void CreateLightsBuffer()
{
BufferLoadDesc bufferDesc = {};
// Light Uniform Buffer
bufferDesc = {};
bufferDesc.mDesc.mDescriptors = DESCRIPTOR_TYPE_UNIFORM_BUFFER;
bufferDesc.mDesc.mMemoryUsage = RESOURCE_MEMORY_USAGE_CPU_TO_GPU;
bufferDesc.mDesc.mSize = sizeof(LightBuffer);
bufferDesc.mDesc.mFlags = BUFFER_CREATION_FLAG_PERSISTENT_MAP_BIT;
bufferDesc.pData = NULL;
bufferDesc.ppBuffer = &pLightBuffer;
addResource(&bufferDesc);
// PointLights Structured Buffer
bufferDesc = {};
bufferDesc.mDesc.mDescriptors = DESCRIPTOR_TYPE_BUFFER;
bufferDesc.mDesc.mMemoryUsage = RESOURCE_MEMORY_USAGE_CPU_TO_GPU;
bufferDesc.mDesc.mFlags = BUFFER_CREATION_FLAG_NONE;
bufferDesc.mDesc.mFirstElement = 0;
bufferDesc.mDesc.mElementCount = gPointLights;
bufferDesc.mDesc.mStructStride = sizeof(PointLight);
bufferDesc.mDesc.mSize = bufferDesc.mDesc.mStructStride * bufferDesc.mDesc.mElementCount;
bufferDesc.pData = NULL;
bufferDesc.ppBuffer = &pPointLightsBuffer;
addResource(&bufferDesc);
}
bool LoadModels()
{
// Main Texture
TextureLoadDesc textureDesc = {};
textureDesc.mRoot = FSR_Textures;
textureDesc.pFilename = pTexturesFileNames[0];
textureDesc.ppTexture = &pTexture;
addResource(&textureDesc, true);
// Specular Texture
textureDesc.pFilename = pTexturesFileNames[1];
textureDesc.ppTexture = &pSpecularTexture;
addResource(&textureDesc, true);
AssimpImporter importer;
if (!importer.ImportModel("../../../../art/Meshes/bunny.obj", &gModel))
{
return false;
}
size_t meshSize = gModel.mMeshArray.size();
for (size_t i = 0; i < meshSize; ++i)
{
AssimpImporter::Mesh subMesh = gModel.mMeshArray[i];
MeshBatch* pMeshBatch = (MeshBatch*)conf_placement_new<MeshBatch>(conf_calloc(1, sizeof(MeshBatch)));
sceneData.meshes.push_back(pMeshBatch);
// Vertex Buffer
BufferLoadDesc bufferDesc = {};
bufferDesc.mDesc.mDescriptors = DESCRIPTOR_TYPE_VERTEX_BUFFER;
bufferDesc.mDesc.mMemoryUsage = RESOURCE_MEMORY_USAGE_GPU_ONLY;
bufferDesc.mDesc.mVertexStride = sizeof(float3);
bufferDesc.mDesc.mSize = bufferDesc.mDesc.mVertexStride * subMesh.mPositions.size();
bufferDesc.pData = subMesh.mPositions.data();
bufferDesc.ppBuffer = &pMeshBatch->pPositionStream;
addResource(&bufferDesc);
bufferDesc.mDesc.mVertexStride = sizeof(float3);
bufferDesc.mDesc.mSize = subMesh.mNormals.size() * bufferDesc.mDesc.mVertexStride;
bufferDesc.pData = subMesh.mNormals.data();
bufferDesc.ppBuffer = &pMeshBatch->pNormalStream;
addResource(&bufferDesc);
bufferDesc.mDesc.mVertexStride = sizeof(float2);
bufferDesc.mDesc.mSize = subMesh.mUvs.size() * bufferDesc.mDesc.mVertexStride;
bufferDesc.pData = subMesh.mUvs.data();
bufferDesc.ppBuffer = &pMeshBatch->pUVStream;
addResource(&bufferDesc);
pMeshBatch->mCountIndices = subMesh.mIndices.size();
// Index buffer
bufferDesc = {};
bufferDesc.mDesc.mDescriptors = DESCRIPTOR_TYPE_INDEX_BUFFER;
bufferDesc.mDesc.mMemoryUsage = RESOURCE_MEMORY_USAGE_GPU_ONLY;
bufferDesc.mDesc.mIndexType = INDEX_TYPE_UINT32;
bufferDesc.mDesc.mSize = sizeof(uint) * (uint)subMesh.mIndices.size();
bufferDesc.pData = subMesh.mIndices.data();
bufferDesc.ppBuffer = &pMeshBatch->pIndicesStream;
addResource(&bufferDesc);
}
return true;
}
};
DEFINE_APPLICATION_MAIN(GoochShading) | [
"ahmadierfan99@gmail.com"
] | ahmadierfan99@gmail.com |
bf22bdb8d0669c0a325aecbf70d2ba75f9ecf299 | 6d269401c81dfc969c023e34dbac98997659e48a | /src/benchmarks/RacyBackgroundExample.cc | 061e6f239d52544113c14c3e5034710b5e4f3b70 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | hassansalehe/TaskSanitizer | eea83728f78c8073209521c162d01848821d493d | a3d3b441dc1a46eea2f8f39976dbd7bd68570aa8 | refs/heads/master | 2022-05-02T21:52:59.244635 | 2021-07-10T22:04:56 | 2021-07-10T22:04:56 | 133,125,679 | 7 | 3 | NOASSERTION | 2021-07-10T22:04:56 | 2018-05-12T07:53:43 | C++ | UTF-8 | C++ | false | false | 845 | cc | ///////////////////////////////////////////////////////////////////////
//
// (c) 2015 - 2021 Hassan Salehe Matar
//
// Description:
//
// This app creates two concurrent tasks with critical sections each.
//
// Determinacy races:
// - There is a determinacy race between the two concurrent
// tasks because they can execute in any order and thus final
// result of "i" can be 1 or 2
//
//////////////////////////////////////////////////////////////////////
#include <stdio.h>
#if !defined(NTHREADS)
#define NTHREADS 2
#endif
int main() {
int i=0;
#pragma omp parallel num_threads(NTHREADS)
#pragma omp single
{
#pragma omp task shared(i)
#pragma omp critical(lock_i)
{ i = 1; }
#pragma omp task shared(i)
#pragma omp critical(lock_i)
{ i = 2; }
}
printf ("i=%d\n",i);
return 0;
}
| [
"hassansalehe@gmail.com"
] | hassansalehe@gmail.com |
3fb710d82978b6bc404f17ad1fde4042631bc439 | 4c78dcdcd619565f571fa8fbff88bd92010abe4d | /ncadtoollib/include/ncadtoollib/NGLogBase.h | c575709f7a460c3ef70e58168fda6c03312e261c | [
"MIT"
] | permissive | exyorha/ncadtools | 4f5f32bffa6e95be368e72b1cb0c82349b375d48 | 3d5f9c53c66c2c5c00765f1df07bd968f89a2621 | refs/heads/main | 2023-06-05T01:38:27.426254 | 2021-06-24T09:56:37 | 2021-06-24T09:56:37 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 375 | h | #ifndef NCADTOOLIB_NGLOGBASE_H
#define NCADTOOLIB_NGLOGBASE_H
#include <ncadtoollib/NGBaseBlock.h>
namespace ncadtoollib {
class NGStream;
class NGLogBase : public NGBaseBlock {
public:
uint32_t unknown3_1;
uint8_t unknown3_2;
};
NGStream& operator <<(NGStream& stream, const NGLogBase& obj);
NGStream& operator >>(NGStream& stream, NGLogBase& obj);
}
#endif
| [
"moontouched@moontouched.me"
] | moontouched@moontouched.me |
4dccb53507e0f0d1cf96c823cf9be53477da2171 | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/CMake/CMake-gumtree/Kitware_CMake_repos_basic_block_block_13595.cpp | 905c590b0acca5ca7218db92128c54d611552573 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 41 | cpp | {
free(zip->erd);
zip->erd = NULL;
} | [
"993273596@qq.com"
] | 993273596@qq.com |
6595d1366083410de5966647f5ee7720ecad3fb7 | 00d69e58470663deef5d9541093ed6af9ad01526 | /Team19/Code19/extensions/spa/src/PQL/AffectsTEvaluator.h | ae75623610659baa2472a55394c95c0f7f5d6b3f | [] | no_license | zixinn/20s2-cp-spa-team-19 | ea4b801d61b8f278a5e1d02f8560cf2487e67a8b | c673145ad68f49f9dd22fd17bbc0315eac5f6b41 | refs/heads/master | 2023-05-08T08:31:09.211600 | 2021-04-16T02:56:02 | 2021-04-16T02:56:02 | 372,253,453 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 599 | h | #pragma once
#include "QueryUtility.h"
// Helper class to evaluate such that clauses with Affects* relationship
class AffectsTEvaluator {
public:
// Constructor for AffectsTEvaluator
AffectsTEvaluator();
// Evaluates the clause and stores the results in the unordered map tempResults
// Returns true if the clause can be satisfied and false otherwise
static bool evaluate(unordered_map<STRING, STRING> declarations, Clause clause,
unordered_map<STRING, vector<int>>& tempResults);
// Destructor for AffectsTEvaluator
~AffectsTEvaluator();
};
| [
"voongyuxuan@gmail.com"
] | voongyuxuan@gmail.com |
67b9f249fa85b38f88a0d3f0a7db6e438e8361cf | a1b858bd2eb2b464f500ab94242cb2ad39333b92 | /SP4/Base/Source/SkyBox/SkyBoxEntity.cpp | 29e2ad0ca9a09caf0428d53940f58638d934df2e | [] | no_license | SP4-SureA/SureALa | eb26133f1dcc54e8db640a4e7239f6b80b4c3e03 | d5a1787ad851ae8be8cf990b7b70c558d8a6ec8f | refs/heads/master | 2021-01-13T01:08:47.738130 | 2017-03-02T12:03:35 | 2017-03-02T12:03:35 | 81,785,597 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,919 | cpp | #include "SkyBoxEntity.h"
#include "MeshBuilder.h"
#include "GraphicsManager.h"
#include "RenderHelper.h"
#include "EntityManager.h"
SkyBoxEntity::SkyBoxEntity(void)
: size(3000.0f, 3000.0f, 3000.0f)
, m_bBoundaryDefined(false)
, seamlessOffset(0.1f)
{
}
SkyBoxEntity::~SkyBoxEntity()
{
}
void SkyBoxEntity::Update(double _dt)
{
// Does nothing here, can inherit & override or create your own version of this class :D
}
void SkyBoxEntity::Render()
{
MS& modelStack = GraphicsManager::GetInstance()->GetModelStack();
modelStack.PushMatrix();
// Front
modelStack.PushMatrix();
modelStack.Translate(0, 0, -size.z / 2 + seamlessOffset);
modelStack.Scale(size.x, size.y, size.z);
RenderHelper::RenderMesh(modelMesh[FRONT]);
modelStack.PopMatrix();
// Back
modelStack.PushMatrix();
modelStack.Rotate(180, 0, 1, 0);
modelStack.Translate(0, 0, -size.z / 2 + seamlessOffset);
modelStack.Scale(size.x, size.y, size.z);
RenderHelper::RenderMesh(modelMesh[BACK]);
modelStack.PopMatrix();
// Left
modelStack.PushMatrix();
modelStack.Rotate(-90, 0, 1, 0);
modelStack.Translate(0, 0, -size.z / 2 + seamlessOffset);
modelStack.Scale(size.x, size.y, size.z);
RenderHelper::RenderMesh(modelMesh[LEFT]);
modelStack.PopMatrix();
// Right
modelStack.PushMatrix();
modelStack.Rotate(90, 0, 1, 0);
modelStack.Translate(0, 0, -size.z / 2 + seamlessOffset);
modelStack.Scale(size.x, size.y, size.z);
RenderHelper::RenderMesh(modelMesh[RIGHT]);
modelStack.PopMatrix();
// Top
modelStack.PushMatrix();
modelStack.Rotate(90, 1, 0, 0);
modelStack.Translate(0, 0, -size.z / 2 + seamlessOffset);
modelStack.Rotate(-90, 0, 0, 1);
modelStack.Scale(size.x, size.y, size.z);
RenderHelper::RenderMesh(modelMesh[TOP]);
modelStack.PopMatrix();
// Bottom
modelStack.PushMatrix();
modelStack.Rotate(-90, 1, 0, 0);
modelStack.Translate(0, 0, -size.z / 2 + seamlessOffset);
modelStack.Rotate(90, 0, 0, 1);
modelStack.Scale(size.x, size.y, size.z);
RenderHelper::RenderMesh(modelMesh[BOTTOM]);
modelStack.PopMatrix();
modelStack.PopMatrix();
}
// Set a mesh to this class
void SkyBoxEntity::SetMesh(const int _side, Mesh* _modelMesh)
{
modelMesh[_side] = _modelMesh;
}
Vector3 SkyBoxEntity::GetBoundary(void)
{
if (!m_bBoundaryDefined)
{
boundary = Vector3( position.x - (size.x*scale.x) / 2.0f,
position.y - (size.y*scale.y) / 2.0f,
position.z - (size.z*scale.z) / 2.0f);
m_bBoundaryDefined = true;
}
return boundary;
};
SkyBoxEntity* Create::SkyBox(EntityManager* em,
const std::string& _meshName0,
const std::string& _meshName1,
const std::string& _meshName2,
const std::string& _meshName3,
const std::string& _meshName4,
const std::string& _meshName5)
{
if (em == NULL)
return NULL;
Mesh* modelMesh0 = MeshBuilder::GetInstance()->GetMesh(_meshName0);
if (modelMesh0 == nullptr)
return nullptr;
Mesh* modelMesh1 = MeshBuilder::GetInstance()->GetMesh(_meshName1);
if (modelMesh1 == nullptr)
return nullptr;
Mesh* modelMesh2 = MeshBuilder::GetInstance()->GetMesh(_meshName2);
if (modelMesh2 == nullptr)
return nullptr;
Mesh* modelMesh3 = MeshBuilder::GetInstance()->GetMesh(_meshName3);
if (modelMesh3 == nullptr)
return nullptr;
Mesh* modelMesh4 = MeshBuilder::GetInstance()->GetMesh(_meshName4);
if (modelMesh4 == nullptr)
return nullptr;
Mesh* modelMesh5 = MeshBuilder::GetInstance()->GetMesh(_meshName5);
if (modelMesh5 == nullptr)
return nullptr;
SkyBoxEntity* result = new SkyBoxEntity();
result->SetMesh(SkyBoxEntity::FRONT, modelMesh0);
result->SetMesh(SkyBoxEntity::BACK, modelMesh1);
result->SetMesh(SkyBoxEntity::LEFT, modelMesh2);
result->SetMesh(SkyBoxEntity::RIGHT, modelMesh3);
result->SetMesh(SkyBoxEntity::TOP, modelMesh4);
result->SetMesh(SkyBoxEntity::BOTTOM, modelMesh5);
em->AddEntity(result);
return result;
}
| [
"155134X@M313G404.sidm.student.local"
] | 155134X@M313G404.sidm.student.local |
63f61af49c70de027bef284c9983e634da18d0f5 | d736e3fb7fad485f12dd41232a10481409ad25ea | /socket/src/SocketException.h | 4bff31b650adace9f56288312f7510735491a01b | [] | no_license | lihuaweishiyigehaoren/messageboard | eea7c3462b6a0918e318f50ce1eb90045a79bfa8 | bd83fcf9042cc52929404beb6611f82f8e789170 | refs/heads/master | 2020-04-28T03:09:56.609504 | 2019-03-19T12:57:33 | 2019-03-19T12:57:33 | 174,926,307 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 340 | h | #include <exception>
#include <string>
class SocketException : public std::exception {
public:
SocketException(int code, const std::string& message);
const char* what() const noexcept;
int GetCode() const;
const std::string& GetMessage() const;
private:
int _code;
std::string _message;
std::string _what;
}; | [
"1206909328@qq.com"
] | 1206909328@qq.com |
1592a0db3f40a434b211ddae73314883720f4252 | c2351146c711efcd94780ec9ba58206be607d0d0 | /build-Server-Desktop_Qt_5_10_1_MSVC2017_64bit-Debug/debug/moc_Mytcpserver.cpp | 6e92b175b0ef54ac7c559b09db0d709cae605682 | [] | no_license | needhourger/Qtchat | cf006bf10c9dcad42a3a112f8f0c0cfa14d30e50 | b285f1a7d7a761078fbb482fcfe88f85db4a0b69 | refs/heads/master | 2020-03-21T07:09:40.357162 | 2018-06-22T06:32:21 | 2018-06-22T06:32:21 | 138,264,080 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,571 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'Mytcpserver.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.10.1)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../../Server/Mytcpserver.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'Mytcpserver.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.10.1. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_Mytcpserver_t {
QByteArrayData data[7];
char stringdata0[103];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_Mytcpserver_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_Mytcpserver_t qt_meta_stringdata_Mytcpserver = {
{
QT_MOC_LITERAL(0, 0, 11), // "Mytcpserver"
QT_MOC_LITERAL(1, 12, 16), // "on_newConnection"
QT_MOC_LITERAL(2, 29, 0), // ""
QT_MOC_LITERAL(3, 30, 14), // "on_acceptError"
QT_MOC_LITERAL(4, 45, 28), // "QAbstractSocket::SocketError"
QT_MOC_LITERAL(5, 74, 12), // "on_readyRead"
QT_MOC_LITERAL(6, 87, 15) // "on_disconnected"
},
"Mytcpserver\0on_newConnection\0\0"
"on_acceptError\0QAbstractSocket::SocketError\0"
"on_readyRead\0on_disconnected"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_Mytcpserver[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 0, 34, 2, 0x0a /* Public */,
3, 1, 35, 2, 0x0a /* Public */,
5, 0, 38, 2, 0x0a /* Public */,
6, 0, 39, 2, 0x0a /* Public */,
// slots: parameters
QMetaType::Void,
QMetaType::Void, 0x80000000 | 4, 2,
QMetaType::Void,
QMetaType::Void,
0 // eod
};
void Mytcpserver::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Mytcpserver *_t = static_cast<Mytcpserver *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->on_newConnection(); break;
case 1: _t->on_acceptError((*reinterpret_cast< QAbstractSocket::SocketError(*)>(_a[1]))); break;
case 2: _t->on_readyRead(); break;
case 3: _t->on_disconnected(); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
switch (_id) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 1:
switch (*reinterpret_cast<int*>(_a[1])) {
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
case 0:
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QAbstractSocket::SocketError >(); break;
}
break;
}
}
}
QT_INIT_METAOBJECT const QMetaObject Mytcpserver::staticMetaObject = {
{ &QTcpServer::staticMetaObject, qt_meta_stringdata_Mytcpserver.data,
qt_meta_data_Mytcpserver, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *Mytcpserver::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *Mytcpserver::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_Mytcpserver.stringdata0))
return static_cast<void*>(this);
return QTcpServer::qt_metacast(_clname);
}
int Mytcpserver::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QTcpServer::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
}
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
| [
"841904608@qq.com"
] | 841904608@qq.com |
f879d94594368ed9fa435b190b6c2e94ca0385aa | 0087923e1008354aecc974043f0e102083f18398 | /foo_spider_monkey_panel/events/event.cpp | 706b17a65ff6c76baecb498605abf4e24eca83fd | [
"MIT",
"MS-PL",
"HPND",
"Unlicense",
"BSL-1.0"
] | permissive | MEOoms/foo_spider_monkey_panel | 59d67863d42bfdbdb24e9742a7ee92ae62391406 | 78c645ca23408351af7486f98d99595deb27b405 | refs/heads/master | 2023-08-02T16:33:48.059884 | 2021-09-25T13:26:14 | 2021-09-25T13:26:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 880 | cpp | #include <stdafx.h>
#include "event.h"
#include <panel/js_panel_window.h>
namespace smp
{
EventBase::EventBase( EventId id )
: id_( id )
{
}
std::unique_ptr<EventBase> EventBase::Clone()
{
return nullptr;
}
void EventBase::SetTarget( std::shared_ptr<PanelTarget> pTarget )
{
pTarget_ = pTarget;
}
EventId EventBase::GetId() const
{
return id_;
}
Event_Mouse* EventBase::AsMouseEvent()
{
return nullptr;
}
Event_Drag* EventBase::AsDragEvent()
{
return nullptr;
}
PanelTarget::PanelTarget( panel::js_panel_window& panel )
: pPanel_( &panel )
, hWnd_( panel.GetHWND() )
{
}
HWND PanelTarget::GetHwnd()
{
return hWnd_;
}
panel::js_panel_window* PanelTarget::GetPanel()
{
assert( core_api::is_main_thread() );
return pPanel_;
}
void PanelTarget::UnlinkPanel()
{
pPanel_ = nullptr;
hWnd_ = nullptr;
}
} // namespace smp
| [
"noreply@github.com"
] | noreply@github.com |
b267cb810a2206f81d4439afec8610dfd53ba81e | a7764174fb0351ea666faa9f3b5dfe304390a011 | /inc/Handle_IGESSolid_Ellipsoid.hxx | 84a011c4fd7cd98b35e3732834a6e3d009d4985c | [] | no_license | uel-dataexchange/Opencascade_uel | f7123943e9d8124f4fa67579e3cd3f85cfe52d91 | 06ec93d238d3e3ea2881ff44ba8c21cf870435cd | refs/heads/master | 2022-11-16T07:40:30.837854 | 2020-07-08T01:56:37 | 2020-07-08T01:56:37 | 276,290,778 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 825 | hxx | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _Handle_IGESSolid_Ellipsoid_HeaderFile
#define _Handle_IGESSolid_Ellipsoid_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_IGESData_IGESEntity_HeaderFile
#include <Handle_IGESData_IGESEntity.hxx>
#endif
class Standard_Transient;
class Handle(Standard_Type);
class Handle(IGESData_IGESEntity);
class IGESSolid_Ellipsoid;
DEFINE_STANDARD_HANDLE(IGESSolid_Ellipsoid,IGESData_IGESEntity)
#endif
| [
"shoka.sho2@excel.co.jp"
] | shoka.sho2@excel.co.jp |
85d81686d89381e9ec823831b3a4c6c480299ba6 | b6e60224e1046180a5ca57d315b10d7fa17318ed | /src/platform/symbian/IconConverter.cpp | 09239f45dcb0dbac7611ac5c21ac5da9a01aeb8c | [] | no_license | vivekgalatage/widgetmanager | 942a135de9cc5a384e4eab78a3d6255d20bcee3f | 0f497d0744d09c33d678b5cdd2b1cfa17d0935e1 | refs/heads/master | 2021-01-21T14:17:09.634378 | 2016-07-25T23:45:21 | 2016-07-25T23:45:21 | 58,015,718 | 0 | 0 | null | 2016-07-25T23:45:21 | 2016-05-04T02:10:41 | C++ | UTF-8 | C++ | false | false | 19,589 | cpp | //
// ============================================================================
// Name : IconConverter.cpp
// Part of : Wrt Widget Installer
//
// Description:
// Icon convert to convert icon for png to mbm format
//
// Version : WRT 1.0
//
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
//
// This file is part of Qt Web Runtime.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// version 2.1 as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
//
// INCLUDE FILES
#include <QString>
#include <fbs.h>
#include <ImageConversion.h>
#include <BitmapTransforms.h>
#include "IconConverter.h"
#include "WidgetUtilsLogs.h"
#include <QEventLoop>
#include <QDebug>
// CONSTANTS
_LIT( KTempPath,"c:\\system\\temp\\" );
const TInt KIconSizeLarge = 88;
const TInt KIconSizeMedium = 32;
const TInt KIconSizeSmall = 24;
// ============================================================================
// CIconConverter::NewL()
// two-phase constructor
//
// @since 3.1
// @param aController - controller for callback to notify the completion
// @param aFs - file session
// @return pointer to CIconConverter
// ============================================================================
//
CIconConverter* CIconConverter::NewL(QEventLoop* loop)
{
CIconConverter* self =
new(ELeave) CIconConverter( loop );
CleanupStack::PushL( self );
self->ConstructL();
CleanupStack::Pop( self );
return self;
}
// ============================================================================
// CIconConverter::CIconConverter()
// C++ default constructor
//
// @since 3.1
// ============================================================================
CIconConverter::CIconConverter( QEventLoop* loop ) :
CActive( EPriorityStandard )
, m_loop(loop)
{
CActiveScheduler::Add( this );
}
// ============================================================================
// CIconConverter::ConstructL()
// Symbian default constructor
//
// @since 3.1
// ============================================================================
void CIconConverter::ConstructL()
{
User::LeaveIfError( iFs.Connect() );
User::LeaveIfError( iFs.ShareProtected() );
User::LeaveIfError( RFbsSession::Connect() );
// create the destination bitmap
iOriginalBitmap = new ( ELeave ) CFbsBitmap;
iOriginalBitmapMask = new ( ELeave ) CFbsBitmap;
iTempBitmap = new ( ELeave ) CFbsBitmap;
iTempBitmapMask = new ( ELeave ) CFbsBitmap;
iTempPath = KTempPath().AllocL();
iIconSizes = new CArrayFixFlat<TSize>( 3 );
iIconSizes->InsertL( 0, TSize( KIconSizeLarge, KIconSizeLarge ) );
iIconSizes->InsertL( 1, TSize( KIconSizeMedium, KIconSizeMedium ) );
iIconSizes->InsertL( 2, TSize( KIconSizeSmall, KIconSizeSmall ) );
}
// ============================================================================
// CIconConverter::~CIconConverter()
// destructor
//
// @since 3.1
// ============================================================================
CIconConverter::~CIconConverter()
{
Cancel();
// CImageDecoder must be deleted first otherwise a related thread might panic
if ( iImageDecoder )
{
delete iImageDecoder;
}
if ( iOriginalBitmap )
{
delete iOriginalBitmap;
}
if ( iOriginalBitmapMask )
{
delete iOriginalBitmapMask;
}
if ( iOutputFileName )
{
delete iOutputFileName;
}
if ( iTempBitmap )
{
delete iTempBitmap;
}
if ( iTempBitmapMask )
{
delete iTempBitmapMask;
}
if ( iScaler )
{
delete iScaler;
}
if ( iTempPath )
{
delete iTempPath;
}
iIconFile.Close();
iIconPngFile.Close();
RFbsSession::Disconnect();
if ( iIconSizes )
{
iIconSizes->Reset();
delete iIconSizes;
}
iFs.Close();
}
bool CIconConverter::Convert(
const QString& aInputFileName,
const QString& aOutputFileName )
{
TPtrC16 inFile(reinterpret_cast<const TUint16*>(aInputFileName.constData()));
TPtrC16 outFile(reinterpret_cast<const TUint16*>(aOutputFileName.constData()));
TRAPD(err, StartToDecodeL(inFile,outFile));
if (err != KErrNone) {
return false;
}
return true;
}
// ============================================================================
// CIconConverter::StartToDecodeL
// use image decoder to decode the image
//
// @since 3.1
// ============================================================================
void CIconConverter::StartToDecodeL(
const TDesC& aInputFileName,
const TDesC& aOutputFileName )
{
iState = EConvertingFile;
delete iImageDecoder;
iImageDecoder = NULL;
delete iOutputFileName;
iOutputFileName = 0;
iOutputFileName = aOutputFileName.AllocL();
// create the decoder
iImageDecoder = CImageDecoder::FileNewL( iFs, aInputFileName );
LOG (" after CImageDecoder::FileNewL");
// Extract information about the image, now we've read the header
TFrameInfo info = iImageDecoder->FrameInfo( 0 );
LOG (" after CImageDecoder::FrameInfo");
iOriginalBitmap->Create( info.iOverallSizeInPixels, info.iFrameDisplayMode );
LOG (" after iOriginalBitmap->Create");
// If the PNG has a built in transparency, use it to build the mask
if ( info.iFlags & TFrameInfo::ETransparencyPossible )
{
// If we have a full alpha channel, use that
if ( info.iFlags & TFrameInfo::EAlphaChannel )
{
LOG (" bf iOriginalBitmap->Create 1");
User::LeaveIfError( iOriginalBitmapMask->Create(
info.iOverallSizeInPixels,
EGray256 ) );
}
else
{
LOG (" bf iOriginalBitmap->Create 2");
User::LeaveIfError( iOriginalBitmapMask->Create(
info.iOverallSizeInPixels,
EGray2 ) );
}
LOG (" bf iImageDecoder->Convert");
iImageDecoder->Convert(
&iStatus, *iOriginalBitmap, *iOriginalBitmapMask );
LOG (" af iImageDecoder->Convert 1");
}
else
{
iImageDecoder->Convert( &iStatus, *iOriginalBitmap );
LOG (" af iImageDecoder->Convert 1");
}
// start conversion to bitmap
SetActive();
LOG (" af SetActive()");
}
// ============================================================================
// CIconConverter::RunL()
// Handle various stages of icon conversion
//
// @since 3.1
// ============================================================================
void CIconConverter::RunL()
{
// If there is an error in the previous stage, then leave. Otherwise,
// call the handle function
LOG ("CIconConverter::RunL() status = " << iStatus.Int());
User::LeaveIfError( iStatus.Int() );
switch ( iState )
{
case EConvertingFile:
LOG (" bf DoProcessMaskL()");
DoProcessMaskL();
break;
case EScalingIcon:
LOG (" bf DoMaskScalingL()");
DoMaskScalingL();
break;
case EScalingMask:
case EFinalize:
LOG (" bf DoIconStoreL()");
DoIconStoreL();
break;
default:
LOG (" default");
User::Leave( KErrNotSupported );
break;
};
}
// ============================================================================
// CIconConverter::RunError()
// Notify client with error
//
// @since 3.1
// ============================================================================
TInt CIconConverter::RunError( TInt aError )
{
LOG ("CIconConverter::RunError() err = " << aError);
// If any error occurred, then complete the client with the error.
if ( iClientStatus )
{
User::RequestComplete( iClientStatus, aError );
}
// There is nothing more to do if notifyCompletion leaves.
if (m_loop->isRunning())
m_loop->exit();
return KErrNone;
}
// ============================================================================
// CIconConverter::DoCancel()
// cancel icon conversion
//
// @since 3.1
// ============================================================================
void CIconConverter::DoCancel()
{
LOG ("CIconConverter::DoCancel()");
switch (iState)
{
case EConvertingFile:
if ( iImageDecoder )
{
iImageDecoder->Cancel();
}
break;
case EScalingIcon:
case EScalingMask:
if ( iScaler )
{
iScaler->Cancel();
}
break;
};
if ( iClientStatus )
{
User::RequestComplete( iClientStatus, KErrCancel );
}
// no need to call notifyCompletion() because cancel can only be
// caused by the client
if (m_loop->isRunning())
m_loop->exit();
}
// ============================================================================
// CIconConverter::DoProcessMaskL()
// process the bitmap mask
//
// @since 3.1
// ============================================================================
void CIconConverter::DoProcessMaskL()
{
LOG ("CIconConverter::DoProcessMaskL()");
// we use white to mean transparent at this stage, simply for efficiency
// since all the canvases we will copy in to begin as white
if ( iOriginalBitmapMask->Handle() == 0 )
{
// Create a mask that shows the whole bitmap as an icon
// (all black)
User::LeaveIfError( iOriginalBitmapMask->Create(
iOriginalBitmap->SizeInPixels(), EGray2 ) );
CFbsBitmapDevice* device =
CFbsBitmapDevice::NewL( iOriginalBitmapMask );
CleanupStack::PushL( device );
CFbsBitGc* gc;
User::LeaveIfError( device->CreateContext( gc ) );
gc->SetBrushStyle( CGraphicsContext::ESolidBrush );
gc->SetDrawMode( CGraphicsContext::EDrawModePEN );
gc->SetBrushColor( KRgbBlack );
// Create a big black image
gc->Clear();
delete gc;
CleanupStack::PopAndDestroy( device );
}
else
{
// Invert the mask obtained from the PNG
CFbsBitmapDevice* device =
CFbsBitmapDevice::NewL( iOriginalBitmapMask );
CleanupStack::PushL(device);
CFbsBitGc* gc;
User::LeaveIfError( device->CreateContext( gc ) );
gc->SetDrawMode( CGraphicsContext::EDrawModeNOTSCREEN );
gc->Clear();
delete gc;
CleanupStack::PopAndDestroy( device );
}
LOG (" af iOriginalBitmapMask->Handle()");
// Scale the icon to the sizes required
iCurrentSizeIndex = 0;
DoIconScalingL();
LOG ("CIconConverter::DoProcessMaskL() ...Done");
}
// ============================================================================
// CIconConverter::DoIconScalingL()
// Scale the bitmap
//
// @since 3.1
// ============================================================================
void CIconConverter::DoIconScalingL()
{
LOG ("CIconConverter::DoIconScalingL()");
// free any current icons to prevent memory leaks
iTempBitmap->Reset();
LOG (" af iTempBitmap->Reset()");
// current target size
TSize size = iIconSizes->At( iCurrentSizeIndex );
LOG (" af iIconSizes->At()");
iState = EScalingIcon;
// Create a canvas to hold the scaled icon, of the same depth
User::LeaveIfError(
iTempBitmap->Create( size, iOriginalBitmap->DisplayMode() ) );
LOG (" af iOriginalBitmap->DisplayMode()");
DoScalingL( *iOriginalBitmap, *iTempBitmap );
}
// ============================================================================
// CIconConverter::DoMaskScalingL()
// Scale the bitmap mask
//
// @since 3.1
// ============================================================================
void CIconConverter::DoMaskScalingL()
{
LOG ("CIconConverter::DoMaskScalingL()");
// Reset the mask to prevent memory leaks
iTempBitmapMask->Reset();
// current target size
TSize size = iIconSizes->At( iCurrentSizeIndex );
iState = EScalingMask;
// Create a canvas to hold the scaled icon, of 8 bit colour depth
User::LeaveIfError( iTempBitmapMask->Create( size, EGray256 ) );
DoScalingL( *iOriginalBitmapMask, *iTempBitmapMask );
}
// ============================================================================
// CIconConverter::DoScalingL()
// Scale
//
// @since 3.1
// ============================================================================
void CIconConverter::DoScalingL(
CFbsBitmap& aBitmapSource, CFbsBitmap& aBitmapTarget )
{
LOG ("CIconConverter::DoScalingL()");
ScalerL().Scale( &iStatus, aBitmapSource, aBitmapTarget, ETrue );
LOG ("CIconConverter::DoScalingL() ...Done");
SetActive();
}
// ============================================================================
// CIconConverter::ScalerL()
// Create bitmap scalar
//
// @since 3.1
// ============================================================================
CBitmapScaler& CIconConverter::ScalerL()
{
LOG ("CIconConverter::ScalerL()");
if ( iScaler == NULL )
{
iScaler = CBitmapScaler::NewL();
LOG ("CBitmapScaler::NewL()");
// always use highest quality scaling
User::LeaveIfError( iScaler->SetQualityAlgorithm( CBitmapScaler::EMaximumQuality ) );
LOG ("SetQualityAlgorithm()");
}
LOG ("CIconConverter::ScalerL() ...Done");
return *iScaler;
}
// ============================================================================
// CIconConverter::DoIconStoreL()
// Store icon and mask files
//
// @since 3.1
// ============================================================================
void CIconConverter::DoIconStoreL()
{
LOG ("CIconConverter::DoIconStoreL()");
// Store the icon and its mask in temporary files until we are ready
// to create the final icon
// Icon is stored at index n, mask at index n+1
TInt iconIndex = iCurrentSizeIndex * 2;
TFileName iconFile = *iTempPath;
GetTempIconName( iconIndex++, iconFile );
LOG (" af GetTempIconName() 1");
TFileName maskFile = *iTempPath;
GetTempIconName( iconIndex, maskFile );
LOG (" af GetTempIconName() 2");
// invert the masks before saving
CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( iTempBitmapMask );
CleanupStack::PushL( device );
LOG (" af CFbsBitmapDevice::NewL()");
CFbsBitGc* gc;
User::LeaveIfError( device->CreateContext( gc ) );
gc->SetDrawMode( CGraphicsContext::EDrawModeNOTSCREEN );
gc->Clear();
LOG (" af device->CreateContext()");
delete gc;
CleanupStack::PopAndDestroy( device );
// save the bitmaps
User::LeaveIfError( iTempBitmap->Save( iconFile ) );
LOG (" af iTempBitmap->Save()");
User::LeaveIfError( iTempBitmapMask->Save( maskFile ) );
LOG (" af iTempBitmapMask->Save()");
if ( ++iCurrentSizeIndex < iIconSizes->Count() )
{
// do the next icon size
LOG (" bf DoIconScalingL()");
DoIconScalingL();
}
else
{
LOG (" bf DoCreateFinalIconL()");
DoCreateFinalIconL();
}
LOG ("CIconConverter::DoIconStoreL() ...Done");
}
// ============================================================================
// CIconConverter::DoCreateFinalIconL()
// Create the final icon
//
// @since 3.1
// ============================================================================
void CIconConverter::DoCreateFinalIconL()
{
LOG ("CIconConverter::DoCreateFinalIconL()");
TInt i, elements = 0;
// one icon, one mask per size
TInt bitmapCount = iIconSizes->Count() * 2;
LOG (" bitmapCount: " << bitmapCount);
TFileName** filenames = new ( ELeave ) TFileName*[bitmapCount];
CleanupStack::PushL( filenames );
TInt32* uniqueIds = new ( ELeave ) TInt32[bitmapCount];
CleanupStack::PushL( uniqueIds );
TInt err = KErrNone;
for ( i = 0; i < bitmapCount; ++i )
{
filenames[i] = NULL;
filenames[i] = new TFileName( *iTempPath );
elements = i;
if ( filenames[i] == NULL )
{
// we need to cleanup this structure
err = KErrNoMemory;
goto cleanup;
}
GetTempIconName( i, *filenames[i] );
uniqueIds[i] = 0;
}
TRAP( err, CFbsBitmap::StoreL(
*iOutputFileName, bitmapCount, ( const TDesC** )filenames, uniqueIds ) );
cleanup:
for ( i = 0; i <= elements; ++i )
{
if ( filenames[i] == NULL )
{
// if we failed to allocate a filename, then we would not have continued
break;
}
else
{
delete filenames[i];
}
}
CleanupStack::PopAndDestroy( 2, filenames );
// There is no recovery on a leave and we don't want to trigger
// RunError here since that will also call notifyCompletion.
if (m_loop->isRunning())
m_loop->exit();
LOG ("CIconConverter::DoCreateFinalIconL() ...Done err = " << err);
}
// ============================================================================
// CIconConverter::GetTempIconName()
// Get temporary icon name
//
// @since 3.1
// ============================================================================
void CIconConverter::GetTempIconName( const TInt& aIndex, TFileName& aIconName )
{
_LIT( KIcon, "ICON" );
_LIT( KBmp, ".MBM" );
aIconName.Append( KIcon );
aIconName.AppendNum( static_cast<TInt64>( aIndex ) );
aIconName.Append( KBmp );
}
IconConverterWrapper::IconConverterWrapper(QEventLoop *loop, QObject *parent)
: QObject(parent),
m_eventLoop(loop),
m_converter(0) {
}
IconConverterWrapper::~IconConverterWrapper() {
delete m_converter;
}
bool IconConverterWrapper::Init(const QString& inputFileName, const QString& outputFileName) {
TRAPD(error, m_converter = CIconConverter::NewL(m_eventLoop));
if (error != KErrNone)
return false;
bool ret = true;
ret = m_converter->Convert(inputFileName, outputFileName);
return ret;
}
| [
"vivek.vg@samsung.com"
] | vivek.vg@samsung.com |
2b6db20676f2cad29140ea617d771d0351c42c6d | 09c2bd419afeb05327651e15c41efeb26e520820 | /09ObjectOrientedProgramming/47Composition2.cpp | 19234719816390264860d2ae91ad0a2e0ba19578 | [] | no_license | cheffycoder/Introduction-to-Cpp | ff5f7e007cfd3686c8b0d7a71f21400deb2ee7d1 | fe56251943b8cbedb2d0bde0d5c0d68c9fab35f6 | refs/heads/main | 2023-05-04T03:26:49.482793 | 2019-05-05T17:21:24 | 2019-05-05T17:21:24 | 348,647,442 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 640 | cpp | #include<bits/stdc++.h>
using namespace std;
class Birthday{
public:
Birthday(int m, int d, int y){
month=m;
day=d;
year=y;
}
void printDob(){
cout<< month << "/" << day << "/" << year << endl;
}
private:
int month;
int day;
int year;
};
class Name{
public:
Name( string x, Birthday object)
: name(x) , ob(object)
{
}
void printInfo(){
cout<< name << " your birthday is on ";
ob.printDob();
}
private:
string name;
Birthday ob;
};
int main(){
Birthday shivamDob( 7, 21, 1999);
Name ShivamObj("Shivam", shivamDob );
ShivamObj.printInfo();
return 0;
}
| [
"shivambandral@gmail.com"
] | shivambandral@gmail.com |
f1ddd916a28218c9666e4d5a0b1ab011ffe06e43 | d7b4a065c139454e84e8d04093f8c827478a21bf | /src/mumble/OSS.h | c9b881cb20d46075b828543abf997c3f54a31981 | [] | no_license | pcgod/mumble-wip | 0f5e8e66f7eb07e9548c6c0cb936bf8d21484ae2 | 50023d2c0d683d3a1a0b57f655fb1d6b0afbabc5 | refs/heads/master | 2021-01-18T03:05:54.052037 | 2011-05-20T07:18:10 | 2011-05-20T11:07:23 | 1,747,043 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,028 | h | /* Copyright (C) 2005-2011, Thorvald Natvig <thorvald@natvig.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the Mumble Developers 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 FOUNDATION 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.
*/
#ifndef _OSS_H
#define _OSS_H
#include "AudioInput.h"
#include "AudioOutput.h"
class OSSInput : public AudioInput {
private:
Q_OBJECT
Q_DISABLE_COPY(OSSInput)
protected:
void release();
public:
OSSInput();
~OSSInput();
void run();
};
class OSSOutput : public AudioOutput {
friend class OSSUser;
private:
Q_OBJECT
Q_DISABLE_COPY(OSSOutput)
public:
OSSOutput();
~OSSOutput();
void run();
};
#else
#endif
| [
"slicer@users.sourceforge.net"
] | slicer@users.sourceforge.net |
f4cd1c085bafaa3cb996f037dc541a2f0f981b90 | ea8aa77c861afdbf2c9b3268ba1ae3f9bfd152fe | /hiho1391.cpp | 03de3db6fc14eca4c37073ea60eb5dcb7cfe6219 | [] | no_license | lonelam/SolveSet | 987a01e72d92f975703f715e6a7588d097f7f2e5 | 66a9a984d7270ff03b9c2dfa229d99b922907d57 | refs/heads/master | 2021-04-03T02:02:03.108669 | 2018-07-21T14:25:53 | 2018-07-21T14:25:53 | 62,948,874 | 9 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 1,978 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int inf = 0x3f3f3f3f;
const int maxn = 20000 + 100;
struct seg
{
int l, r, dam;
bool operator<(const seg & rhs) const
{
return l > rhs.l;
}
} segs[maxn];
bool cmp(const seg & lhs, const seg & rhs)
{
return lhs.r < rhs.r;
}
int Ta, Tb, X, N, M;
int Tl[maxn], Tc[maxn], D[maxn];
int main()
{
while(scanf("%d%d%d%d%d", &Ta, &Tb, &X, &N, &M) != EOF)
{
int tot = 0;
int ans = inf;
int suffer = 0;
for (int i = 0; i < N; i++)
{
scanf("%d%d%d", Tl + i, Tc + i, D + i);
if (Tl[i] + Tc[i] >= X && Tl[i] + Tc[i] <= X + Tb)
{
segs[tot].l = Tl[i] + 2 * Tc[i];
const int term =(X + Tb - Tl[i] - Tc[i] ) / (2 * Tc[i]) ;
segs[tot].r = segs[tot].l + term * 2 * Tc[i];
segs[tot++].dam = D[i];
suffer += D[i];
}
}
for (int i = 0; i < M; i++)
{
scanf("%d%d%d", Tl + i, Tc + i, D + i);
if (Tl[i] + 2 * Tc[i] >= X && Tl[i] + 2 * Tc[i] <= X + Tb)
{
segs[tot].l = Tl[i] + Tc[i];
const int term = (X + Tb - Tl[i] - 2 * Tc[i] ) / (2 * Tc[i]) + 1 ;
segs[tot].r = segs[tot].l + term * 2 * Tc[i];
segs[tot++].dam = D[i];
}
else
{
segs[tot].l = segs[tot].r = Tl[i] + Tc[i];
segs[tot++].dam = D[i];
}
suffer += D[i];
}
priority_queue<seg> Q;
sort(segs, segs + tot, cmp);
if (tot == 0)
{
printf("%d\n", suffer);
}
else
{
int defr = segs[0].r, defl = defr - Ta;
for (int i = 0; i < tot; i++)
{
defr = segs[i].r, defl = defr - Ta;
if (segs[i].l >= defl)
{
Q.push(segs[i]);
suffer -= segs[i].dam;
}
while(!Q.empty() && Q.top().l < defl)
{
suffer += Q.top().dam;
Q.pop();
}
ans = min(ans, suffer);
}
printf("%d\n", ans);
}
}
}
| [
"laizenan@gmail.com"
] | laizenan@gmail.com |
b8040fbd35ac08c379276d4a8455e0b22bc96ad5 | 5b74887a7346d60a4e52fa16e92c4f2d9c564fa6 | /CPPLearn/leetcode_3.cpp | b1b87689d0414b661a76b75c6851bb2afdadbf1f | [
"BSD-2-Clause"
] | permissive | tju-wang/CppLearn | abb81b2aaf34f376db4c0675bc36aff4a340e257 | b9e38d40345e0602f3e1648c53b55e89d1531816 | refs/heads/master | 2021-05-16T20:01:39.234807 | 2020-11-16T08:10:08 | 2020-11-16T08:10:08 | 250,449,231 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 904 | cpp | #include <iostream>
using namespace std;
#include <string>
class Solution {
public:
int lengthOfLongestSubstring(string s) {
int ret = 0;
int s_size = s.size();
if (s_size <= 1)
return s_size;
bool flag = false;
for (int i = 0; i<s_size && flag == false; ++i)
{
for (int j = i+1; j<s_size; ++j)
{
char ch = s[j];
string sub = s.substr(i, j-i);
flag = false;
if (sub.find(ch) != sub.npos)
{
if (sub.size() > ret)
ret = sub.size();
//flag = true;
break;
}
if (j == s_size - 1)
{
flag = true;
if(ret < sub.size() + 1)
ret = sub.size() + 1;
}
}
}
return ret;
}
};
//思路:滑动指针法,查看子字符串中 是否含有下一个字符
int main()
{
Solution su;
while (1)
{
string input;
cin >> input;
cout << su.lengthOfLongestSubstring(input) << endl;
}
return 0;
}
| [
"1350989027@qq.com"
] | 1350989027@qq.com |
e755ba818a70e16b7fcfb794120a3b99a7c17b18 | 4f778afc92a424148f7a204a7af502568c72918b | /example-dowhile.cpp | eab0e1f24dc0ad74dd686634b422a8b2e1d01747 | [] | no_license | dwikikurnia/examplecpp | 5d9682c4b955f5a3c2077add8bb6ca55a25ad90e | e4af294247e062b404572ec0b795c09433765417 | refs/heads/master | 2023-01-29T11:20:21.295049 | 2020-12-09T15:46:47 | 2020-12-09T15:46:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 226 | cpp | #include <iostream>
using namespace std;
int main()
{
int a = 1;
do
{
cout << "hore " << a << endl;
a += 1;
} while (a < 5);
cout << "\n \nProgram Selesai" << endl;
return 0;
}
| [
"dwikikurnia1@gmail.com"
] | dwikikurnia1@gmail.com |
f05447a4df030e3ab27444353bfef63ee1b1abb1 | b04200e379d9d5b4c0e27d1c8546081f9fb17ce7 | /doc/snippets/MagnumTrade.cpp | 7a10ffdb92befde4b843913c920fb09b359304a5 | [
"MIT"
] | permissive | DaShanSister/magnum | 0e34d13d939854408c054c936faf31e0a624d906 | fe2020bc62444f7b40804351195dbdfa9f8ae7af | refs/heads/master | 2020-03-23T23:24:53.775887 | 2018-07-22T17:24:36 | 2018-07-22T17:28:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,968 | cpp | /*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
Vladimír Vondruš <mosra@centrum.cz>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include "Magnum/PixelFormat.h"
#include "Magnum/Trade/AbstractImporter.h"
#include "Magnum/Trade/ImageData.h"
#include "Magnum/Trade/ObjectData2D.h"
#include "Magnum/Trade/ObjectData3D.h"
#ifdef MAGNUM_TARGET_GL
#include "Magnum/GL/Texture.h"
#endif
using namespace Magnum;
using namespace Magnum::Math::Literals;
int main() {
{
/* [ImageData-construction] */
Containers::Array<char> data;
Trade::ImageData2D image{PixelFormat::RGB8Unorm, {32, 32}, std::move(data)};
/* [ImageData-construction] */
}
{
/* [ImageData-construction-compressed] */
Containers::Array<char> data;
Trade::ImageData2D image{CompressedPixelFormat::Bc1RGBUnorm,
{32, 32}, std::move(data)};
/* [ImageData-construction-compressed] */
}
#ifdef MAGNUM_TARGET_GL
{
/* [ImageData-usage] */
std::unique_ptr<Trade::AbstractImporter> importer;
Containers::Optional<Trade::ImageData2D> image = importer->image2D(0);
if(!image) Fatal{} << "Oopsie!";
GL::Texture2D texture;
// ...
if(!image->isCompressed())
texture.setSubImage(0, {}, *image);
else
texture.setCompressedSubImage(0, {}, *image);
/* [ImageData-usage] */
}
#endif
{
Trade::ObjectData2D& foo();
Trade::ObjectData2D& data = foo();
/* [ObjectData2D-transformation] */
Matrix3 transformation =
Matrix3::from(data.rotation().toMatrix(), data.translation())*
Matrix3::scaling(data.scaling());
/* [ObjectData2D-transformation] */
static_cast<void>(transformation);
}
{
Trade::ObjectData3D& bar();
Trade::ObjectData3D& data = bar();
/* [ObjectData3D-transformation] */
Matrix4 transformation =
Matrix4::from(data.rotation().toMatrix(), data.translation())*
Matrix4::scaling(data.scaling());
/* [ObjectData3D-transformation] */
static_cast<void>(transformation);
}
}
| [
"mosra@centrum.cz"
] | mosra@centrum.cz |
70115217789f3de8994bc58ca9214593c38813df | b0c35def742103d74d155c0bef0aa7bfe1fc7602 | /DigitalSignature.cpp | 28cfd2c0e210effb0a178bccf8efbffbb3eb216b | [] | no_license | rkgoswami/CNS_Programs | cdb8e1c87f1df226bbf6690e7b28a4b3166ed253 | 23787490cb823c02ea3f8f17aea485ff1f96cd4c | refs/heads/master | 2021-01-11T03:16:34.137967 | 2016-12-17T05:21:45 | 2016-12-17T05:21:45 | 71,077,008 | 0 | 1 | null | 2016-11-16T04:48:13 | 2016-10-16T21:03:24 | C++ | UTF-8 | C++ | false | false | 5,365 | cpp | #include <bits/stdc++.h>
using namespace std;
string hexToBinary(string hexa){
int i=0;
string binStr="";
int len = hexa.length();
while(i<len)
{
switch(hexa[i])
{
case '0': binStr+="0000"; break;
case '1': binStr+="0001"; break;
case '2': binStr+="0010"; break;
case '3': binStr+="0011"; break;
case '4': binStr+="0100"; break;
case '5': binStr+="0101"; break;
case '6': binStr+="0110"; break;
case '7': binStr+="0111"; break;
case '8': binStr+="1000"; break;
case '9': binStr+="1001"; break;
case 'A': binStr+="1010"; break;
case 'B': binStr+="1011"; break;
case 'C': binStr+="1100"; break;
case 'D': binStr+="1101"; break;
case 'E': binStr+="1110"; break;
case 'F': binStr+="1111"; break;
case 'a': binStr+="1010"; break;
case 'b': binStr+="1011"; break;
case 'c': binStr+="1100"; break;
case 'd': binStr+="1101"; break;
case 'e': binStr+="1110"; break;
case 'f': binStr+="1111"; break;
default: cout<<"\nInvalid hexadecimal digit "<<hexa[i];
}
i++;
}
return binStr;
}
int conversionBinToInt(string s){
int len = s.length();
int val=0;
for(int i=len-1,k=0;i>=0;--i,k++){
val=val+(s[i]-'0')*pow(2,k);
}
return val;
}
int SimpleHash(string text){
/* Step 1 : Convert the plain text into hex form
Step 2 : Convert the hex to binary
Step 3 : Calculate the hash using simple XOR method
Step 4 : Convert the binStr into integer
*/
//Step 1:
stringstream ss;
for(int i=0;i<text.length();++i){
ss<<hex<<(int)text[i];
}
string hexText(ss.str());
//Step 2:
string binText = hexToBinary(hexText);
cout<<"\nbinText = "<<binText;
//Step 3:
string hashStr="";
unsigned short a,b,c,d;
for(int i=0;i<binText.length()-4;i+=4){
a=(unsigned short)(binText[i]-'0');
b=(unsigned short)(binText[i+1]-'0');
c=(unsigned short)(binText[i+2]-'0');
d=(unsigned short)(binText[i+3]-'0');
hashStr+=((a^b^c^d)+'0');
}
//Step 4:
int hashVal = conversionBinToInt(hashStr);
cout<<"\nHashVal Generated = "<<hashVal;
return hashVal;
}
int findInvModQ(int k,int q){
int invK = 1;
while(1){
if( ((k*invK)%q) == 1)
break;
invK++;
}
return invK;
}
long powerMod(long a,int x,int mod){
int val = a % mod;
long res = 1;
for (int i = 1; i <= x ; ++i){
res= (res*a)%mod;
}
return res;
}
void signing(string text,int g,int p,int q,int k,int x,int signature[2]){
/* Step 1: Calculate r = (g^k mod p)mod q
Step 2: Calculate s = ( (k^-1) * (H(M)+xr) )mod q
Step 2.1 : Calculate k^-1 = a i.e ( k*a mod q = 1)
Step 2.2 : Calculate H(M)
Step 2.2 : Calculate s = (((k^-1)mod q )( (H(M))+xr) mod q ) )mod q
*/
//Step 1:
int r = powerMod(g,k,p)%q;
//Step 2.1:
int invK = findInvModQ(k,q);
//Step 2.2:
int hashVal = SimpleHash(text);
//Step 2.3:
int s = ( (invK % q) * ((hashVal+(x*r))%q) %q );
signature[0]=r;
signature[1]=s;
}
int verify(string text,int signature[2],int p,int q,int g,int y){
//signature(r,s) i.e r = signature[0] , s = signature[1]
/* Step 1: Calculate w = (s')^-1 mod q
Step 2: Calculate v
Step 2.1 : Calculate u1 = [H(M')w]mod q
Step 2.2 : Calculate u2 = r'w mod q
Step 2.2 : Calculate v = ( ((g^u1)(y^u2)) mod p ) mod q
Step 3: return v
*/
int w = findInvModQ(signature[1],q) % q;
int u1 = (SimpleHash(text)*w )% q;
int u2 = (signature[0]*w )% q;
int v = ( ( powerMod(g,u1,p)*powerMod(y,u2,p) ) %p ) %q;
return v;
}
bool checkPrime(int p){
for(int i=2;i<=sqrt(p);++i){
if(p%i==0){
return false;
}
}
return true;
}
int main(){
/* Step 1: Input a prime number
Step 2: Select prime no. (p) such that q divides p-1
Step 3: Calculate value of g
Step 3.1: Randomly generate the h i.e 1 < h < (p-1)
Step 3.2: Calculate g = h^((p-1)/q) mod p i.e g > 1
Step 4: Calculate User's Public key
- generate the value of x
- such that 0<x<q
Step 5: Calculate User's Private Key
- y = g^x mod p
Step 6: Generate the User's Per Message secret key
- randomly generate the k
Step 7: Signing function
Step 8: Verifying function
Step 9: if(v==r):
"Authentic"
else:
"Unauthentic"
*/
srand(time(NULL));
//Step 1:
int q ,p;
cout<<"\nEnter the prime number i.e q : ";
cin>>q;
//Step 2:
int i=1;
while(1){
p = q*i +1;
if(checkPrime(p)){
break;
}
else
i++;
}
//Step 3:
int h = rand()%(p-1)+1;
int g = powerMod(h,(p-1)/q,p);
//Step 4:
int x=rand()%q;
//Step 5:
int y = int(pow(g,x)) % p;
//Step 6:
int k = rand()%q;
cout<<"\nq = "<<q;
cout<<"\np = "<<p;
cout<<"\ng = "<<g;
cout<<"\nx = "<<x;
cout<<"\ny = "<<y;
cout<<"\nk = "<<k;
string msg;
cout<<"\nEnter the Message : ";
cin>>msg;
//Step 7:
int signature[2];
signing(msg,g,p,q,k,x,signature);
cout<<"\nSignature(r,s): ( "<<signature[0]<<" , "<<signature[1]<<" )";
cout<<"\nEnter the recieved msg i.e M'(with or without error): ";
cin>>msg;
//Step 8:
int v = verify(msg,signature,p,q,g,y);
cout<<"\nVerify(v): "<<v<<endl;
if(v==signature[0]){
cout<<"\nAuthentic";
}
else{
cout<<"\nUnauthentic";
}
cout<<"\n";
return 0;
}
| [
"rishav4894@gmail.com"
] | rishav4894@gmail.com |
2edbca71a316aa90c1c4038b64a00f9aacd45626 | 1095cfe2e29ddf4e4c5e12d713bd12f45c9b6f7d | /ext/drampower/src/MemArchitectureSpec.cc | f3155853d78bac178194ee14a1fbe17611014e8a | [
"BSD-3-Clause",
"LicenseRef-scancode-proprietary-license",
"LGPL-2.0-or-later",
"MIT"
] | permissive | gem5/gem5 | 9ec715ae036c2e08807b5919f114e1d38d189bce | 48a40cf2f5182a82de360b7efa497d82e06b1631 | refs/heads/stable | 2023-09-03T15:56:25.819189 | 2023-08-31T05:53:03 | 2023-08-31T05:53:03 | 27,425,638 | 1,185 | 1,177 | BSD-3-Clause | 2023-09-14T08:29:31 | 2014-12-02T09:46:00 | C++ | UTF-8 | C++ | false | false | 2,885 | cc | /*
* Copyright (c) 2012-2014, TU Delft
* Copyright (c) 2012-2014, TU Eindhoven
* Copyright (c) 2012-2014, TU Kaiserslautern
* 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.
*
* Authors: Karthik Chandrasekar
*
*/
#include "MemArchitectureSpec.h"
#include <cassert>
using namespace Data;
MemArchitectureSpec::MemArchitectureSpec() :
burstLength(0),
nbrOfBanks(0),
nbrOfRanks(0),
dataRate(0),
nbrOfColumns(0),
nbrOfRows(0),
width(0),
nbrOfBankGroups(0),
dll(false),
twoVoltageDomains(false),
termination(false)
{
}
void MemArchitectureSpec::processParameters()
{
// Load all parameters in our member variables
nbrOfBanks = getParamValWithDefault("nbrOfBanks", 1);
nbrOfRanks = getParamValWithDefault("nbrOfRanks", 1);
nbrOfBankGroups = getParamValWithDefault("nbrOfBankGroups", 1);
dataRate = getParamValWithDefault("dataRate", 1);
burstLength = getParamValWithDefault("burstLength", 1);
nbrOfColumns = getParamValWithDefault("nbrOfColumns", 1);
nbrOfRows = getParamValWithDefault("nbrOfRows", 1);
width = getParamValWithDefault("width", 1);
assert("memory width should be a multiple of 8" && (width % 8) == 0);
dll = getParamValWithDefault("dll", false);
twoVoltageDomains = getParamValWithDefault("twoVoltageDomains", false);
termination = getParamValWithDefault("termination", false);
}
| [
"andreas.hansson@arm.com"
] | andreas.hansson@arm.com |
a9f0f613f6ebfd840b64ac5ea92427e516c04d36 | 58dc9b58af3a7cf1bfec01f12a837b410317fc9e | /AngewandteKryptografie/src/Praktikum-7/DHProtocol.h | c066058c603f0af22d1692f4f1e71f820f40ab07 | [] | no_license | fenixA/ak | 148e1b2e48d42a8f96dfdea9fc18b492f0780a94 | fa9e168ac32ea69e1cd8e27f74fd3e44e4ba2a94 | refs/heads/master | 2020-12-24T15:58:06.680709 | 2015-01-08T16:07:18 | 2015-01-08T16:07:18 | 27,716,225 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 814 | h | /*
* DHProtocol.h
*/
#ifndef DHPROTOCOL_H_
#define DHPROTOCOL_H_
#include <iostream>
#include <integer.h>
#include <socketft.h>
using namespace std;
using namespace CryptoPP;
class DHProtocol {
protected:
/*
* Module of the Diffie-Hellman key exchange (must be prime)
*/
Integer p;
/*
* Prime q such that p = 2*q + 1
*/
Integer q;
/*
* Generator of Z^*_p
*/
Integer alpha;
bool serverBob(Socket c);
bool serverOscar(Socket c, const string& host, unsigned int port);
public:
DHProtocol(const string& param_file);
void alice(const string& host, unsigned int port);
void bob(unsigned int port);
void oscar(unsigned int inport, const string& host, unsigned int port);
Integer modExp(const Integer& a, const Integer& b,
const Integer& n) const;
};
#endif /* DHPROTOCOL_H_ */
| [
"f.assange@googlemail.com"
] | f.assange@googlemail.com |
4af4ca14a81ebf8bea3ce5478165fd44907bc43b | 774b15c96e98542f9ea78ba942be78622647455c | /PROG50016GameArch/Game Engine/PROG50016.GameEngine/PROG50016.GameEngine/ISystem.cpp | 86a6875928b2b51429f7681f693080bf1cd721bc | [] | no_license | Adsew/ClassStuff | 6dc2c82dcf3487a97dac21e4755e3b90358afa76 | 4a9bbc1d4d52e76adfa282ff35e36d94dda1d8f1 | refs/heads/master | 2021-09-22T14:53:38.507989 | 2018-06-02T02:54:22 | 2018-06-02T02:54:22 | 102,508,943 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 21 | cpp | #include "ISystem.h"
| [
"30912391+Adsew@users.noreply.github.com"
] | 30912391+Adsew@users.noreply.github.com |
f06ead0b28974d56bf9375f7560709ccdf9ae2a8 | ee947cc9c049af249f655df0eda1f2363bf3a51b | /src/entreader.cpp | bdadcdf9f931271e5434067059eb8f665190973f | [
"MIT"
] | permissive | mattiascibien/def2fgd | 5b381c2f746675031b6a379b2796978524223c32 | bec8f7ea2d532d3e40fa901b1a6c3e283b8bc35e | refs/heads/master | 2023-08-25T12:44:37.115316 | 2021-10-25T14:42:32 | 2021-10-25T14:42:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,878 | cpp | //Copyright (c) 2015 Roman Chistokhodov
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iterator>
#include <stdexcept>
#include <sstream>
#include "entreader.h"
#include "rapidxml.hpp"
#include "translate.h"
using namespace rapidxml;
namespace
{
static bool hasName(xml_base<>* elem, const char* name)
{
return strncmp(elem->name(), name, elem->name_size()) == 0;
}
static std::string valueString(xml_base<>* elem)
{
return std::string(elem->value(), elem->value_size());
}
static void readColor(const char* begin, size_t size, unsigned* color)
{
const char* end = begin + size;
const char* current = begin;
for (size_t i=0; i<3 && current != end; ++i)
{
while(current != end && isspace(*current))
current++;
const char* start = current;
while(current != end && (isdigit(*current) || *current == '.'))
current++;
color[i] = colorFromFloat(static_cast<float>(strtod(start, NULL)));
}
}
static void readBox(const char* begin, size_t size, int* box)
{
const char* end = begin + size;
const char* current = begin;
for (size_t i=0; i<6 && current != end; ++i)
{
while(current != end && isspace(*current))
current++;
const char* start = current;
while(current != end && (isdigit(*current) || *current == '-'))
current++;
box[i] = static_cast<int>(strtol(start, NULL, 10));
}
}
static const char* entTypeToFgdType(const char* type, size_t size)
{
if (strncmp(type, "angles", size) == 0)
return "angle";
if (strncmp(type, "real", size) == 0)
return "float";
if (strncmp(type, "integer", size) == 0)
return "integer";
if (strncmp(type, "sound", size) == 0)
return "sound";
if (strncmp(type, "model", size) == 0)
return "studio";
return "";
}
}
std::string descriptionLines(const std::string& description)
{
std::string toReturn;
std::istringstream stream(description);
std::string line;
while(getline(stream, line))
{
bool sectionName = true;
if (line.size() > 8) {
for (size_t i=0; i<8; ++i) {
sectionName = sectionName && line[i] == '-';
}
}
if (sectionName) { //probably something like -------- KEYS --------. Just skip.
continue;
}
if (toReturn.empty()) {
toReturn = withoutQuotes(line);
} else {
toReturn += "\\n\\n";
toReturn += withoutQuotes(line);
}
}
return toReturn;
}
std::vector<Entity> readEntFile(std::istream& stream)
{
std::vector<char> input((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>());
std::vector<Entity> toReturn;
xml_document<> doc;
doc.parse<parse_trim_whitespace>(&input[0]);
xml_node<>* classes = doc.first_node("classes");
if (!classes)
throw std::runtime_error(translate("No 'classes' entry found"));
for (xml_node<>* entityNode = classes->first_node(); entityNode; entityNode = entityNode->next_sibling())
{
Entity entity;
entity.description = descriptionLines(std::string(entityNode->value(), entityNode->value_size()));
if (hasName(entityNode, "point"))
entity.solid = false;
else if (hasName(entityNode, "group"))
entity.solid = true;
xml_attribute<>* nameAttr = entityNode->first_attribute("name");
if (!nameAttr)
continue; // no name, nothing to do here
entity.name = valueString(nameAttr);
xml_attribute<>* colorAttr = entityNode->first_attribute("color");
if (colorAttr)
readColor(colorAttr->value(), colorAttr->value_size(), entity.color);
xml_attribute<>* boxAttr = entityNode->first_attribute("box");
if (boxAttr)
readBox(boxAttr->value(), boxAttr->value_size(), entity.box);
xml_attribute<>* modelAttr = entityNode->first_attribute("model");
if (modelAttr) {
entity.model = valueString(modelAttr);
}
for (xml_node<>* keyNode = entityNode->first_node(); keyNode; keyNode = keyNode->next_sibling())
{
if (hasName(keyNode, "flag"))
{
xml_attribute<>* keyAttr = keyNode->first_attribute("key");
xml_attribute<>* bitAttr = keyNode->first_attribute("bit");
if (keyAttr && bitAttr)
{
size_t flagnum = static_cast<size_t>(strtol(bitAttr->value(), NULL, 10));
if (flagnum < Entity::SpawnFlagNum)
{
entity.spawnflags[flagnum] = valueString(keyAttr);
entity.flagsdescriptions[flagnum] = withoutQuotes(valueString(keyNode));
}
}
}
else
{
xml_attribute<>* keyAttr = keyNode->first_attribute("key");
if (keyAttr)
{
entity.keys.push_back(Key(
valueString(keyAttr),
withoutQuotes(valueString(keyNode)),
entTypeToFgdType(keyNode->name(), keyNode->name_size())
));
}
}
}
xml_node<>* lastNode = entityNode->last_node();
if (lastNode && lastNode->name_size() == 0)
{
std::string val = valueString(lastNode);
size_t pos = val.find("modeldisabled=");
if (pos != std::string::npos && entity.model.empty())
{
std::string::iterator it = val.begin() + pos + strlen("modeldisabled=");
if (*it == '"')
{
it++;
std::string::iterator start = it;
while(it != val.end() && *it != '"')
it++;
std::string modelname(start, it);
entity.model = modelname;
}
}
if (pos != std::string::npos) {
val.resize(pos);
}
if (val.size()) {
if (entity.description.size()) {
entity.description += "\\n\\n";
}
entity.description += descriptionLines(val);
}
}
toReturn.push_back(entity);
}
return toReturn;
}
| [
"freeslave93@gmail.com"
] | freeslave93@gmail.com |
987cf9e69aad05d63fb71cbfed2b3cd5d8783f18 | 0f627588659dea8530d564742e0e2b74b2d69e11 | /C++_code/Lecture_10.cpp | e33223e259117a760d2da26ad61870f00789a694 | [] | no_license | Shubham230198/Foundation | e80e1d14d93a4206321eb415a548163e7aa6763f | 078f474c98cad5b841c7a7f92a24787da3e1f0f8 | refs/heads/master | 2021-02-05T14:05:34.910038 | 2020-05-02T20:10:45 | 2020-05-02T20:10:45 | 243,788,905 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 635 | cpp | //Lecture - 10
//2 - JULY
#include<iostream>
using namespace std;
/*void tower(char S,char D,char H,int n) //TOWER OF HANOI.
{
if(n==0)
{
return;
}
tower(S,H,D,n-1);
cout<<"move "<<n<<"th disc from "<<S<<" to "<<D<<endl;
tower(H,D,S,n-1);
}
int main()
{
int n=5;
char S='S';
char D='D';
char H='H';
tower(S, D, H, n);
return 0;
}*/ //REVIEWED.
int main(int argc,char** argv)
{
} | [
"tiwari.98shubham@gmail.com"
] | tiwari.98shubham@gmail.com |
5790451bbd8e874113108ae8d094acbd15890e68 | a738fab3d35dbc7ae90b7ca24ff7411ac12a76d9 | /Security and criptography/Tema2_SC/Tema2_SC/Debug/Generated Files/winrt/impl/Windows.Media.Audio.0.h | d7a50d4727aef2669336befc0234a3917a05ad09 | [] | no_license | TheSeeven/personal-projects | 66c309233dfdf1d9986846f5bec5ededd57cf119 | 0d103b9647d2b1c650b0f0d7a63cc64786ddac23 | refs/heads/main | 2023-06-10T19:12:06.490243 | 2021-07-01T08:34:01 | 2021-07-01T08:34:01 | 301,747,006 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 153,614 | h | // WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.210403.2
#ifndef WINRT_Windows_Media_Audio_0_H
#define WINRT_Windows_Media_Audio_0_H
WINRT_EXPORT namespace winrt::Windows::Devices::Enumeration
{
struct DeviceInformation;
}
WINRT_EXPORT namespace winrt::Windows::Foundation
{
struct EventRegistrationToken;
struct HResult;
struct IAsyncAction;
template <typename TResult> struct __declspec(empty_bases) IAsyncOperation;
struct IClosable;
template <typename T> struct __declspec(empty_bases) IReference;
template <typename TSender, typename TResult> struct __declspec(empty_bases) TypedEventHandler;
}
WINRT_EXPORT namespace winrt::Windows::Foundation::Collections
{
template <typename T> struct __declspec(empty_bases) IVectorView;
template <typename T> struct __declspec(empty_bases) IVector;
}
WINRT_EXPORT namespace winrt::Windows::Foundation::Numerics
{
}
WINRT_EXPORT namespace winrt::Windows::Media
{
struct AudioFrame;
enum class AudioProcessing : int32_t;
enum class SoundLevel : int32_t;
}
WINRT_EXPORT namespace winrt::Windows::Media::Capture
{
enum class MediaCategory : int32_t;
}
WINRT_EXPORT namespace winrt::Windows::Media::Core
{
struct MediaSource;
}
WINRT_EXPORT namespace winrt::Windows::Media::Devices
{
enum class AudioDeviceRole : int32_t;
}
WINRT_EXPORT namespace winrt::Windows::Media::Effects
{
struct IAudioEffectDefinition;
}
WINRT_EXPORT namespace winrt::Windows::Media::MediaProperties
{
struct AudioEncodingProperties;
struct MediaEncodingProfile;
}
WINRT_EXPORT namespace winrt::Windows::Media::Render
{
enum class AudioRenderCategory : int32_t;
}
WINRT_EXPORT namespace winrt::Windows::Media::Transcoding
{
enum class TranscodeFailureReason : int32_t;
}
WINRT_EXPORT namespace winrt::Windows::Storage
{
struct IStorageFile;
struct StorageFile;
}
WINRT_EXPORT namespace winrt::Windows::Media::Audio
{
enum class AudioDeviceNodeCreationStatus : int32_t
{
Success = 0,
DeviceNotAvailable = 1,
FormatNotSupported = 2,
UnknownFailure = 3,
AccessDenied = 4,
};
enum class AudioFileNodeCreationStatus : int32_t
{
Success = 0,
FileNotFound = 1,
InvalidFileType = 2,
FormatNotSupported = 3,
UnknownFailure = 4,
};
enum class AudioGraphCreationStatus : int32_t
{
Success = 0,
DeviceNotAvailable = 1,
FormatNotSupported = 2,
UnknownFailure = 3,
};
enum class AudioGraphUnrecoverableError : int32_t
{
None = 0,
AudioDeviceLost = 1,
AudioSessionDisconnected = 2,
UnknownFailure = 3,
};
enum class AudioNodeEmitterDecayKind : int32_t
{
Natural = 0,
Custom = 1,
};
enum class AudioNodeEmitterSettings : uint32_t
{
None = 0,
DisableDoppler = 0x1,
};
enum class AudioNodeEmitterShapeKind : int32_t
{
Omnidirectional = 0,
Cone = 1,
};
enum class AudioPlaybackConnectionOpenResultStatus : int32_t
{
Success = 0,
RequestTimedOut = 1,
DeniedBySystem = 2,
UnknownFailure = 3,
};
enum class AudioPlaybackConnectionState : int32_t
{
Closed = 0,
Opened = 1,
};
enum class MediaSourceAudioInputNodeCreationStatus : int32_t
{
Success = 0,
FormatNotSupported = 1,
NetworkError = 2,
UnknownFailure = 3,
};
enum class MixedRealitySpatialAudioFormatPolicy : int32_t
{
UseMixedRealityDefaultSpatialAudioFormat = 0,
UseDeviceConfigurationDefaultSpatialAudioFormat = 1,
};
enum class QuantumSizeSelectionMode : int32_t
{
SystemDefault = 0,
LowestLatency = 1,
ClosestToDesired = 2,
};
enum class SetDefaultSpatialAudioFormatStatus : int32_t
{
Succeeded = 0,
AccessDenied = 1,
LicenseExpired = 2,
LicenseNotValidForAudioEndpoint = 3,
NotSupportedOnAudioEndpoint = 4,
UnknownError = 5,
};
enum class SpatialAudioModel : int32_t
{
ObjectBased = 0,
FoldDown = 1,
};
struct IAudioDeviceInputNode;
struct IAudioDeviceOutputNode;
struct IAudioFileInputNode;
struct IAudioFileOutputNode;
struct IAudioFrameCompletedEventArgs;
struct IAudioFrameInputNode;
struct IAudioFrameOutputNode;
struct IAudioGraph;
struct IAudioGraph2;
struct IAudioGraph3;
struct IAudioGraphConnection;
struct IAudioGraphSettings;
struct IAudioGraphSettings2;
struct IAudioGraphSettingsFactory;
struct IAudioGraphStatics;
struct IAudioGraphUnrecoverableErrorOccurredEventArgs;
struct IAudioInputNode;
struct IAudioInputNode2;
struct IAudioNode;
struct IAudioNodeEmitter;
struct IAudioNodeEmitter2;
struct IAudioNodeEmitterConeProperties;
struct IAudioNodeEmitterDecayModel;
struct IAudioNodeEmitterDecayModelStatics;
struct IAudioNodeEmitterFactory;
struct IAudioNodeEmitterNaturalDecayModelProperties;
struct IAudioNodeEmitterShape;
struct IAudioNodeEmitterShapeStatics;
struct IAudioNodeListener;
struct IAudioNodeWithListener;
struct IAudioPlaybackConnection;
struct IAudioPlaybackConnectionOpenResult;
struct IAudioPlaybackConnectionStatics;
struct IAudioStateMonitor;
struct IAudioStateMonitorStatics;
struct ICreateAudioDeviceInputNodeResult;
struct ICreateAudioDeviceInputNodeResult2;
struct ICreateAudioDeviceOutputNodeResult;
struct ICreateAudioDeviceOutputNodeResult2;
struct ICreateAudioFileInputNodeResult;
struct ICreateAudioFileInputNodeResult2;
struct ICreateAudioFileOutputNodeResult;
struct ICreateAudioFileOutputNodeResult2;
struct ICreateAudioGraphResult;
struct ICreateAudioGraphResult2;
struct ICreateMediaSourceAudioInputNodeResult;
struct ICreateMediaSourceAudioInputNodeResult2;
struct IEchoEffectDefinition;
struct IEchoEffectDefinitionFactory;
struct IEqualizerBand;
struct IEqualizerEffectDefinition;
struct IEqualizerEffectDefinitionFactory;
struct IFrameInputNodeQuantumStartedEventArgs;
struct ILimiterEffectDefinition;
struct ILimiterEffectDefinitionFactory;
struct IMediaSourceAudioInputNode;
struct IReverbEffectDefinition;
struct IReverbEffectDefinitionFactory;
struct ISetDefaultSpatialAudioFormatResult;
struct ISpatialAudioDeviceConfiguration;
struct ISpatialAudioDeviceConfigurationStatics;
struct ISpatialAudioFormatConfiguration;
struct ISpatialAudioFormatConfigurationStatics;
struct ISpatialAudioFormatSubtypeStatics;
struct AudioDeviceInputNode;
struct AudioDeviceOutputNode;
struct AudioFileInputNode;
struct AudioFileOutputNode;
struct AudioFrameCompletedEventArgs;
struct AudioFrameInputNode;
struct AudioFrameOutputNode;
struct AudioGraph;
struct AudioGraphBatchUpdater;
struct AudioGraphConnection;
struct AudioGraphSettings;
struct AudioGraphUnrecoverableErrorOccurredEventArgs;
struct AudioNodeEmitter;
struct AudioNodeEmitterConeProperties;
struct AudioNodeEmitterDecayModel;
struct AudioNodeEmitterNaturalDecayModelProperties;
struct AudioNodeEmitterShape;
struct AudioNodeListener;
struct AudioPlaybackConnection;
struct AudioPlaybackConnectionOpenResult;
struct AudioStateMonitor;
struct AudioSubmixNode;
struct CreateAudioDeviceInputNodeResult;
struct CreateAudioDeviceOutputNodeResult;
struct CreateAudioFileInputNodeResult;
struct CreateAudioFileOutputNodeResult;
struct CreateAudioGraphResult;
struct CreateMediaSourceAudioInputNodeResult;
struct EchoEffectDefinition;
struct EqualizerBand;
struct EqualizerEffectDefinition;
struct FrameInputNodeQuantumStartedEventArgs;
struct LimiterEffectDefinition;
struct MediaSourceAudioInputNode;
struct ReverbEffectDefinition;
struct SetDefaultSpatialAudioFormatResult;
struct SpatialAudioDeviceConfiguration;
struct SpatialAudioFormatConfiguration;
struct SpatialAudioFormatSubtype;
}
namespace winrt::impl
{
template <> struct category<winrt::Windows::Media::Audio::IAudioDeviceInputNode>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioDeviceOutputNode>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioFileInputNode>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioFileOutputNode>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioFrameCompletedEventArgs>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioFrameInputNode>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioFrameOutputNode>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioGraph>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioGraph2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioGraph3>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioGraphConnection>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioGraphSettings>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioGraphSettings2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioGraphSettingsFactory>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioGraphStatics>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioGraphUnrecoverableErrorOccurredEventArgs>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioInputNode>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioInputNode2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNode>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeEmitter>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeEmitter2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeEmitterConeProperties>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModel>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModelStatics>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeEmitterFactory>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeEmitterNaturalDecayModelProperties>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeEmitterShape>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeEmitterShapeStatics>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeListener>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioNodeWithListener>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioPlaybackConnection>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioPlaybackConnectionOpenResult>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioPlaybackConnectionStatics>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioStateMonitor>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IAudioStateMonitorStatics>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioGraphResult>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateAudioGraphResult2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult2>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IEchoEffectDefinition>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IEchoEffectDefinitionFactory>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IEqualizerBand>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IEqualizerEffectDefinition>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IEqualizerEffectDefinitionFactory>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IFrameInputNodeQuantumStartedEventArgs>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ILimiterEffectDefinition>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ILimiterEffectDefinitionFactory>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IMediaSourceAudioInputNode>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IReverbEffectDefinition>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::IReverbEffectDefinitionFactory>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ISetDefaultSpatialAudioFormatResult>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfiguration>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfigurationStatics>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ISpatialAudioFormatConfiguration>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ISpatialAudioFormatConfigurationStatics>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::ISpatialAudioFormatSubtypeStatics>{ using type = interface_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioDeviceInputNode>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioDeviceOutputNode>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioFileInputNode>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioFileOutputNode>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioFrameCompletedEventArgs>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioFrameInputNode>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioFrameOutputNode>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioGraph>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioGraphBatchUpdater>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioGraphConnection>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioGraphSettings>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioGraphUnrecoverableErrorOccurredEventArgs>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioNodeEmitter>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioNodeEmitterConeProperties>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioNodeEmitterDecayModel>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioNodeEmitterNaturalDecayModelProperties>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioNodeEmitterShape>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioNodeListener>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioPlaybackConnection>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioPlaybackConnectionOpenResult>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioStateMonitor>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioSubmixNode>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::CreateAudioDeviceInputNodeResult>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::CreateAudioDeviceOutputNodeResult>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::CreateAudioFileInputNodeResult>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::CreateAudioFileOutputNodeResult>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::CreateAudioGraphResult>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::CreateMediaSourceAudioInputNodeResult>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::EchoEffectDefinition>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::EqualizerBand>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::EqualizerEffectDefinition>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::FrameInputNodeQuantumStartedEventArgs>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::LimiterEffectDefinition>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::MediaSourceAudioInputNode>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::ReverbEffectDefinition>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::SetDefaultSpatialAudioFormatResult>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::SpatialAudioDeviceConfiguration>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::SpatialAudioFormatConfiguration>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::SpatialAudioFormatSubtype>{ using type = class_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioDeviceNodeCreationStatus>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioFileNodeCreationStatus>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioGraphCreationStatus>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioGraphUnrecoverableError>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioNodeEmitterDecayKind>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioNodeEmitterSettings>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioNodeEmitterShapeKind>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioPlaybackConnectionOpenResultStatus>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::AudioPlaybackConnectionState>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::MediaSourceAudioInputNodeCreationStatus>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::MixedRealitySpatialAudioFormatPolicy>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::QuantumSizeSelectionMode>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::SetDefaultSpatialAudioFormatStatus>{ using type = enum_category; };
template <> struct category<winrt::Windows::Media::Audio::SpatialAudioModel>{ using type = enum_category; };
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioDeviceInputNode> = L"Windows.Media.Audio.AudioDeviceInputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioDeviceOutputNode> = L"Windows.Media.Audio.AudioDeviceOutputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioFileInputNode> = L"Windows.Media.Audio.AudioFileInputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioFileOutputNode> = L"Windows.Media.Audio.AudioFileOutputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioFrameCompletedEventArgs> = L"Windows.Media.Audio.AudioFrameCompletedEventArgs";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioFrameInputNode> = L"Windows.Media.Audio.AudioFrameInputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioFrameOutputNode> = L"Windows.Media.Audio.AudioFrameOutputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioGraph> = L"Windows.Media.Audio.AudioGraph";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioGraphBatchUpdater> = L"Windows.Media.Audio.AudioGraphBatchUpdater";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioGraphConnection> = L"Windows.Media.Audio.AudioGraphConnection";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioGraphSettings> = L"Windows.Media.Audio.AudioGraphSettings";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioGraphUnrecoverableErrorOccurredEventArgs> = L"Windows.Media.Audio.AudioGraphUnrecoverableErrorOccurredEventArgs";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioNodeEmitter> = L"Windows.Media.Audio.AudioNodeEmitter";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioNodeEmitterConeProperties> = L"Windows.Media.Audio.AudioNodeEmitterConeProperties";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioNodeEmitterDecayModel> = L"Windows.Media.Audio.AudioNodeEmitterDecayModel";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioNodeEmitterNaturalDecayModelProperties> = L"Windows.Media.Audio.AudioNodeEmitterNaturalDecayModelProperties";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioNodeEmitterShape> = L"Windows.Media.Audio.AudioNodeEmitterShape";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioNodeListener> = L"Windows.Media.Audio.AudioNodeListener";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioPlaybackConnection> = L"Windows.Media.Audio.AudioPlaybackConnection";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioPlaybackConnectionOpenResult> = L"Windows.Media.Audio.AudioPlaybackConnectionOpenResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioStateMonitor> = L"Windows.Media.Audio.AudioStateMonitor";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioSubmixNode> = L"Windows.Media.Audio.AudioSubmixNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::CreateAudioDeviceInputNodeResult> = L"Windows.Media.Audio.CreateAudioDeviceInputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::CreateAudioDeviceOutputNodeResult> = L"Windows.Media.Audio.CreateAudioDeviceOutputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::CreateAudioFileInputNodeResult> = L"Windows.Media.Audio.CreateAudioFileInputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::CreateAudioFileOutputNodeResult> = L"Windows.Media.Audio.CreateAudioFileOutputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::CreateAudioGraphResult> = L"Windows.Media.Audio.CreateAudioGraphResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::CreateMediaSourceAudioInputNodeResult> = L"Windows.Media.Audio.CreateMediaSourceAudioInputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::EchoEffectDefinition> = L"Windows.Media.Audio.EchoEffectDefinition";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::EqualizerBand> = L"Windows.Media.Audio.EqualizerBand";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::EqualizerEffectDefinition> = L"Windows.Media.Audio.EqualizerEffectDefinition";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::FrameInputNodeQuantumStartedEventArgs> = L"Windows.Media.Audio.FrameInputNodeQuantumStartedEventArgs";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::LimiterEffectDefinition> = L"Windows.Media.Audio.LimiterEffectDefinition";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::MediaSourceAudioInputNode> = L"Windows.Media.Audio.MediaSourceAudioInputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ReverbEffectDefinition> = L"Windows.Media.Audio.ReverbEffectDefinition";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::SetDefaultSpatialAudioFormatResult> = L"Windows.Media.Audio.SetDefaultSpatialAudioFormatResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::SpatialAudioDeviceConfiguration> = L"Windows.Media.Audio.SpatialAudioDeviceConfiguration";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::SpatialAudioFormatConfiguration> = L"Windows.Media.Audio.SpatialAudioFormatConfiguration";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::SpatialAudioFormatSubtype> = L"Windows.Media.Audio.SpatialAudioFormatSubtype";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioDeviceNodeCreationStatus> = L"Windows.Media.Audio.AudioDeviceNodeCreationStatus";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioFileNodeCreationStatus> = L"Windows.Media.Audio.AudioFileNodeCreationStatus";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioGraphCreationStatus> = L"Windows.Media.Audio.AudioGraphCreationStatus";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioGraphUnrecoverableError> = L"Windows.Media.Audio.AudioGraphUnrecoverableError";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioNodeEmitterDecayKind> = L"Windows.Media.Audio.AudioNodeEmitterDecayKind";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioNodeEmitterSettings> = L"Windows.Media.Audio.AudioNodeEmitterSettings";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioNodeEmitterShapeKind> = L"Windows.Media.Audio.AudioNodeEmitterShapeKind";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioPlaybackConnectionOpenResultStatus> = L"Windows.Media.Audio.AudioPlaybackConnectionOpenResultStatus";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::AudioPlaybackConnectionState> = L"Windows.Media.Audio.AudioPlaybackConnectionState";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::MediaSourceAudioInputNodeCreationStatus> = L"Windows.Media.Audio.MediaSourceAudioInputNodeCreationStatus";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::MixedRealitySpatialAudioFormatPolicy> = L"Windows.Media.Audio.MixedRealitySpatialAudioFormatPolicy";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::QuantumSizeSelectionMode> = L"Windows.Media.Audio.QuantumSizeSelectionMode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::SetDefaultSpatialAudioFormatStatus> = L"Windows.Media.Audio.SetDefaultSpatialAudioFormatStatus";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::SpatialAudioModel> = L"Windows.Media.Audio.SpatialAudioModel";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioDeviceInputNode> = L"Windows.Media.Audio.IAudioDeviceInputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioDeviceOutputNode> = L"Windows.Media.Audio.IAudioDeviceOutputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioFileInputNode> = L"Windows.Media.Audio.IAudioFileInputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioFileOutputNode> = L"Windows.Media.Audio.IAudioFileOutputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioFrameCompletedEventArgs> = L"Windows.Media.Audio.IAudioFrameCompletedEventArgs";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioFrameInputNode> = L"Windows.Media.Audio.IAudioFrameInputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioFrameOutputNode> = L"Windows.Media.Audio.IAudioFrameOutputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioGraph> = L"Windows.Media.Audio.IAudioGraph";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioGraph2> = L"Windows.Media.Audio.IAudioGraph2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioGraph3> = L"Windows.Media.Audio.IAudioGraph3";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioGraphConnection> = L"Windows.Media.Audio.IAudioGraphConnection";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioGraphSettings> = L"Windows.Media.Audio.IAudioGraphSettings";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioGraphSettings2> = L"Windows.Media.Audio.IAudioGraphSettings2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioGraphSettingsFactory> = L"Windows.Media.Audio.IAudioGraphSettingsFactory";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioGraphStatics> = L"Windows.Media.Audio.IAudioGraphStatics";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioGraphUnrecoverableErrorOccurredEventArgs> = L"Windows.Media.Audio.IAudioGraphUnrecoverableErrorOccurredEventArgs";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioInputNode> = L"Windows.Media.Audio.IAudioInputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioInputNode2> = L"Windows.Media.Audio.IAudioInputNode2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNode> = L"Windows.Media.Audio.IAudioNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeEmitter> = L"Windows.Media.Audio.IAudioNodeEmitter";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeEmitter2> = L"Windows.Media.Audio.IAudioNodeEmitter2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeEmitterConeProperties> = L"Windows.Media.Audio.IAudioNodeEmitterConeProperties";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModel> = L"Windows.Media.Audio.IAudioNodeEmitterDecayModel";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModelStatics> = L"Windows.Media.Audio.IAudioNodeEmitterDecayModelStatics";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeEmitterFactory> = L"Windows.Media.Audio.IAudioNodeEmitterFactory";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeEmitterNaturalDecayModelProperties> = L"Windows.Media.Audio.IAudioNodeEmitterNaturalDecayModelProperties";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeEmitterShape> = L"Windows.Media.Audio.IAudioNodeEmitterShape";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeEmitterShapeStatics> = L"Windows.Media.Audio.IAudioNodeEmitterShapeStatics";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeListener> = L"Windows.Media.Audio.IAudioNodeListener";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioNodeWithListener> = L"Windows.Media.Audio.IAudioNodeWithListener";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioPlaybackConnection> = L"Windows.Media.Audio.IAudioPlaybackConnection";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioPlaybackConnectionOpenResult> = L"Windows.Media.Audio.IAudioPlaybackConnectionOpenResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioPlaybackConnectionStatics> = L"Windows.Media.Audio.IAudioPlaybackConnectionStatics";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioStateMonitor> = L"Windows.Media.Audio.IAudioStateMonitor";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IAudioStateMonitorStatics> = L"Windows.Media.Audio.IAudioStateMonitorStatics";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult> = L"Windows.Media.Audio.ICreateAudioDeviceInputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult2> = L"Windows.Media.Audio.ICreateAudioDeviceInputNodeResult2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult> = L"Windows.Media.Audio.ICreateAudioDeviceOutputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult2> = L"Windows.Media.Audio.ICreateAudioDeviceOutputNodeResult2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult> = L"Windows.Media.Audio.ICreateAudioFileInputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult2> = L"Windows.Media.Audio.ICreateAudioFileInputNodeResult2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult> = L"Windows.Media.Audio.ICreateAudioFileOutputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult2> = L"Windows.Media.Audio.ICreateAudioFileOutputNodeResult2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioGraphResult> = L"Windows.Media.Audio.ICreateAudioGraphResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateAudioGraphResult2> = L"Windows.Media.Audio.ICreateAudioGraphResult2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult> = L"Windows.Media.Audio.ICreateMediaSourceAudioInputNodeResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult2> = L"Windows.Media.Audio.ICreateMediaSourceAudioInputNodeResult2";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IEchoEffectDefinition> = L"Windows.Media.Audio.IEchoEffectDefinition";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IEchoEffectDefinitionFactory> = L"Windows.Media.Audio.IEchoEffectDefinitionFactory";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IEqualizerBand> = L"Windows.Media.Audio.IEqualizerBand";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IEqualizerEffectDefinition> = L"Windows.Media.Audio.IEqualizerEffectDefinition";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IEqualizerEffectDefinitionFactory> = L"Windows.Media.Audio.IEqualizerEffectDefinitionFactory";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IFrameInputNodeQuantumStartedEventArgs> = L"Windows.Media.Audio.IFrameInputNodeQuantumStartedEventArgs";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ILimiterEffectDefinition> = L"Windows.Media.Audio.ILimiterEffectDefinition";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ILimiterEffectDefinitionFactory> = L"Windows.Media.Audio.ILimiterEffectDefinitionFactory";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IMediaSourceAudioInputNode> = L"Windows.Media.Audio.IMediaSourceAudioInputNode";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IReverbEffectDefinition> = L"Windows.Media.Audio.IReverbEffectDefinition";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::IReverbEffectDefinitionFactory> = L"Windows.Media.Audio.IReverbEffectDefinitionFactory";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ISetDefaultSpatialAudioFormatResult> = L"Windows.Media.Audio.ISetDefaultSpatialAudioFormatResult";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfiguration> = L"Windows.Media.Audio.ISpatialAudioDeviceConfiguration";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfigurationStatics> = L"Windows.Media.Audio.ISpatialAudioDeviceConfigurationStatics";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ISpatialAudioFormatConfiguration> = L"Windows.Media.Audio.ISpatialAudioFormatConfiguration";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ISpatialAudioFormatConfigurationStatics> = L"Windows.Media.Audio.ISpatialAudioFormatConfigurationStatics";
template <> inline constexpr auto& name_v<winrt::Windows::Media::Audio::ISpatialAudioFormatSubtypeStatics> = L"Windows.Media.Audio.ISpatialAudioFormatSubtypeStatics";
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioDeviceInputNode>{ 0xB01B6BE1,0x6F4E,0x49E2,{ 0xAC,0x01,0x55,0x9D,0x62,0xBE,0xB3,0xA9 } }; // B01B6BE1-6F4E-49E2-AC01-559D62BEB3A9
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioDeviceOutputNode>{ 0x362EDBFF,0xFF1C,0x4434,{ 0x9E,0x0F,0xBD,0x2E,0xF5,0x22,0xAC,0x82 } }; // 362EDBFF-FF1C-4434-9E0F-BD2EF522AC82
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioFileInputNode>{ 0x905B67C8,0x6F65,0x4CD4,{ 0x88,0x90,0x46,0x94,0x84,0x3C,0x27,0x6D } }; // 905B67C8-6F65-4CD4-8890-4694843C276D
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioFileOutputNode>{ 0x50E01980,0x5166,0x4093,{ 0x80,0xF8,0xAD,0xA0,0x00,0x89,0xE9,0xCF } }; // 50E01980-5166-4093-80F8-ADA00089E9CF
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioFrameCompletedEventArgs>{ 0xDC7C829E,0x0208,0x4504,{ 0xA5,0xA8,0xF0,0xF2,0x68,0x92,0x0A,0x65 } }; // DC7C829E-0208-4504-A5A8-F0F268920A65
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioFrameInputNode>{ 0x01B266C7,0xFD96,0x4FF5,{ 0xA3,0xC5,0xD2,0x7A,0x9B,0xF4,0x42,0x37 } }; // 01B266C7-FD96-4FF5-A3C5-D27A9BF44237
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioFrameOutputNode>{ 0xB847371B,0x3299,0x45F5,{ 0x88,0xB3,0xC9,0xD1,0x2A,0x3F,0x1C,0xC8 } }; // B847371B-3299-45F5-88B3-C9D12A3F1CC8
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioGraph>{ 0x1AD46EED,0xE48C,0x4E14,{ 0x96,0x60,0x2C,0x4F,0x83,0xE9,0xCD,0xD8 } }; // 1AD46EED-E48C-4E14-9660-2C4F83E9CDD8
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioGraph2>{ 0x4E4C3BD5,0x4FC1,0x45F6,{ 0xA9,0x47,0x3C,0xD3,0x8F,0x4F,0xD8,0x39 } }; // 4E4C3BD5-4FC1-45F6-A947-3CD38F4FD839
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioGraph3>{ 0xDDCD25AE,0x1185,0x42A7,{ 0x83,0x1D,0x6A,0x9B,0x0F,0xC8,0x68,0x20 } }; // DDCD25AE-1185-42A7-831D-6A9B0FC86820
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioGraphConnection>{ 0x763070ED,0xD04E,0x4FAC,{ 0xB2,0x33,0x60,0x0B,0x42,0xED,0xD4,0x69 } }; // 763070ED-D04E-4FAC-B233-600B42EDD469
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioGraphSettings>{ 0x1D59647F,0xE6FE,0x4628,{ 0x84,0xF8,0x9D,0x8B,0xDB,0xA2,0x57,0x85 } }; // 1D59647F-E6FE-4628-84F8-9D8BDBA25785
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioGraphSettings2>{ 0x72919787,0x4DAB,0x46E3,{ 0xB4,0xC9,0xD8,0xE1,0xA2,0x63,0x60,0x62 } }; // 72919787-4DAB-46E3-B4C9-D8E1A2636062
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioGraphSettingsFactory>{ 0xA5D91CC6,0xC2EB,0x4A61,{ 0xA2,0x14,0x1D,0x66,0xD7,0x5F,0x83,0xDA } }; // A5D91CC6-C2EB-4A61-A214-1D66D75F83DA
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioGraphStatics>{ 0x76EC3132,0xE159,0x4AB7,{ 0xA8,0x2A,0x17,0xBE,0xB4,0xB3,0x1E,0x94 } }; // 76EC3132-E159-4AB7-A82A-17BEB4B31E94
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioGraphUnrecoverableErrorOccurredEventArgs>{ 0xC3D9CBE0,0x3FF6,0x4FB3,{ 0xB2,0x62,0x50,0xD4,0x35,0xC5,0x54,0x23 } }; // C3D9CBE0-3FF6-4FB3-B262-50D435C55423
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioInputNode>{ 0xD148005C,0x8428,0x4784,{ 0xB7,0xFD,0xA9,0x9D,0x46,0x8C,0x5D,0x20 } }; // D148005C-8428-4784-B7FD-A99D468C5D20
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioInputNode2>{ 0x905156B7,0xCA68,0x4C6D,{ 0xA8,0xBC,0xE3,0xEE,0x17,0xFE,0x3F,0xD2 } }; // 905156B7-CA68-4C6D-A8BC-E3EE17FE3FD2
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNode>{ 0x15389D7F,0xDBD8,0x4819,{ 0xBF,0x03,0x66,0x8E,0x93,0x57,0xCD,0x6D } }; // 15389D7F-DBD8-4819-BF03-668E9357CD6D
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeEmitter>{ 0x3676971D,0x880A,0x47B8,{ 0xAD,0xF7,0x13,0x23,0xA9,0xD9,0x65,0xBE } }; // 3676971D-880A-47B8-ADF7-1323A9D965BE
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeEmitter2>{ 0x4AB6EECB,0xEC29,0x47F8,{ 0x81,0x8C,0xB6,0xB6,0x60,0xA5,0xAE,0xB1 } }; // 4AB6EECB-EC29-47F8-818C-B6B660A5AEB1
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeEmitterConeProperties>{ 0xE99B2CEE,0x02CA,0x4375,{ 0x93,0x26,0x0C,0x6A,0xE4,0xBC,0xDF,0xB5 } }; // E99B2CEE-02CA-4375-9326-0C6AE4BCDFB5
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModel>{ 0x1D1D5AF7,0x0D53,0x4FA9,{ 0xBD,0x84,0xD5,0x81,0x6A,0x86,0xF3,0xFF } }; // 1D1D5AF7-0D53-4FA9-BD84-D5816A86F3FF
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModelStatics>{ 0xC7787CA8,0xF178,0x462F,{ 0xBC,0x81,0x8D,0xD5,0xCB,0xE5,0xDA,0xE8 } }; // C7787CA8-F178-462F-BC81-8DD5CBE5DAE8
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeEmitterFactory>{ 0xFDC8489A,0x6AD6,0x4CE4,{ 0xB7,0xF7,0xA9,0x93,0x70,0xDF,0x7E,0xE9 } }; // FDC8489A-6AD6-4CE4-B7F7-A99370DF7EE9
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeEmitterNaturalDecayModelProperties>{ 0x48934BCF,0xCF2C,0x4EFC,{ 0x93,0x31,0x75,0xBD,0x22,0xDF,0x1F,0x0C } }; // 48934BCF-CF2C-4EFC-9331-75BD22DF1F0C
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeEmitterShape>{ 0xEA0311C5,0xE73D,0x44BC,{ 0x85,0x9C,0x45,0x55,0x3B,0xBC,0x48,0x28 } }; // EA0311C5-E73D-44BC-859C-45553BBC4828
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeEmitterShapeStatics>{ 0x57BB2771,0xFFA5,0x4B86,{ 0xA7,0x79,0xE2,0x64,0xAE,0xB9,0x14,0x5F } }; // 57BB2771-FFA5-4B86-A779-E264AEB9145F
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeListener>{ 0xD9722E16,0x0C0A,0x41DA,{ 0xB7,0x55,0x6C,0x77,0x83,0x5F,0xB1,0xEB } }; // D9722E16-0C0A-41DA-B755-6C77835FB1EB
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioNodeWithListener>{ 0x0E0F907C,0x79FF,0x4544,{ 0x9E,0xEB,0x01,0x25,0x7B,0x15,0x10,0x5A } }; // 0E0F907C-79FF-4544-9EEB-01257B15105A
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioPlaybackConnection>{ 0x1A4C1DEA,0xCAFC,0x50E7,{ 0x87,0x18,0xEA,0x3F,0x81,0xCB,0xFA,0x51 } }; // 1A4C1DEA-CAFC-50E7-8718-EA3F81CBFA51
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioPlaybackConnectionOpenResult>{ 0x4E656AEF,0x39F9,0x5FC9,{ 0xA5,0x19,0xA5,0xBB,0xFD,0x9F,0xE9,0x21 } }; // 4E656AEF-39F9-5FC9-A519-A5BBFD9FE921
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioPlaybackConnectionStatics>{ 0xE60963A2,0x69E6,0x5FFC,{ 0x9E,0x13,0x82,0x4A,0x85,0x21,0x3D,0xAF } }; // E60963A2-69E6-5FFC-9E13-824A85213DAF
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioStateMonitor>{ 0x1D13D136,0x0199,0x4CDC,{ 0xB8,0x4E,0xE7,0x2C,0x2B,0x58,0x1E,0xCE } }; // 1D13D136-0199-4CDC-B84E-E72C2B581ECE
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IAudioStateMonitorStatics>{ 0x6374EA4C,0x1B3B,0x4001,{ 0x94,0xD9,0xDD,0x22,0x53,0x30,0xFA,0x40 } }; // 6374EA4C-1B3B-4001-94D9-DD225330FA40
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult>{ 0x16EEC7A8,0x1CA7,0x40EF,{ 0x91,0xA4,0xD3,0x46,0xE0,0xAA,0x1B,0xBA } }; // 16EEC7A8-1CA7-40EF-91A4-D346E0AA1BBA
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult2>{ 0x921C69CE,0x3F35,0x41C7,{ 0x96,0x22,0x79,0xF6,0x08,0xBA,0xED,0xC2 } }; // 921C69CE-3F35-41C7-9622-79F608BAEDC2
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult>{ 0xF7776D27,0x1D9A,0x47F7,{ 0x9C,0xD4,0x28,0x59,0xCC,0x1B,0x7B,0xFF } }; // F7776D27-1D9A-47F7-9CD4-2859CC1B7BFF
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult2>{ 0x4864269F,0xBDCE,0x4AB1,{ 0xBD,0x38,0xFB,0xAE,0x93,0xAE,0xDA,0xCA } }; // 4864269F-BDCE-4AB1-BD38-FBAE93AEDACA
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult>{ 0xCE83D61C,0xE297,0x4C50,{ 0x9C,0xE7,0x1C,0x7A,0x69,0xD6,0xBD,0x09 } }; // CE83D61C-E297-4C50-9CE7-1C7A69D6BD09
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult2>{ 0xF9082020,0x3D80,0x4FE0,{ 0x81,0xC1,0x76,0x8F,0xEA,0x7C,0xA7,0xE0 } }; // F9082020-3D80-4FE0-81C1-768FEA7CA7E0
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult>{ 0x47D6BA7B,0xE909,0x453F,{ 0x86,0x6E,0x55,0x40,0xCD,0xA7,0x34,0xFF } }; // 47D6BA7B-E909-453F-866E-5540CDA734FF
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult2>{ 0x9F01B50D,0x3318,0x47B3,{ 0xA6,0x0A,0x1B,0x49,0x2B,0xE7,0xFC,0x0D } }; // 9F01B50D-3318-47B3-A60A-1B492BE7FC0D
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioGraphResult>{ 0x5453EF7E,0x7BDE,0x4B76,{ 0xBB,0x5D,0x48,0xF7,0x9C,0xFC,0x8C,0x0B } }; // 5453EF7E-7BDE-4B76-BB5D-48F79CFC8C0B
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateAudioGraphResult2>{ 0x6D738DFC,0x88C6,0x4FCB,{ 0xA5,0x34,0x85,0xCE,0xDD,0x40,0x50,0xA1 } }; // 6D738DFC-88C6-4FCB-A534-85CEDD4050A1
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult>{ 0x46A658A3,0x53C0,0x4D59,{ 0x9E,0x51,0xCC,0x1D,0x10,0x44,0xA4,0xC4 } }; // 46A658A3-53C0-4D59-9E51-CC1D1044A4C4
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult2>{ 0x63514CE8,0x6A1A,0x49E3,{ 0x97,0xEC,0x28,0xFD,0x5B,0xE1,0x14,0xE5 } }; // 63514CE8-6A1A-49E3-97EC-28FD5BE114E5
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IEchoEffectDefinition>{ 0x0E4D3FAA,0x36B8,0x4C91,{ 0xB9,0xDA,0x11,0xF4,0x4A,0x8A,0x66,0x10 } }; // 0E4D3FAA-36B8-4C91-B9DA-11F44A8A6610
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IEchoEffectDefinitionFactory>{ 0x0D4E2257,0xAAF2,0x4E86,{ 0xA5,0x4C,0xFB,0x79,0xDB,0x8F,0x6C,0x12 } }; // 0D4E2257-AAF2-4E86-A54C-FB79DB8F6C12
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IEqualizerBand>{ 0xC00A5A6A,0x262D,0x4B85,{ 0x9B,0xB7,0x43,0x28,0x0B,0x62,0xED,0x0C } }; // C00A5A6A-262D-4B85-9BB7-43280B62ED0C
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IEqualizerEffectDefinition>{ 0x023F6F1F,0x83FE,0x449A,{ 0xA8,0x22,0xC6,0x96,0x44,0x2D,0x16,0xB0 } }; // 023F6F1F-83FE-449A-A822-C696442D16B0
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IEqualizerEffectDefinitionFactory>{ 0xD2876FC4,0xD410,0x4EB5,{ 0x9E,0x69,0xC9,0xAA,0x12,0x77,0xEA,0xF0 } }; // D2876FC4-D410-4EB5-9E69-C9AA1277EAF0
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IFrameInputNodeQuantumStartedEventArgs>{ 0x3D9BD498,0xA306,0x4F06,{ 0xBD,0x9F,0xE9,0xEF,0xC8,0x22,0x63,0x04 } }; // 3D9BD498-A306-4F06-BD9F-E9EFC8226304
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ILimiterEffectDefinition>{ 0x6B755D19,0x2603,0x47BA,{ 0xBD,0xEB,0x39,0x05,0x5E,0x34,0x86,0xDC } }; // 6B755D19-2603-47BA-BDEB-39055E3486DC
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ILimiterEffectDefinitionFactory>{ 0xECBAE6F1,0x61FF,0x45EF,{ 0xB8,0xF5,0x48,0x65,0x9A,0x57,0xC7,0x2D } }; // ECBAE6F1-61FF-45EF-B8F5-48659A57C72D
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IMediaSourceAudioInputNode>{ 0x99D8983B,0xA88A,0x4041,{ 0x8E,0x4F,0xDD,0xBA,0xC0,0xC9,0x1F,0xD3 } }; // 99D8983B-A88A-4041-8E4F-DDBAC0C91FD3
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IReverbEffectDefinition>{ 0x4606AA89,0xF563,0x4D0A,{ 0x8F,0x6E,0xF0,0xCD,0xDF,0xF3,0x5D,0x84 } }; // 4606AA89-F563-4D0A-8F6E-F0CDDFF35D84
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::IReverbEffectDefinitionFactory>{ 0xA7D5CBFE,0x100B,0x4FF0,{ 0x9D,0xA6,0xDC,0x4E,0x05,0xA7,0x59,0xF0 } }; // A7D5CBFE-100B-4FF0-9DA6-DC4E05A759F0
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ISetDefaultSpatialAudioFormatResult>{ 0x1C2AA511,0x1400,0x5E70,{ 0x9E,0xA9,0xAE,0x15,0x12,0x41,0xE8,0xEA } }; // 1C2AA511-1400-5E70-9EA9-AE151241E8EA
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfiguration>{ 0xEE830034,0x61CF,0x5749,{ 0x9D,0xA4,0x10,0xF0,0xFE,0x02,0x81,0x99 } }; // EE830034-61CF-5749-9DA4-10F0FE028199
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfigurationStatics>{ 0x3EC37F7B,0x936D,0x4E04,{ 0x97,0x28,0x28,0x27,0xD9,0xF7,0x58,0xC4 } }; // 3EC37F7B-936D-4E04-9728-2827D9F758C4
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ISpatialAudioFormatConfiguration>{ 0x32DF09A8,0x50F0,0x5395,{ 0x99,0x23,0x7D,0x44,0xCA,0x71,0xED,0x6D } }; // 32DF09A8-50F0-5395-9923-7D44CA71ED6D
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ISpatialAudioFormatConfigurationStatics>{ 0x2B5FEF71,0x67C9,0x4E5F,{ 0xA3,0x5B,0x41,0x68,0x07,0x11,0xF8,0xC7 } }; // 2B5FEF71-67C9-4E5F-A35B-41680711F8C7
template <> inline constexpr guid guid_v<winrt::Windows::Media::Audio::ISpatialAudioFormatSubtypeStatics>{ 0xB3DE8A47,0x83EE,0x4266,{ 0xA9,0x45,0xBE,0xDF,0x50,0x7A,0xFE,0xED } }; // B3DE8A47-83EE-4266-A945-BEDF507AFEED
template <> struct default_interface<winrt::Windows::Media::Audio::AudioDeviceInputNode>{ using type = winrt::Windows::Media::Audio::IAudioDeviceInputNode; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioDeviceOutputNode>{ using type = winrt::Windows::Media::Audio::IAudioDeviceOutputNode; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioFileInputNode>{ using type = winrt::Windows::Media::Audio::IAudioFileInputNode; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioFileOutputNode>{ using type = winrt::Windows::Media::Audio::IAudioFileOutputNode; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioFrameCompletedEventArgs>{ using type = winrt::Windows::Media::Audio::IAudioFrameCompletedEventArgs; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioFrameInputNode>{ using type = winrt::Windows::Media::Audio::IAudioFrameInputNode; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioFrameOutputNode>{ using type = winrt::Windows::Media::Audio::IAudioFrameOutputNode; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioGraph>{ using type = winrt::Windows::Media::Audio::IAudioGraph; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioGraphBatchUpdater>{ using type = winrt::Windows::Foundation::IClosable; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioGraphConnection>{ using type = winrt::Windows::Media::Audio::IAudioGraphConnection; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioGraphSettings>{ using type = winrt::Windows::Media::Audio::IAudioGraphSettings; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioGraphUnrecoverableErrorOccurredEventArgs>{ using type = winrt::Windows::Media::Audio::IAudioGraphUnrecoverableErrorOccurredEventArgs; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioNodeEmitter>{ using type = winrt::Windows::Media::Audio::IAudioNodeEmitter; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioNodeEmitterConeProperties>{ using type = winrt::Windows::Media::Audio::IAudioNodeEmitterConeProperties; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioNodeEmitterDecayModel>{ using type = winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModel; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioNodeEmitterNaturalDecayModelProperties>{ using type = winrt::Windows::Media::Audio::IAudioNodeEmitterNaturalDecayModelProperties; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioNodeEmitterShape>{ using type = winrt::Windows::Media::Audio::IAudioNodeEmitterShape; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioNodeListener>{ using type = winrt::Windows::Media::Audio::IAudioNodeListener; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioPlaybackConnection>{ using type = winrt::Windows::Media::Audio::IAudioPlaybackConnection; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioPlaybackConnectionOpenResult>{ using type = winrt::Windows::Media::Audio::IAudioPlaybackConnectionOpenResult; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioStateMonitor>{ using type = winrt::Windows::Media::Audio::IAudioStateMonitor; };
template <> struct default_interface<winrt::Windows::Media::Audio::AudioSubmixNode>{ using type = winrt::Windows::Media::Audio::IAudioInputNode; };
template <> struct default_interface<winrt::Windows::Media::Audio::CreateAudioDeviceInputNodeResult>{ using type = winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult; };
template <> struct default_interface<winrt::Windows::Media::Audio::CreateAudioDeviceOutputNodeResult>{ using type = winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult; };
template <> struct default_interface<winrt::Windows::Media::Audio::CreateAudioFileInputNodeResult>{ using type = winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult; };
template <> struct default_interface<winrt::Windows::Media::Audio::CreateAudioFileOutputNodeResult>{ using type = winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult; };
template <> struct default_interface<winrt::Windows::Media::Audio::CreateAudioGraphResult>{ using type = winrt::Windows::Media::Audio::ICreateAudioGraphResult; };
template <> struct default_interface<winrt::Windows::Media::Audio::CreateMediaSourceAudioInputNodeResult>{ using type = winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult; };
template <> struct default_interface<winrt::Windows::Media::Audio::EchoEffectDefinition>{ using type = winrt::Windows::Media::Audio::IEchoEffectDefinition; };
template <> struct default_interface<winrt::Windows::Media::Audio::EqualizerBand>{ using type = winrt::Windows::Media::Audio::IEqualizerBand; };
template <> struct default_interface<winrt::Windows::Media::Audio::EqualizerEffectDefinition>{ using type = winrt::Windows::Media::Audio::IEqualizerEffectDefinition; };
template <> struct default_interface<winrt::Windows::Media::Audio::FrameInputNodeQuantumStartedEventArgs>{ using type = winrt::Windows::Media::Audio::IFrameInputNodeQuantumStartedEventArgs; };
template <> struct default_interface<winrt::Windows::Media::Audio::LimiterEffectDefinition>{ using type = winrt::Windows::Media::Audio::ILimiterEffectDefinition; };
template <> struct default_interface<winrt::Windows::Media::Audio::MediaSourceAudioInputNode>{ using type = winrt::Windows::Media::Audio::IMediaSourceAudioInputNode; };
template <> struct default_interface<winrt::Windows::Media::Audio::ReverbEffectDefinition>{ using type = winrt::Windows::Media::Audio::IReverbEffectDefinition; };
template <> struct default_interface<winrt::Windows::Media::Audio::SetDefaultSpatialAudioFormatResult>{ using type = winrt::Windows::Media::Audio::ISetDefaultSpatialAudioFormatResult; };
template <> struct default_interface<winrt::Windows::Media::Audio::SpatialAudioDeviceConfiguration>{ using type = winrt::Windows::Media::Audio::ISpatialAudioDeviceConfiguration; };
template <> struct default_interface<winrt::Windows::Media::Audio::SpatialAudioFormatConfiguration>{ using type = winrt::Windows::Media::Audio::ISpatialAudioFormatConfiguration; };
template <> struct abi<winrt::Windows::Media::Audio::IAudioDeviceInputNode>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Device(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioDeviceOutputNode>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Device(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioFileInputNode>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall put_PlaybackSpeedFactor(double) noexcept = 0;
virtual int32_t __stdcall get_PlaybackSpeedFactor(double*) noexcept = 0;
virtual int32_t __stdcall get_Position(int64_t*) noexcept = 0;
virtual int32_t __stdcall Seek(int64_t) noexcept = 0;
virtual int32_t __stdcall get_StartTime(void**) noexcept = 0;
virtual int32_t __stdcall put_StartTime(void*) noexcept = 0;
virtual int32_t __stdcall get_EndTime(void**) noexcept = 0;
virtual int32_t __stdcall put_EndTime(void*) noexcept = 0;
virtual int32_t __stdcall get_LoopCount(void**) noexcept = 0;
virtual int32_t __stdcall put_LoopCount(void*) noexcept = 0;
virtual int32_t __stdcall get_Duration(int64_t*) noexcept = 0;
virtual int32_t __stdcall get_SourceFile(void**) noexcept = 0;
virtual int32_t __stdcall add_FileCompleted(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_FileCompleted(winrt::event_token) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioFileOutputNode>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_File(void**) noexcept = 0;
virtual int32_t __stdcall get_FileEncodingProfile(void**) noexcept = 0;
virtual int32_t __stdcall FinalizeAsync(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioFrameCompletedEventArgs>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Frame(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioFrameInputNode>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall put_PlaybackSpeedFactor(double) noexcept = 0;
virtual int32_t __stdcall get_PlaybackSpeedFactor(double*) noexcept = 0;
virtual int32_t __stdcall AddFrame(void*) noexcept = 0;
virtual int32_t __stdcall DiscardQueuedFrames() noexcept = 0;
virtual int32_t __stdcall get_QueuedSampleCount(uint64_t*) noexcept = 0;
virtual int32_t __stdcall add_AudioFrameCompleted(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_AudioFrameCompleted(winrt::event_token) noexcept = 0;
virtual int32_t __stdcall add_QuantumStarted(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_QuantumStarted(winrt::event_token) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioFrameOutputNode>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall GetFrame(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioGraph>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall CreateFrameInputNode(void**) noexcept = 0;
virtual int32_t __stdcall CreateFrameInputNodeWithFormat(void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateDeviceInputNodeAsync(int32_t, void**) noexcept = 0;
virtual int32_t __stdcall CreateDeviceInputNodeWithFormatAsync(int32_t, void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateDeviceInputNodeWithFormatOnDeviceAsync(int32_t, void*, void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateFrameOutputNode(void**) noexcept = 0;
virtual int32_t __stdcall CreateFrameOutputNodeWithFormat(void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateDeviceOutputNodeAsync(void**) noexcept = 0;
virtual int32_t __stdcall CreateFileInputNodeAsync(void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateFileOutputNodeAsync(void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateFileOutputNodeWithFileProfileAsync(void*, void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateSubmixNode(void**) noexcept = 0;
virtual int32_t __stdcall CreateSubmixNodeWithFormat(void*, void**) noexcept = 0;
virtual int32_t __stdcall Start() noexcept = 0;
virtual int32_t __stdcall Stop() noexcept = 0;
virtual int32_t __stdcall ResetAllNodes() noexcept = 0;
virtual int32_t __stdcall add_QuantumStarted(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_QuantumStarted(winrt::event_token) noexcept = 0;
virtual int32_t __stdcall add_QuantumProcessed(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_QuantumProcessed(winrt::event_token) noexcept = 0;
virtual int32_t __stdcall add_UnrecoverableErrorOccurred(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_UnrecoverableErrorOccurred(winrt::event_token) noexcept = 0;
virtual int32_t __stdcall get_CompletedQuantumCount(uint64_t*) noexcept = 0;
virtual int32_t __stdcall get_EncodingProperties(void**) noexcept = 0;
virtual int32_t __stdcall get_LatencyInSamples(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_PrimaryRenderDevice(void**) noexcept = 0;
virtual int32_t __stdcall get_RenderDeviceAudioProcessing(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_SamplesPerQuantum(int32_t*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioGraph2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall CreateFrameInputNodeWithFormatAndEmitter(void*, void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateDeviceInputNodeWithFormatAndEmitterOnDeviceAsync(int32_t, void*, void*, void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateFileInputNodeWithEmitterAsync(void*, void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateSubmixNodeWithFormatAndEmitter(void*, void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateBatchUpdater(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioGraph3>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall CreateMediaSourceAudioInputNodeAsync(void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateMediaSourceAudioInputNodeWithEmitterAsync(void*, void*, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioGraphConnection>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Destination(void**) noexcept = 0;
virtual int32_t __stdcall put_Gain(double) noexcept = 0;
virtual int32_t __stdcall get_Gain(double*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioGraphSettings>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_EncodingProperties(void**) noexcept = 0;
virtual int32_t __stdcall put_EncodingProperties(void*) noexcept = 0;
virtual int32_t __stdcall get_PrimaryRenderDevice(void**) noexcept = 0;
virtual int32_t __stdcall put_PrimaryRenderDevice(void*) noexcept = 0;
virtual int32_t __stdcall get_QuantumSizeSelectionMode(int32_t*) noexcept = 0;
virtual int32_t __stdcall put_QuantumSizeSelectionMode(int32_t) noexcept = 0;
virtual int32_t __stdcall get_DesiredSamplesPerQuantum(int32_t*) noexcept = 0;
virtual int32_t __stdcall put_DesiredSamplesPerQuantum(int32_t) noexcept = 0;
virtual int32_t __stdcall get_AudioRenderCategory(int32_t*) noexcept = 0;
virtual int32_t __stdcall put_AudioRenderCategory(int32_t) noexcept = 0;
virtual int32_t __stdcall get_DesiredRenderDeviceAudioProcessing(int32_t*) noexcept = 0;
virtual int32_t __stdcall put_DesiredRenderDeviceAudioProcessing(int32_t) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioGraphSettings2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall put_MaxPlaybackSpeedFactor(double) noexcept = 0;
virtual int32_t __stdcall get_MaxPlaybackSpeedFactor(double*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioGraphSettingsFactory>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall Create(int32_t, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioGraphStatics>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall CreateAsync(void*, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioGraphUnrecoverableErrorOccurredEventArgs>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Error(int32_t*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioInputNode>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_OutgoingConnections(void**) noexcept = 0;
virtual int32_t __stdcall AddOutgoingConnection(void*) noexcept = 0;
virtual int32_t __stdcall AddOutgoingConnectionWithGain(void*, double) noexcept = 0;
virtual int32_t __stdcall RemoveOutgoingConnection(void*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioInputNode2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Emitter(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNode>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_EffectDefinitions(void**) noexcept = 0;
virtual int32_t __stdcall put_OutgoingGain(double) noexcept = 0;
virtual int32_t __stdcall get_OutgoingGain(double*) noexcept = 0;
virtual int32_t __stdcall get_EncodingProperties(void**) noexcept = 0;
virtual int32_t __stdcall get_ConsumeInput(bool*) noexcept = 0;
virtual int32_t __stdcall put_ConsumeInput(bool) noexcept = 0;
virtual int32_t __stdcall Start() noexcept = 0;
virtual int32_t __stdcall Stop() noexcept = 0;
virtual int32_t __stdcall Reset() noexcept = 0;
virtual int32_t __stdcall DisableEffectsByDefinition(void*) noexcept = 0;
virtual int32_t __stdcall EnableEffectsByDefinition(void*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeEmitter>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Position(winrt::Windows::Foundation::Numerics::float3*) noexcept = 0;
virtual int32_t __stdcall put_Position(winrt::Windows::Foundation::Numerics::float3) noexcept = 0;
virtual int32_t __stdcall get_Direction(winrt::Windows::Foundation::Numerics::float3*) noexcept = 0;
virtual int32_t __stdcall put_Direction(winrt::Windows::Foundation::Numerics::float3) noexcept = 0;
virtual int32_t __stdcall get_Shape(void**) noexcept = 0;
virtual int32_t __stdcall get_DecayModel(void**) noexcept = 0;
virtual int32_t __stdcall get_Gain(double*) noexcept = 0;
virtual int32_t __stdcall put_Gain(double) noexcept = 0;
virtual int32_t __stdcall get_DistanceScale(double*) noexcept = 0;
virtual int32_t __stdcall put_DistanceScale(double) noexcept = 0;
virtual int32_t __stdcall get_DopplerScale(double*) noexcept = 0;
virtual int32_t __stdcall put_DopplerScale(double) noexcept = 0;
virtual int32_t __stdcall get_DopplerVelocity(winrt::Windows::Foundation::Numerics::float3*) noexcept = 0;
virtual int32_t __stdcall put_DopplerVelocity(winrt::Windows::Foundation::Numerics::float3) noexcept = 0;
virtual int32_t __stdcall get_IsDopplerDisabled(bool*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeEmitter2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_SpatialAudioModel(int32_t*) noexcept = 0;
virtual int32_t __stdcall put_SpatialAudioModel(int32_t) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeEmitterConeProperties>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_InnerAngle(double*) noexcept = 0;
virtual int32_t __stdcall get_OuterAngle(double*) noexcept = 0;
virtual int32_t __stdcall get_OuterAngleGain(double*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModel>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Kind(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_MinGain(double*) noexcept = 0;
virtual int32_t __stdcall get_MaxGain(double*) noexcept = 0;
virtual int32_t __stdcall get_NaturalProperties(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModelStatics>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall CreateNatural(double, double, double, double, void**) noexcept = 0;
virtual int32_t __stdcall CreateCustom(double, double, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeEmitterFactory>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall CreateAudioNodeEmitter(void*, void*, uint32_t, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeEmitterNaturalDecayModelProperties>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_UnityGainDistance(double*) noexcept = 0;
virtual int32_t __stdcall get_CutoffDistance(double*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeEmitterShape>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Kind(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_ConeProperties(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeEmitterShapeStatics>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall CreateCone(double, double, double, void**) noexcept = 0;
virtual int32_t __stdcall CreateOmnidirectional(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeListener>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Position(winrt::Windows::Foundation::Numerics::float3*) noexcept = 0;
virtual int32_t __stdcall put_Position(winrt::Windows::Foundation::Numerics::float3) noexcept = 0;
virtual int32_t __stdcall get_Orientation(winrt::Windows::Foundation::Numerics::quaternion*) noexcept = 0;
virtual int32_t __stdcall put_Orientation(winrt::Windows::Foundation::Numerics::quaternion) noexcept = 0;
virtual int32_t __stdcall get_SpeedOfSound(double*) noexcept = 0;
virtual int32_t __stdcall put_SpeedOfSound(double) noexcept = 0;
virtual int32_t __stdcall get_DopplerVelocity(winrt::Windows::Foundation::Numerics::float3*) noexcept = 0;
virtual int32_t __stdcall put_DopplerVelocity(winrt::Windows::Foundation::Numerics::float3) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioNodeWithListener>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall put_Listener(void*) noexcept = 0;
virtual int32_t __stdcall get_Listener(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioPlaybackConnection>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall Start() noexcept = 0;
virtual int32_t __stdcall StartAsync(void**) noexcept = 0;
virtual int32_t __stdcall get_DeviceId(void**) noexcept = 0;
virtual int32_t __stdcall get_State(int32_t*) noexcept = 0;
virtual int32_t __stdcall Open(void**) noexcept = 0;
virtual int32_t __stdcall OpenAsync(void**) noexcept = 0;
virtual int32_t __stdcall add_StateChanged(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_StateChanged(winrt::event_token) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioPlaybackConnectionOpenResult>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Status(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioPlaybackConnectionStatics>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall GetDeviceSelector(void**) noexcept = 0;
virtual int32_t __stdcall TryCreateFromId(void*, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioStateMonitor>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall add_SoundLevelChanged(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_SoundLevelChanged(winrt::event_token) noexcept = 0;
virtual int32_t __stdcall get_SoundLevel(int32_t*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IAudioStateMonitorStatics>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall CreateForRenderMonitoring(void**) noexcept = 0;
virtual int32_t __stdcall CreateForRenderMonitoringWithCategory(int32_t, void**) noexcept = 0;
virtual int32_t __stdcall CreateForRenderMonitoringWithCategoryAndDeviceRole(int32_t, int32_t, void**) noexcept = 0;
virtual int32_t __stdcall CreateForRenderMonitoringWithCategoryAndDeviceId(int32_t, void*, void**) noexcept = 0;
virtual int32_t __stdcall CreateForCaptureMonitoring(void**) noexcept = 0;
virtual int32_t __stdcall CreateForCaptureMonitoringWithCategory(int32_t, void**) noexcept = 0;
virtual int32_t __stdcall CreateForCaptureMonitoringWithCategoryAndDeviceRole(int32_t, int32_t, void**) noexcept = 0;
virtual int32_t __stdcall CreateForCaptureMonitoringWithCategoryAndDeviceId(int32_t, void*, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Status(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_DeviceInputNode(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Status(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_DeviceOutputNode(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Status(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_FileInputNode(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Status(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_FileOutputNode(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioGraphResult>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Status(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_Graph(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateAudioGraphResult2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Status(int32_t*) noexcept = 0;
virtual int32_t __stdcall get_Node(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult2>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_ExtendedError(winrt::hresult*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IEchoEffectDefinition>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall put_WetDryMix(double) noexcept = 0;
virtual int32_t __stdcall get_WetDryMix(double*) noexcept = 0;
virtual int32_t __stdcall put_Feedback(double) noexcept = 0;
virtual int32_t __stdcall get_Feedback(double*) noexcept = 0;
virtual int32_t __stdcall put_Delay(double) noexcept = 0;
virtual int32_t __stdcall get_Delay(double*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IEchoEffectDefinitionFactory>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall Create(void*, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IEqualizerBand>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Bandwidth(double*) noexcept = 0;
virtual int32_t __stdcall put_Bandwidth(double) noexcept = 0;
virtual int32_t __stdcall get_FrequencyCenter(double*) noexcept = 0;
virtual int32_t __stdcall put_FrequencyCenter(double) noexcept = 0;
virtual int32_t __stdcall get_Gain(double*) noexcept = 0;
virtual int32_t __stdcall put_Gain(double) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IEqualizerEffectDefinition>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Bands(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IEqualizerEffectDefinitionFactory>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall Create(void*, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IFrameInputNodeQuantumStartedEventArgs>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_RequiredSamples(int32_t*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ILimiterEffectDefinition>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall put_Release(uint32_t) noexcept = 0;
virtual int32_t __stdcall get_Release(uint32_t*) noexcept = 0;
virtual int32_t __stdcall put_Loudness(uint32_t) noexcept = 0;
virtual int32_t __stdcall get_Loudness(uint32_t*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ILimiterEffectDefinitionFactory>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall Create(void*, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IMediaSourceAudioInputNode>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall put_PlaybackSpeedFactor(double) noexcept = 0;
virtual int32_t __stdcall get_PlaybackSpeedFactor(double*) noexcept = 0;
virtual int32_t __stdcall get_Position(int64_t*) noexcept = 0;
virtual int32_t __stdcall Seek(int64_t) noexcept = 0;
virtual int32_t __stdcall get_StartTime(void**) noexcept = 0;
virtual int32_t __stdcall put_StartTime(void*) noexcept = 0;
virtual int32_t __stdcall get_EndTime(void**) noexcept = 0;
virtual int32_t __stdcall put_EndTime(void*) noexcept = 0;
virtual int32_t __stdcall get_LoopCount(void**) noexcept = 0;
virtual int32_t __stdcall put_LoopCount(void*) noexcept = 0;
virtual int32_t __stdcall get_Duration(int64_t*) noexcept = 0;
virtual int32_t __stdcall get_MediaSource(void**) noexcept = 0;
virtual int32_t __stdcall add_MediaSourceCompleted(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_MediaSourceCompleted(winrt::event_token) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IReverbEffectDefinition>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall put_WetDryMix(double) noexcept = 0;
virtual int32_t __stdcall get_WetDryMix(double*) noexcept = 0;
virtual int32_t __stdcall put_ReflectionsDelay(uint32_t) noexcept = 0;
virtual int32_t __stdcall get_ReflectionsDelay(uint32_t*) noexcept = 0;
virtual int32_t __stdcall put_ReverbDelay(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_ReverbDelay(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_RearDelay(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_RearDelay(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_PositionLeft(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_PositionLeft(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_PositionRight(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_PositionRight(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_PositionMatrixLeft(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_PositionMatrixLeft(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_PositionMatrixRight(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_PositionMatrixRight(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_EarlyDiffusion(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_EarlyDiffusion(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_LateDiffusion(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_LateDiffusion(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_LowEQGain(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_LowEQGain(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_LowEQCutoff(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_LowEQCutoff(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_HighEQGain(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_HighEQGain(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_HighEQCutoff(uint8_t) noexcept = 0;
virtual int32_t __stdcall get_HighEQCutoff(uint8_t*) noexcept = 0;
virtual int32_t __stdcall put_RoomFilterFreq(double) noexcept = 0;
virtual int32_t __stdcall get_RoomFilterFreq(double*) noexcept = 0;
virtual int32_t __stdcall put_RoomFilterMain(double) noexcept = 0;
virtual int32_t __stdcall get_RoomFilterMain(double*) noexcept = 0;
virtual int32_t __stdcall put_RoomFilterHF(double) noexcept = 0;
virtual int32_t __stdcall get_RoomFilterHF(double*) noexcept = 0;
virtual int32_t __stdcall put_ReflectionsGain(double) noexcept = 0;
virtual int32_t __stdcall get_ReflectionsGain(double*) noexcept = 0;
virtual int32_t __stdcall put_ReverbGain(double) noexcept = 0;
virtual int32_t __stdcall get_ReverbGain(double*) noexcept = 0;
virtual int32_t __stdcall put_DecayTime(double) noexcept = 0;
virtual int32_t __stdcall get_DecayTime(double*) noexcept = 0;
virtual int32_t __stdcall put_Density(double) noexcept = 0;
virtual int32_t __stdcall get_Density(double*) noexcept = 0;
virtual int32_t __stdcall put_RoomSize(double) noexcept = 0;
virtual int32_t __stdcall get_RoomSize(double*) noexcept = 0;
virtual int32_t __stdcall put_DisableLateField(bool) noexcept = 0;
virtual int32_t __stdcall get_DisableLateField(bool*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::IReverbEffectDefinitionFactory>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall Create(void*, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ISetDefaultSpatialAudioFormatResult>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_Status(int32_t*) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfiguration>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_DeviceId(void**) noexcept = 0;
virtual int32_t __stdcall get_IsSpatialAudioSupported(bool*) noexcept = 0;
virtual int32_t __stdcall IsSpatialAudioFormatSupported(void*, bool*) noexcept = 0;
virtual int32_t __stdcall get_ActiveSpatialAudioFormat(void**) noexcept = 0;
virtual int32_t __stdcall get_DefaultSpatialAudioFormat(void**) noexcept = 0;
virtual int32_t __stdcall SetDefaultSpatialAudioFormatAsync(void*, void**) noexcept = 0;
virtual int32_t __stdcall add_ConfigurationChanged(void*, winrt::event_token*) noexcept = 0;
virtual int32_t __stdcall remove_ConfigurationChanged(winrt::event_token) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfigurationStatics>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall GetForDeviceId(void*, void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ISpatialAudioFormatConfiguration>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall ReportLicenseChangedAsync(void*, void**) noexcept = 0;
virtual int32_t __stdcall ReportConfigurationChangedAsync(void*, void**) noexcept = 0;
virtual int32_t __stdcall get_MixedRealityExclusiveModePolicy(int32_t*) noexcept = 0;
virtual int32_t __stdcall put_MixedRealityExclusiveModePolicy(int32_t) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ISpatialAudioFormatConfigurationStatics>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall GetDefault(void**) noexcept = 0;
};
};
template <> struct abi<winrt::Windows::Media::Audio::ISpatialAudioFormatSubtypeStatics>
{
struct __declspec(novtable) type : inspectable_abi
{
virtual int32_t __stdcall get_WindowsSonic(void**) noexcept = 0;
virtual int32_t __stdcall get_DolbyAtmosForHeadphones(void**) noexcept = 0;
virtual int32_t __stdcall get_DolbyAtmosForHomeTheater(void**) noexcept = 0;
virtual int32_t __stdcall get_DolbyAtmosForSpeakers(void**) noexcept = 0;
virtual int32_t __stdcall get_DTSHeadphoneX(void**) noexcept = 0;
virtual int32_t __stdcall get_DTSXUltra(void**) noexcept = 0;
};
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioDeviceInputNode
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Devices::Enumeration::DeviceInformation) Device() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioDeviceInputNode>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioDeviceInputNode<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioDeviceOutputNode
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Devices::Enumeration::DeviceInformation) Device() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioDeviceOutputNode>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioDeviceOutputNode<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioFileInputNode
{
WINRT_IMPL_AUTO(void) PlaybackSpeedFactor(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) PlaybackSpeedFactor() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::TimeSpan) Position() const;
WINRT_IMPL_AUTO(void) Seek(winrt::Windows::Foundation::TimeSpan const& position) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan>) StartTime() const;
WINRT_IMPL_AUTO(void) StartTime(winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan> const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan>) EndTime() const;
WINRT_IMPL_AUTO(void) EndTime(winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan> const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::IReference<int32_t>) LoopCount() const;
WINRT_IMPL_AUTO(void) LoopCount(winrt::Windows::Foundation::IReference<int32_t> const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::TimeSpan) Duration() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Storage::StorageFile) SourceFile() const;
WINRT_IMPL_AUTO(winrt::event_token) FileCompleted(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioFileInputNode, winrt::Windows::Foundation::IInspectable> const& handler) const;
using FileCompleted_revoker = impl::event_revoker<winrt::Windows::Media::Audio::IAudioFileInputNode, &impl::abi_t<winrt::Windows::Media::Audio::IAudioFileInputNode>::remove_FileCompleted>;
[[nodiscard]] FileCompleted_revoker FileCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioFileInputNode, winrt::Windows::Foundation::IInspectable> const& handler) const;
WINRT_IMPL_AUTO(void) FileCompleted(winrt::event_token const& token) const noexcept;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioFileInputNode>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioFileInputNode<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioFileOutputNode
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Storage::IStorageFile) File() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::MediaProperties::MediaEncodingProfile) FileEncodingProfile() const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Transcoding::TranscodeFailureReason>) FinalizeAsync() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioFileOutputNode>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioFileOutputNode<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioFrameCompletedEventArgs
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::AudioFrame) Frame() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioFrameCompletedEventArgs>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioFrameCompletedEventArgs<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioFrameInputNode
{
WINRT_IMPL_AUTO(void) PlaybackSpeedFactor(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) PlaybackSpeedFactor() const;
WINRT_IMPL_AUTO(void) AddFrame(winrt::Windows::Media::AudioFrame const& frame) const;
WINRT_IMPL_AUTO(void) DiscardQueuedFrames() const;
[[nodiscard]] WINRT_IMPL_AUTO(uint64_t) QueuedSampleCount() const;
WINRT_IMPL_AUTO(winrt::event_token) AudioFrameCompleted(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioFrameInputNode, winrt::Windows::Media::Audio::AudioFrameCompletedEventArgs> const& handler) const;
using AudioFrameCompleted_revoker = impl::event_revoker<winrt::Windows::Media::Audio::IAudioFrameInputNode, &impl::abi_t<winrt::Windows::Media::Audio::IAudioFrameInputNode>::remove_AudioFrameCompleted>;
[[nodiscard]] AudioFrameCompleted_revoker AudioFrameCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioFrameInputNode, winrt::Windows::Media::Audio::AudioFrameCompletedEventArgs> const& handler) const;
WINRT_IMPL_AUTO(void) AudioFrameCompleted(winrt::event_token const& token) const noexcept;
WINRT_IMPL_AUTO(winrt::event_token) QuantumStarted(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioFrameInputNode, winrt::Windows::Media::Audio::FrameInputNodeQuantumStartedEventArgs> const& handler) const;
using QuantumStarted_revoker = impl::event_revoker<winrt::Windows::Media::Audio::IAudioFrameInputNode, &impl::abi_t<winrt::Windows::Media::Audio::IAudioFrameInputNode>::remove_QuantumStarted>;
[[nodiscard]] QuantumStarted_revoker QuantumStarted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioFrameInputNode, winrt::Windows::Media::Audio::FrameInputNodeQuantumStartedEventArgs> const& handler) const;
WINRT_IMPL_AUTO(void) QuantumStarted(winrt::event_token const& token) const noexcept;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioFrameInputNode>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioFrameInputNode<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioFrameOutputNode
{
WINRT_IMPL_AUTO(winrt::Windows::Media::AudioFrame) GetFrame() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioFrameOutputNode>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioFrameOutputNode<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioGraph
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioFrameInputNode) CreateFrameInputNode() const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioFrameInputNode) CreateFrameInputNode(winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioDeviceInputNodeResult>) CreateDeviceInputNodeAsync(winrt::Windows::Media::Capture::MediaCategory const& category) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioDeviceInputNodeResult>) CreateDeviceInputNodeAsync(winrt::Windows::Media::Capture::MediaCategory const& category, winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioDeviceInputNodeResult>) CreateDeviceInputNodeAsync(winrt::Windows::Media::Capture::MediaCategory const& category, winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties, winrt::Windows::Devices::Enumeration::DeviceInformation const& device) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioFrameOutputNode) CreateFrameOutputNode() const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioFrameOutputNode) CreateFrameOutputNode(winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioDeviceOutputNodeResult>) CreateDeviceOutputNodeAsync() const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioFileInputNodeResult>) CreateFileInputNodeAsync(winrt::Windows::Storage::IStorageFile const& file) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioFileOutputNodeResult>) CreateFileOutputNodeAsync(winrt::Windows::Storage::IStorageFile const& file) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioFileOutputNodeResult>) CreateFileOutputNodeAsync(winrt::Windows::Storage::IStorageFile const& file, winrt::Windows::Media::MediaProperties::MediaEncodingProfile const& fileEncodingProfile) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioSubmixNode) CreateSubmixNode() const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioSubmixNode) CreateSubmixNode(winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties) const;
WINRT_IMPL_AUTO(void) Start() const;
WINRT_IMPL_AUTO(void) Stop() const;
WINRT_IMPL_AUTO(void) ResetAllNodes() const;
WINRT_IMPL_AUTO(winrt::event_token) QuantumStarted(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioGraph, winrt::Windows::Foundation::IInspectable> const& handler) const;
using QuantumStarted_revoker = impl::event_revoker<winrt::Windows::Media::Audio::IAudioGraph, &impl::abi_t<winrt::Windows::Media::Audio::IAudioGraph>::remove_QuantumStarted>;
[[nodiscard]] QuantumStarted_revoker QuantumStarted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioGraph, winrt::Windows::Foundation::IInspectable> const& handler) const;
WINRT_IMPL_AUTO(void) QuantumStarted(winrt::event_token const& token) const noexcept;
WINRT_IMPL_AUTO(winrt::event_token) QuantumProcessed(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioGraph, winrt::Windows::Foundation::IInspectable> const& handler) const;
using QuantumProcessed_revoker = impl::event_revoker<winrt::Windows::Media::Audio::IAudioGraph, &impl::abi_t<winrt::Windows::Media::Audio::IAudioGraph>::remove_QuantumProcessed>;
[[nodiscard]] QuantumProcessed_revoker QuantumProcessed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioGraph, winrt::Windows::Foundation::IInspectable> const& handler) const;
WINRT_IMPL_AUTO(void) QuantumProcessed(winrt::event_token const& token) const noexcept;
WINRT_IMPL_AUTO(winrt::event_token) UnrecoverableErrorOccurred(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioGraph, winrt::Windows::Media::Audio::AudioGraphUnrecoverableErrorOccurredEventArgs> const& handler) const;
using UnrecoverableErrorOccurred_revoker = impl::event_revoker<winrt::Windows::Media::Audio::IAudioGraph, &impl::abi_t<winrt::Windows::Media::Audio::IAudioGraph>::remove_UnrecoverableErrorOccurred>;
[[nodiscard]] UnrecoverableErrorOccurred_revoker UnrecoverableErrorOccurred(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioGraph, winrt::Windows::Media::Audio::AudioGraphUnrecoverableErrorOccurredEventArgs> const& handler) const;
WINRT_IMPL_AUTO(void) UnrecoverableErrorOccurred(winrt::event_token const& token) const noexcept;
[[nodiscard]] WINRT_IMPL_AUTO(uint64_t) CompletedQuantumCount() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::MediaProperties::AudioEncodingProperties) EncodingProperties() const;
[[nodiscard]] WINRT_IMPL_AUTO(int32_t) LatencyInSamples() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Devices::Enumeration::DeviceInformation) PrimaryRenderDevice() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::AudioProcessing) RenderDeviceAudioProcessing() const;
[[nodiscard]] WINRT_IMPL_AUTO(int32_t) SamplesPerQuantum() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioGraph>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioGraph<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioGraph2
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioFrameInputNode) CreateFrameInputNode(winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties, winrt::Windows::Media::Audio::AudioNodeEmitter const& emitter) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioDeviceInputNodeResult>) CreateDeviceInputNodeAsync(winrt::Windows::Media::Capture::MediaCategory const& category, winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties, winrt::Windows::Devices::Enumeration::DeviceInformation const& device, winrt::Windows::Media::Audio::AudioNodeEmitter const& emitter) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioFileInputNodeResult>) CreateFileInputNodeAsync(winrt::Windows::Storage::IStorageFile const& file, winrt::Windows::Media::Audio::AudioNodeEmitter const& emitter) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioSubmixNode) CreateSubmixNode(winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& encodingProperties, winrt::Windows::Media::Audio::AudioNodeEmitter const& emitter) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioGraphBatchUpdater) CreateBatchUpdater() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioGraph2>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioGraph2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioGraph3
{
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateMediaSourceAudioInputNodeResult>) CreateMediaSourceAudioInputNodeAsync(winrt::Windows::Media::Core::MediaSource const& mediaSource) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateMediaSourceAudioInputNodeResult>) CreateMediaSourceAudioInputNodeAsync(winrt::Windows::Media::Core::MediaSource const& mediaSource, winrt::Windows::Media::Audio::AudioNodeEmitter const& emitter) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioGraph3>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioGraph3<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioGraphConnection
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::IAudioNode) Destination() const;
WINRT_IMPL_AUTO(void) Gain(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) Gain() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioGraphConnection>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioGraphConnection<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioGraphSettings
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::MediaProperties::AudioEncodingProperties) EncodingProperties() const;
WINRT_IMPL_AUTO(void) EncodingProperties(winrt::Windows::Media::MediaProperties::AudioEncodingProperties const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Devices::Enumeration::DeviceInformation) PrimaryRenderDevice() const;
WINRT_IMPL_AUTO(void) PrimaryRenderDevice(winrt::Windows::Devices::Enumeration::DeviceInformation const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::QuantumSizeSelectionMode) QuantumSizeSelectionMode() const;
WINRT_IMPL_AUTO(void) QuantumSizeSelectionMode(winrt::Windows::Media::Audio::QuantumSizeSelectionMode const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(int32_t) DesiredSamplesPerQuantum() const;
WINRT_IMPL_AUTO(void) DesiredSamplesPerQuantum(int32_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Render::AudioRenderCategory) AudioRenderCategory() const;
WINRT_IMPL_AUTO(void) AudioRenderCategory(winrt::Windows::Media::Render::AudioRenderCategory const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::AudioProcessing) DesiredRenderDeviceAudioProcessing() const;
WINRT_IMPL_AUTO(void) DesiredRenderDeviceAudioProcessing(winrt::Windows::Media::AudioProcessing const& value) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioGraphSettings>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioGraphSettings<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioGraphSettings2
{
WINRT_IMPL_AUTO(void) MaxPlaybackSpeedFactor(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) MaxPlaybackSpeedFactor() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioGraphSettings2>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioGraphSettings2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioGraphSettingsFactory
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioGraphSettings) Create(winrt::Windows::Media::Render::AudioRenderCategory const& audioRenderCategory) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioGraphSettingsFactory>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioGraphSettingsFactory<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioGraphStatics
{
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::CreateAudioGraphResult>) CreateAsync(winrt::Windows::Media::Audio::AudioGraphSettings const& settings) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioGraphStatics>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioGraphStatics<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioGraphUnrecoverableErrorOccurredEventArgs
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioGraphUnrecoverableError) Error() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioGraphUnrecoverableErrorOccurredEventArgs>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioGraphUnrecoverableErrorOccurredEventArgs<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioInputNode
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Media::Audio::AudioGraphConnection>) OutgoingConnections() const;
WINRT_IMPL_AUTO(void) AddOutgoingConnection(winrt::Windows::Media::Audio::IAudioNode const& destination) const;
WINRT_IMPL_AUTO(void) AddOutgoingConnection(winrt::Windows::Media::Audio::IAudioNode const& destination, double gain) const;
WINRT_IMPL_AUTO(void) RemoveOutgoingConnection(winrt::Windows::Media::Audio::IAudioNode const& destination) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioInputNode>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioInputNode<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioInputNode2
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitter) Emitter() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioInputNode2>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioInputNode2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNode
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Media::Effects::IAudioEffectDefinition>) EffectDefinitions() const;
WINRT_IMPL_AUTO(void) OutgoingGain(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) OutgoingGain() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::MediaProperties::AudioEncodingProperties) EncodingProperties() const;
[[nodiscard]] WINRT_IMPL_AUTO(bool) ConsumeInput() const;
WINRT_IMPL_AUTO(void) ConsumeInput(bool value) const;
WINRT_IMPL_AUTO(void) Start() const;
WINRT_IMPL_AUTO(void) Stop() const;
WINRT_IMPL_AUTO(void) Reset() const;
WINRT_IMPL_AUTO(void) DisableEffectsByDefinition(winrt::Windows::Media::Effects::IAudioEffectDefinition const& definition) const;
WINRT_IMPL_AUTO(void) EnableEffectsByDefinition(winrt::Windows::Media::Effects::IAudioEffectDefinition const& definition) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNode>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNode<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeEmitter
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::Numerics::float3) Position() const;
WINRT_IMPL_AUTO(void) Position(winrt::Windows::Foundation::Numerics::float3 const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::Numerics::float3) Direction() const;
WINRT_IMPL_AUTO(void) Direction(winrt::Windows::Foundation::Numerics::float3 const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterShape) Shape() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterDecayModel) DecayModel() const;
[[nodiscard]] WINRT_IMPL_AUTO(double) Gain() const;
WINRT_IMPL_AUTO(void) Gain(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) DistanceScale() const;
WINRT_IMPL_AUTO(void) DistanceScale(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) DopplerScale() const;
WINRT_IMPL_AUTO(void) DopplerScale(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::Numerics::float3) DopplerVelocity() const;
WINRT_IMPL_AUTO(void) DopplerVelocity(winrt::Windows::Foundation::Numerics::float3 const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(bool) IsDopplerDisabled() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeEmitter>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeEmitter<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeEmitter2
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::SpatialAudioModel) SpatialAudioModel() const;
WINRT_IMPL_AUTO(void) SpatialAudioModel(winrt::Windows::Media::Audio::SpatialAudioModel const& value) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeEmitter2>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeEmitter2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeEmitterConeProperties
{
[[nodiscard]] WINRT_IMPL_AUTO(double) InnerAngle() const;
[[nodiscard]] WINRT_IMPL_AUTO(double) OuterAngle() const;
[[nodiscard]] WINRT_IMPL_AUTO(double) OuterAngleGain() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeEmitterConeProperties>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeEmitterConeProperties<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeEmitterDecayModel
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterDecayKind) Kind() const;
[[nodiscard]] WINRT_IMPL_AUTO(double) MinGain() const;
[[nodiscard]] WINRT_IMPL_AUTO(double) MaxGain() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterNaturalDecayModelProperties) NaturalProperties() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModel>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeEmitterDecayModel<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeEmitterDecayModelStatics
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterDecayModel) CreateNatural(double minGain, double maxGain, double unityGainDistance, double cutoffDistance) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterDecayModel) CreateCustom(double minGain, double maxGain) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeEmitterDecayModelStatics>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeEmitterDecayModelStatics<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeEmitterFactory
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitter) CreateAudioNodeEmitter(winrt::Windows::Media::Audio::AudioNodeEmitterShape const& shape, winrt::Windows::Media::Audio::AudioNodeEmitterDecayModel const& decayModel, winrt::Windows::Media::Audio::AudioNodeEmitterSettings const& settings) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeEmitterFactory>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeEmitterFactory<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeEmitterNaturalDecayModelProperties
{
[[nodiscard]] WINRT_IMPL_AUTO(double) UnityGainDistance() const;
[[nodiscard]] WINRT_IMPL_AUTO(double) CutoffDistance() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeEmitterNaturalDecayModelProperties>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeEmitterNaturalDecayModelProperties<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeEmitterShape
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterShapeKind) Kind() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterConeProperties) ConeProperties() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeEmitterShape>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeEmitterShape<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeEmitterShapeStatics
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterShape) CreateCone(double innerAngle, double outerAngle, double outerAngleGain) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeEmitterShape) CreateOmnidirectional() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeEmitterShapeStatics>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeEmitterShapeStatics<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeListener
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::Numerics::float3) Position() const;
WINRT_IMPL_AUTO(void) Position(winrt::Windows::Foundation::Numerics::float3 const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::Numerics::quaternion) Orientation() const;
WINRT_IMPL_AUTO(void) Orientation(winrt::Windows::Foundation::Numerics::quaternion const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) SpeedOfSound() const;
WINRT_IMPL_AUTO(void) SpeedOfSound(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::Numerics::float3) DopplerVelocity() const;
WINRT_IMPL_AUTO(void) DopplerVelocity(winrt::Windows::Foundation::Numerics::float3 const& value) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeListener>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeListener<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioNodeWithListener
{
WINRT_IMPL_AUTO(void) Listener(winrt::Windows::Media::Audio::AudioNodeListener const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioNodeListener) Listener() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioNodeWithListener>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioNodeWithListener<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioPlaybackConnection
{
WINRT_IMPL_AUTO(void) Start() const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncAction) StartAsync() const;
[[nodiscard]] WINRT_IMPL_AUTO(hstring) DeviceId() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioPlaybackConnectionState) State() const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioPlaybackConnectionOpenResult) Open() const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::AudioPlaybackConnectionOpenResult>) OpenAsync() const;
WINRT_IMPL_AUTO(winrt::event_token) StateChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioPlaybackConnection, winrt::Windows::Foundation::IInspectable> const& handler) const;
using StateChanged_revoker = impl::event_revoker<winrt::Windows::Media::Audio::IAudioPlaybackConnection, &impl::abi_t<winrt::Windows::Media::Audio::IAudioPlaybackConnection>::remove_StateChanged>;
[[nodiscard]] StateChanged_revoker StateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioPlaybackConnection, winrt::Windows::Foundation::IInspectable> const& handler) const;
WINRT_IMPL_AUTO(void) StateChanged(winrt::event_token const& token) const noexcept;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioPlaybackConnection>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioPlaybackConnection<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioPlaybackConnectionOpenResult
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioPlaybackConnectionOpenResultStatus) Status() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::hresult) ExtendedError() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioPlaybackConnectionOpenResult>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioPlaybackConnectionOpenResult<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioPlaybackConnectionStatics
{
WINRT_IMPL_AUTO(hstring) GetDeviceSelector() const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioPlaybackConnection) TryCreateFromId(param::hstring const& id) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioPlaybackConnectionStatics>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioPlaybackConnectionStatics<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioStateMonitor
{
WINRT_IMPL_AUTO(winrt::event_token) SoundLevelChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioStateMonitor, winrt::Windows::Foundation::IInspectable> const& handler) const;
using SoundLevelChanged_revoker = impl::event_revoker<winrt::Windows::Media::Audio::IAudioStateMonitor, &impl::abi_t<winrt::Windows::Media::Audio::IAudioStateMonitor>::remove_SoundLevelChanged>;
[[nodiscard]] SoundLevelChanged_revoker SoundLevelChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::AudioStateMonitor, winrt::Windows::Foundation::IInspectable> const& handler) const;
WINRT_IMPL_AUTO(void) SoundLevelChanged(winrt::event_token const& token) const noexcept;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::SoundLevel) SoundLevel() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioStateMonitor>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioStateMonitor<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IAudioStateMonitorStatics
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioStateMonitor) CreateForRenderMonitoring() const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioStateMonitor) CreateForRenderMonitoring(winrt::Windows::Media::Render::AudioRenderCategory const& category) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioStateMonitor) CreateForRenderMonitoring(winrt::Windows::Media::Render::AudioRenderCategory const& category, winrt::Windows::Media::Devices::AudioDeviceRole const& role) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioStateMonitor) CreateForRenderMonitoringWithCategoryAndDeviceId(winrt::Windows::Media::Render::AudioRenderCategory const& category, param::hstring const& deviceId) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioStateMonitor) CreateForCaptureMonitoring() const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioStateMonitor) CreateForCaptureMonitoring(winrt::Windows::Media::Capture::MediaCategory const& category) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioStateMonitor) CreateForCaptureMonitoring(winrt::Windows::Media::Capture::MediaCategory const& category, winrt::Windows::Media::Devices::AudioDeviceRole const& role) const;
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioStateMonitor) CreateForCaptureMonitoringWithCategoryAndDeviceId(winrt::Windows::Media::Capture::MediaCategory const& category, param::hstring const& deviceId) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IAudioStateMonitorStatics>
{
template <typename D> using type = consume_Windows_Media_Audio_IAudioStateMonitorStatics<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioDeviceInputNodeResult
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioDeviceNodeCreationStatus) Status() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioDeviceInputNode) DeviceInputNode() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioDeviceInputNodeResult<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioDeviceInputNodeResult2
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::hresult) ExtendedError() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioDeviceInputNodeResult2>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioDeviceInputNodeResult2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioDeviceOutputNodeResult
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioDeviceNodeCreationStatus) Status() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioDeviceOutputNode) DeviceOutputNode() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioDeviceOutputNodeResult<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioDeviceOutputNodeResult2
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::hresult) ExtendedError() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioDeviceOutputNodeResult2>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioDeviceOutputNodeResult2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioFileInputNodeResult
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioFileNodeCreationStatus) Status() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioFileInputNode) FileInputNode() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioFileInputNodeResult<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioFileInputNodeResult2
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::hresult) ExtendedError() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioFileInputNodeResult2>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioFileInputNodeResult2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioFileOutputNodeResult
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioFileNodeCreationStatus) Status() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioFileOutputNode) FileOutputNode() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioFileOutputNodeResult<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioFileOutputNodeResult2
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::hresult) ExtendedError() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioFileOutputNodeResult2>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioFileOutputNodeResult2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioGraphResult
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioGraphCreationStatus) Status() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::AudioGraph) Graph() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioGraphResult>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioGraphResult<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateAudioGraphResult2
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::hresult) ExtendedError() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateAudioGraphResult2>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateAudioGraphResult2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateMediaSourceAudioInputNodeResult
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::MediaSourceAudioInputNodeCreationStatus) Status() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::MediaSourceAudioInputNode) Node() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateMediaSourceAudioInputNodeResult<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ICreateMediaSourceAudioInputNodeResult2
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::hresult) ExtendedError() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ICreateMediaSourceAudioInputNodeResult2>
{
template <typename D> using type = consume_Windows_Media_Audio_ICreateMediaSourceAudioInputNodeResult2<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IEchoEffectDefinition
{
WINRT_IMPL_AUTO(void) WetDryMix(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) WetDryMix() const;
WINRT_IMPL_AUTO(void) Feedback(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) Feedback() const;
WINRT_IMPL_AUTO(void) Delay(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) Delay() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IEchoEffectDefinition>
{
template <typename D> using type = consume_Windows_Media_Audio_IEchoEffectDefinition<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IEchoEffectDefinitionFactory
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::EchoEffectDefinition) Create(winrt::Windows::Media::Audio::AudioGraph const& audioGraph) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IEchoEffectDefinitionFactory>
{
template <typename D> using type = consume_Windows_Media_Audio_IEchoEffectDefinitionFactory<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IEqualizerBand
{
[[nodiscard]] WINRT_IMPL_AUTO(double) Bandwidth() const;
WINRT_IMPL_AUTO(void) Bandwidth(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) FrequencyCenter() const;
WINRT_IMPL_AUTO(void) FrequencyCenter(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) Gain() const;
WINRT_IMPL_AUTO(void) Gain(double value) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IEqualizerBand>
{
template <typename D> using type = consume_Windows_Media_Audio_IEqualizerBand<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IEqualizerEffectDefinition
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Media::Audio::EqualizerBand>) Bands() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IEqualizerEffectDefinition>
{
template <typename D> using type = consume_Windows_Media_Audio_IEqualizerEffectDefinition<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IEqualizerEffectDefinitionFactory
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::EqualizerEffectDefinition) Create(winrt::Windows::Media::Audio::AudioGraph const& audioGraph) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IEqualizerEffectDefinitionFactory>
{
template <typename D> using type = consume_Windows_Media_Audio_IEqualizerEffectDefinitionFactory<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IFrameInputNodeQuantumStartedEventArgs
{
[[nodiscard]] WINRT_IMPL_AUTO(int32_t) RequiredSamples() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IFrameInputNodeQuantumStartedEventArgs>
{
template <typename D> using type = consume_Windows_Media_Audio_IFrameInputNodeQuantumStartedEventArgs<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ILimiterEffectDefinition
{
WINRT_IMPL_AUTO(void) Release(uint32_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint32_t) Release() const;
WINRT_IMPL_AUTO(void) Loudness(uint32_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint32_t) Loudness() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ILimiterEffectDefinition>
{
template <typename D> using type = consume_Windows_Media_Audio_ILimiterEffectDefinition<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ILimiterEffectDefinitionFactory
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::LimiterEffectDefinition) Create(winrt::Windows::Media::Audio::AudioGraph const& audioGraph) const;
};
template <> struct consume<winrt::Windows::Media::Audio::ILimiterEffectDefinitionFactory>
{
template <typename D> using type = consume_Windows_Media_Audio_ILimiterEffectDefinitionFactory<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IMediaSourceAudioInputNode
{
WINRT_IMPL_AUTO(void) PlaybackSpeedFactor(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) PlaybackSpeedFactor() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::TimeSpan) Position() const;
WINRT_IMPL_AUTO(void) Seek(winrt::Windows::Foundation::TimeSpan const& position) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan>) StartTime() const;
WINRT_IMPL_AUTO(void) StartTime(winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan> const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan>) EndTime() const;
WINRT_IMPL_AUTO(void) EndTime(winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan> const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::IReference<int32_t>) LoopCount() const;
WINRT_IMPL_AUTO(void) LoopCount(winrt::Windows::Foundation::IReference<int32_t> const& value) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Foundation::TimeSpan) Duration() const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Core::MediaSource) MediaSource() const;
WINRT_IMPL_AUTO(winrt::event_token) MediaSourceCompleted(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::MediaSourceAudioInputNode, winrt::Windows::Foundation::IInspectable> const& handler) const;
using MediaSourceCompleted_revoker = impl::event_revoker<winrt::Windows::Media::Audio::IMediaSourceAudioInputNode, &impl::abi_t<winrt::Windows::Media::Audio::IMediaSourceAudioInputNode>::remove_MediaSourceCompleted>;
[[nodiscard]] MediaSourceCompleted_revoker MediaSourceCompleted(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::MediaSourceAudioInputNode, winrt::Windows::Foundation::IInspectable> const& handler) const;
WINRT_IMPL_AUTO(void) MediaSourceCompleted(winrt::event_token const& token) const noexcept;
};
template <> struct consume<winrt::Windows::Media::Audio::IMediaSourceAudioInputNode>
{
template <typename D> using type = consume_Windows_Media_Audio_IMediaSourceAudioInputNode<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IReverbEffectDefinition
{
WINRT_IMPL_AUTO(void) WetDryMix(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) WetDryMix() const;
WINRT_IMPL_AUTO(void) ReflectionsDelay(uint32_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint32_t) ReflectionsDelay() const;
WINRT_IMPL_AUTO(void) ReverbDelay(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) ReverbDelay() const;
WINRT_IMPL_AUTO(void) RearDelay(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) RearDelay() const;
WINRT_IMPL_AUTO(void) PositionLeft(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) PositionLeft() const;
WINRT_IMPL_AUTO(void) PositionRight(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) PositionRight() const;
WINRT_IMPL_AUTO(void) PositionMatrixLeft(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) PositionMatrixLeft() const;
WINRT_IMPL_AUTO(void) PositionMatrixRight(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) PositionMatrixRight() const;
WINRT_IMPL_AUTO(void) EarlyDiffusion(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) EarlyDiffusion() const;
WINRT_IMPL_AUTO(void) LateDiffusion(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) LateDiffusion() const;
WINRT_IMPL_AUTO(void) LowEQGain(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) LowEQGain() const;
WINRT_IMPL_AUTO(void) LowEQCutoff(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) LowEQCutoff() const;
WINRT_IMPL_AUTO(void) HighEQGain(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) HighEQGain() const;
WINRT_IMPL_AUTO(void) HighEQCutoff(uint8_t value) const;
[[nodiscard]] WINRT_IMPL_AUTO(uint8_t) HighEQCutoff() const;
WINRT_IMPL_AUTO(void) RoomFilterFreq(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) RoomFilterFreq() const;
WINRT_IMPL_AUTO(void) RoomFilterMain(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) RoomFilterMain() const;
WINRT_IMPL_AUTO(void) RoomFilterHF(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) RoomFilterHF() const;
WINRT_IMPL_AUTO(void) ReflectionsGain(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) ReflectionsGain() const;
WINRT_IMPL_AUTO(void) ReverbGain(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) ReverbGain() const;
WINRT_IMPL_AUTO(void) DecayTime(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) DecayTime() const;
WINRT_IMPL_AUTO(void) Density(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) Density() const;
WINRT_IMPL_AUTO(void) RoomSize(double value) const;
[[nodiscard]] WINRT_IMPL_AUTO(double) RoomSize() const;
WINRT_IMPL_AUTO(void) DisableLateField(bool value) const;
[[nodiscard]] WINRT_IMPL_AUTO(bool) DisableLateField() const;
};
template <> struct consume<winrt::Windows::Media::Audio::IReverbEffectDefinition>
{
template <typename D> using type = consume_Windows_Media_Audio_IReverbEffectDefinition<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_IReverbEffectDefinitionFactory
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::ReverbEffectDefinition) Create(winrt::Windows::Media::Audio::AudioGraph const& audioGraph) const;
};
template <> struct consume<winrt::Windows::Media::Audio::IReverbEffectDefinitionFactory>
{
template <typename D> using type = consume_Windows_Media_Audio_IReverbEffectDefinitionFactory<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ISetDefaultSpatialAudioFormatResult
{
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::SetDefaultSpatialAudioFormatStatus) Status() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ISetDefaultSpatialAudioFormatResult>
{
template <typename D> using type = consume_Windows_Media_Audio_ISetDefaultSpatialAudioFormatResult<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ISpatialAudioDeviceConfiguration
{
[[nodiscard]] WINRT_IMPL_AUTO(hstring) DeviceId() const;
[[nodiscard]] WINRT_IMPL_AUTO(bool) IsSpatialAudioSupported() const;
WINRT_IMPL_AUTO(bool) IsSpatialAudioFormatSupported(param::hstring const& subtype) const;
[[nodiscard]] WINRT_IMPL_AUTO(hstring) ActiveSpatialAudioFormat() const;
[[nodiscard]] WINRT_IMPL_AUTO(hstring) DefaultSpatialAudioFormat() const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Media::Audio::SetDefaultSpatialAudioFormatResult>) SetDefaultSpatialAudioFormatAsync(param::hstring const& subtype) const;
WINRT_IMPL_AUTO(winrt::event_token) ConfigurationChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::SpatialAudioDeviceConfiguration, winrt::Windows::Foundation::IInspectable> const& handler) const;
using ConfigurationChanged_revoker = impl::event_revoker<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfiguration, &impl::abi_t<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfiguration>::remove_ConfigurationChanged>;
[[nodiscard]] ConfigurationChanged_revoker ConfigurationChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Audio::SpatialAudioDeviceConfiguration, winrt::Windows::Foundation::IInspectable> const& handler) const;
WINRT_IMPL_AUTO(void) ConfigurationChanged(winrt::event_token const& token) const noexcept;
};
template <> struct consume<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfiguration>
{
template <typename D> using type = consume_Windows_Media_Audio_ISpatialAudioDeviceConfiguration<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ISpatialAudioDeviceConfigurationStatics
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::SpatialAudioDeviceConfiguration) GetForDeviceId(param::hstring const& deviceId) const;
};
template <> struct consume<winrt::Windows::Media::Audio::ISpatialAudioDeviceConfigurationStatics>
{
template <typename D> using type = consume_Windows_Media_Audio_ISpatialAudioDeviceConfigurationStatics<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ISpatialAudioFormatConfiguration
{
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncAction) ReportLicenseChangedAsync(param::hstring const& subtype) const;
WINRT_IMPL_AUTO(winrt::Windows::Foundation::IAsyncAction) ReportConfigurationChangedAsync(param::hstring const& subtype) const;
[[nodiscard]] WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::MixedRealitySpatialAudioFormatPolicy) MixedRealityExclusiveModePolicy() const;
WINRT_IMPL_AUTO(void) MixedRealityExclusiveModePolicy(winrt::Windows::Media::Audio::MixedRealitySpatialAudioFormatPolicy const& value) const;
};
template <> struct consume<winrt::Windows::Media::Audio::ISpatialAudioFormatConfiguration>
{
template <typename D> using type = consume_Windows_Media_Audio_ISpatialAudioFormatConfiguration<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ISpatialAudioFormatConfigurationStatics
{
WINRT_IMPL_AUTO(winrt::Windows::Media::Audio::SpatialAudioFormatConfiguration) GetDefault() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ISpatialAudioFormatConfigurationStatics>
{
template <typename D> using type = consume_Windows_Media_Audio_ISpatialAudioFormatConfigurationStatics<D>;
};
template <typename D>
struct consume_Windows_Media_Audio_ISpatialAudioFormatSubtypeStatics
{
[[nodiscard]] WINRT_IMPL_AUTO(hstring) WindowsSonic() const;
[[nodiscard]] WINRT_IMPL_AUTO(hstring) DolbyAtmosForHeadphones() const;
[[nodiscard]] WINRT_IMPL_AUTO(hstring) DolbyAtmosForHomeTheater() const;
[[nodiscard]] WINRT_IMPL_AUTO(hstring) DolbyAtmosForSpeakers() const;
[[nodiscard]] WINRT_IMPL_AUTO(hstring) DTSHeadphoneX() const;
[[nodiscard]] WINRT_IMPL_AUTO(hstring) DTSXUltra() const;
};
template <> struct consume<winrt::Windows::Media::Audio::ISpatialAudioFormatSubtypeStatics>
{
template <typename D> using type = consume_Windows_Media_Audio_ISpatialAudioFormatSubtypeStatics<D>;
};
}
#endif
| [
"perianu.leon@outlook.com"
] | perianu.leon@outlook.com |
f38010c6b89f46b3e5875d8e5055c0a4b3cb7f6c | 893c6744b6d76102241811d5f2de702b7d7e1489 | /src/PanelDue.hpp | 593f52fa7db4e8a30ae753c17e31c128336271a6 | [] | no_license | chandler767/FusionPanel-OLD | 89916583a44665b30ea5bd8a08a292be25e2f5fa | c26db8239a7370c8d71f8830fa1de3b45e631add | refs/heads/master | 2021-08-07T19:02:58.583494 | 2017-11-08T19:22:21 | 2017-11-08T19:22:21 | 63,447,905 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 635 | hpp | /*
* PanelDue.hpp
*
* Created: 06/12/2014 14:23:38
* Author: David
* Updated for Fusion3: Chandler Mayo
*/
#ifndef PANELDUE_H_
#define PANELDUE_H_
#include "Hardware/UTFT.hpp"
#include "Display.hpp"
#include "RequestTimer.hpp"
// Global functions in PanelDue.cpp that are called from elsewhere
extern void ProcessReceivedValue(const char id[], const char val[], int index);
extern void ProcessArrayLength(const char id[], int length);
extern void StartReceivedMessage();
extern void EndReceivedMessage();
// Global data in PanelDue.cpp that is used elsewhere
extern UTFT lcd;
extern MainWindow mgr;
#endif /* PANELDUE_H_ */ | [
"chandler@chandlermayo.com"
] | chandler@chandlermayo.com |
2601655b67aa58d1f3a395585fd4e8f60b40c22f | c288b672473a6a808cd99ae4e9976e554668182a | /main.cpp | 3542c52051ed9125cefcad2d9e19ecfd41f2860f | [] | no_license | Changy15061149/compiler | ec24ce8d554b36832d4be88d3ec5f17d10fad4eb | 35f22ff0c9cf294d29f750fb746dbf42b4e63e0f | refs/heads/master | 2022-08-20T01:45:18.388648 | 2018-03-27T16:01:20 | 2018-03-27T16:01:20 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 76,158 | cpp |
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <map>
#include <cstring>
#include <cstdlib>
//#include "solve_code.c"
#define iftag 101
#define elsetag 102
#define switchtag 103
#define casetag 104
#define whiletag 105
#define consttag 106
#define inttag 107
#define chartag 108
#define voidtag 109
#define maintag 110
#define scanftag 111
#define printftag 112
#define idtag 113
#define returntag 115
#define defaulttag 116
#define plustag 122
#define minustag 123
#define startag 124
#define divtag 125
#define lpartag 126
#define rpartag 127
#define commatag 128
#define semitag 129
#define colontag 130
#define assigntag 131
#define equtag 132
#define leseqtag 133
#define lesstag 134
#define moreeqtag 135
#define moretag 136
#define noteqtag 137
#define LPtag 138
#define RPtag 139
#define lmidtag 140
#define rmidtag 141
#define numtag 142
#define CHtag 199
/////////////////////////////////////////////////////////////////////////////////
#define stringtag 114
#define intarraytype 50
#define chararraytype 51
#define intretag 53
#define charretag 54
#define array_maxpos 1000
#define alloc_size 400
////////////////////////////////////////////////////////////////////////////////
using namespace std;
/////////////////////////////////////////////////////////////////////////////////
int solve_if();
int solve_simple();
int solve_expression();
void solve_assign();
void solve_while();
int solve_const(int a);
int solve_statement(int a);
int solve_sentence(bool ish = 0);
void solve_printf();
void solve_scanf();
void solve_return();
struct jj
{
string name;
int type;
int size;
int last;
int depth;
int constvalue;
int addr;
int arr[100];
bool con = 0;
bool ret = 0;
int position;
}tab[10010];
struct kk
{
string type;
string idname;
int pos1;
int pos2;
int pos3;
int self;
}code1[5000010];
int codepos = 0;
int storeposition;
int tabpos = 0;
map <string,int>find_t;
int depth;
struct lldd
{
string type;
string p1;
string p2;
string p3;
int pos1,pos2,pos3;
}MIPS1[5000010];
FILE *fp=NULL;
int sum_string_tag;
string st_output[10010];
int charsostrong = 1;
int sumchar = 0;
//fprintf(f,"%d ",a[i]);
////////////////////////////////////////////////////////////////////////////////
//sint st_use;
char code[10000060];
bool Mul[10000060];
int line[10000006];
char id[400],string_1[6000];
int Int_Value;
int length_of_code,pos;
void error(string s = "error2")
{
cout<<"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
cout<<"ERROR! Near line "<<line[pos]<<":"<<endl;
cout<<s<<endl;
}
char next()
{
char ret = code[pos];
pos ++;
return ret;
}
char last()
{
pos --;
return code[pos];
}
bool isAlpha(char a)
{
return (a == '_' || (a >='a' && a <= 'z') || (a >='A' && a <= 'Z'));
}
bool isNum(char a)
{
return (a >= '0' && a <= '9');
}
int solveReserve(char a)
{
int pos1 = pos;
memset(id,0,sizeof(id));
int i = 0;
while(isAlpha(a) || isNum(a))
{
a = next();
if(a >= 'A' && a <= 'Z') a -= ('A' - 'a');
//cout<<"a:"<<a<<endl;
if(isAlpha(a) || isNum(a))
id[i] = a;
i ++;
//if(i > 100 || a == 0)error();
}i --;
cout<<"ID:"<<id<<' '<<i<<endl;
last();
if(i == 2)//if
{
if(id[0] == 'i'){
if(id[1] == 'f')
return iftag;
else return -1;}
else return -1;
}
else if(i == 3)//int
{
// cout<<"Yes! Party time!"<<endl;
if(id[0] == 'i'){
if(id[1] == 'n'){
if(id[2] == 't')
{
// cout<<"int"<<endl;
return inttag;
}
else return -1;}
else return -1;}
else return -1;
}
else if(i == 4)//char,else,case,void,main
{
if(id[0] == 'c'){
if(id[1] == 'h'){if(id[2] == 'a'){if(id[3] == 'r')return chartag;else return -1;}else return -1;}
else if(id[1] == 'a' && id[2] == 's' && id[3] == 'e')return casetag;
else return -1;}
else {
if(id[0] == 'e'){
if(id[1] == 'l'){
if(id[2] == 's'){
if(id[3] == 'e')
return elsetag;
else return -1;}
else return -1;}
else return -1;}
else {
if(id[0] == 'v'){
if(id[1] == 'o'){
if(id[2] == 'i'){
if(id[3] == 'd')
return voidtag;
else return -1;}
else return -1;}
else return -1;}
else {
if(id[0] == 'm'){
if(id[1] == 'a'){
if(id[2] == 'i'){
if(id[3] == 'n')
return maintag;
else return -1;}
else return -1;}
else return -1;}
else return -1;
}
}
}
}
else if(i == 5)//while,const,scanf
{
if(id[0] == 'w' && id[1] == 'h' && id[2] == 'i' && id[3] == 'l' && id[4] == 'e') return whiletag;
else if(id[0] == 'c' && id[1] == 'o' && id[2] == 'n' && id[3] == 's' && id[4] == 't') return consttag;
else if(id[0] == 's' && id[1] == 'c' && id[2] == 'a' && id[3] == 'n' && id[4] == 'f') return scanftag;
else return -1;
}
else if(i == 6)//switch,printf,return
{
if(id[0] == 's' && id[1] == 'w' && id[2] == 'i' && id[3] == 't' && id[4] == 'c' && id[5] == 'h') return switchtag;
else if(id[0] == 'p' && id[1] == 'r' && id[2] == 'i' && id[3] == 'n' && id[4] == 't' && id[5] == 'f') return printftag;
else if(id[0] == 'r' && id[1] == 'e' && id[2] == 't' && id[3] == 'u' && id[4] == 'r' && id[5] == 'n') return returntag;
else return -1;
}
else if(i == 7)
{
if(id[0] == 'd' && id[1] == 'e' && id[2] == 'f' && id[3] == 'a' && id[4] == 'u' && id[5] == 'l' && id[6] == 't') return defaulttag;
else return -1;
}
else return -1;
return -1;
}
int solveString()
{
memset(string_1,0,sizeof(string_1));
char a = code[pos];
int i = 0;
while(a != '"')
{
a = next();
if(a == '"')break;
//cout<<"a = "<<a<<endl;
if(!(a == 32 || a == 33 || (a >= 35 && a <= 126))) error("字符串中含有非法字符!");
string_1[i] = a;//cout<<string_1<<endl;
if(i > 3000 || a == 0)
{if(a != 0)error("长度超过最大值!");else error("缺少右括号!");exit(0);}
i ++;
}
if(i == 0)
next();
return stringtag;
}
int solveChar()
{
memset(string_1,0,sizeof(string_1));
char a = next();
if((! isNum(a)) && (! isAlpha(a)) && a != '+' && a != '-' && a != '*' && a != '/')error("非法单个字符");
string_1[0] = a;
//cout<<a<<endl;
a = next();
if(a != '\'')
{error("缺少右边的单引号");last();}
//next();
cout<<code[pos]<<code[pos + 1]<<endl;
return CHtag;
}
bool isNumber(char a)
{
return a >= '1' && a <= '9';
}
int nextsym()
{
int sum = 0;
bool tag = 0;
//cout<<"pos:"<<pos<<endl;
char a = code[pos];
// cout<<"a:="<<a<<endl;
while (isspace(a))
{
a = next();
tag = 1;
}
if(tag) pos --;
if(a == '/')
{
//cout<<"love letter"<<endl;
a = next();
a = next();
//cout<<a<<endl;
if(a == '/')
{
while(a != '\n')
a = next();
if(a == '\n'){return -2;}
}
else if(a == '*')
{
// cout<<"yes,party time!"<<endl;
while(1)
{
a = next();
if(a == '*')
{
a = next();
if(a == '/'){next();return -2;}
last();
}
}
}
else {last();return divtag;}
}
else if(isAlpha(a))
{
int i = solveReserve(a);
if(i != -1)return i;
else
{
return idtag;
}
}
else if(isNumber(a))
{
long long z = 0;
a = next();
while(isNum(a))
{
z *= 10;
z += a - '0';//if(z > 2147483647)error();
a = next();
}
last();
Int_Value = z;
cout<<"INT VALUE:"<<Int_Value<<endl;
return numtag;
}
else if(a == '<')
{
a = next();
a = next();
if(a == '='){return leseqtag;}
last();
return lesstag;
}
else if(a == '>')
{
a = next();
a = next();
if(a == '='){return moreeqtag;}
last();
return moretag;
}
else if(a == '=')
{
a = next();
a = next();
if(a == '='){return equtag;}
last();
return assigntag;
}
else if(a == '!')
{
a = next();
a = next();
if(a == '='){return noteqtag;}
last();
error("!后应该紧接着等于号");
}
else if(a == '"')
{
next();
return solveString();
}
else if(a == '\'')
{
next();
return solveChar();
}
else if(a == '+')
{
next();
return plustag;
}
else if(a == '-')
{
next();
return minustag;
}
else if(a == '*')
{
next();
return startag;
}
else if(a == '(')
{
next();
return lpartag;
}
else if(a == ')')
{
next();
return rpartag;
}
else if(a == ',')
{
next();
return commatag;
}
else if(a == '{')
{
next();
return LPtag;
}
else if(a == '}')
{
next();
return RPtag;
}
else if(a == ':')
{
next();
return colontag;
}
else if(a == ';')
{
next();
return semitag;
}
else if(a == '[')
{
next();
return lmidtag;
}
else if(a == ']')
{
next();
return rmidtag;
}
else if(a == '0')
{
next();
a = next();
if(!(a >= '0' && a <= '9'))
{
last();
Int_Value = 0;
return numtag;
}
else error("非0整数不能以0开头");
}
else
{if(a == 0)return 0;
else error("非法字符开头!");
next();
return 7;}
}
void word_temp()
{
int po = pos;
while(1)
{
po = pos;
int i = nextsym();
cout<<"At line :"<<line[po]<<endl;
for(int j = po;j < pos;j ++)
cout<<code[j];
cout<<endl;
cout<<"code = "<<i<<endl;
switch (i)
{
case 101: cout<<"if语句"<<endl;break;
case 102: cout<<"else语句"<<endl;break;
case 103: cout<<"switch语句"<<endl;break;
case 104: cout<<"case语句"<<endl;break;
case 105: cout<<"while语句"<<endl;break;
case 106: cout<<"const语句"<<endl;break;
case 107: cout<<"int语句"<<endl;break;
case 108: cout<<"char语句"<<endl;break;
case 109: cout<<"void语句"<<endl;break;
case 110: cout<<"main语句"<<endl;break;
case 111: cout<<"scanf语句"<<endl;break;
case 112: cout<<"printf语句"<<endl;break;
case 113: cout<<"id语句"<<endl;break;
case 114: cout<<"string类型字符串"<<endl;break;
case 115: cout<<"return语句"<<endl;break;
case 122: cout<<"加法符号+"<<endl;break;
case 123: cout<<"减法符号-"<<endl;break;
case 124: cout<<"星星符号*"<<endl;break;
case 125: cout<<"除法符号/"<<endl;break;
case 126: cout<<"左小括号("<<endl;break;
case 127: cout<<"右小括号)"<<endl;break;
case 128: cout<<"逗号,"<<endl;break;
case 129: cout<<"分号;"<<endl;break;
case 130: cout<<"冒号:"<<endl;break;
case 131: cout<<"赋值语句="<<endl;break;
case 132: cout<<"等于判断 == "<<endl;break;
case 133: cout<<"小于等于 <="<<endl;break;
case 134: cout<<"小于<"<<endl;break;
case 135: cout<<"大于等于 >="<<endl;break;
case 136: cout<<"大于 >"<<endl;break;
case 137: cout<<"不等于 !="<<endl;break;
case 138: cout<<"左大于号{"<<endl;break;
case 139: cout<<"右大于号}"<<endl;break;
case 140: cout<<"左中括号["<<endl;break;
case 141: cout<<"右中括号]"<<endl;break;
}
cout<<"_______________________________________________________"<<endl;
if(i == 0)break;
}
}
void solve_line()
{
for(int i = 1;code[i] != 0;i ++)
{
if(code[i - 1] == '\n')
{
line[i] = line[i - 1] + 1;
}
else line[i] = line[i-1];
}
}
void input()
{
char s[500];
cout<<"Please input the path of our code!"<<endl;
cin>>s;
string c = s;
freopen(s,"r",stdin);
int i = 0;
while(scanf("%c",&code[i]) != EOF)
{
i ++;
if(i == 10000000)
{
cout<<"Code too long! Exit!"<<endl;
exit(0);
}
}
length_of_code = i;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
int filltab(int type = inttag,int depth = 1,string id = "")
{
string c = id;
int ret;
if(find_t[c] == 0)
{
tabpos ++;
tab[tabpos].name = c;
tab[tabpos].last = find_t[c];
find_t[c] = tabpos;
tab[tabpos].type = type;
tab[tabpos].depth = depth;
tab[tabpos].con = 0;
tab[tabpos].ret = 0;
tab[tabpos].size = 1;
if(tab[tabpos - 1].depth == tab[tabpos].depth)
{
tab[tabpos].addr = tab[tabpos - 1].addr + ((tab[tabpos - 1].ret)?0:(tab[tabpos-1].size));
}
else
{
tab[tabpos].addr = 2;
}
ret = tabpos;
}
else
{
//cout<<"符号表:"<<c<<endl;
//cout<<depth<<endl;
// cout<<tab[find_t[c]].name<<' '<<tab[find_t[c]].depth<<endl;;
if(tab[find_t[c]].depth == depth){error("重复定义!");}//
else
{
tabpos ++;
tab[tabpos].name = c;
tab[tabpos].last = find_t[c];
find_t[c] = tabpos;
tab[tabpos].type = type;
tab[tabpos].depth = depth;
tab[tabpos].con = 0;
tab[tabpos].ret = 0;
tab[tabpos].size = 1;
ret = tabpos;
if(tab[tabpos].depth == tab[tabpos - 1].depth)
{
tab[tabpos].addr = tab[tabpos - 1].addr + ((tab[tabpos - 1].ret)?0:(tab[tabpos-1].size));
}
else
{
tab[tabpos].addr = 2;
}
}
}
return tabpos;
}
int lastcode;
int tab_pos;
int find_tab(string a = "a")
{
int ppp = find_t[a];
cout<<a<<endl;
if(ppp == 0)error("不存在变量!");
else
{
tab_pos = ppp;
if(tab[ppp].ret)
{
if(tab[ppp].type == inttag)return intretag;
if(tab[ppp].type == chartag)return charretag;
return voidtag;
}
if(tab[ppp].size>1)
{
//cout<<"findpos!:"<<tab[ppp].name<<endl;
if(tab[ppp].type == inttag)return intarraytype;
if(tab[ppp].type == chartag)return chararraytype;
}
return tab[ppp].type;
}
return tab[ppp].type;
}
void push_tab(int depth = 1)
{
int i;
while(tab[tabpos].depth == 1)
{
find_t[tab[tabpos].name] = tab[tabpos].last;
tab[tabpos].size = 0;
tab[tabpos].last = 0;
tab[tabpos].ret = 0;
tab[tabpos].con = 0;
tabpos --;
}
}
int sumtag = 0;
void emitstr(int i)
{
fprintf(fp,"li $a0 %d\n",i);
fprintf(fp,"li $v0 11\n");
fprintf(fp,"syscall\n");
}
void emitprintfstring()
{
int i = 0;
for(i = 0;string_1[i] != 0;i ++)
{
emitstr(string_1[i]);
}
fprintf(fp,"li $a0 10\n");
fprintf(fp,"li $v0 11\n");
fprintf(fp,"syscall\n");
}
void emitmipspex(int pos)
{
fprintf(fp,"lw $a0 %d($sp)\n",pos*4);
fprintf(fp,"li $v0 1\n");
fprintf(fp,"syscall\n");
fprintf(fp,"li $a0 10\n");
fprintf(fp,"li $v0 11\n");
fprintf(fp,"syscall\n");
}
void emitprintfex(int pos)
{
codepos ++;
code1[codepos].type = "Printf";
code1[codepos].pos1 = pos;
emitmipspex(pos);
}
void emitmipspchar(int pos)
{
fprintf(fp,"lw $a0 %d($sp)\n",pos*4);
fprintf(fp,"li $v0 11\n");
fprintf(fp,"syscall\n");
fprintf(fp,"li $a0 10\n");
fprintf(fp,"li $v0 11\n");
fprintf(fp,"syscall\n");
}
void emitprintfchar(int pos)
{
codepos ++;
code1[codepos].type = "Printfc";
code1[codepos].pos1 = pos;
emitmipspchar(pos);
}
void emitmipsscanf(int PO)
{
if(tab[PO].type == chartag)
{
fprintf(fp,"li $v0 12\n");
}
else if(tab[PO].type == inttag)
{
fprintf(fp,"li $v0 5\n");
}
else {error("读入非法类型!");return;}
fprintf(fp,"syscall\n");
if(tab[PO].depth == 0)
{
fprintf(fp,"sw $v0 %d($0)\n",tab[PO].addr * 4);
}
else
{
fprintf(fp, "sw $v0 %d($sp)\n",tab[PO].addr * 4);
cout<<"SCSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS:"<<tab[PO].name<<' '<<tab[PO].addr<<' '<<tab[PO].size<<' '<<tab[PO].depth<<endl;
}
}
void emitscanf(int PO)
{
codepos ++;
code1[codepos].type = "Scanf";
code1[codepos].idname = tab[PO].name;
emitmipsscanf(PO);
}
void emitmfret(int pos1)
{
fprintf(fp,"sw $a1 %d($sp)\n",pos1*4);
}
void emitmipsrv(int pos1)
{
fprintf(fp,"lw $a1 %d($sp)\n",pos1 * 4);
}
void emitret_value(int pos1)
{
codepos ++;
code1[codepos].type = "SetRetValue";
code1[codepos].pos1 = pos1;
emitmipsrv(pos1);
}
void emitmipsexpression()
{
fprintf(fp,"lw $s1 %d($sp)\n",code1[codepos].pos2*4);
fprintf(fp,"lw $s2 %d($sp)\n",code1[codepos].pos3*4);
if(code1[codepos].type == "ADD")
{
fprintf(fp,"addu $s1 $s1 $s2\n");
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
else if(code1[codepos].type == "MINUS")
{
fprintf(fp,"subu $s1 $s1 $s2\n");
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
else if(code1[codepos].type == "DIV")
{
fprintf(fp,"div $s1 $s2\n");
fprintf(fp,"mflo $s1\n");
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
else if(code1[codepos].type == "MULT")
{
fprintf(fp,"mult $s1 $s2\n");
fprintf(fp,"mflo $s1\n");
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
}
void emitexpression(string a,int pos1,int pos2,int pos3)
{
codepos ++;
code1[codepos].type = a;
code1[codepos].pos1 = pos1;
code1[codepos].pos2 = pos2;
code1[codepos].pos3 = pos3;
emitmipsexpression();
}
void emitmipsloadarray(int PO)
{
if(tab[PO].depth == 0)
{
fprintf(fp,"li $s2 %d\n",tab[PO].addr *4);
fprintf(fp,"lw $s3 %d($sp)\n",code1[codepos].pos2 * 4);
fprintf(fp,"sll $s3 $s3 2\n");
fprintf(fp,"addu $s2 $s2 $s3\n");
fprintf(fp,"lw $s1 0($s2)\n",tab[PO].addr*4);
}
else
{
fprintf(fp,"li $s2 %d\n",tab[PO].addr *4);
fprintf(fp,"addu $s2 $s2 $sp\n");
fprintf(fp,"lw $s3 %d($sp)\n",code1[codepos].pos2 * 4);
fprintf(fp,"sll $s3 $s3 2\n");
fprintf(fp,"addu $s2 $s2 $s3\n");
fprintf(fp,"lw $s1 0($s2)\n",tab[PO].addr*4);
}
// fprintf(fp,"add $s1 $s1 %d\n",code1[codepos].pos2*4);
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
void emitloadarray(int PO,int lastmodify,int spp)
{
codepos ++;
code1[codepos].type = "loadarray";
code1[codepos].idname = tab[PO].name;
code1[codepos].pos2 = spp;
code1[codepos].pos1 = lastmodify;
emitmipsloadarray(PO);
}
void emitmipslid(int PO)
{
if(tab[PO].con)
{
fprintf(fp,"li $s1 %d\n",tab[PO].constvalue);
}
else if(tab[PO].depth == 0)
{
fprintf(fp,"lw $s1 %d($0)\n",tab[PO].addr*4);
}
else
fprintf(fp,"lw $s1 %d($sp)\n",tab[PO].addr*4);
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
void emitload(int PO,int lastmodify)
{
codepos ++;
code1[codepos].type = "loadID";
code1[codepos].idname = tab[PO].name;
code1[codepos].pos1 = lastmodify;
emitmipslid(PO);
}
void emitmipslc()
{
fprintf(fp,"li $s1 %d\n",code1[codepos].pos2);
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
void emitloadchar(int lastmodify,int a)
{
codepos ++;
code1[codepos].type = "loadchar";
code1[codepos].pos2 = a;
code1[codepos].pos1 = lastmodify;
emitmipslc();
}
void emitmipsli()
{
fprintf(fp,"li $s1 %d\n",code1[codepos].pos2);
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
void emitloadint(int lastmodify,int a)
{
codepos ++;
code1[codepos].type = "loadint";
code1[codepos].pos2 = a;
code1[codepos].pos1 = lastmodify;
emitmipsli();
}
void emitmipsloadw()
{
fprintf(fp,"lw $s1 %d($sp)\n",code1[codepos].pos2*4);
fprintf(fp,"lw $s2 %d($sp)\n",code1[codepos].pos1*4);
fprintf(fp,"sw $s1 0($s2)\n");
}
void emitloadw(int pos1,int pos2)
{
codepos ++;
code1[codepos].type = "LW";
code1[codepos].pos1 = pos1;
code1[codepos].pos2 = pos2;
emitmipsloadw();
}
void emitmipsidpos(int PO)
{
if(tab[PO].depth == 0)
{
fprintf(fp,"li $s1 %d\n",tab[PO].addr*4);
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
else
{
fprintf(fp,"li $s1 %d\n",tab[PO].addr*4);
fprintf(fp,"addu $s1 $s1 $sp\n");
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
}
void emitidpos(int PO,int pos1)
{
codepos ++;
code1[codepos].type = "LoadIdPos";
code1[codepos].pos1 = pos1;
code1[codepos].idname = tab[PO].name;
emitmipsidpos(PO);
}
void emitloadarraypos(int PO)
{
if(tab[PO].depth == 0)
{
fprintf(fp,"li $s1 %d\n",tab[PO].addr*4);
fprintf(fp,"lw $s3 %d($sp)\n",code1[codepos].pos2*4);
fprintf(fp,"li $s5 4\n");
fprintf(fp,"mult $s5 $s3\n");
fprintf(fp,"mflo $s3\n");
fprintf(fp,"addu $s1 $s1 $s3\n");
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
else
{
fprintf(fp,"li $s1 %d\n",tab[PO].addr*4);
fprintf(fp,"lw $s3 %d($sp)\n",code1[codepos].pos2*4);
fprintf(fp,"li $s5 4\n");
fprintf(fp,"mult $s5 $s3\n");
fprintf(fp,"mflo $s3\n");
fprintf(fp,"addu $s1 $s1 $s3\n");
fprintf(fp,"addu $s1 $s1 $sp\n");
fprintf(fp,"sw $s1 %d($sp)\n",code1[codepos].pos1*4);
}
}
void emitarraypos(int PO,int pos1,int pos2)
{
codepos ++;
code1[codepos].type = "LoadArrayPos";
code1[codepos].pos1 = pos1;
code1[codepos].pos2 = pos2;
emitloadarraypos(PO);
}
void emitmipstag()
{
fprintf(fp,"tag%d:\n",code1[codepos].pos1);
}
void emittag(int pos)
{
codepos ++;
code1[codepos].type = "tag:";
code1[codepos].pos1 = pos;
emitmipstag();
}
void emitmipsjump()
{
fprintf(fp,"j tag%d\n",code1[codepos].pos1);
}
void emitjump(int tag)
{
codepos ++;
code1[codepos].type = "JUMP";
code1[codepos].pos1 = tag;
emitmipsjump();
}
void emitmipsbeq()
{
fprintf(fp,"lw $s1 %d($sp)\n",((code1[codepos].pos1)*4));
fprintf(fp,"lw $s2 %d($sp)\n",((code1[codepos].pos2)*4));
fprintf(fp,"beq $s1 $s2 tag%d\n",code1[codepos].pos3);
}
void emitbeq(int pos1,int pos2,int pos3)
{
codepos ++;
code1[codepos].type = "BEQ";
code1[codepos].pos1 = pos1;
code1[codepos].pos2 = pos2;
code1[codepos].pos3 = pos3;
emitmipsbeq();
}
void emitmipsless()
{
fprintf(fp,"lw $s1 %d($sp)\n",((code1[codepos].pos1)*4));
fprintf(fp,"lw $s2 %d($sp)\n",((code1[codepos].pos2)*4));
fprintf(fp,"li $s3 0\n");
fprintf(fp,"slt $s3 $s1 $s2\n");
fprintf(fp,"beq $s3 $0 tag%d\n",code1[codepos].pos3);
}
void emitless(int pos1,int pos2,int pos3)
{
codepos ++;
code1[codepos].type = "Bless";
code1[codepos].pos1 = pos1;
code1[codepos].pos2 = pos2;
code1[codepos].pos3 = pos3;
emitmipsless();
}
void emitmipslesseq()
{
fprintf(fp,"lw $s1 %d($sp)\n",((code1[codepos].pos1)*4));
fprintf(fp,"lw $s2 %d($sp)\n",((code1[codepos].pos2)*4));
fprintf(fp,"li $s3 0\n");
fprintf(fp,"slt $s3 $s2 $s1\n");
fprintf(fp,"bne $s3 $0 tag%d\n",code1[codepos].pos3);
}
void emitlesseq(int pos1,int pos2,int pos3)
{
codepos ++;
code1[codepos].type = "Blesseq";
code1[codepos].pos1 = pos1;
code1[codepos].pos2 = pos2;
code1[codepos].pos3 = pos3;
emitmipslesseq();
}
void emitmipsmore()
{
fprintf(fp,"lw $s1 %d($sp)\n",((code1[codepos].pos1)*4));
fprintf(fp,"lw $s2 %d($sp)\n",((code1[codepos].pos2)*4));
fprintf(fp,"li $s3 0\n");
fprintf(fp,"slt $s3 $s2 $s1\n");
fprintf(fp,"beq $s3 $0 tag%d\n",code1[codepos].pos3);
}
void emitmore(int pos1,int pos2,int pos3)
{
codepos ++;
code1[codepos].type = "Bmore";
code1[codepos].pos1 = pos1;
code1[codepos].pos2 = pos2;
code1[codepos].pos3 = pos3;
emitmipsmore();
}
void emitmipsmoreeq()
{
fprintf(fp,"lw $s1 %d($sp)\n",((code1[codepos].pos1)*4));
fprintf(fp,"lw $s2 %d($sp)\n",((code1[codepos].pos2)*4));
fprintf(fp,"li $s3 0\n");
fprintf(fp,"slt $s3 $s1 $s2\n");
fprintf(fp,"bne $s3 $0 tag%d\n",code1[codepos].pos3);
}
void emitmoreeq(int pos1,int pos2,int pos3)
{
codepos ++;
code1[codepos].type = "Bmoreeq";
code1[codepos].pos1 = pos1;
code1[codepos].pos2 = pos2;
code1[codepos].pos3 = pos3;
emitmipsmoreeq();
}
void emitmipsbsingle()
{
fprintf(fp,"lw $s1 %d($sp)\n",((code1[codepos].pos1)*4));
fprintf(fp,"beq $s1 $0 tag%d\n",code1[codepos].pos3);
}
void emitsingle(int pos,int tag)
{
codepos ++;
code1[codepos].type = "Bsingle";
code1[codepos].pos1 = pos;
code1[codepos].pos3 = tag;
emitmipsbsingle();
}
void emitmipsbne()
{
fprintf(fp,"lw $s1 %d($sp)\n",((code1[codepos].pos1)*4));
fprintf(fp,"lw $s2 %d($sp)\n",((code1[codepos].pos2)*4));
fprintf(fp,"bne $s1 $s2 tag%d\n",code1[codepos].pos3);
}
void emitbne(int pos1,int pos2,int pos3)
{
codepos ++;
code1[codepos].type = "BNE";
code1[codepos].pos1 = pos1;
code1[codepos].pos2 = pos2;
code1[codepos].pos3 = pos3;
emitmipsbne();
}
void emitmipsreturn()
{
fprintf(fp,"lw $31 4($sp)\n");
fprintf(fp,"addi $sp $sp %d\n",alloc_size);
fprintf(fp,"jr $31\n");
}
void emitreturn()
{
codepos ++;
code1[codepos].type = "RET";
emitmipsreturn();
}
void emitmipscall(int PO)
{
fprintf(fp,"sw $31 4($sp)\n");
fprintf(fp,"subi $sp $sp %d\n",alloc_size);
fprintf(fp,"jal tag%d\n",tab[PO].position);
}
void emitcall(int PO)
{
codepos ++;
code1[codepos].type = "CALL";
code1[codepos].idname = tab[PO].name;
emitmipscall(PO);
}
void emitrere()
{
//cout<<"REEEEEEEEEEEEEREEEEEEEEEEEEEE!"<<endl;
fprintf(fp,"lw $31 4($sp)\n");
}
void emitmipsmain()
{
fprintf(fp,"main:\n");
}
void emitmaintag()
{
codepos ++;
code1[codepos].type = "MAIN";
emitmipsmain();
}
void emitmipsjmain()
{
fprintf(fp,"jal main\n");
fprintf(fp,"j end\n");
}
void emitend()
{
fprintf(fp,"end:\n");
}
void emitjmain()
{
codepos ++;
code1[codepos].type = "J";
code1[codepos].idname = "main";
emitmipsjmain();
}
void emitmipscallmain()
{
fprintf(fp,"li $sp 0x00002ffc\n");
fprintf(fp,"subi $sp $sp %d\n",alloc_size);
}
void emitcallmain()
{
codepos ++;
code1[codepos].type = "callmain";
emitmipscallmain();
}
void emitmipscallpre()
{
}
void emitcallpre()
{
codepos ++;
code1[codepos].type = "call_pre";
emitmipscallpre();
}
void mipsfillpos(int pos1,int pos2)
{
fprintf(fp,"lw $s1 %d($sp)\n",pos2*4);
fprintf(fp,"sw $s1 %d($sp)\n",(- alloc_size + 8 + pos1*4));
}
int solve_if()
{
cout<<"第"<<line[pos]<<"为if语句"<<endl;
int tag;
int tt1,tt2,tt3;
int lastmodify,lastmodify2 = 0;
//storeposition
sumtag ++;
tt1 = sumtag;
sumtag ++;
tt2 = sumtag;
tag = nextsym();
if(tag != lpartag)
{
// error();
}
storeposition ++;
lastmodify = storeposition + 1;
tag = solve_expression();
//tag = nextsym();
//emit();//生成跳转语句
//if(tag == equtag){//cout<<"Yes, party time!"<<endl;
//tag = solve_expression();}
if(tag == moretag){storeposition ++; lastmodify2 = storeposition + 1; tag = solve_expression();emitmore(lastmodify,lastmodify2,tt1);}
else if(tag == moreeqtag){storeposition ++; lastmodify2 = storeposition + 1; tag = solve_expression();emitmoreeq(lastmodify,lastmodify2,tt1);}
else if(tag == lesstag){storeposition ++; lastmodify2 = storeposition + 1; tag = solve_expression();emitless(lastmodify,lastmodify2,tt1);}
else if(tag == leseqtag){storeposition ++; lastmodify2 = storeposition + 1; tag = solve_expression();emitlesseq(lastmodify,lastmodify2,tt1);}
else if(tag == equtag){storeposition ++;lastmodify2 = storeposition+1;tag = solve_expression();emitbne(lastmodify,lastmodify2,tt1);}
else if(tag == noteqtag){storeposition ++;lastmodify2 = storeposition+1;tag = solve_expression();emitbeq(lastmodify,lastmodify2,tt1);}
else {emitsingle(lastmodify,tt1);}
if(tag != rpartag)error();
solve_sentence();
emitjump(tt2);
emittag(tt1);
// cout<<"waxiue"<<code[pos]<<endl;
tag = nextsym();
if(tag != elsetag){error;}
tag = solve_sentence();
emittag(tt2);
cout<<line[pos]<<endl;
return tag;
//在这里需要补充跳转后的位置
}
int solve_switch()
{
cout<<"第"<<line[pos]<<"为switch语句"<<endl;
int a = nextsym();
if(a != lpartag)error();
storeposition ++;
int popo1 = storeposition + 1;
a = solve_expression();
if(a != rpartag){error();cout<<"卡卡卡卡卡卡卡"<<endl;}
a = nextsym();
if(a != LPtag){error();
//cout<<"汪汪汪汪无无"<<endl;
}
a = nextsym();
sumtag ++;
int tagend = sumtag;
// cout<<a<<' '<<casetag<<' '<<idtag<<endl;
while(a == casetag)
{
//a = nextsym();
//if(a != numtag)error();
sumtag ++;
int ttaagg = sumtag;
storeposition = popo1;
int popo2 = popo1 + 1;
a = solve_expression();
emitbne(popo1,popo2,ttaagg);
//a = nextsym();
if(a != colontag)
{
error();
}
a = solve_sentence();
emitjump(tagend);
emittag(ttaagg);
a = nextsym();
}
if(a == defaulttag)
{
a = nextsym();
if(a != colontag)
{
error();
}
a = solve_sentence();
a = nextsym();
}emittag(tagend);
if(a != RPtag)error();
return a;
}
int simplelastpos;
int solve_simple(string lasttype,int lastpos)
{
int a = nextsym(),type;
int popopos = storeposition + 1;
int inipos = lastpos;
if(a == lpartag)
{
popopos = storeposition + 1;
a = solve_expression();if(a != rpartag)error();a = nextsym();
emitexpression(lasttype,inipos,inipos,popopos);
storeposition ++;
}
else
{
int PP ;
if(a != idtag && a != numtag && a != CHtag && a != chartag&& a != plustag && a != minustag){error("表达式乘除法后应该跟变量");}
if(a == idtag)
{
type = find_tab(id);
PP = tab_pos;
}
else type = 0;
if(type == intarraytype || type == chararraytype || type == lpartag)
{
//cout<<"Yes!"<<endl;
a = nextsym();
if(a != lmidtag)error("数组维数问题");
int fff = 0;
storeposition ++;
popopos = storeposition + 1;
while(a == lmidtag)
{
fff ++;
a = solve_expression();
//a = nextsym();
if(a != rmidtag)error();
a = nextsym();
}storeposition ++;
emitloadarray(PP,popopos - 1,popopos);
emitexpression(lasttype,inipos,inipos,popopos - 1);
storeposition ++ ;
if(fff != 1)error("数组维数有问题");
}
else if(type == voidtag || type == intretag || type == charretag)
{
popopos = storeposition + 1;
storeposition ++;
int i;
if(tab[PP].size != 0)
{
a = nextsym();
int popping = storeposition + 1;
int popping1 = popping;
if(a != lpartag)error("函数调用缺少左括号!!");
for(i = 1;i <= tab[PP].size;i ++)
{
a = solve_expression();
if(a != commatag && i != tab[PP].size)error();
// mipsfillpos(i-1,poppin);
storeposition = popping ;
popping = storeposition + 1;
}
for(i = popping1;i < popping;i ++)
{
mipsfillpos(i-popping1,i);
}
if(a != rpartag)error("函数调用缺少右括号");
emitcall(PP);
emitrere();
emitmfret(popopos);
emitexpression(lasttype,inipos,inipos,popopos);
}
else
{
emitcall(PP);
emitrere();
emitmfret(popopos);
emitexpression(lasttype,inipos,inipos,popopos);
}
a = nextsym();
}
else if(type == inttag || type == chartag)
{
popopos = storeposition + 1;
storeposition ++;
emitload(PP,popopos);
emitexpression(lasttype,inipos,inipos,popopos);
a = nextsym();
}
else
{
if(a == CHtag)
{
popopos = storeposition + 1;
storeposition ++;
emitloadchar(popopos,string_1[0]);
emitexpression(lasttype,inipos,inipos,popopos);
}
else if(a == numtag)
{
popopos = storeposition + 1;
storeposition ++;
emitloadint(popopos,Int_Value);
emitexpression(lasttype,inipos,inipos,popopos);
}
else if(a == plustag || a == minustag)
{
int aa = a;
a = nextsym();
if(a != numtag)error("应该接整数!");
popopos = storeposition + 1;
storeposition ++;
if(aa == minustag)
emitloadint(popopos,-Int_Value);
else emitloadint(popopos,Int_Value);
emitexpression(lasttype,inipos,inipos,popopos);
}
else error("类型有问题!(○` 3′○)");
a = nextsym();
// storeposition ++;
}
}
//cout<<"????"<<endl;
while(a == startag || a == divtag)
{
int PP;
if(a == startag || a == divtag)
{
if(a == startag)lasttype = "MULT";
else lasttype = "DIV";
a = nextsym();
if(a == idtag)
{
type = find_tab(id);
PP = tab_pos;
}
else type = 0;
if(a == lpartag)
{
popopos = storeposition + 1;
a = solve_expression();
if(a != rpartag)error("缺少右小括号");
emitexpression(lasttype,inipos,inipos,popopos);
storeposition ++;
a = nextsym();
}
else if(type == intarraytype || type == chararraytype)
{
a = nextsym();
if(a != lmidtag)error();
int fff = 0;
storeposition ++;
popopos = storeposition + 1;
//storeposition ++;
while(a == lmidtag)
{
fff ++;
a = solve_expression();
//a = nextsym();
if(a != rmidtag)error();
a = nextsym();
}emitloadarray(PP,popopos - 1,popopos);
emitexpression(lasttype,inipos,inipos,popopos - 1);
if(fff != 1)error("数组维数有问题");
}
else if(type == voidtag || type == intretag || type == charretag)
{
int i;
popopos = storeposition + 1;
storeposition ++;
if(tab[PP].size != 0)
{
a = nextsym();
int popping = storeposition + 1;
int popping1 = popping;
if(a != lpartag)error("函数调用缺少左括号!!");
for(i = 1;i <= tab[PP].size;i ++)
{
a = solve_expression();
if(a != commatag && i != tab[PP].size)error();
// mipsfillpos(i-1,poppin);
storeposition = popping ;
popping = storeposition + 1;
}
for(i = popping1;i < popping;i ++)
{
mipsfillpos(i-popping1,i);
}
if(a != rpartag)error("函数调用缺少右括号");
emitcall(PP);
emitrere();
emitmfret(popopos);
emitexpression(lasttype,inipos,inipos,popopos);
storeposition = popping1 - 2;
}
else
{
emitcall(PP);
emitrere();
emitmfret(popopos);
emitexpression(lasttype,inipos,inipos,popopos);
}
a = nextsym();
}
else if(type == inttag || type == chartag)
{
popopos = storeposition + 1;
storeposition ++;
emitload(PP,popopos);
emitexpression(lasttype,inipos,inipos,popopos);
a = nextsym();
}
else
{
if(a == CHtag)
{
popopos = storeposition + 1;
storeposition ++;
emitloadchar(popopos,string_1[0]);
emitexpression(lasttype,inipos,inipos,popopos);
}
else if(a == numtag)
{
popopos = storeposition + 1;
storeposition ++;
emitloadint(popopos,Int_Value);
emitexpression(lasttype,inipos,inipos,popopos);
}
else if(a == plustag || a == minustag)
{
int aa = a;
a = nextsym();
if(a != numtag)error("应该接整数!");
popopos = storeposition + 1;
storeposition ++;
if(aa == minustag)
emitloadint(popopos,-Int_Value);
else emitloadint(popopos,Int_Value);
emitexpression(lasttype,inipos,inipos,popopos);
}
else error("类型有问题!(○` 3′○)");
a = nextsym();
// storeposition ++;
}
//else error();
}
}
// cout<<"outside simple!"<<endl;
return a;
}
void mipsstart()
{
fprintf(fp,"sw $31 4($sp)\n");
}
int solve_expression()
{
int charsost = 1;
int sumcha = 0;
// cout<<"哈哈哈哈哈哈哈哈expression!"<<endl;
int spo = storeposition + 1;
storeposition ++;
int poss = pos;
int start_pos = pos;
int a = nextsym(),type;
string lasttype = "ADD";
int lastmodify = 0;//storeposition + 1;////////////
emitloadint(spo,0);
//emitloadint(0,0);
// emitloadint(lastmodify,0);///////////
storeposition ++;
bool tata = 0;
if(a == idtag || a == numtag || a == CHtag || a == lpartag )
{
lastmodify = storeposition + 1;
tata = 1;
if(a == lpartag)
{
if(a == lpartag)
{
tata = 1;
a = solve_expression();
//lastmodify = store_position;
if(a != rpartag)error();
a = nextsym();
}
}
else if(a == idtag)
{
int type1 = find_tab(id);
int PO = tab_pos;
if(type1 == intarraytype || type1 == chararraytype)
{
if(type1 == intarraytype)charsost = 0;
else sumcha ++;
a = nextsym();
if(a != lmidtag)error("应输入数组的维数");
storeposition ++;
int spp = storeposition + 1;
int fff = 0;
while(a == lmidtag)
{
fff ++;
a = solve_expression();
if(a != rmidtag)error();
a = nextsym();
}
if(fff != 1)error("数组维数有问题");
emitloadarray(PO,lastmodify,spp);
}else if(type1 == voidtag || type1 == intretag || type1 == charretag)
{
if(type1 != charretag)charsost = 0;
else sumcha ++;
if(type1 == voidtag)error("不应该调用无返回值的函数!");
int i;
if(tab[PO].size != 0)
{
storeposition ++;
int popping = storeposition + 1;
int popping1 = popping;
a = nextsym();
if(a != lpartag)error("函数调用缺少左括号!!!");
for(i = 1;i <= tab[PO].size;i ++)
{
a = solve_expression();
if(a != commatag && i != tab[PO].size)error();
storeposition = popping;
popping = storeposition + 1;
//mipsfillpos(i-1,popping);
}
for(i = popping1;i < popping;i ++)
mipsfillpos(i-popping1,i);
storeposition = popping1 - 2;
emitcall(PO);
emitrere();
emitmfret(lastmodify);
if(a != rpartag)error("函数调用缺少右括号");
} else
{
emitcall(PO);
emitrere();
emitmfret(lastmodify);
}
a = nextsym();
}
else
{
if(tab[PO].type != chartag)charsost = 0;
else sumcha ++;
emitload(PO,lastmodify);
a = nextsym();
}
}else
{
if(a == CHtag)
{
sumcha ++;
emitloadchar(lastmodify,string_1[0]);
}
else if(a == numtag)
{
charsost = 0;
emitloadint(lastmodify,Int_Value);
}
else if(a == plustag || a == minustag)
{
charsost = 0;
int aa = a;
a = nextsym();
if(aa == plustag)
emitloadint(lastmodify,Int_Value);
else
emitloadint(lastmodify,-Int_Value);
}
else error("类型有问题!(○` 3′○)");
a = nextsym();
}
storeposition ++;
}
while( a == plustag || a == minustag || a == startag || a == divtag)
{
if(a == startag || a == divtag)
{
charsost = 0;
if(!tata)error("不能以乘除法开头");
string llss;
if(a == startag)llss = "MULT";
else llss = "DIV";
a = solve_simple(llss,lastmodify);
}
else
{
tata = 1;
emitexpression(lasttype,spo,spo,lastmodify);
if(a == plustag)lasttype = "ADD";
else if(a == minustag)lasttype = "MINUS";
a = nextsym();
if(a == lpartag)
{
lastmodify = storeposition + 1;
a = solve_expression();
//lasttype =
if(a != rpartag)error("缺少右小括号");
a = nextsym();
}
else
{
if(a == numtag || a == idtag || a == CHtag|| a == plustag|| a == minustag)
{
if(a == idtag)
{
int type1 = find_tab(id);
int PO = tab_pos;
lastmodify = storeposition + 1;
if(type1 == intarraytype || type1 == chararraytype)
{
if(type1 == intarraytype)charsost = 0;
else sumcha ++;
a = nextsym();
if(a != lmidtag)error("数组维数问题!");
int fff = 0;
storeposition ++;
int spp = storeposition + 1;
while(a == lmidtag)
{
fff ++;
a = solve_expression();
if(a != rmidtag)error("右中括号问题");
a = nextsym();
}
if(fff != 1)error("数组维数有问题");
emitloadarray(PO,lastmodify,spp);
}
else if(type1 == voidtag || type1 == intretag || type1 == charretag)
{
if(type1 != charretag)charsost = 0;
else sumcha ++;
storeposition ++;
int popping = storeposition + 1;
int popping1 = popping;
if(type1== voidtag)error("不应该调用无返回值函数!");
int i;
if(tab[PO].size != 0)
{
a = nextsym();
if(a != lpartag)error("函数调用缺少左括号!!!!");
for(i = 1;i <= tab[PO].size;i ++)
{
a = solve_expression();
//mipsfillpos(i-1,popping);
storeposition = popping;
popping = storeposition +1;
if(a != commatag && i != tab[PO].size)error();
}
for(i = popping1;i < popping;i ++)
mipsfillpos(i-popping1,i);
storeposition = popping1 - 2;
if(a != rpartag)error("函数调用缺少右括号");
} a = nextsym();emitcall(PO);emitrere();emitmfret(lastmodify);
}//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
else
{
if(tab[PO].type != chartag)charsost = 0;
else sumcha ++;
emitload(PO,lastmodify);
a = nextsym();
}
}else
{ if(a == CHtag)
{
sumcha ++;
lastmodify = storeposition + 1;
emitloadchar(lastmodify,string_1[0]);
}
else if(a == numtag)
{
charsost = 0;
lastmodify = storeposition + 1;
emitloadint(lastmodify,Int_Value);
}
else if(a == plustag || a == minustag)
{
// cout<<"?????????????????????"<<endl;
charsost = 0;
int aa = a;
a = nextsym();
lastmodify = storeposition + 1;
if(aa == plustag)
emitloadint(lastmodify,Int_Value);
else
emitloadint(lastmodify,-Int_Value);
}
else
{cout<<a<<endl;error("类型有问题!(○` 3′○)");}
a = nextsym();
}storeposition ++;
}else error("表达式格式有问题");
}
}
}
emitexpression(lasttype,spo,spo,lastmodify);
charsostrong = charsost;
sumchar = sumcha;
cout<<"expression:";
for(int i = poss;i < pos;i ++)cout<<code[i];cout<<endl;
//cout<<"outside expression!"<<endl;
return a;
}
void solve_assign()
{
cout<<"第"<<line[pos]<<"行为赋值语句!"<<endl;
int type = find_tab(id);
int PO = tab_pos,fff = 0;
//cout<<tab[PO].name<<' '<<tab[PO].size<<endl;
int a;
int assignpos1,assignpos2;
if(type == intarraytype || type == chararraytype)
{
// cout<<"Yes!"<<endl;
a = nextsym();
int pos_expcode1 = storeposition + 1;
while(a == lmidtag)//error();
{
a = solve_expression();
if(a != rmidtag)error();
a = nextsym();
fff ++;
}
//
if(fff != 1)error("等号左边数组维数有问题");
storeposition ++;
emitarraypos(PO,storeposition,pos_expcode1);
}
//需要存储下地址之类的
//cout<<"呱呱呱"<<endl;
else
{ storeposition ++;
emitidpos(PO,storeposition);
a = nextsym();}
// cout<<a<<' '<<assigntag<<endl;
if(a != assigntag)
{error("等号问题");}
assignpos1 = storeposition;
assignpos2 = storeposition + 1;
//storeposition ++;
a = solve_expression();
emitloadw(assignpos1,assignpos2);
// emit();
if(a != semitag)error("分号不对!");
// cout<<"退出呱呱呱"<<endl;
}
void solve_while()
{
cout<<"第"<<line[pos]<<"行为while语句!"<<endl;
int lastmodify,lastmodify2 = 0;
int tt1,tt2;
//storeposition
sumtag ++;
tt1 = sumtag;
sumtag ++;
tt2 = sumtag;
emittag(tt2);
int a = nextsym();
if(a != lpartag)error();
//storeposition ++;
lastmodify = storeposition + 1;
a = solve_expression();
// a = nextsym();
if(a != rpartag)
{
// cout<<"wawawaawa"<<endl;
if(a == equtag)
{
storeposition ++;
lastmodify2 = storeposition+1;
a = solve_expression();
emitbne(lastmodify,lastmodify2,tt1);
}
else if(a == lesstag)
{
storeposition ++;
lastmodify2 = storeposition+1;
a = solve_expression();
emitless(lastmodify,lastmodify2,tt1);
}
else if(a == leseqtag)
{
storeposition ++;
lastmodify2 = storeposition+1;
a = solve_expression();
emitlesseq(lastmodify,lastmodify2,tt1);
}
else if(a == moretag)
{
storeposition ++;
lastmodify2 = storeposition+1;
a = solve_expression();
emitmore(lastmodify,lastmodify2,tt1);
}
else if(a == moreeqtag)
{
storeposition ++;
lastmodify2 = storeposition+1;
a = solve_expression();
emitmoreeq(lastmodify,lastmodify2,tt1);
}
else if(a == noteqtag)
{
storeposition ++;
lastmodify2 = storeposition+1;
a = solve_expression();
emitbeq(lastmodify,lastmodify2,tt1);
}
else error();
//a = solve_expression();
//a = nextsym();
if(a != rpartag)
error();
//solve_expression();
}else{emitsingle(lastmodify,tt1);}
solve_sentence();
emitjump(tt2);
emittag(tt1);
}
int solve_const(int a)
{
cout<<"第"<<line[pos]<<"行为const声明语句!"<<endl;
while(a == consttag)
{
int type;
a = nextsym();
type = a;
//记录类型!!!!!!!!!!!!!!!!!!
a = nextsym();
//cout<<a<<' '<<idtag<<endl;
if(a != idtag)error();
int PO = filltab(type,depth,id);
tab[PO].con= 1;
a = nextsym();
if(a != assigntag)error();
a = nextsym();
int nunu = 1;
if(a == plustag || a == minustag)
{
nunu = (a == minustag)?-1:1;
a = nextsym();
if(a != numtag )
{
error();
}
//if(num == 0)error();
}//filltab!!!!!!!!!!!!!!!!!!!
if(a != numtag && a != CHtag)error();
if(a == numtag)
tab[PO].constvalue = nunu * Int_Value;
else
tab[PO].constvalue = string_1[0];
a = nextsym();
if(a == commatag)
{
// cout<<"comma right!"<<endl;
while(a == commatag)
{
a = nextsym();
if(a != idtag)error();
int PO = filltab(type,depth,id);
tab[PO].con= 1;
a = nextsym();
if(a != assigntag)error();
a = nextsym();
int nunu = 1;
if(a == plustag || a == minustag)
{
nunu = (a == minustag)?-1:1;
a = nextsym();
if(a != numtag )
{
error();
}
//if(num == 0)error();
}//filltab
if(a != numtag && a != CHtag)error();
if(a == numtag)
tab[PO].constvalue = nunu * Int_Value;
else
tab[PO].constvalue = string_1[0];
a = nextsym();
}
}
if(a != semitag)error();
//filltab();
a = nextsym();
}return a;
}
int solve_statement(int a)
{
cout<<"第"<<line[pos]<<"行为变量语句!"<<endl;
while(a == inttag || a == chartag)
{
int poppop = pos;
int type = a;
a = nextsym();
if(a != idtag)error();
string idid = id;
a = nextsym();
if(a == LPtag || a == lpartag)
{
pos = poppop;
return type;
}int PO = filltab(type,depth,idid);
int gg = 0;
while(a == lmidtag)
{
gg ++;
a = nextsym();
if(a != numtag)error();
tab[PO].arr[gg] = Int_Value;
tab[PO].size = Int_Value;
if(tab[PO].size == 1)tab[PO].size ++;
//if(int == 0)error()
a = nextsym();
if(a != rmidtag)error();
a = nextsym();
}//tab[PO].size = gg;
while(a == commatag)
{ a = nextsym();
if(a != idtag)error("bu");
int PO = filltab(type,depth,id);
a = nextsym();
int gg = 0;
while(a == lmidtag)
{
gg ++;
a = nextsym();
if(a != numtag)error();
if(Int_Value == 0)error("数组大小不应为0");
tab[PO].arr[gg] = Int_Value;
tab[PO].size = Int_Value;
if(tab[PO].size == 1)tab[PO].size ++;
a = nextsym();
if(a != rmidtag)error();
a = nextsym();
}//filltab
//tab[PO].size = gg;
}if(a != semitag)error("que");
// next();
//记录类型!!!!!!!!!!!!!!!!!!
a = nextsym();
}//return nextsym();
return a;
}
void solve_printf()
{
cout<<"第"<<line[pos]<<"行为printf语句!"<<endl;
int a = nextsym();
if(a != lpartag)error();
int nowpos = pos;
a = nextsym();
if(a != stringtag)
{
pos = nowpos;
storeposition ++;
int yes = storeposition + 1;
charsostrong = 1;
sumchar = 0;
a = solve_expression();
cout<<charsostrong<<' '<<sumchar<<"SSSSSSSSSSSSSSSSSSOOOOOOOOOOOOOOOOOOOOOOOO"<<endl;
if((!charsostrong)||(sumchar != 1))
emitprintfex(yes);
else emitprintfchar(yes);
if(a != rpartag)error();
a = nextsym();
}
else
{
emitprintfstring();
a = nextsym();
if(a == commatag)
{
storeposition ++;
int yes = storeposition + 1;
charsostrong = 1;
sumchar = 0;
a = solve_expression();
if((!charsostrong)||(sumchar != 0))
emitprintfex(yes);
else emitprintfchar(yes);
}
if(a != rpartag)error("输出语句缺少右括号");
a = nextsym();
}
if(a != semitag)error("输出语句缺少分号");
}
void solve_scanf()
{
cout<<"第"<<line[pos]<<"行为scanf语句!"<<endl;
int a = nextsym();
if(a != lpartag)error();
a = nextsym();
if(a != idtag)error();
find_tab(id);
int PO = tab_pos;
emitscanf(PO);
a = nextsym();
cout<<"SCANF"<<endl;
while(a == commatag)
{
a = nextsym();
if(a != idtag)error();
find_tab(id);
PO = tab_pos;
emitscanf(PO);
a = nextsym();
}
if(a != rpartag)error();
a = nextsym();
if(a != semitag)error();
}
void solve_return()
{
cout<<"第"<<line[pos]<<"行为return语句!"<<endl;
// int popo = pos;
int a = nextsym();
if(a == semitag){emitreturn(); return;}
//cout<<"fafafa"<<endl;
// cout<<"STO:"<<storeposition <<endl;
if(a != lpartag)error();
storeposition ++;
int sp = storeposition + 1;
a = solve_expression();
emitret_value(sp);
if(a != rpartag)error();
a = nextsym();
if(a != semitag)error();
emitreturn();
}
void solve_statement_strong(int a)
{
int type = a;
cout<<"第"<<line[pos]<<"行为函数声明语句!"<<endl;
int lastpos = pos;
a = nextsym();
int PO = filltab(type,0,id);
tab[PO].ret = 1;
int hehe = 0;
sumtag ++;
emittag(sumtag);
tab[PO].position = sumtag;
if(a != lpartag)
{
pos = lastpos;
tab[PO].size = 0;
// cout<<"emmmm?"<<endl;
solve_sentence(1);
}
else
{
hehe ++;
a = nextsym();
int tyty;
if(a != chartag && a != inttag)error();
tyty = a;
tab[PO].arr[hehe] = a;
a = nextsym();
if(a != idtag)error();filltab(tyty,1,id);
a = nextsym();
while(a == commatag)
{
hehe ++;
a = nextsym();
tyty = a;
tab[PO].arr[hehe] = a;
if(a != chartag && a != inttag)error();
a = nextsym();filltab(tyty,1,id);
if(a != idtag)error();
a = nextsym();
}
if(a != rpartag)error();
tab[PO].size = hehe;
solve_sentence(1);
}
}
int st_use;
int solve_sentence(bool ish)
{
int a = nextsym();
//int b;
int pos1 = pos;
int pos2;
if(a != LPtag)
{
switch (a)
{
case iftag:
{
cout<<"if"<<endl;
solve_if();
//cout<<"eeeeeeeeeeeeennnnnnnnnnnnnnnnnnndddddddddddd"<<endl;
//cout<<code[pos - 3]<<code[pos - 2]<<code[pos - 1]<<endl;
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case whiletag:
{
cout<<"while"<<endl;
solve_while();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case idtag:
{
cout<<"id"<<endl;
// cout<<"emmmmmmmm"<<endl;
int type = find_tab(id);
int PO = tab_pos;
//cout<<type<<endl;
//cout<<tab[PO].ret<<endl;
if(type == voidtag || type == intretag || type == charretag)
{
//cout<<"MMMMMMMMMMMMMMMMMMMMMMMMMMM"<<endl;
int i;
emitcallpre();
if(tab[PO].size != 0)
{
// cout<<tab[PO].size<<endl;
storeposition ++;
int ss = storeposition + 1;
int ss1 = ss;
a = nextsym();
if(a != lpartag)error("函数调用缺少左括号!!!!!");
for(i = 1;i <= tab[PO].size;i ++)
{
storeposition = ss;
ss = storeposition + 1;
a = solve_expression();
//mipsfillpos(i-1,ss);
storeposition = ss;
if(a != commatag && i != tab[PO].size)error();
}
for(i = ss1+1;i <= ss;i ++)
{
mipsfillpos(i-ss1-1,i);
}
int ssv,ssd;
for(int j = PO;tab[j].depth == 1;j ++)
{
ssv = tab[j].addr + ((tab[j].ret)?0:tab[j].size);
}
if(a != rpartag)error("函数调用缺少右括号");
} emitcall(PO);
//cout<<"???????!!!!!!!!!!!!"<<endl;
emitrere();
a = nextsym();
if(a != semitag)error("函数调用缺少分号");
}
else
solve_assign();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case printftag:
{
cout<<"printf"<<endl;
solve_printf();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case scanftag:
{
cout<<"scanf"<<endl;
solve_scanf();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case returntag:
{
cout<<"return"<<endl;
solve_return();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case LPtag:
{
// cout<<"LP"<<endl;
a = solve_sentence();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case switchtag:
{
//cout<<"!!!!!!!!!!!!!!!!!!!!!!!!switch"<<endl;
solve_switch();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case semitag:{break;}
default:error("哇塞!");
a = nextsym();
}
}
//////////////////////////////////////((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
else
{//int st_use;
pos1 = pos;
a = nextsym();
if(ish){mipsstart();
if(a == consttag){ //cout<<"inside successfully"<<endl;
a = solve_const(a);
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
// a = nextsym();
}
// cout<<"a := "<<a<<' '<<chartag<<' '<<inttag<<endl;
if(a == chartag || a == inttag)
{//cout<<"inside successfully2"<<endl;
a = solve_statement(a);
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
//a = nextsym();
}
if(!tab[tabpos].ret)
st_use = tab[tabpos].addr+tab[tabpos].size;
else st_use = 2;
//cout<<"ST_USE!"<<st_use;
}
//cout<<"________________________________"<<endl;
while(a != RPtag && a != 0)
{
//cout<<"__________________________________"<<endl;
//cout<<a<<endl;
storeposition = st_use;
cout<<"SP:"<<storeposition<<' '<<st_use<<"wwwwwwwwwwwwwww"<<endl;
switch (a)
{
case iftag:
{
cout<<"if"<<endl;
solve_if();
//cout<<"eeeeeeeeeeeeennnnnnnnnnnnnnnnnnndddddddddddd"<<endl;
//cout<<code[pos - 3]<<code[pos - 2]<<code[pos - 1]<<endl;
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case whiletag:
{
cout<<"while"<<endl;
solve_while();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case idtag:
{
cout<<"id"<<endl;
// cout<<"emmmmmmmm"<<endl;
int type = find_tab(id);
int PO = tab_pos;
if(type == voidtag || type == intretag || type == charretag)
{
int i;
emitcallpre();
if(tab[PO].size != 0)
{
// cout<<tab[PO].size<<' '<<tab[PO].name<<' '<<type<<' '<<voidtag<<endl;
storeposition ++;
int ss = storeposition + 1;
int ss1 = ss;
a = nextsym();
if(a != lpartag)error("函数调用缺少左括号!!!!!");
for(i = 1;i <= tab[PO].size;i ++)
{
storeposition = ss;
ss = storeposition + 1;
a = solve_expression();
//mipsfillpos(i-1,ss);
storeposition = ss;
if(a != commatag && i != tab[PO].size)error();
}
for(i = ss1+1;i <= ss;i ++)
{
mipsfillpos(i-ss1-1,i);
}
int ssv,ssd;
for(int j = PO;tab[j].depth == 1;j ++)
{
ssv = tab[j].addr + ((tab[j].ret)?0:tab[j].size);
}
if(a != rpartag)error("函数调用缺少右括号");
// st_use = ssd;
}emitcall(PO);
emitrere();
a = nextsym();
if(a != semitag)error("函数调用缺少分号");
}
else
solve_assign();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case printftag:
{
cout<<"printf"<<endl;
solve_printf();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case scanftag:
{
cout<<"scanf"<<endl;
solve_scanf();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case returntag:
{
cout<<"return"<<endl;
solve_return();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case LPtag:
{
// cout<<"LP"<<endl;
pos = pos1;
a = solve_sentence();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case switchtag:
{
solve_switch();
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
break;
}
case semitag:{break;}
default:error("哇塞!");
}a = nextsym();//cout<<a<<' '<<RPtag<<' '<<pos<<endl;
}if(a != RPtag){error();}
//cout<<line[pos]<<endl;
}
if(ish)emitmipsreturn();
return a;
}
void solve_all()
{
//cout<<"fff"<<endl;
emitcallmain();
emitjmain();
int a = nextsym();
int pos2,pos1;
depth = 0;
if(a == consttag){ // cout<<"inside successfully"<<endl;
a = solve_const(a);
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
// a = nextsym();
}
if(a == chartag || a == inttag)
{
a = solve_statement(a);
pos2 = pos;
for(int i = pos1;i < pos2;i ++)
cout<<code[i];
cout<<endl;
pos1 = pos2;
//a = nextsym();
}
depth = 1;
while(a == voidtag || a == inttag || a == chartag)
{
int gg = a;
a = nextsym();
if(a != idtag && a != maintag)error();
if(a != maintag)
{
solve_statement_strong(gg);
emitreturn();
push_tab();
//cout<<"歪歪歪歪歪歪"<<endl;
//cout<<a<<' '<<voidtag<<endl;
}
else
{
cout<<"now main!"<<endl;
if(gg != voidtag)error();
a = nextsym();
if(a != lpartag)error();
a = nextsym();
if(a != rpartag)error();
emitmaintag();
solve_sentence(1);
break;
}
//if(a == maintag)break;
a = nextsym();
//cout<<a<<endl;
}
emitend();
}
void outputcode()
{
for(int i = 1;i <= codepos;i ++)
{
cout<<code1[i].type<<' '<<code1[i].pos1<<' '<<code1[i].pos2<<' '<<code1[i].idname<<' '<<code1[i].pos3<<endl;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
input();
solve_line();
fp = fopen("MIPS1.txt","w");
// freopen("ans.txt","w",stdout);
solve_all();
//word_temp();
//freopen("code_mid.txt","w",stdout);
cout<<"---------------------------code start!---------------------------------"<<endl;
outputcode();
return 0;
}
| [
"904186268@qq.com"
] | 904186268@qq.com |
c2aa15d4c8ca47876bce7618d761b1eba1b3b71a | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5769900270288896_0/C++/tinyjr/main.cpp | e85b1090ed93931213613e69b36bec1b8d6c70db | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 2,536 | cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <list>
#include <sstream>
#include <ctime>
#include <functional>
#define pi 3.14159265358979323846264338327950288
#define pb push_back
#define mp make_pair
#define LL long long
#define LD long double
#define INF 1000000000
#define INFll 1000000000000000000ll
#define Vi vector<int>
#define VI Vi::iterator
#define Mi map<int, int>
#define MI Mi::iterator
#define Si set<int>
#define SI Si::iterator
#define FOR(i,s,e) for (int i=(s); i<(e); i++)
#define FOE(i,s,e) for (int i=(s); i<=(e); i++)
#define FOD(i,s,e) for (int i=(s)-1; i>=(e); i--)
#define CLR(a,x) memset(a, x, sizeof(a))
#define mid (l + r) / 2
#define Left k * 2, l, mid
#define Right k * 2 + 1, mid + 1, r
#define N 111111
using namespace std;
vector<int> g[N];
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
int n, r, c;
int main() {
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
int T, cas;
cin >> T;
for (int cas = 1; cas <= T; cas ++) {
cin >> r >> c >> n;
for (int i = 1; i <= r; i++) {
g[i].resize(c);
}
int tn = n;
int ans1 = 0;
for (int i = 1; i <= r; i++)
for (int j = 1; j <= c; j++)
n -= g[i][j] = (i + j) & 1;
for (; n > 0; n--) {
int temp = INF;
int si = 0, sj = 0;
for (int i = 1; i <= r; i++)
for (int j = 1; j <= c; j++)
if (g[i][j] == 0){
int cnt = 0;
for (int k = 0; k < 4; k++) {
int tx = i + dx[k], ty = j + dy[k];
if (tx > 0 && tx <= r && ty > 0 && ty <= c)
cnt += g[tx][ty];
}
if (cnt < temp) temp = cnt, si = i, sj = j;
}
ans1 += temp;
g[si][sj] = 1;
}
n = tn;
int ans2 = 0;
for (int i = 1; i <= r; i++)
for (int j = 1; j <= c; j++)
n -= g[i][j] = ((i + j) & 1) == 0;
for (; n > 0; n--) {
int temp = INF;
int si = 0, sj = 0;
for (int i = 1; i <= r; i++)
for (int j = 1; j <= c; j++)
if (g[i][j] == 0){
int cnt = 0;
for (int k = 0; k < 4; k++) {
int tx = i + dx[k], ty = j + dy[k];
if (tx > 0 && tx <= r && ty > 0 && ty <= c)
cnt += g[tx][ty];
}
if (cnt < temp) temp = cnt, si = i, sj = j;
}
ans2 += temp;
g[si][sj] = 1;
}
printf("Case #%d: %d\n", cas, min(ans1, ans2));
}
}
| [
"eewestman@gmail.com"
] | eewestman@gmail.com |
4652ea788c354e224ab1f5709e15b09de13ad648 | f3ba51a5d310586a90355deac7bc5edd8c1914de | /DEBUG/TileMapUpdateMGR_DEBUG/bin/android/obj/src/sys/io/_Process/Stdout.cpp | 8897dc7479c71643a9468f274ce6f037394e3561 | [] | no_license | J4M4I5M7/JMHAXE_PROJECTS | ebfaf8c4eba6bbd46a81b3a776233e3e90e82424 | 424a8253d93bf9394db4812f5a7a6c422c076d02 | refs/heads/master | 2020-04-25T18:15:50.619718 | 2015-07-09T19:39:25 | 2015-07-09T19:39:25 | 38,839,769 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,842 | cpp | #include <hxcpp.h>
#ifndef INCLUDED_cpp_Lib
#include <cpp/Lib.h>
#endif
#ifndef INCLUDED_haxe_io_Bytes
#include <haxe/io/Bytes.h>
#endif
#ifndef INCLUDED_haxe_io_Eof
#include <haxe/io/Eof.h>
#endif
#ifndef INCLUDED_haxe_io_Error
#include <haxe/io/Error.h>
#endif
#ifndef INCLUDED_haxe_io_Input
#include <haxe/io/Input.h>
#endif
#ifndef INCLUDED_sys_io__Process_Stdout
#include <sys/io/_Process/Stdout.h>
#endif
namespace sys{
namespace io{
namespace _Process{
Void Stdout_obj::__construct(Dynamic p,bool out)
{
HX_STACK_FRAME("sys.io._Process.Stdout","new",0xc765a8f4,"sys.io._Process.Stdout.new","C:\\DEV\\Programs\\Haxe\\HaxeToolKit\\haxe\\std/cpp/_std/sys/io/Process.hx",64,0x4652e940)
HX_STACK_THIS(this)
HX_STACK_ARG(p,"p")
HX_STACK_ARG(out,"out")
{
HX_STACK_LINE(65)
this->p = p;
HX_STACK_LINE(66)
this->out = out;
HX_STACK_LINE(67)
::haxe::io::Bytes _g = ::haxe::io::Bytes_obj::alloc((int)1); HX_STACK_VAR(_g,"_g");
HX_STACK_LINE(67)
this->buf = _g;
}
;
return null();
}
//Stdout_obj::~Stdout_obj() { }
Dynamic Stdout_obj::__CreateEmpty() { return new Stdout_obj; }
hx::ObjectPtr< Stdout_obj > Stdout_obj::__new(Dynamic p,bool out)
{ hx::ObjectPtr< Stdout_obj > result = new Stdout_obj();
result->__construct(p,out);
return result;}
Dynamic Stdout_obj::__Create(hx::DynamicArray inArgs)
{ hx::ObjectPtr< Stdout_obj > result = new Stdout_obj();
result->__construct(inArgs[0],inArgs[1]);
return result;}
int Stdout_obj::readByte( ){
HX_STACK_FRAME("sys.io._Process.Stdout","readByte",0xa72b886a,"sys.io._Process.Stdout.readByte","C:\\DEV\\Programs\\Haxe\\HaxeToolKit\\haxe\\std/cpp/_std/sys/io/Process.hx",70,0x4652e940)
HX_STACK_THIS(this)
HX_STACK_LINE(71)
int _g = this->readBytes(this->buf,(int)0,(int)1); HX_STACK_VAR(_g,"_g");
HX_STACK_LINE(71)
if (((_g == (int)0))){
HX_STACK_LINE(72)
HX_STACK_DO_THROW(::haxe::io::Error_obj::Blocked);
}
HX_STACK_LINE(73)
return this->buf->b->__get((int)0);
}
int Stdout_obj::readBytes( ::haxe::io::Bytes str,int pos,int len){
HX_STACK_FRAME("sys.io._Process.Stdout","readBytes",0x9eebd4c9,"sys.io._Process.Stdout.readBytes","C:\\DEV\\Programs\\Haxe\\HaxeToolKit\\haxe\\std/cpp/_std/sys/io/Process.hx",76,0x4652e940)
HX_STACK_THIS(this)
HX_STACK_ARG(str,"str")
HX_STACK_ARG(pos,"pos")
HX_STACK_ARG(len,"len")
HX_STACK_LINE(77)
int result; HX_STACK_VAR(result,"result");
HX_STACK_LINE(78)
try
{
HX_STACK_CATCHABLE(Dynamic, 0);
{
HX_STACK_LINE(79)
int _g = (( ((this->out)) ? Dynamic(::sys::io::_Process::Stdout_obj::_stdout_read_dyn()) : Dynamic(::sys::io::_Process::Stdout_obj::_stderr_read_dyn()) ))(this->p,str->b,pos,len).Cast< int >(); HX_STACK_VAR(_g,"_g");
HX_STACK_LINE(79)
result = _g;
}
}
catch(Dynamic __e){
{
HX_STACK_BEGIN_CATCH
Dynamic e = __e;{
HX_STACK_LINE(81)
HX_STACK_DO_THROW(::haxe::io::Eof_obj::__new());
}
}
}
HX_STACK_LINE(83)
if (((result == (int)0))){
HX_STACK_LINE(83)
HX_STACK_DO_THROW(::haxe::io::Eof_obj::__new());
}
HX_STACK_LINE(84)
return result;
}
HX_DEFINE_DYNAMIC_FUNC3(Stdout_obj,readBytes,return )
Dynamic Stdout_obj::_stdout_read;
Dynamic Stdout_obj::_stderr_read;
Stdout_obj::Stdout_obj()
{
}
void Stdout_obj::__Mark(HX_MARK_PARAMS)
{
HX_MARK_BEGIN_CLASS(Stdout);
HX_MARK_MEMBER_NAME(p,"p");
HX_MARK_MEMBER_NAME(out,"out");
HX_MARK_MEMBER_NAME(buf,"buf");
HX_MARK_END_CLASS();
}
void Stdout_obj::__Visit(HX_VISIT_PARAMS)
{
HX_VISIT_MEMBER_NAME(p,"p");
HX_VISIT_MEMBER_NAME(out,"out");
HX_VISIT_MEMBER_NAME(buf,"buf");
}
Dynamic Stdout_obj::__Field(const ::String &inName,bool inCallProp)
{
switch(inName.length) {
case 1:
if (HX_FIELD_EQ(inName,"p") ) { return p; }
break;
case 3:
if (HX_FIELD_EQ(inName,"out") ) { return out; }
if (HX_FIELD_EQ(inName,"buf") ) { return buf; }
break;
case 8:
if (HX_FIELD_EQ(inName,"readByte") ) { return readByte_dyn(); }
break;
case 9:
if (HX_FIELD_EQ(inName,"readBytes") ) { return readBytes_dyn(); }
break;
case 12:
if (HX_FIELD_EQ(inName,"_stdout_read") ) { return _stdout_read; }
if (HX_FIELD_EQ(inName,"_stderr_read") ) { return _stderr_read; }
}
return super::__Field(inName,inCallProp);
}
Dynamic Stdout_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
switch(inName.length) {
case 1:
if (HX_FIELD_EQ(inName,"p") ) { p=inValue.Cast< Dynamic >(); return inValue; }
break;
case 3:
if (HX_FIELD_EQ(inName,"out") ) { out=inValue.Cast< bool >(); return inValue; }
if (HX_FIELD_EQ(inName,"buf") ) { buf=inValue.Cast< ::haxe::io::Bytes >(); return inValue; }
break;
case 12:
if (HX_FIELD_EQ(inName,"_stdout_read") ) { _stdout_read=inValue.Cast< Dynamic >(); return inValue; }
if (HX_FIELD_EQ(inName,"_stderr_read") ) { _stderr_read=inValue.Cast< Dynamic >(); return inValue; }
}
return super::__SetField(inName,inValue,inCallProp);
}
void Stdout_obj::__GetFields(Array< ::String> &outFields)
{
outFields->push(HX_CSTRING("p"));
outFields->push(HX_CSTRING("out"));
outFields->push(HX_CSTRING("buf"));
super::__GetFields(outFields);
};
static ::String sStaticFields[] = {
HX_CSTRING("_stdout_read"),
HX_CSTRING("_stderr_read"),
String(null()) };
#if HXCPP_SCRIPTABLE
static hx::StorageInfo sMemberStorageInfo[] = {
{hx::fsObject /*Dynamic*/ ,(int)offsetof(Stdout_obj,p),HX_CSTRING("p")},
{hx::fsBool,(int)offsetof(Stdout_obj,out),HX_CSTRING("out")},
{hx::fsObject /*::haxe::io::Bytes*/ ,(int)offsetof(Stdout_obj,buf),HX_CSTRING("buf")},
{ hx::fsUnknown, 0, null()}
};
#endif
static ::String sMemberFields[] = {
HX_CSTRING("p"),
HX_CSTRING("out"),
HX_CSTRING("buf"),
HX_CSTRING("readByte"),
HX_CSTRING("readBytes"),
String(null()) };
static void sMarkStatics(HX_MARK_PARAMS) {
HX_MARK_MEMBER_NAME(Stdout_obj::__mClass,"__mClass");
HX_MARK_MEMBER_NAME(Stdout_obj::_stdout_read,"_stdout_read");
HX_MARK_MEMBER_NAME(Stdout_obj::_stderr_read,"_stderr_read");
};
#ifdef HXCPP_VISIT_ALLOCS
static void sVisitStatics(HX_VISIT_PARAMS) {
HX_VISIT_MEMBER_NAME(Stdout_obj::__mClass,"__mClass");
HX_VISIT_MEMBER_NAME(Stdout_obj::_stdout_read,"_stdout_read");
HX_VISIT_MEMBER_NAME(Stdout_obj::_stderr_read,"_stderr_read");
};
#endif
Class Stdout_obj::__mClass;
void Stdout_obj::__register()
{
hx::Static(__mClass) = hx::RegisterClass(HX_CSTRING("sys.io._Process.Stdout"), hx::TCanCast< Stdout_obj> ,sStaticFields,sMemberFields,
&__CreateEmpty, &__Create,
&super::__SGetClass(), 0, sMarkStatics
#ifdef HXCPP_VISIT_ALLOCS
, sVisitStatics
#endif
#ifdef HXCPP_SCRIPTABLE
, sMemberStorageInfo
#endif
);
}
void Stdout_obj::__boot()
{
_stdout_read= ::cpp::Lib_obj::load(HX_CSTRING("std"),HX_CSTRING("process_stdout_read"),(int)4);
_stderr_read= ::cpp::Lib_obj::load(HX_CSTRING("std"),HX_CSTRING("process_stderr_read"),(int)4);
}
} // end namespace sys
} // end namespace io
} // end namespace _Process
| [
"J4M4I5M7@hotmail.com"
] | J4M4I5M7@hotmail.com |
5b0cb834ae0f8de3f00311b1e261908ea9405f0c | c2f4aaaf5dd799bb8f7008277f3021f774105e2b | /Version3.3 openGL/project18/Framework/CGameframework.cpp | 6b1e5cf6874f667dc96ef5cb28c8c836a200387f | [] | no_license | pinkogeneral/2019-2openGL-version3.3 | 6cad79f9fe827095931651269547551def69cf3b | fdafa11b321c5694fc6e598f5d951a684a92f928 | refs/heads/master | 2022-05-07T01:51:45.819592 | 2019-12-05T08:43:34 | 2019-12-05T08:43:34 | null | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 8,585 | cpp | #include "stdafx.h"
#include "readshader.h"
#include "CGameframework.h"
#include "CGameobject.h"
//[no remove]========================================
GLuint ProgramID;
glm::vec3 cameraPos = glm::vec3(0.0f, 4.0f, 15.0f);
glm::vec3 cameraDirection = glm::vec3(0.0f, 0.0f, 0.0f);
glm::vec3 cameraUp = glm::vec3(0.0f, 4.0f, 0.0f);
//===================================================
//===================================================
CCube* m_Robot;// 얼굴, 팔 2개, 다리 2개 , 몸통, 코 = 총 7개
float angle = 0.0f, g_posx = 0.0f, g_posy = 0.0f, g_posz = 0.0f;
float Frontviewangle = 0.0f;
float g_rLeg = 0.0f, g_lLeg = 0.0f, g_rArm = 0.0f, g_lArm = 0.0f;
bool startmove = false;
float Tick = 0.0f;
CStage* m_Stage;
CFrontView* mFrontStage;
//===================================================
CGameFrameWork::CGameFrameWork()
{
}
CGameFrameWork::~CGameFrameWork()
{
delete[] m_Robot;
}
void CGameFrameWork::FrameAdvance(int argc, char** argv)
{
glutInit(&argc, argv); //glut 초기화
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); //디스플레이 모드 설정
glutInitWindowPosition(100, 100); //윈도우의 위치 지정
glutInitWindowSize(WINDOW_SIZE_WIDTH, WINDOW_SIZE_HEIGHT); //윈도우의 크기 지정
glutCreateWindow("using index buffer");//윈도우 생성
//[ GLEW 초기화 하기 ]=======================================================
glewExperimental = GL_TRUE; //glew 초기화
if (glewInit() != GLEW_OK)
{
std::cerr << "Unable to initialize GLEW" << std::endl;
exit(EXIT_FAILURE);
}
else std::cout << "GLEW Initialized\n";
ProgramID = (Complie_Shaders());
m_Robot = new CCube[7];
m_Stage = new CStage[4];
mFrontStage = new CFrontView;
//m_Ccube2 = new CCube;
glutKeyboardFunc(Keyboard);
glutKeyboardUpFunc(KeyboardUP);
glutTimerFunc(100, Timerfunction, 1);
glutDisplayFunc(RenderScene); // 출력 함수의 지정
glutReshapeFunc(Reshape);
//glutMouseFunc(MouseEvent);
//glutReshapeFunc (); // 다시 그리기 함수 지정
glutMainLoop();
}
void RenderScene()
{
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glUseProgram(ProgramID);
int modelLoc = glGetUniformLocation(ProgramID, "model");
int viewLoc = glGetUniformLocation(ProgramID, "view");
int projLoc = glGetUniformLocation(ProgramID, "projection");
glm::mat4 view = glm::mat4(1.0f);
view = glm::lookAt(cameraPos, cameraDirection, cameraUp);
glUniformMatrix4fv(viewLoc, 1, GL_FALSE, &view[0][0]);
glm::mat4 projection = glm::mat4(1.0f);
projection = glm::perspective(glm::radians(60.0f), (float)WINDOW_SIZE_WIDTH / (float)WINDOW_SIZE_HEIGHT, 0.1f, 200.0f);
glUniformMatrix4fv(projLoc, 1, GL_FALSE, &projection[0][0]);
//[몸통]===========================================================
glm::mat4 CenterBody = glm::mat4(1.0f); // 단위행렬로초기화
CenterBody = glm::translate(CenterBody, glm::vec3(g_posx, g_posy, g_posz));
cout << "g_posx : " << g_posx << "g_posy : " << g_posy << "g_posz : " << g_posz << endl;
CenterBody = glm::rotate(CenterBody,angle,glm::vec3(0.0, 1.0, 0.0));
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(CenterBody));
m_Robot[0].ChangeColor(0.4f,0.4f,0.0f);//몸통
m_Robot[0].Render();
//[얼굴]============================================================
glm::mat4 Head = glm::mat4(1.0f);
Head = glm::translate(CenterBody, glm::vec3(0.0, 0.45, 0.0));
Head = glm::scale(Head, glm::vec3(0.5, 0.5, 0.5));
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(Head));
m_Robot[1].ChangeColor(0.2f, 0.2f, 0.2f);//
m_Robot[1].Render();
//[코]==============================================================
Head = glm::translate(Head, glm::vec3(0.0, 0.0, 0.45));
Head = glm::scale(Head, glm::vec3(0.2, 0.2, 0.5));
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(Head));
m_Robot[2].ChangeColor(0.8f, 0.2f, 0.2f);//
m_Robot[2].Render();
//[오른팔]===========================================================
glm::mat4 RightArm = glm::mat4(1.0f);
RightArm = glm::translate(CenterBody, glm::vec3(0.36f, +0.1f, 0.0f));
RightArm = glm::rotate(RightArm, g_rArm, glm::vec3(1.0f, 0.0f, 0.0f));
RightArm = glm::scale(RightArm, glm::vec3(0.2, 0.7, 0.2));
RightArm = glm::translate(RightArm, glm::vec3(0.0f, -0.18f, 0.0f));
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(RightArm));
m_Robot[3].ChangeColor(1.0f,0.0f,0.5f);//
m_Robot[3].Render();
//[왼팔]============================================================
glm::mat4 LeftArm = glm::mat4(1.0f);
LeftArm = glm::translate(CenterBody, glm::vec3(-0.36f, +0.10f, 0.0f));
LeftArm = glm::rotate(LeftArm, g_lArm, glm::vec3(1.0f, 0.0f, 0.0f));
LeftArm = glm::scale(LeftArm, glm::vec3(0.2, 0.7, 0.2));
LeftArm = glm::translate(LeftArm, glm::vec3(0.0f, -0.18f, 0.0f));
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(LeftArm));
m_Robot[4].ChangeColor(0.1f, 0.6f, 0.8f);//
m_Robot[4].Render();
//[오른다리]========================================================
glm::mat4 RightLeg = glm::mat4(1.0f);
RightLeg = glm::translate(CenterBody, glm::vec3(0.15f, -0.38f, 0.0f));
RightLeg = glm::rotate(RightLeg, g_rLeg, glm::vec3(1.0f, 0.0f, 0.0f));
RightLeg = glm::scale(RightLeg, glm::vec3(0.3, 0.7, 0.3));
RightLeg = glm::translate(RightLeg, glm::vec3(0.0f, -0.15f, 0.0f));
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(RightLeg));
m_Robot[5].ChangeColor(1.0f, 1.0f, 0.0f);//
m_Robot[5].Render();
//[왼다리]==========================================================
glm::mat4 LeftLeg = glm::mat4(1.0f);
LeftLeg = glm::translate(CenterBody, glm::vec3(-0.15f, -0.38f, 0.0f));
LeftLeg = glm::rotate(LeftLeg, g_lLeg, glm::vec3(1.0f, 0.0f, 0.0f));
LeftLeg = glm::scale(LeftLeg, glm::vec3(0.3, 0.7, 0.3));
LeftLeg = glm::translate(LeftLeg, glm::vec3(0.0f, -0.15f, 0.0f));
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(LeftLeg));
m_Robot[6].ChangeColor(0.2f, 0.9f, 0.4f);//
m_Robot[6].Render();
glm::mat4 groung = glm::mat4(1.0f);
groung = glm::translate(groung, glm::vec3(0.0f, +1.5f, 0.0f));
groung = glm::scale(groung, glm::vec3(20.0, 8.0, 20.0));
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(groung));
m_Stage[0].SetColor(0.6);
m_Stage[0].InitBuffer();
m_Stage[0].Render();
glm::mat4 FrontStage = glm::mat4(1.0f);
FrontStage = glm::translate(FrontStage, glm::vec3(0.0f, +1.5f, 0.0f));
FrontStage = glm::scale(FrontStage, glm::vec3(20.0, 8.0, 20.0));
FrontStage = glm::rotate(FrontStage, Frontviewangle, glm::vec3(1.0, 0.0, 0.0));
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(FrontStage));
mFrontStage->InitBuffer();
mFrontStage->Render();
glutSwapBuffers();
}
bool frontUP = false;
void Keyboard(unsigned char key, int x, int y)
{
if (key == 'o')
{//Frontviewangle -= 0.05f;
frontUP = true;
}
//[ 이동키 ]==================
if (key == 'w' || key == 'W')
{
if (g_posz < -4.9)
g_posz += 0.0f;
else {
angle = 3.2f;
g_posz -= 0.1f;
startmove = true;
Tick = 0.4;
}
//if (g_posx > 5.3 || g_posx < -5.3)
// g_posx += 0.0f;
}
if (key == 's' || key == 'S')
{
angle = 0.0f;
g_posz += 0.1f;
startmove = true;
Tick = 0.4;
}
if (key == 'a' || key == 'A')
{
if (g_posx < -5.3)
g_posx += 0.0f;
else
{
angle = -1.6f;
g_posx -= 0.1f;
startmove = true;
Tick = 0.4;
}
}
if (key == 'd' || key == 'D')
{
if (g_posx > 5.3)
g_posx += 0.0f;
else {
angle = 1.6f;
g_posx += 0.1f;
startmove = true;
Tick = 0.4;
}
}//============================
if (key == ' ')
{
//angle = 1.6f;
g_posy += 0.4f;
startmove = false;
}
glutPostRedisplay();
}
bool RotateRateCheck = false;
void Timerfunction(int value)
{
if (Frontviewangle <= -1.5)
frontUP = false;
if (startmove)
{
if (RotateRateCheck == false)
{
g_rArm += Tick;
g_lArm -= Tick;
g_rLeg -= Tick;
g_lLeg += Tick;
if (g_rArm > 1.0f) { RotateRateCheck = true; }
}
else if (RotateRateCheck == true)
{
g_rArm -= Tick;
g_lArm += Tick;
g_rLeg += Tick;
g_lLeg -= Tick;
if (g_rArm < -1.0f) { RotateRateCheck = false; }
}
}
if(frontUP)
Frontviewangle -= 0.05f;
glutTimerFunc(100, Timerfunction, 1);
glutPostRedisplay();
}
void SpecialKeyboard(int key, int x, int y)
{
}
void KeyboardUP(unsigned char key, int x, int y)
{
startmove = false;
if (key == ' ')
{
for (int i = 0; i < 4; ++i)
{
g_posy -= 0.1f;
}
}
glutPostRedisplay();
}
void Reshape(int w, int h)
{
glViewport(0, 0, w, h);
glutPostRedisplay();
}
| [
"48274192+AhnaGeneral@users.noreply.github.com"
] | 48274192+AhnaGeneral@users.noreply.github.com |
55549a3cb0714f6802e244b2eafb916c13439e98 | 28d68af73c56375314efd07eaf6a1a9241a51ce3 | /aws-cpp-sdk-redshift/source/model/HsmStatus.cpp | c855bafa5f14b2f02f5e311a01189d51e7e61e3d | [
"JSON",
"MIT",
"Apache-2.0"
] | permissive | zeliard/aws-sdk-cpp | 93b560791fa359be25b201e9a6513bc3cb415046 | 14119f1f5bc159ce00a1332f86e117362afd3cb6 | refs/heads/master | 2021-01-16T22:49:18.731977 | 2016-01-04T01:54:38 | 2016-01-04T01:54:38 | 41,892,393 | 0 | 1 | null | 2015-09-04T01:35:43 | 2015-09-04T01:35:43 | null | UTF-8 | C++ | false | false | 3,564 | cpp | /*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#include <aws/redshift/model/HsmStatus.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <utility>
using namespace Aws::Redshift::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils;
HsmStatus::HsmStatus() :
m_hsmClientCertificateIdentifierHasBeenSet(false),
m_hsmConfigurationIdentifierHasBeenSet(false),
m_statusHasBeenSet(false)
{
}
HsmStatus::HsmStatus(const XmlNode& xmlNode) :
m_hsmClientCertificateIdentifierHasBeenSet(false),
m_hsmConfigurationIdentifierHasBeenSet(false),
m_statusHasBeenSet(false)
{
*this = xmlNode;
}
HsmStatus& HsmStatus::operator =(const XmlNode& xmlNode)
{
XmlNode resultNode = xmlNode;
if(!resultNode.IsNull())
{
XmlNode hsmClientCertificateIdentifierNode = resultNode.FirstChild("HsmClientCertificateIdentifier");
if(!hsmClientCertificateIdentifierNode.IsNull())
{
m_hsmClientCertificateIdentifier = StringUtils::Trim(hsmClientCertificateIdentifierNode.GetText().c_str());
m_hsmClientCertificateIdentifierHasBeenSet = true;
}
XmlNode hsmConfigurationIdentifierNode = resultNode.FirstChild("HsmConfigurationIdentifier");
if(!hsmConfigurationIdentifierNode.IsNull())
{
m_hsmConfigurationIdentifier = StringUtils::Trim(hsmConfigurationIdentifierNode.GetText().c_str());
m_hsmConfigurationIdentifierHasBeenSet = true;
}
XmlNode statusNode = resultNode.FirstChild("Status");
if(!statusNode.IsNull())
{
m_status = StringUtils::Trim(statusNode.GetText().c_str());
m_statusHasBeenSet = true;
}
}
return *this;
}
void HsmStatus::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
if(m_hsmClientCertificateIdentifierHasBeenSet)
{
oStream << location << index << locationValue << ".HsmClientCertificateIdentifier=" << StringUtils::URLEncode(m_hsmClientCertificateIdentifier.c_str()) << "&";
}
if(m_hsmConfigurationIdentifierHasBeenSet)
{
oStream << location << index << locationValue << ".HsmConfigurationIdentifier=" << StringUtils::URLEncode(m_hsmConfigurationIdentifier.c_str()) << "&";
}
if(m_statusHasBeenSet)
{
oStream << location << index << locationValue << ".Status=" << StringUtils::URLEncode(m_status.c_str()) << "&";
}
}
void HsmStatus::OutputToStream(Aws::OStream& oStream, const char* location) const
{
if(m_hsmClientCertificateIdentifierHasBeenSet)
{
oStream << location << ".HsmClientCertificateIdentifier=" << StringUtils::URLEncode(m_hsmClientCertificateIdentifier.c_str()) << "&";
}
if(m_hsmConfigurationIdentifierHasBeenSet)
{
oStream << location << ".HsmConfigurationIdentifier=" << StringUtils::URLEncode(m_hsmConfigurationIdentifier.c_str()) << "&";
}
if(m_statusHasBeenSet)
{
oStream << location << ".Status=" << StringUtils::URLEncode(m_status.c_str()) << "&";
}
}
| [
"henso@amazon.com"
] | henso@amazon.com |
752a84fbc8fa42a444174423458a21f96134f72b | 29a8bd0313113e6edba69cb90c91dfed613bc6a1 | /dalvikInsight/jni/vm/mterp/c/OP_IGET_VOLATILE.cpp | c3fdb2d22e933ce48f49b70ece17682ce62f5979 | [] | no_license | freemanZYQ/JNI | 0995cb199aff48b7b6cb349f2deca6d9e0134090 | 2f4a4e03e53448ee724bf39dac9d55c75fcf3954 | refs/heads/master | 2020-10-01T20:27:44.682632 | 2018-10-11T06:07:13 | 2018-10-11T06:07:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 97 | cpp | #include "opcommon.h"
HANDLE_IGET_X(OP_IGET_VOLATILE, "-volatile", IntVolatile, )
OP_END
| [
"xueyongfu@analysys.com.cn"
] | xueyongfu@analysys.com.cn |
7bc442debd5a7f261c6d270d61c31a512aa8382e | 9a3fc0a5abe3bf504a63a643e6501a2f3452ba6d | /ncpc/2009/beacons/beacons_jm.cpp | 157e99006ce3adea9c838678545575afed6f8dfa | [] | no_license | rodolfo15625/algorithms | 7034f856487c69553205198700211d7afb885d4c | 9e198ff0c117512373ca2d9d706015009dac1d65 | refs/heads/master | 2021-01-18T08:30:19.777193 | 2014-10-20T13:15:09 | 2014-10-20T13:15:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,715 | cpp | #include <cassert>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
//#define DEBUG
//#define VERBOSE_DEBUG
const int MAX_DEVICES = 2500;
const int MAX_OBSTACLES = 2500;
using namespace std;
const double PI = 3.141592653589793238462643;
typedef pair<double,double> TInterval;
bool overlaps(TInterval ival1, TInterval ival2)
{
return ival2.second - ival1.first > 0.0 && ival1.second - ival2.first > 0.0;
}
bool overlaps(set<TInterval> &intervals, TInterval interval)
{
set<TInterval>::iterator probe = lower_bound(intervals.begin(), intervals.end(), interval);
if (probe != intervals.end() && overlaps(interval, *probe))
return true;
if (probe == intervals.begin())
return false;
probe--;
return overlaps(interval, *probe);
}
bool circular_overlaps(set<TInterval> &intervals, TInterval interval)
{
if (interval.second > interval.first)
return overlaps(intervals, interval);
TInterval ival1(interval.first, 2*PI);
TInterval ival2(0, interval.second);
return overlaps(intervals, ival1) || overlaps(intervals, ival2);
}
void insert(set<TInterval> &intervals, TInterval interval)
{
if (intervals.size() == 0 || interval.second < intervals.begin()->first)
{
intervals.insert(interval);
return;
}
TInterval startPoint = make_pair(interval.first, interval.first);
TInterval endPoint = make_pair(interval.second, interval.second);
// Find iterator to the first overlapping interval
// (or the first interval after it if no overlapping interval exist)
set<TInterval>::iterator firstNode = lower_bound(intervals.begin(), intervals.end(), startPoint);
if (firstNode != intervals.begin()) firstNode--;
if (firstNode->second < interval.first) firstNode++;
// Find iterator to the last overlapping interval
// (or the first interval before it if no overlapping interval exist)
set<TInterval>::iterator lastNode = lower_bound(intervals.begin(), intervals.end(), endPoint);
if (lastNode == intervals.end() || (lastNode != intervals.begin() && lastNode->first != interval.second))
lastNode--;
// If no existing intervals overlap, firstNode will now be greater than lastNode
if (firstNode == intervals.end() || firstNode->first > lastNode->first)
{
intervals.insert(interval);
return;
}
double mergedFirst = min(firstNode->first, interval.first);
double mergedSecond = max(lastNode->second, interval.second);
intervals.erase(firstNode, ++lastNode);
intervals.insert(make_pair(mergedFirst, mergedSecond));
}
void circular_insert(set<TInterval> &intervals, TInterval interval)
{
if (interval.second > interval.first)
{
insert(intervals, interval);
}
else
{
insert(intervals, make_pair(interval.first, 2*PI));
insert(intervals, make_pair(0, interval.second));
}
}
void show(set<TInterval> &intervals)
{
for(set<TInterval>::iterator i = intervals.begin(); i != intervals.end(); i++)
{
cout << "[" << i->first << "," << i->second << "]" << " ";
}
cout << endl;
}
struct Object
{
double x, y, radius;
double angle, theta, distance;
int index;
TInterval interval;
Object() {}
Object(int xx, int yy, int rr) {
x = xx;
y = yy;
radius = rr;
}
Object operator-(const Object &offset) const
{
Object res(x - offset.x, y - offset.y, radius);
res.index = index;
return res;
}
bool operator<(const Object &other) const
{
return distance < other.distance;
}
void calc()
{
angle = atan2(y, x);
int distanceSquared = x*x + y*y;
distance = sqrt(distanceSquared);
if (radius > 0)
{
theta = asin(radius/distance);
assert(theta >= 0);
distance = sqrt(distanceSquared - radius*radius);
}
else
{
theta = 1e-9;
}
angle = fmod(angle + 2*PI, 2*PI);
double fromAngle = fmod(angle - theta + 2*PI, 2*PI);
double toAngle = fmod(angle + theta + 2*PI, 2*PI);
interval = make_pair(fromAngle, toAngle);
}
};
#ifdef DEBUG
bool hasEdge[MAX_DEVICES][MAX_DEVICES];
int noEdges = 0;
#endif
int main()
{
int noDevices, noObstacles;
cin >> noDevices >> noObstacles;
vector<Object> devices(noDevices), obstacles(noObstacles);
vector<int> component(noDevices);
for (int i = 0; i < noDevices; i++) {
cin >> devices[i].x >> devices[i].y;
devices[i].index = i;
component[i] = i;
}
for (int i = 0; i < noObstacles; i++) {
cin >> obstacles[i].x >> obstacles[i].y >> obstacles[i].radius;
obstacles[i].index = -1;
}
// Build graph by considering from each device which other devices are visible
for (int i = 0; i < noDevices; i++)
{
Object* cur = &devices[i];
// Sort remaining devices and obstacles according to distance
// from the current device in ascending order.
// Maintain a circular set of blocked angles which is updated after each obstacle.
// Note: distance for obstacles is not their centers but the distance to the sides of the circle
#ifdef VERBOSE_DEBUG
cout << "Checking outgoing edges from point at " << devices[i].x << "," << devices[i].y << endl;
#endif
vector<Object> objects;
for (int j = 0; j < noDevices; j++)
if (i != j)
objects.push_back(devices[j] - *cur);
for (int j = 0; j < noObstacles; j++)
objects.push_back(obstacles[j] - *cur);
for(int j = 0; j < objects.size(); j++)
objects[j].calc();
sort(objects.begin(), objects.end());
set<TInterval> blockedView;
for(vector<Object>::iterator o = objects.begin(); o != objects.end(); o++)
{
if (o->index >= 0)
{
// A point, check if visible
#ifdef VERBOSE_DEBUG
cout << "Check visibility to point at " << (o->x + cur->x) << "," << (o->y + cur->y) << " (angle " << o->angle << ")" << endl;
#endif
if (!circular_overlaps(blockedView, o->interval))
{
#ifdef DEBUG
cout << "Edge between " << i << " and " << o->index << endl;
hasEdge[i][o->index] = true;
noEdges++;
#endif
int oldComponent = component[o->index], newComponent = component[i];
if (newComponent != oldComponent)
{
for(int k=0; k<noDevices; k++)
if (component[k] == oldComponent)
component[k] = newComponent;
}
}
}
else
{
// An obstacle, add to blocking set
#ifdef VERBOSE_DEBUG
cout << "Adding blocking angle [" << o->interval.first << "," << o->interval.second << "]" << endl;
#endif
circular_insert(blockedView, o->interval);
}
}
}
#ifdef DEBUG
for(int i=0; i<noDevices; i++)
for(int j=i+1; j<noDevices; j++)
if (hasEdge[i][j] != hasEdge[j][i])
cerr << "Error - edge status between " << i << " and " << j << " differs." << endl;
cout << noEdges << " edges" << endl;
#endif
set<int> uniqueComponents(component.begin(), component.end());
cout << uniqueComponents.size() - 1 << endl;
return 0;
}
| [
"winftc@gmail.com"
] | winftc@gmail.com |
12f2b3253328745cfb3347649e8e147c1f1c4e32 | c7feda8bb2b63bb0b1e346d9019f261e5e5a88e2 | /codejam/kick_2019/roundE/B.cpp | adb24a15ff291c4b05487406f1908bd8f2b05fc1 | [] | no_license | EcutDavid/oj-practices | f6f05ee179b53fca436d6be33ef873033c72d895 | 831502fe83f7611d2031365663e8409919e2b0b0 | refs/heads/master | 2021-06-30T23:47:04.197213 | 2020-11-13T10:53:37 | 2020-11-13T10:53:37 | 152,569,918 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,876 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef double f64;
typedef long long i64;
typedef int i32;
typedef pair<i32, i32> pi32;
typedef unsigned long long u64;
typedef unsigned int u32;
typedef vector<i32> vi32;
typedef deque<i32> di32;
#define all(c) (c).begin(), (c).end()
#define REP(i, a, b) for (auto i = a; i < b; i++)
#define REPA(i, a, b, acc) for (auto i = a; i < b; i += acc)
#define PB push_back
#define PF push_front
#define PRINT(x) cout << #x ": " << (x) << endl;
#define TR(c, it) for (auto(it) = (c).begin(); (it) != (c).end(); (it)++)
#define MAX_PRECISION cout << setprecision(numeric_limits<double>::max_digits10);
typedef pair<double, double> Slot;
i32 main() {
ios::sync_with_stdio(false); // Makes IO faster, remove this line if C style scanf/printf needed.
i32 T;
cin >> T;
REP(t, 1, T + 1) {
cout << "Case #" << t << ": ";
i32 d, s;
cin >> d >> s;
vector<pair<double, Slot>> slots;
REP(i, 0, s) {
double c, e;
cin >> c >> e;
double factor = c / (c + e);
Slot ce = {c, e};
slots.push_back({ factor, ce });
}
sort(slots.rbegin(), slots.rend());
REP(i, 0, d) {
double codeGoal, eatGoal;
cin >> codeGoal >> eatGoal;
double fac = 0;
int index = 0;
while (codeGoal > 0 && index < s) {
double power = slots[index].second.first;
if (codeGoal >= power) {
codeGoal -= power;
index++;
} else {
fac = codeGoal / power;
codeGoal = 0;
}
}
if (fac != 0) {
eatGoal -= (1.0 - fac) * slots[index].second.second;
index++;
}
while(eatGoal > 0 && index < s) {
eatGoal -= slots[index].second.second;
index++;
}
if (codeGoal <= 0 && eatGoal <= 0) cout << "Y";
else cout << "N";
}
cout << "\n";
}
}
| [
"davidguandev@gmail.com"
] | davidguandev@gmail.com |
6ea27af09077a0a326ed5e224110efef42a19a9c | 73dd302d61abef70efecd0c41e00559f6fba20f2 | /ConProd2/src/conproddialog.h | 76b491b2856005301b60ec03ac0d67a7f19934e5 | [] | no_license | tudodetalhado/varios | 8c18473a0d6f923db4c7e2cfde77047ec45a041e | 19de3719e02537375944d449fae5ea3b6bd12920 | refs/heads/master | 2020-12-02T18:01:00.070678 | 2017-07-15T04:07:32 | 2017-07-15T04:07:32 | 96,461,245 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 603 | h | #ifndef CONPRODDIALOG_H
#define CONPRODDIALOG_H
#include <QDialog>
#include "consumer.h"
#include "producer.h"
#include <QSemaphore>
namespace Ui {
class ConProdDialog;
}
class ConProdDialog : public QDialog
{
Q_OBJECT
public:
explicit ConProdDialog(QWidget *parent = 0);
~ConProdDialog();
public slots:
void onBufferValueChanged(int);
void onProducerValueChanged(int);
void onConsumerValueChanged(int);
private slots:
void on_startButton_clicked();
private:
Ui::ConProdDialog *ui;
Producer *mProducer;
Consumer *mConsumer;
};
#endif // CONPRODDIALOG_H
| [
"geucimar@gmail.com"
] | geucimar@gmail.com |
fa6d1235230557c8d81db2c01a020415b0cc3f00 | 948f4e13af6b3014582909cc6d762606f2a43365 | /testcases/juliet_test_suite/testcases/CWE122_Heap_Based_Buffer_Overflow/s03/CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_loop_82_bad.cpp | c947bab12a5e8e87f3ae73069d26d9a4ec371f0d | [] | no_license | junxzm1990/ASAN-- | 0056a341b8537142e10373c8417f27d7825ad89b | ca96e46422407a55bed4aa551a6ad28ec1eeef4e | refs/heads/master | 2022-08-02T15:38:56.286555 | 2022-06-16T22:19:54 | 2022-06-16T22:19:54 | 408,238,453 | 74 | 13 | null | 2022-06-16T22:19:55 | 2021-09-19T21:14:59 | null | UTF-8 | C++ | false | false | 1,308 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_loop_82_bad.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805.label.xml
Template File: sources-sink-82_bad.tmpl.cpp
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: Allocate using new[] and set data pointer to a small buffer
* GoodSource: Allocate using new[] and set data pointer to a large buffer
* Sinks: loop
* BadSink : Copy int array to data using a loop
* Flow Variant: 82 Data flow: data passed in a parameter to a virtual method called via a pointer
*
* */
#ifndef OMITBAD
#include "std_testcase.h"
#include "CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_loop_82.h"
namespace CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_loop_82
{
void CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_int_loop_82_bad::action(int * data)
{
{
int source[100] = {0}; /* fill with 0's */
{
size_t i;
/* POTENTIAL FLAW: Possible buffer overflow if data < 100 */
for (i = 0; i < 100; i++)
{
data[i] = source[i];
}
printIntLine(data[0]);
delete [] data;
}
}
}
}
#endif /* OMITBAD */
| [
"yzhang0701@gmail.com"
] | yzhang0701@gmail.com |
1bd94bedfb5b038311ff0ea3de89ccc90d7c1be6 | 9f81d77e028503dcbb6d7d4c0c302391b8fdd50c | /google/cloud/bigtable/internal/connection_refresh_state.h | 4e4f9f3dcfdd5b629de61e8360fc494631a36a34 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | googleapis/google-cloud-cpp | b96a6ee50c972371daa8b8067ddd803de95f54ba | 178d6581b499242c52f9150817d91e6c95b773a5 | refs/heads/main | 2023-08-31T09:30:11.624568 | 2023-08-31T03:29:11 | 2023-08-31T03:29:11 | 111,860,063 | 450 | 351 | Apache-2.0 | 2023-09-14T21:52:02 | 2017-11-24T00:19:31 | C++ | UTF-8 | C++ | false | false | 3,481 | h | // Copyright 2022 Google LLC
//
// 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
//
// https://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 GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_CONNECTION_REFRESH_STATE_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_CONNECTION_REFRESH_STATE_H
#include "google/cloud/bigtable/version.h"
#include "google/cloud/completion_queue.h"
#include "google/cloud/future.h"
#include "google/cloud/internal/random.h"
#include <chrono>
#include <cstdint>
#include <memory>
#include <mutex>
#include <unordered_map>
namespace google {
namespace cloud {
namespace bigtable_internal {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
class OutstandingTimers
: public std::enable_shared_from_this<OutstandingTimers> {
public:
explicit OutstandingTimers(
std::shared_ptr<internal::CompletionQueueImpl> const& cq_impl)
: weak_cq_impl_(cq_impl) {}
// Register a timer. It will automatically deregister on completion.
void RegisterTimer(future<void> fut);
// Cancel all currently registered timers and all which will be registered in
// the future.
void CancelAll();
private:
void DeregisterTimer(std::uint64_t id);
std::mutex mu_;
bool shutdown_ = false; // GUARDED_BY(mu_)
std::uint64_t id_generator_ = 0; // GUARDED_BY(mu_)
std::unordered_map<std::uint64_t,
future<void>> timers_; // GUARDED_BY(mu_)
// Object of this class is owned by timers continuations, which means it
// cannot have an owning reference to the `CompletionQueue` because it would
// otherwise create a risk of a deadlock on the completion queue destruction.
std::weak_ptr<internal::CompletionQueueImpl>
weak_cq_impl_; // GUARDED_BY(mu_)
};
/**
* State required by timers scheduled by `CommonClient`.
*
* The scheduled timers might outlive `CommonClient`. They need some shared,
* persistent state. Objects of this class implement it.
*/
class ConnectionRefreshState {
public:
explicit ConnectionRefreshState(
std::shared_ptr<internal::CompletionQueueImpl> const& cq_impl,
std::chrono::milliseconds min_conn_refresh_period,
std::chrono::milliseconds max_conn_refresh_period);
std::chrono::milliseconds RandomizedRefreshDelay();
OutstandingTimers& timers() { return *timers_; }
bool enabled() const;
private:
std::mutex mu_;
std::chrono::milliseconds min_conn_refresh_period_;
std::chrono::milliseconds max_conn_refresh_period_;
google::cloud::internal::DefaultPRNG rng_;
std::shared_ptr<OutstandingTimers> timers_;
};
/**
* Schedule a chain of timers to refresh the connection.
*/
void ScheduleChannelRefresh(
std::shared_ptr<internal::CompletionQueueImpl> const& cq,
std::shared_ptr<ConnectionRefreshState> const& state,
std::shared_ptr<grpc::Channel> const& channel);
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace bigtable_internal
} // namespace cloud
} // namespace google
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGTABLE_INTERNAL_CONNECTION_REFRESH_STATE_H
| [
"noreply@github.com"
] | noreply@github.com |
795bb57417a94ae30244579da6d25f2aa692bc78 | 12a42054b156383ebbe3ccc5de4150633c66da5d | /problems/smallest-range/solution.cpp | aa7d23f318efb1605e5c3e31dbd9196768fc2555 | [] | no_license | cfoust/leetcode-problems | 93c33029f74f32c64caf8294292226d199d6e272 | f5ad7866906d0a2cf2250e5972ce910bf35ce526 | refs/heads/master | 2020-03-16T23:05:45.123781 | 2018-05-11T16:41:09 | 2018-05-11T16:41:09 | 133,064,772 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 106 | cpp | class Solution {
public:
vector<int> smallestRange(vector<vector<int>>& nums) {
}
}; | [
"cfoust@sqweebloid.com"
] | cfoust@sqweebloid.com |
52e5cfd4eec9de96784799ac30299008fc53182a | 4c23be1a0ca76f68e7146f7d098e26c2bbfb2650 | /ic8h18/0.001/EC6H13O2H | c4f9f58275c45f0400dd289520d53d5f8798539b | [] | no_license | labsandy/OpenFOAM_workspace | a74b473903ddbd34b31dc93917e3719bc051e379 | 6e0193ad9dabd613acf40d6b3ec4c0536c90aed4 | refs/heads/master | 2022-02-25T02:36:04.164324 | 2019-08-23T02:27:16 | 2019-08-23T02:27:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 841 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.001";
object EC6H13O2H;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 2.27797e-19;
boundaryField
{
boundary
{
type empty;
}
}
// ************************************************************************* //
| [
"jfeatherstone123@gmail.com"
] | jfeatherstone123@gmail.com | |
b9ffbfabe6d992b8314562d70228c340a698c24b | 0fe2847bf222a3df0847a08de244000207514d05 | /src/libseabreeze/src/vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeature.cpp | 63694c65dd22c08bd6f9681244a4f01de0f0b04f | [
"MIT"
] | permissive | asenchristov/python-seabreeze | 3656161eb2bf2be082839700f021a5957b81f00b | 573bae1d9de4e819611b2f5b9c66f98d7d0fe066 | refs/heads/master | 2022-12-01T09:39:46.079901 | 2020-08-18T09:07:30 | 2020-08-18T09:07:30 | 288,403,712 | 0 | 0 | MIT | 2020-08-18T08:49:58 | 2020-08-18T08:49:57 | null | UTF-8 | C++ | false | false | 3,303 | cpp | /***************************************************//**
* @file EEPROMSlotFeature.cpp
* @date February 2009
* @author Ocean Optics, Inc.
*
* LICENSE:
*
* SeaBreeze Copyright (C) 2014, Ocean Optics Inc
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*******************************************************/
#include "common/globals.h"
#include "vendors/OceanOptics/features/eeprom_slots/EEPROMSlotFeature.h"
#include "api/seabreezeapi/FeatureFamilies.h"
using namespace seabreeze;
using namespace seabreeze::api;
using namespace std;
EEPROMSlotFeature::EEPROMSlotFeature(unsigned int numSlots) {
this->numberOfSlots = numSlots;
}
EEPROMSlotFeature::~EEPROMSlotFeature() {
}
#ifdef _WINDOWS
#pragma warning (disable: 4101) // unreferenced local variable
#endif
vector< vector<byte> * > *EEPROMSlotFeature::readAllEEPROMSlots(
const Protocol &protocol, const Bus &bus) {
unsigned int i;
vector< vector<byte> * > *retval = new vector< vector<byte> * >();
for(i = 0; i < this->numberOfSlots; i++) {
try {
/* This may throw a FeatureException */
retval[i].push_back(readEEPROMSlot(protocol, bus, i));
} catch (IllegalArgumentException &iae) {
/* This shouldn't be possible since the loop is enumerating
* the known range of slots, but recover anyway
*/
continue;
}
}
return retval;
}
vector<byte> *EEPROMSlotFeature::readEEPROMSlot(const Protocol &protocol,
const Bus &bus, unsigned int slot) {
if(slot >= this->numberOfSlots) {
string error("EEPROM slot out of bounds.");
throw IllegalArgumentException(error);
}
/* This may throw a FeatureException. */
return EEPROMSlotFeatureBase::readEEPROMSlot(protocol, bus, slot);
}
int EEPROMSlotFeature::writeEEPROMSlot(const Protocol &protocol,
const Bus &bus, unsigned int slot, const vector<byte> &data) {
if(slot >= this->numberOfSlots) {
throw IllegalArgumentException(string("EEPROM slot out of bounds."));
}
return EEPROMSlotFeatureBase::writeEEPROMSlot(protocol, bus, slot, data);
}
FeatureFamily EEPROMSlotFeature::getFeatureFamily() {
FeatureFamilies families;
return families.EEPROM;
}
| [
"andreas@poehlmann.io"
] | andreas@poehlmann.io |
43b23af99aee11ecd2e674d44679d200f6c0beec | cd72b19d2030f36f78dab52390d092ed3dc8005f | /lib/src/test/blurTest.cpp | 15c6bb79536532b0c6c642638e86d90151fc75cb | [
"MIT",
"DOC"
] | permissive | stitchEm/stitchEm | 08c5a3ef95c16926c944c1835fdd4ab4b6855580 | 4a0e9fc167f10c7dde46394aff302927c15ce6cb | refs/heads/master | 2022-11-27T20:13:45.741733 | 2022-11-22T17:26:07 | 2022-11-22T17:26:07 | 182,059,770 | 250 | 68 | MIT | 2022-11-22T17:26:08 | 2019-04-18T09:36:54 | C++ | UTF-8 | C++ | false | false | 6,444 | cpp | // Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
#include "common/testing.hpp"
#include "common/util.hpp"
#include <gpu/buffer.hpp>
#include <gpu/memcpy.hpp>
#include <gpu/image/blur.hpp>
#include "libvideostitch/gpu_device.hpp"
#include <util/pnm.hpp>
#include <stdint.h>
#include <string.h>
#include <cassert>
#include <iostream>
#include <sstream>
namespace VideoStitch {
namespace Testing {
/**
* Golden brute-force implementation of 1D NoWrap box blur.
*/
std::vector<unsigned char> golden1DBoxBlurNoWrap(const std::vector<unsigned char>& data, int radius) {
ENSURE(!data.empty());
std::vector<unsigned char> extended;
// Extend edges.
for (int i = 0; i < radius; ++i) {
extended.push_back(data.front());
}
for (int i = 0; i < (int)data.size(); ++i) {
extended.push_back(data[i]);
}
for (int i = 0; i < radius; ++i) {
extended.push_back(data.back());
}
std::vector<unsigned char> result(data.size());
for (int i = 0; i < (int)data.size(); ++i) {
int v = 0;
for (int j = 0; j < 2 * radius + 1; ++j) {
v += extended[i + j];
}
ENSURE(v / (2 * radius + 1) < 255);
result[i] = (unsigned char)(v / (2 * radius + 1));
}
return result;
}
/**
* Golden brute-force implementation of 1D Wrap box blur.
*/
std::vector<unsigned char> golden1DBoxBlurWrap(const std::vector<unsigned char>& data, int radius) {
ENSURE(!data.empty());
std::vector<unsigned char> extended;
// Extend edges.
for (int i = 0; i < radius; ++i) {
extended.push_back(data[data.size() - (radius - i)]);
}
for (int i = 0; i < (int)data.size(); ++i) {
extended.push_back(data[i]);
}
for (int i = 0; i < radius; ++i) {
extended.push_back(data[i]);
}
std::vector<unsigned char> result(data.size());
for (int i = 0; i < (int)data.size(); ++i) {
int acc(0);
for (int j = 0; j < 2 * radius + 1; ++j) {
acc += extended[i + j];
}
result[i] = static_cast<unsigned char>(acc / (2 * radius + 1));
}
return result;
}
void testBoxBlurNoWrap(int size, int radius) {
std::vector<unsigned char> data;
for (int i = 0; i < size; ++i) {
data.push_back((unsigned char)(((i + 1) * 457) % 255));
}
const std::vector<unsigned char> golden = golden1DBoxBlurNoWrap(data, radius);
DeviceBuffer<unsigned char> devSrc(1, data.size());
devSrc.fill(data);
DeviceBuffer<unsigned char> devDst(1, data.size());
devDst.fill(0);
Image::boxBlur1DNoWrap(devDst.gpuBuf(), devSrc.gpuBufConst(), 1, data.size(), radius, 16, GPU::Stream::getDefault());
std::vector<unsigned char> actual;
devDst.readback(actual);
ENSURE_ARRAY_EQ(golden.data(), actual.data(), (unsigned)data.size());
}
void testBoxBlurWrap(unsigned size, unsigned radius) {
if ((std::size_t)(2 * radius) >= size) {
// the blur takes the whole buffer for all pixels since the stencil is larger than the patchlet,
// so just resize the stencil
radius = (unsigned)(size / 2 - 1);
}
std::vector<unsigned char> data;
for (unsigned i = 0; i < size; ++i) {
data.push_back((unsigned char)(((i + 1) * 457) % 255));
}
const std::vector<unsigned char> golden = golden1DBoxBlurWrap(data, radius);
DeviceBuffer<unsigned char> devSrc(1, data.size());
devSrc.fill(data);
DeviceBuffer<unsigned char> devDst(1, data.size());
devDst.fill(0);
Image::boxBlur1DWrap(devDst.gpuBuf(), devSrc.gpuBufConst(), 1, data.size(), radius, 16, GPU::Stream::getDefault());
std::vector<unsigned char> actual;
devDst.readback(actual);
ENSURE_ARRAY_EQ(golden.data(), actual.data(), (unsigned)data.size());
}
PotentialValue<GPU::Buffer<unsigned char>> loadFile(const char* filename, int64_t& width, int64_t& height) {
std::vector<unsigned char> tmp;
if (!VideoStitch::Util::PnmReader::read(filename, width, height, tmp, &std::cerr)) {
std::stringstream msg;
msg << "Image '" << filename << "': failed to setup reader.";
return Status{Origin::Input, ErrType::SetupFailure, msg.str()};
}
std::vector<unsigned char> buffer;
buffer.reserve((size_t)(width * height));
for (size_t i = 0; i < (size_t)(width * height); ++i) {
buffer[i] = tmp[(size_t)(3 * i)];
}
auto devBuffer = GPU::Buffer<unsigned char>::allocate((size_t)(width * height), "BlurTest");
ENSURE(devBuffer.ok());
ENSURE(GPU::memcpyBlocking(devBuffer.value(), &buffer.front()).ok());
return devBuffer;
}
} // namespace Testing
} // namespace VideoStitch
int main(int argc, char** argv) {
VideoStitch::Testing::initTest();
VideoStitch::Testing::ENSURE(VideoStitch::GPU::setDefaultBackendDevice(0));
// No Wrap
VideoStitch::Testing::testBoxBlurNoWrap(1531, 5);
VideoStitch::Testing::testBoxBlurNoWrap(1043, 10); // test blur1DKernelNoWrap
VideoStitch::Testing::testBoxBlurNoWrap(4, 2);
VideoStitch::Testing::testBoxBlurNoWrap(4, 5);
// Wrap
VideoStitch::Testing::testBoxBlurWrap(1531, 5);
VideoStitch::Testing::testBoxBlurWrap(1043, 10); // test blur1DKernelWrap
VideoStitch::Testing::testBoxBlurWrap(4, 2);
VideoStitch::Testing::testBoxBlurWrap(4, 5);
VideoStitch::Testing::testBoxBlurWrap(15, 7); // blur1DKernelWrap
if (argc < 4) {
// std::cerr << "usage: " << argv[0] << " src.pgm radius passes" << std::endl;;
return 0;
}
int64_t width, height;
auto devBuffer = VideoStitch::Testing::loadFile(argv[1], width, height);
unsigned radius = atoi(argv[2]);
unsigned passes = atoi(argv[3]);
std::cerr << "radius: " << radius << " passes: " << passes << std::endl;
if (devBuffer.ok()) {
auto devWork = VideoStitch::GPU::Buffer<unsigned char>::allocate((size_t)(width * height), "BlurTest");
VideoStitch::Testing::ENSURE(devWork.status());
VideoStitch::Image::gaussianBlur2D(devBuffer.value(), devWork.value(), width, height, radius, passes, false, 256,
VideoStitch::GPU::Stream::getDefault());
unsigned char* out = new unsigned char[(size_t)(width * height)];
VideoStitch::GPU::Stream::getDefault().synchronize();
VideoStitch::Testing::ENSURE(VideoStitch::GPU::memcpyBlocking(out, devBuffer.value()));
std::ofstream* ofs = VideoStitch::Util::PpmWriter::openPpm("blured.pgm", width, height, &std::cerr);
ofs->write((const char*)out, width * height);
delete ofs;
delete[] out;
VideoStitch::Testing::ENSURE(devWork.value().release());
VideoStitch::Testing::ENSURE(devBuffer.value().release());
}
return 0;
}
| [
"stitchemvr@gmail.com"
] | stitchemvr@gmail.com |
e0ef229ab0574d9c2b7f55aae0c2802b8f5e20bb | a039823f1bff83c53927499b5be12d8be81d7d64 | /nan-lib/nan-marshal.h | c89e28676a8b983dd861d12b0d848e1bcea4ec15 | [
"MIT"
] | permissive | ludiazv/node-nrf24 | 8b2ae0725530b052a09c51ad8edbcd67b7c3f8df | 5d257834d489709438c0002ada3acc58a164a4b4 | refs/heads/master | 2023-04-27T12:05:03.778563 | 2023-04-24T12:55:50 | 2023-04-24T12:55:50 | 119,454,286 | 38 | 23 | MIT | 2019-07-09T07:57:37 | 2018-01-29T23:15:47 | C++ | UTF-8 | C++ | false | false | 16,834 | h | /*********************************************************************
* NAN Marshal - Data type marshalling for NAN module
*
* Copyright (c) 2015 NAN-Marshal contributors:
* - Ievgen Khvedchenia <https://github.com/BloodAxe>
*
* MIT License <https://github.com/BloodAxe/nan-Marshal/blob/master/LICENSE.md>
*
* Version 0.0.1: current Node 4.0.0, Node 12: 0.12.7, Node 10: 0.10.40, iojs: 3.2.0
*
* See https://github.com/BloodAxe/nan-marshal for the latest update to this file
**********************************************************************************/
#pragma once
#include <nan.h>
#include <node_buffer.h>
#include <complex>
#include <functional>
#include <iostream>
#include <sstream>
#include <array>
#include <memory>
#include <map>
#include <stdexcept>
#if _MSC_VER
#define NANMARSHAL_NOTHROW _THROW0()
#else
#define NANMARSHAL_NOTHROW noexcept
#endif
namespace Nan
{
typedef v8::Local<v8::Value> V8Result;
template <typename T>
T Marshal(V8Result val);
template <typename T>
V8Result Marshal(const T& val);
class MarshalException : public std::runtime_error
{
public:
const char * what() const NANMARSHAL_NOTHROW override
{
return m_message.c_str();
}
inline MarshalException(const char * message)
: std::runtime_error("MarshalTypeMismatchException")
, m_message(message)
{
}
private:
std::string m_message;
};
namespace marshal
{
struct access
{
template<typename Archive, typename T>
static inline void serialize(Archive& ar, T& type)
{
type.serialize(ar);
}
};
template <typename T>
struct nvp_struct
{
const char * name;
T& value;
explicit inline nvp_struct(const char * name_, T & value_)
: name(name_)
, value(value_)
{}
inline nvp_struct(const nvp_struct & rhs)
: name(rhs.name)
, value(rhs.value)
{}
};
template <typename T>
inline nvp_struct<T> make_nvp(const char * name, T& val)
{
return nvp_struct<T>(name, val);
}
template <typename T>
inline nvp_struct<T> make_nvp(const char * name, const T& val)
{
return nvp_struct<T>(name, const_cast<T&>(val));
}
template <typename T>
inline nvp_struct<T> make_nvp(const char * name, T* val) = delete;
template <typename T>
inline nvp_struct<T> make_nvp(const char * name, const T* val) = delete;
template<typename Archive, typename T>
inline void serialize(Archive& ar, T& type)
{
access::serialize(ar, type);
}
template<typename T>
struct Serializer
{
template<typename InputArchive>
static inline void load(InputArchive& ar, T& val)
{
marshal::serialize(ar, val);
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, const T& val)
{
marshal::serialize(ar, const_cast<T&>(val));
}
};
#define BASIC_TYPE_SERIALIZER(type)\
template<> \
struct Serializer<type> \
{\
template<typename InputArchive>\
static inline void load(InputArchive& ar, type& val)\
{\
ar.load(val); \
}\
template<typename OutputArchive>\
static inline void save(OutputArchive& ar, const type& val)\
{\
ar.save(val); \
}\
}
#define ENUM_SERIALIZER(type)\
template<>\
struct Serializer<type>\
{\
template<typename InputArchive>\
static inline void load(InputArchive& ar, type& val)\
{\
int int_val; \
ar & int_val; \
val = (type)int_val; \
}\
template<typename OutputArchive>\
static inline void save(OutputArchive& ar, const type& val)\
{\
int int_val = (int)val; \
ar & int_val; \
}\
}
// declare serializers for simple types
BASIC_TYPE_SERIALIZER(char);
BASIC_TYPE_SERIALIZER(unsigned char);
BASIC_TYPE_SERIALIZER(short);
BASIC_TYPE_SERIALIZER(unsigned short);
BASIC_TYPE_SERIALIZER(int);
BASIC_TYPE_SERIALIZER(unsigned int);
BASIC_TYPE_SERIALIZER(long);
BASIC_TYPE_SERIALIZER(unsigned long);
BASIC_TYPE_SERIALIZER(unsigned long long);
BASIC_TYPE_SERIALIZER(float);
BASIC_TYPE_SERIALIZER(double);
BASIC_TYPE_SERIALIZER(bool);
template<typename T>
struct Serializer< std::shared_ptr<T> >
{
template<typename InputArchive>
static inline void load(InputArchive& ar, std::shared_ptr<T>& val)
{
val.reset(new T);
T& _val = *val.get();
ar & _val;
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, const std::shared_ptr<T>& val)
{
const T& _val = *val.get();
ar & _val;
}
};
// serializer for std::vector
template<typename T>
struct Serializer < std::vector<T> >
{
template<typename InputArchive>
static inline void load(InputArchive& ar, std::vector<T>& val)
{
int N = ar.template As<v8::Array>()->Length();
val.resize(N);
for (int i = 0; i < N; i++)
{
V8Result item = ar.template As<v8::Array>()->Get(i);
val[i] = Marshal<T>(item);
}
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, const std::vector<T>& val)
{
auto result = Nan::New<v8::Array>((int)val.size());
for (uint32_t i = 0; i < val.size(); i++)
{
const T& item = val[i];
result->Set(i, Marshal(item));
}
ar = result;
}
};
// serializer for std::pair
template<typename K, typename V>
struct Serializer < std::pair<K, V> >
{
template<typename InputArchive>
static inline void load(InputArchive& ar, std::pair<K, V>& val)
{
ar & make_nvp("key", val.first);
ar & make_nvp("value", val.second);
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, const std::pair<K, V>& val)
{
ar & make_nvp("key", val.first);
ar & make_nvp("value", val.second);
}
};
template<>
struct Serializer < std::string >
{
template<typename InputArchive>
static inline void load(InputArchive& ar, std::string& val)
{
size_t len = Nan::DecodeBytes(ar, Nan::ASCII);
val.resize(len);
Nan::DecodeWrite(const_cast<char*>(val.data()), len, ar, Nan::ASCII);
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, const std::string& val)
{
ar = Nan::New<v8::String>(val).ToLocalChecked();
}
};
// serializer for std::map
template<typename K, typename V>
struct Serializer < std::map<K, V> >
{
template<typename InputArchive>
static inline void load(InputArchive& ar, std::map<K, V>& map_val)
{
int N = ar.template As<v8::Array>()->Length();
for (int i = 0; i < N; i++)
{
V8Result item = ar.template As<v8::Array>()->Get(i);
map_val.insert(Marshal< std::pair<K, V> >(item));
}
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, const std::map<K, V>& map_val)
{
v8::Local<v8::Array> result = Nan::New<v8::Array>();
uint32_t idx = 0;
for (typename std::map<K, V>::const_iterator i = map_val.begin(); i != map_val.end(); ++i, ++idx)
{
result->Set(idx, Marshal(*i));
}
ar = result;
}
};
// serializer for std::complex
template<typename T>
struct Serializer < std::complex<T> >
{
template<typename InputArchive>
static inline void load(InputArchive& ar, std::complex<T>& val)
{
T real, imag;
ar & make_nvp("real", real);
ar & make_nvp("imag", imag);
val = std::complex<T>(real, imag);
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, const std::complex<T>& val)
{
T real = val.real();
T imag = val.imag();
ar & make_nvp("real", real);
ar & make_nvp("imag", imag);
}
};
template<typename T>
struct Serializer < nvp_struct<T> >
{
template<typename InputArchive>
static inline void load(InputArchive& ar, nvp_struct<T>& val)
{
ar.load(val);
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, const nvp_struct<T>& val)
{
ar.save(val);
}
};
template<typename T, int N>
struct Serializer < T[N] >
{
template<typename InputArchive>
static inline void load(InputArchive& ar, T(&val)[N])
{
for (int i = 0; i < N; i++)
{
V8Result item = ar.template As<v8::Array>()->Get(i);
val[i] = Marshal<T>(item);
}
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, T const (&val)[N])
{
v8::Local<v8::Array> result = Nan::New<v8::Array>(N);
for (uint32_t i = 0; i < N; i++)
{
const T& item = val[i];
result->Set(i, Marshal(item));
}
ar = result;
}
};
template<typename T, std::size_t N>
struct Serializer < std::array<T, N> >
{
template<typename InputArchive>
static inline void load(InputArchive& ar, std::array<T, N>& val)
{
for (int i = 0; i < N; i++)
{
V8Result item = ar.template As<v8::Array>()->Get(i);
val[i] = Marshal<T>(item);
}
}
template<typename OutputArchive>
static inline void save(OutputArchive& ar, const std::array<T, N>& val)
{
v8::Local<v8::Array> result = Nan::New<v8::Array>(static_cast<int>(N));
for (uint32_t i = 0; i < N; i++)
{
const T& item = val[i];
result->Set(i, Marshal(item));
}
ar = result;
}
};
template <bool C_>
struct bool_ {
static const bool value = C_;
typedef bool value_type;
};
class SaveArchive
{
public:
typedef v8::Local<v8::Value> V8Result;
inline SaveArchive()
{
}
inline SaveArchive(V8Result& dst) : _dst(dst)
{
}
inline ~SaveArchive()
{
}
typedef bool_<false> is_loading;
typedef bool_<true> is_saving;
template<typename T>
inline SaveArchive& operator& (const T& val)
{
Serializer<T>::save(*this, val);
return *this;
}
template<typename T>
inline void save(const T& val)
{
_dst = Nan::New(val);
}
template<typename T>
inline void save(const nvp_struct<T>& val)
{
if (_dst.IsEmpty() || !_dst->IsObject())
{
_dst = Nan::New<v8::Object>();
}
Nan::Set(_dst, Nan::New<v8::String>(val.name).ToLocalChecked(), Marshal(val.value));
}
template<typename T>
void save(T* const& val) = delete;
inline SaveArchive& operator=(V8Result newVal)
{
_dst = newVal;
return *this;
}
inline operator V8Result()
{
return _dst;
}
V8Result _dst;
private:
};
class LoadArchive
{
public:
inline LoadArchive(V8Result src)
: _src(src)
{
}
inline ~LoadArchive()
{
}
typedef bool_<true> is_loading;
typedef bool_<false> is_saving;
inline V8Result target() const
{
return _src;
}
template<typename T>
inline LoadArchive& operator& (const T& val)
{
Serializer<T>::load(*this, const_cast<T&>(val));
return *this;
}
template<typename T>
void load(T& val);
template<typename T>
void load(T*& val) = delete;
template<typename T>
inline void load(nvp_struct<T>& val)
{
if (!_src->IsObject())
{
throw MarshalException("Underlying instance is not an object");
}
auto prop = Nan::Get(_src, Nan::New<v8::String>(val.name).ToLocalChecked());
if (prop.IsEmpty())
{
throw MarshalException("Object does not contains property");
}
val.value = Marshal<T>(prop);
}
template <typename T>
inline v8::Local<T> As()
{
return _src.template As<T>();
}
inline operator V8Result()
{
return _src;
}
private:
V8Result _src;
};
template<>
inline void LoadArchive::load(bool& val)
{
if (!_src->IsBoolean())
throw MarshalException("Argument is not a boolean");
//val = _src->BooleanValue(v8::Isolate::GetCurrent());
val = Nan::To<bool>(_src).FromJust();
}
template<>
inline void LoadArchive::load(int& val)
{
if (!_src->IsInt32())
throw MarshalException("Argument is not a number");
//val = _src->Int32Value(Nan::GetCurrentContext()).FromJust();
val = Nan::To<int32_t>(_src).FromJust();
}
template<>
inline void LoadArchive::load(float& val)
{
if (!_src->IsNumber())
throw MarshalException("Argument is not a number");
val = (float)_src->NumberValue(Nan::GetCurrentContext()).FromJust();
}
template<>
inline void LoadArchive::load(double& val)
{
if (!_src->IsNumber())
throw MarshalException("Argument is not a number");
val = (double)_src->NumberValue(Nan::GetCurrentContext()).FromJust();
}
template<>
inline void LoadArchive::load(uint32_t& val)
{
val = (uint32_t)_src->Uint32Value(Nan::GetCurrentContext()).FromJust();
}
}
// Marshal functions implementation
template <typename T>
inline T Marshal(V8Result val)
{
marshal::LoadArchive ia(val);
T loaded = T();
ia & loaded;
return std::move(loaded);
}
template <typename T>
inline V8Result Marshal(const T& val)
{
Nan::EscapableHandleScope scope;
marshal::SaveArchive oa;
oa & val;
return scope.Escape(oa._dst);
}
} | [
"ldiaz@navarone.local"
] | ldiaz@navarone.local |
7c6d0e19153077bc7af12d2a24ce10480c955868 | 2c3363b84bd11e691aa3cfccfd881ec3807f1a42 | /prelimiary/3/PrtSys-36/DLG_Bmp.cpp | d1cb950a96da9bb8ece22038fad6105fcb259605 | [
"Apache-2.0"
] | permissive | hixiaotian/computer-graphics-project | 0d309633cb76845edb94320e18fe0b4c607571d4 | 390b554a826481234b3b34d22b49e52decd9801c | refs/heads/master | 2022-11-15T16:52:42.852213 | 2020-07-15T03:20:37 | 2020-07-15T03:20:37 | 259,894,304 | 0 | 1 | null | null | null | null | GB18030 | C++ | false | false | 14,693 | cpp | // DLG_Bmp.cpp : implementation file
//
#include "stdafx.h"
#include "PrtSys.h"
#include "DLG_Bmp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDLG_Bmp dialog
//设置滑动条范围的控制数组
GLfloat BMP_Sld[8][2] = //BMP的属性滑条控制范围。
{
{0, 9999} , //粒子的数量 unsigned long 0
{0.0001 , 10.0 } , //lifefate 1.0 1
{0.0001 , 10.0 } , //slowdown 2.0 2
{-20.0 , 20.0 } , //GetXg 0 3
{-20.0 , 20.0 } , //GetYg 0.1 4
{-20.0 , 20.0 }, //GetZg 0 5
{0.0001, 5.0 }, //贴图宽度 6
{0.0, 20.0 }, //图象厚度 7
};
CDLG_Bmp::CDLG_Bmp(CWnd* pParent /*=NULL*/)
: CDialog(CDLG_Bmp::IDD, pParent)
{
//{{AFX_DATA_INIT(CDLG_Bmp)
m_E_file = _T("");
m_E_getx = 0.0f;
m_E_gety = 0.0f;
m_E_getz = 0.0f;
m_E_lifefate = 0.0f;
m_E_maxnum = 0;
m_E_posx = 0.0f;
m_E_posy = 0.0f;
m_E_posz = 0.0f;
m_E_slowdown = 0.0f;
m_E_TW = 0.0f;
m_E_thick = 0.0f;
//}}AFX_DATA_INIT
}
void CDLG_Bmp::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDLG_Bmp)
DDX_Control(pDX, IDC_SB_Thick, m_S_thick);
DDX_Control(pDX, IDC_SB_TextWitdh, m_S_TW);
DDX_Control(pDX, IDC_SB_SLOWDOWN, m_S_slowdown);
DDX_Control(pDX, IDC_SB_MAXNUM, m_S_maxnum);
DDX_Control(pDX, IDC_SB_LIFEFATE, m_S_lifefate);
DDX_Control(pDX, IDC_SB_GETZ, m_S_getz);
DDX_Control(pDX, IDC_SB_GETY, m_S_gety);
DDX_Control(pDX, IDC_SB_GETX, m_S_getx);
DDX_Text(pDX, IDC_EB_FILE, m_E_file);
DDX_Text(pDX, IDC_EB_GETX, m_E_getx);
DDX_Text(pDX, IDC_EB_GETY, m_E_gety);
DDX_Text(pDX, IDC_EB_GETZ, m_E_getz);
DDX_Text(pDX, IDC_EB_LIFEFATE, m_E_lifefate);
DDX_Text(pDX, IDC_EB_MAXNUM, m_E_maxnum);
DDX_Text(pDX, IDC_EB_POS_X, m_E_posx);
DDX_Text(pDX, IDC_EB_POS_Y, m_E_posy);
DDX_Text(pDX, IDC_EB_POS_Z, m_E_posz);
DDX_Text(pDX, IDC_EB_SLOWDOWN, m_E_slowdown);
DDX_Text(pDX, IDC_EB_TextWidth, m_E_TW);
DDX_Text(pDX, IDC_EB_Thick, m_E_thick);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDLG_Bmp, CDialog)
//{{AFX_MSG_MAP(CDLG_Bmp)
ON_BN_CLICKED(IDC_BB_FILE, OnBbFile)
ON_BN_CLICKED(IDC_BB_LOAD, OnBbLoad)
ON_BN_CLICKED(IDC_BB_SAVE, OnBbSave)
ON_EN_KILLFOCUS(IDC_EB_GETX, OnKillfocusEbGetx)
ON_EN_KILLFOCUS(IDC_EB_GETY, OnKillfocusEbGety)
ON_EN_KILLFOCUS(IDC_EB_GETZ, OnKillfocusEbGetz)
ON_EN_KILLFOCUS(IDC_EB_LIFEFATE, OnKillfocusEbLifefate)
ON_EN_KILLFOCUS(IDC_EB_MAXNUM, OnKillfocusEbMaxnum)
ON_EN_KILLFOCUS(IDC_EB_POS_X, OnKillfocusEbPosX)
ON_EN_KILLFOCUS(IDC_EB_POS_Y, OnKillfocusEbPosY)
ON_EN_KILLFOCUS(IDC_EB_POS_Z, OnKillfocusEbPosZ)
ON_EN_KILLFOCUS(IDC_EB_SLOWDOWN, OnKillfocusEbSlowdown)
ON_EN_KILLFOCUS(IDC_EB_TextWidth, OnKillfocusEBTextWidth)
ON_EN_KILLFOCUS(IDC_EB_Thick, OnKillfocusEBThick)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SB_GETX, OnReleasedcaptureSbGetx)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SB_GETY, OnReleasedcaptureSbGety)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SB_GETZ, OnReleasedcaptureSbGetz)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SB_LIFEFATE, OnReleasedcaptureSbLifefate)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SB_MAXNUM, OnReleasedcaptureSbMaxnum)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SB_SLOWDOWN, OnReleasedcaptureSbSlowdown)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SB_TextWitdh, OnReleasedcaptureSBTextWitdh)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SB_Thick, OnReleasedcaptureSBThick)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDLG_Bmp message handlers
void CDLG_Bmp::UpdateDLGDate(void)//更新界面数据
{
m_E_maxnum=m_DLGData->MAX_PARTICLES; //粒子的最大数(不可超过10000)
m_E_posx=m_DLGData->star_x; //粒子源的位置
m_E_posy=m_DLGData->star_y;
m_E_posz=m_DLGData->star_z;
m_E_lifefate=m_DLGData->lifefate; // 削减粒子的生命,数值约大,粒子的生命就越短
m_E_slowdown=m_DLGData->slowdown; // 减慢粒子的速度,数值约大越慢,越小越快
m_E_getx=m_DLGData->GetXg; //粒子系统受到的空间重力场(矢量)
m_E_gety=m_DLGData->GetYg;
m_E_getz=m_DLGData->GetZg;
m_E_TW=m_DLGData->TextWidth; //贴图宽度
m_E_thick=m_DLGData->pram[1]; //厚度
LPTSTR p = m_E_file.GetBuffer(260); //开辟缓冲区
strcpy(p,*FileName); //将文件名装入String对象中
m_E_file.ReleaseBuffer(); //释放缓冲
//***************************************************************
UpdateData(FALSE); //将程序里的值及时更新到控件
//对滑动条进行初始化
float pos[8] ;
pos[0]= (m_E_maxnum - BMP_Sld[0][0]) * 100.0 / (BMP_Sld[0][1] - BMP_Sld[0][0]);
pos[1]= (m_E_lifefate - BMP_Sld[1][0]) * 100.0 / (BMP_Sld[1][1] - BMP_Sld[1][0]);
pos[2]= (m_E_slowdown - BMP_Sld[2][0]) * 100.0 / (BMP_Sld[2][1] - BMP_Sld[2][0]);
pos[3]= (m_E_getx - BMP_Sld[3][0]) * 100.0 / (BMP_Sld[3][1] - BMP_Sld[3][0]);
pos[4]= (m_E_gety - BMP_Sld[4][0]) * 100.0 / (BMP_Sld[4][1] - BMP_Sld[4][0]);
pos[5]= (m_E_getz - BMP_Sld[5][0]) * 100.0 / (BMP_Sld[5][1] - BMP_Sld[5][0]);
pos[6]= (m_E_TW - BMP_Sld[6][0]) * 100.0 / (BMP_Sld[6][1] - BMP_Sld[6][0]);
pos[7]= (m_E_thick - BMP_Sld[7][0]) * 100.0 / (BMP_Sld[7][1] - BMP_Sld[7][0]);
m_S_maxnum.SetPos(pos[0]);
m_S_lifefate.SetPos(pos[1]);
m_S_slowdown.SetPos(pos[2]);
m_S_getx.SetPos(pos[3]);
m_S_gety.SetPos(pos[4]);
m_S_getz.SetPos(pos[5]);
m_S_TW.SetPos(pos[6]);
m_S_thick.SetPos(pos[7]);
}
void CDLG_Bmp::OnBbFile()
{
// TODO: Add your control notification handler code here
char szCurDir[256];//保存当前目录
GetCurrentDirectory(sizeof(szCurDir),szCurDir);
CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY,"真彩24b位图文件(*.bmp)|*.bmp||",NULL);
if(dlg.DoModal()==IDOK) //显示文件对话框
{
m_E_file = dlg.GetPathName(); //取得文件名
strcpy(*FileName,m_E_file); //将文件名更新到外界的对象
m_DLGData->dead=true; //设置文件更新标致
UpdateDLGDate(); //更新界面数据
}
SetCurrentDirectory(szCurDir); //恢复当前路径!
}
void CDLG_Bmp::OnBbLoad()
{
// TODO: Add your control notification handler code here
char szCurDir[256];//保存当前目录
GetCurrentDirectory(sizeof(szCurDir),szCurDir);
CString filename;
CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY,"效果文件(*.pse)|*.pse||",NULL);
if(dlg.DoModal()==IDOK)//显示文件对话框
{
filename = dlg.GetPathName();//取得文件名
FILE *fp;
fp=fopen(filename,"rb+");//打开保存的文件
if(!fp)MessageBox("打开文件失败!");
else
{
fseek(fp,0L,0);//移到文件开头
char s[10];
fgets(s,5,fp);//读入开头文件表示
if(strcmp(s,"PSES")!=0)MessageBox("不是粒子效果文件!");
else
{
fseek(fp,4L,0);//读取效果
int ch;
ch=fgetc(fp);
if(ch!=7)MessageBox("不是位图效果文件!");
else
{
fseek(fp,5L,0);
fread(m_DLGData,sizeof(*m_DLGData),1,fp);//读入我们的效果数据
fseek(fp,5L+sizeof(*m_DLGData),0);
fread(FileName,260,1,fp);//读入位图文件名
m_DLGData->dead=true; //设置文件更新标致
}
}
fclose(fp);//关闭文件指针
}
UpdateDLGDate();//更新界面数据
}
SetCurrentDirectory(szCurDir);//恢复当前路径!
}
void CDLG_Bmp::OnBbSave()
{
// TODO: Add your control notification handler code here
char szCurDir[256];//保存当前目录
GetCurrentDirectory(sizeof(szCurDir),szCurDir);
CString filename;
CFileDialog dlg(FALSE,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,"效果文件(*.pse)|*.pse||",NULL);
if(dlg.DoModal()==IDOK)//显示文件对话框
{
filename = dlg.GetPathName();//取得文件名
FILE *fp;
fp=fopen(filename,"wb+");//建立保存的文件
if(!fp)MessageBox("写文件失败!");
else{
fseek(fp,0L,0);//移到文件开头
fputs("PSES",fp);//写入开头文件表示
int ch=7;
fputc(ch,fp); //写入粒子效果的表示,7就是位图!
fwrite(m_DLGData,sizeof(*m_DLGData),1,fp);//写入我们的效果数据
fwrite(FileName,260,1,fp);//写入位图文件名
fclose(fp);//关闭文件指针
}
}
SetCurrentDirectory(szCurDir);//恢复当前路径!
}
void CDLG_Bmp::OnKillfocusEbGetx()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->GetXg=m_E_getx; //将程序的值更新到真正所控制的对象
float pos = (m_E_getx - BMP_Sld[3][0]) * 100.0 /
(BMP_Sld[3][1] - BMP_Sld[3][0]);
m_S_getx.SetPos(pos);
}
void CDLG_Bmp::OnKillfocusEbGety()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->GetYg=m_E_gety; //将程序的值更新到真正所控制的对象
float pos = (m_E_gety - BMP_Sld[4][0]) * 100.0 /
(BMP_Sld[4][1] - BMP_Sld[4][0]);
m_S_gety.SetPos(pos);
}
void CDLG_Bmp::OnKillfocusEbGetz()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->GetZg=m_E_getz; //将程序的值更新到真正所控制的对象
float pos = (m_E_getz - BMP_Sld[5][0]) * 100.0 /
(BMP_Sld[5][1] - BMP_Sld[5][0]);
m_S_getz.SetPos(pos);
}
void CDLG_Bmp::OnKillfocusEbLifefate()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->lifefate=m_E_lifefate; //将程序的值更新到真正所控制的对象
float pos = (m_E_lifefate - BMP_Sld[1][0]) * 100.0 /
(BMP_Sld[1][1] - BMP_Sld[1][0]);
m_S_lifefate.SetPos(pos);
}
void CDLG_Bmp::OnKillfocusEbMaxnum()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->MAX_PARTICLES=m_E_maxnum; //将程序的值更新到真正所控制的对象
float pos = (m_E_maxnum - BMP_Sld[0][0]) * 100.0 /
(BMP_Sld[0][1] - BMP_Sld[0][0]);
m_S_maxnum.SetPos(pos);
}
void CDLG_Bmp::OnKillfocusEbPosX()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->star_x=m_E_posx; //将程序的值更新到真正所控制的对象
}
void CDLG_Bmp::OnKillfocusEbPosY()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->star_y=m_E_posy; //将程序的值更新到真正所控制的对象
}
void CDLG_Bmp::OnKillfocusEbPosZ()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->star_z=m_E_posz; //将程序的值更新到真正所控制的对象
}
void CDLG_Bmp::OnKillfocusEbSlowdown()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->slowdown=m_E_slowdown; //将程序的值更新到真正所控制的对象
float pos = (m_E_slowdown - BMP_Sld[2][0]) * 100.0 /
(BMP_Sld[2][1] - BMP_Sld[2][0]);
m_S_slowdown.SetPos(pos);
}
void CDLG_Bmp::OnKillfocusEBTextWidth()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->TextWidth=m_E_TW; //将程序的值更新到真正所控制的对象
float pos = (m_E_TW - BMP_Sld[6][0]) * 100.0 /
(BMP_Sld[6][1] - BMP_Sld[6][0]);
m_S_TW.SetPos(pos);
}
void CDLG_Bmp::OnKillfocusEBThick()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE); //将界面的值更新到程序
m_DLGData->pram[1]=m_E_thick; //将程序的值更新到真正所控制的对象
float pos = (m_E_thick - BMP_Sld[7][0]) * 100.0 /
(BMP_Sld[7][1] - BMP_Sld[7][0]);
m_S_thick.SetPos(pos);
}
void CDLG_Bmp::OnReleasedcaptureSbGetx(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_E_getx=(m_S_getx.GetPos()/100.0)
*(BMP_Sld[3][1] - BMP_Sld[3][0])
+ BMP_Sld[3][0];
m_DLGData->GetXg=m_E_getx;
UpdateData(FALSE);
*pResult = 0;
}
void CDLG_Bmp::OnReleasedcaptureSbGety(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_E_gety=(m_S_gety.GetPos()/100.0)
*(BMP_Sld[4][1] - BMP_Sld[4][0])
+ BMP_Sld[4][0];
m_DLGData->GetYg=m_E_gety;
UpdateData(FALSE);
*pResult = 0;
}
void CDLG_Bmp::OnReleasedcaptureSbGetz(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_E_getz=(m_S_getz.GetPos()/100.0)
*(BMP_Sld[5][1] - BMP_Sld[5][0])
+ BMP_Sld[5][0];
m_DLGData->GetZg=m_E_getz;
UpdateData(FALSE);
*pResult = 0;
}
void CDLG_Bmp::OnReleasedcaptureSbLifefate(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_E_lifefate=(m_S_lifefate.GetPos()/100.0)
*(BMP_Sld[1][1] - BMP_Sld[1][0])
+ BMP_Sld[1][0];
m_DLGData->lifefate=m_E_lifefate;
UpdateData(FALSE);
*pResult = 0;
}
void CDLG_Bmp::OnReleasedcaptureSbMaxnum(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_E_maxnum=(m_S_maxnum.GetPos()/100.0)
*(BMP_Sld[0][1] - BMP_Sld[0][0])
+ BMP_Sld[0][0];
m_DLGData->MAX_PARTICLES=m_E_maxnum;
UpdateData(FALSE);
*pResult = 0;
}
void CDLG_Bmp::OnReleasedcaptureSbSlowdown(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_E_slowdown=(m_S_slowdown.GetPos()/100.0)
*(BMP_Sld[2][1] - BMP_Sld[2][0])
+ BMP_Sld[2][0];
m_DLGData->slowdown=m_E_slowdown;
UpdateData(FALSE);
*pResult = 0;
}
void CDLG_Bmp::OnReleasedcaptureSBTextWitdh(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_E_TW=(m_S_TW.GetPos()/100.0)
*(BMP_Sld[6][1] - BMP_Sld[6][0])
+ BMP_Sld[6][0];
m_DLGData->TextWidth=m_E_TW;
UpdateData(FALSE);
*pResult = 0;
}
void CDLG_Bmp::OnReleasedcaptureSBThick(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_E_thick=(m_S_thick.GetPos()/100.0)
*(BMP_Sld[7][1] - BMP_Sld[7][0])
+ BMP_Sld[7][0];
m_DLGData->pram[1]=m_E_thick;
UpdateData(FALSE);
*pResult = 0;
}
////////////////////////////////////////
void CDLG_Bmp::GetExtData(DlgData_PRT &Ex_DLGData,char (*tFName)[256]) //获得外界数据
{
m_DLGData=&Ex_DLGData; //取得外界存储数据的结构,因为是传址调用,
//所以只要在这里改,外面的数据也就改了
FileName=tFName; //获得文件名
UpdateDLGDate(); //更新界面数据
}
| [
"1220219614@qq.com"
] | 1220219614@qq.com |
4138632f3975523dc3416d6bd98d598c5dbd3400 | ed6691cce916ceb654639ffeebef5d9d3aa96cc7 | /include/imac2gl3/shapes/MatrixStack.hpp | 53366bfe5a76a0bed0dba30da23a5f70da87b845 | [] | no_license | flavienINK/IMAINECRAFT | 79ac58962270d1aa074f0b49084b368852b28838 | baace0c14bd41da3a742f360b562a3cfcbe2fe6a | refs/heads/master | 2020-05-19T10:06:42.465117 | 2013-01-11T16:24:03 | 2013-01-11T16:24:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 583 | hpp | #ifndef MATRIXSTACK_H
#define MATRIXSTACK_H
#include <cstddef>
#include <GL/glew.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <stack>
#include "imac2gl3/shader_tools.hpp"
class MatrixStack{
private:
std::stack<glm::mat4> m_Stack;
public:
MatrixStack();
~MatrixStack();
void push();
void pop();
void mult(const glm::mat4&);
const glm::mat4& top() const;
void set(const glm::mat4&);
void scale(const glm::vec3&);
void translate(const glm::vec3&);
void rotate(float, const glm::vec3&);
};
#endif
| [
"flavien.leygues@gmail.com"
] | flavien.leygues@gmail.com |
3420971b89a18df5af62483b7cad57884aee8b9b | fad9cfe5aff1e60a5430de19a06c9522a856c3f4 | /src/isPaADescendantOfPb.cpp | a880e6c33081304e5af2743506785dcbeb227880 | [
"MIT"
] | permissive | buaazhouxingyu/topoana | e4c47d957fcf0b893e19c25f8f7e3a4a789e194d | 49e41e04494f6f1419f6b618029eacd12a1d5224 | refs/heads/master | 2022-10-01T10:41:57.479337 | 2022-09-29T13:03:34 | 2022-09-29T13:03:34 | 189,695,400 | 16 | 11 | null | 2020-01-10T08:29:12 | 2019-06-01T05:44:36 | C++ | UTF-8 | C++ | false | false | 1,423 | cpp | #include "../include/topoana.h"
#include <iostream>
#include <cstdlib>
bool topoana::isPaADescendantOfPb(vector<int> vMidx, int idxA, int idxB)
{
if(idxA<0||((unsigned int) idxA)>=vMidx.size())
{
cerr<<"Error: The integer \"idxA\" is not a reasonable index for the vector \"vMidx\"!"<<endl;
cerr<<"Infor: The integer \"idxA\" is "<<idxA<<"."<<endl;
cerr<<"Infor: The size of the vector \"vMidx\" is "<<vMidx.size()<<"."<<endl;
cerr<<"Infor: Please check them."<<endl;
exit(-1);
}
if(idxB<0||((unsigned int) idxB)>=vMidx.size())
{
cerr<<"Error: The integer \"idxB\" is not a reasonable index for the vector \"vMidx\"!"<<endl;
cerr<<"Infor: The integer \"idxB\" is "<<idxB<<"."<<endl;
cerr<<"Infor: The size of the vector \"vMidx\" is "<<vMidx.size()<<"."<<endl;
cerr<<"Infor: Please check them."<<endl;
exit(-1);
}
if(idxA<idxB)
{
cerr<<"Error: The integer \"idxA\" is less than the integer \"idxB\"!"<<endl;
cerr<<"Infor: The integer \"idxA\" is "<<idxA<<"."<<endl;
cerr<<"Infor: The integer \"idxB\" is "<<idxB<<"."<<endl;
cerr<<"Infor: The integer \"idxA\" should be greater than the integer \"idxB\"!"<<endl;
cerr<<"Infor: Please check them."<<endl;
exit(-1);
}
while(vMidx[idxA]!=idxA)
{
if(vMidx[idxA]==idxB) return true;
else idxA=vMidx[idxA];
}
return false;
}
| [
"xing-yu.zhou@desy.de"
] | xing-yu.zhou@desy.de |
75346951c3d83e7b46dcaa051b0f30a2e79022b9 | e154a67d426c97c328b0c97882572fbfc7d02010 | /NextPermutation.cpp | 21a8f80335d3fcc450ffeb7dd76ad3a3d47dd900 | [] | no_license | TopHK/LeetCode-Mine | 261a77aa850317d71d4763e5fdd095bc8824ca44 | aeae6012ac31440a1172019cbd2cf648cf68a9d5 | refs/heads/master | 2021-03-12T21:50:31.944604 | 2015-08-19T03:14:54 | 2015-08-19T03:14:54 | 41,009,431 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 997 | cpp | /*************************************************************************
> File Name: NextPermutation.cpp
> Author:
> Mail:
> Created Time: 2015年06月29日 星期一 12时28分18秒
************************************************************************/
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void nextPermutation(vector<int>& nums)
{
int size = nums.size();
if(size < 2) return;
int i = size-2;
while(i>=0 && nums[i]>=nums[i+1]) i--;
if(i < 0)
{
sort(nums.begin(), nums.end());
return;
}
int j = size-1;
while(j>=0 && nums[j]<=nums[i]) j--;
swap(nums[i], nums[j]);
sort(nums.begin()+i+1, nums.end());
}
void print(const vector<int>& nums)
{
for(int i=0; i<nums.size(); ++i)
cout<<nums[i]<<" ";
cout<<endl;
}
int main()
{
int arr[] = {3, 2, 1};
vector<int> nums(arr, arr+sizeof(arr)/sizeof(int));
nextPermutation(nums);
print(nums);
return 0;
}
| [
"TopShaojie.kang@gmail.com"
] | TopShaojie.kang@gmail.com |
fb8f45e5648d90832d9e294abd51b1ded5882afe | 8d83c56718f0845423ec1eff847df9f590b0a116 | /Mods/CrysisWarsMod/Code/Game.h | e4a134cde3aac5847784f344680c7dfb5120c49f | [] | no_license | CyberSys/Crysis-Wars-Source-Code | 534e7936a9856b529fce327ae4d2388828066498 | 9cfe9fa887f6583b72f3bf1dc3c5609077e44fc6 | refs/heads/master | 2021-09-02T12:54:05.307572 | 2018-01-02T20:29:59 | 2018-01-02T20:29:59 | null | 0 | 0 | null | null | null | null | WINDOWS-1250 | C++ | false | false | 9,714 | h | /*************************************************************************
Crytek Source File.
Copyright (C), Crytek Studios, 2001-2004.
-------------------------------------------------------------------------
$Id$
$DateTime$
Description:
-------------------------------------------------------------------------
History:
- 3:8:2004 11:23 : Created by Márcio Martins
*************************************************************************/
#ifndef __GAME_H__
#define __GAME_H__
#if _MSC_VER > 1000
# pragma once
#endif
#include <IGame.h>
#include <IGameFramework.h>
#include <IGameObjectSystem.h>
#include <IGameObject.h>
#include <IActorSystem.h>
#include <StlUtils.h>
#include "ClientSynchedStorage.h"
#include "ServerSynchedStorage.h"
#include "Cry_Camera.h"
#define GAME_NAME "Crysis Wars"
#define GAME_LONGNAME "Crysis Wars"
struct ISystem;
struct IConsole;
struct ILCD;
class CScriptBind_Actor;
class CScriptBind_Item;
class CScriptBind_Weapon;
class CScriptBind_GameRules;
class CScriptBind_Game;
class CScriptBind_HUD;
class CWeaponSystem;
class CFlashMenuObject;
class COptionsManager;
struct IActionMap;
struct IActionFilter;
class CGameActions;
class CGameRules;
class CBulletTime;
class CHUD;
class CSynchedStorage;
class CClientSynchedStorage;
class CServerSynchedStorage;
struct SCVars;
struct SItemStrings;
class CItemSharedParamsList;
class CSPAnalyst;
class CSoundMoods;
class CLaptopUtil;
class CLCDWrapper;
class CDownloadTask;
// when you add stuff here, also update in CGame::RegisterGameObjectEvents
enum ECryGameEvent
{
eCGE_PreFreeze = eGFE_PreFreeze, // this is really bad and must be fixed
eCGE_PreShatter = eGFE_PreShatter,
eCGE_PostFreeze = 256,
eCGE_PostShatter,
eCGE_OnShoot,
eCGE_Recoil,
eCGE_BeginReloadLoop,
eCGE_EndReloadLoop,
eCGE_ActorRevive,
eCGE_VehicleDestroyed,
eCGE_TurnRagdoll,
eCGE_EnableFallAndPlay,
eCGE_DisableFallAndPlay,
eCGE_VehicleTransitionEnter,
eCGE_VehicleTransitionExit,
eCGE_HUD_PDAMessage,
eCGE_HUD_TextMessage,
eCGE_TextArea,
eCGE_HUD_Break,
eCGE_HUD_Reboot,
eCGE_InitiateAutoDestruction,
eCGE_Event_Collapsing,
eCGE_Event_Collapsed,
eCGE_MultiplayerChatMessage,
eCGE_ResetMovementController,
eCGE_AnimateHands,
eCGE_Ragdoll,
eCGE_EnablePhysicalCollider,
eCGE_DisablePhysicalCollider,
eCGE_RebindAnimGraphInputs,
eCGE_OpenParachute,
eCGE_Turret_LockedTarget,
eCGE_Turret_LostTarget,
};
static const int GLOBAL_SERVER_IP_KEY = 1000;
static const int GLOBAL_SERVER_PUBLIC_PORT_KEY = 1001;
static const int GLOBAL_SERVER_NAME_KEY = 1002;
class CGame :
public IGame, public IGameFrameworkListener
{
public:
typedef bool (*BlockingConditionFunction)();
public:
CGame();
virtual ~CGame();
// IGame
virtual bool Init(IGameFramework *pFramework);
virtual bool CompleteInit();
virtual void Shutdown();
virtual int Update(bool haveFocus, unsigned int updateFlags);
virtual void ConfigureGameChannel(bool isServer, IProtocolBuilder *pBuilder);
virtual void EditorResetGame(bool bStart);
virtual void PlayerIdSet(EntityId playerId);
virtual string InitMapReloading();
virtual bool IsReloading() { return m_bReload; }
virtual IGameFramework *GetIGameFramework() { return m_pFramework; }
virtual const char *GetLongName();
virtual const char *GetName();
virtual void GetMemoryStatistics(ICrySizer * s);
virtual void OnClearPlayerIds();
//auto-generated save game file name
virtual const char* CreateSaveGameName();
//level names were renamed without changing the file/directory
virtual const char* GetMappedLevelName(const char *levelName) const;
// ~IGame
// IGameFrameworkListener
virtual void OnPostUpdate(float fDeltaTime);
virtual void OnSaveGame(ISaveGame* pSaveGame);
virtual void OnLoadGame(ILoadGame* pLoadGame);
virtual void OnLevelEnd(const char* nextLevel) {};
virtual void OnActionEvent(const SActionEvent& event);
// ~IGameFrameworkListener
void BlockingProcess(BlockingConditionFunction f);
void GameChannelDestroyed(bool isServer);
void DestroyHUD();
virtual CScriptBind_Actor *GetActorScriptBind() { return m_pScriptBindActor; }
virtual CScriptBind_Item *GetItemScriptBind() { return m_pScriptBindItem; }
virtual CScriptBind_Weapon *GetWeaponScriptBind() { return m_pScriptBindWeapon; }
virtual CScriptBind_GameRules *GetGameRulesScriptBind() { return m_pScriptBindGameRules; }
virtual CScriptBind_HUD *GetHUDScriptBind() { return m_pScriptBindHUD; }
virtual CWeaponSystem *GetWeaponSystem() { return m_pWeaponSystem; };
virtual CItemSharedParamsList *GetItemSharedParamsList() { return m_pItemSharedParamsList; };
CGameActions& Actions() const { return *m_pGameActions; };
CGameRules *GetGameRules() const;
CBulletTime *GetBulletTime() const;
CSoundMoods *GetSoundMoods() const;
CLaptopUtil *GetLaptopUtil() const;
CHUD *GetHUD() const;
CFlashMenuObject *GetMenu() const;
COptionsManager *GetOptions() const;
ILINE CSynchedStorage *GetSynchedStorage() const
{
if (m_pServerSynchedStorage && gEnv->bServer)
return m_pServerSynchedStorage;
return m_pClientSynchedStorage;
}
ILINE CServerSynchedStorage *GetServerSynchedStorage() const
{
return m_pServerSynchedStorage;
}
CSPAnalyst* GetSPAnalyst() const { return m_pSPAnalyst; }
const string& GetLastSaveGame(string &levelName);
const string& GetLastSaveGame() { string tmp; return GetLastSaveGame(tmp); }
ILINE SCVars *GetCVars() {return m_pCVars;}
static void DumpMemInfo(const char* format, ...) PRINTF_PARAMS(1, 2);
CDownloadTask* GetDownloadTask() const { return m_pDownloadTask; }
protected:
virtual void LoadActionMaps(const char* filename = "libs/config/defaultProfile.xml");
virtual void ReleaseActionMaps();
virtual void InitScriptBinds();
virtual void ReleaseScriptBinds();
virtual void CheckReloadLevel();
// These funcs live in GameCVars.cpp
virtual void RegisterConsoleVars();
virtual void RegisterConsoleCommands();
virtual void UnregisterConsoleCommands();
virtual void RegisterGameObjectEvents();
// marcok: this is bad and evil ... should be removed soon
static void CmdRestartGame(IConsoleCmdArgs *pArgs);
static void CmdDumpSS(IConsoleCmdArgs *pArgs);
static void CmdLastInv(IConsoleCmdArgs *pArgs);
static void CmdName(IConsoleCmdArgs *pArgs);
static void CmdTeam(IConsoleCmdArgs *pArgs);
static void CmdLoadLastSave(IConsoleCmdArgs *pArgs);
static void CmdSpectator(IConsoleCmdArgs *pArgs);
static void CmdJoinGame(IConsoleCmdArgs *pArgs);
static void CmdKill(IConsoleCmdArgs *pArgs);
static void CmdVehicleKill(IConsoleCmdArgs *pArgs);
static void CmdRestart(IConsoleCmdArgs *pArgs);
static void CmdSay(IConsoleCmdArgs *pArgs);
static void CmdReloadItems(IConsoleCmdArgs *pArgs);
static void CmdLoadActionmap(IConsoleCmdArgs *pArgs);
static void CmdReloadGameRules(IConsoleCmdArgs *pArgs);
static void CmdNextLevel(IConsoleCmdArgs* pArgs);
static void CmdStartKickVoting(IConsoleCmdArgs* pArgs);
static void CmdStartNextMapVoting(IConsoleCmdArgs* pArgs);
static void CmdVote(IConsoleCmdArgs* pArgs);
static void CmdListPlayers(IConsoleCmdArgs* pArgs);
static void CmdQuickGame(IConsoleCmdArgs* pArgs);
static void CmdQuickGameStop(IConsoleCmdArgs* pArgs);
static void CmdBattleDustReload(IConsoleCmdArgs* pArgs);
static void CmdLogin(IConsoleCmdArgs* pArgs);
static void CmdLoginProfile(IConsoleCmdArgs* pArgs);
static void CmdRegisterNick(IConsoleCmdArgs* pArgs);
static void CmdCryNetConnect(IConsoleCmdArgs* pArgs);
IGameFramework *m_pFramework;
IConsole *m_pConsole;
CWeaponSystem *m_pWeaponSystem;
bool m_bReload;
// script binds
CScriptBind_Actor *m_pScriptBindActor;
CScriptBind_Item *m_pScriptBindItem;
CScriptBind_Weapon *m_pScriptBindWeapon;
CScriptBind_GameRules*m_pScriptBindGameRules;
CScriptBind_Game *m_pScriptBindGame;
CScriptBind_HUD *m_pScriptBindHUD;
//menus
CFlashMenuObject *m_pFlashMenuObject;
COptionsManager *m_pOptionsManager;
IActionMap *m_pDebugAM;
IActionMap *m_pDefaultAM;
IActionMap *m_pMultiplayerAM;
CGameActions *m_pGameActions;
IPlayerProfileManager* m_pPlayerProfileManager;
CHUD *m_pHUD;
CServerSynchedStorage *m_pServerSynchedStorage;
CClientSynchedStorage *m_pClientSynchedStorage;
CSPAnalyst *m_pSPAnalyst;
bool m_inDevMode;
EntityId m_uiPlayerID;
SCVars* m_pCVars;
SItemStrings *m_pItemStrings;
CItemSharedParamsList *m_pItemSharedParamsList;
string m_lastSaveGame;
string m_newSaveGame;
CBulletTime *m_pBulletTime;
CSoundMoods *m_pSoundMoods;
CLaptopUtil *m_pLaptopUtil;
ILCD *m_pLCD;
typedef std::map<string, string, stl::less_stricmp<string> > TLevelMapMap;
TLevelMapMap m_mapNames;
CDownloadTask *m_pDownloadTask;
};
extern CGame *g_pGame;
#define SAFE_HARDWARE_MOUSE_FUNC(func)\
if(gEnv->pHardwareMouse)\
gEnv->pHardwareMouse->func
#define SAFE_MENU_FUNC(func)\
{ if(g_pGame && g_pGame->GetMenu()) g_pGame->GetMenu()->func; }
#define SAFE_MENU_FUNC_RET(func)\
((g_pGame && g_pGame->GetMenu()) ? g_pGame->GetMenu()->func : 0)
#define SAFE_HUD_FUNC(func)\
{ if(g_pGame && g_pGame->GetHUD()) g_pGame->GetHUD()->func; }
#define SAFE_HUD_FUNC_RET(func)\
((g_pGame && g_pGame->GetHUD()) ? g_pGame->GetHUD()->func : 0)
#define SAFE_LAPTOPUTIL_FUNC(func)\
{ if(g_pGame && g_pGame->GetLaptopUtil()) g_pGame->GetLaptopUtil()->func; }
#define SAFE_LAPTOPUTIL_FUNC_RET(func)\
((g_pGame && g_pGame->GetLaptopUtil()) ? g_pGame->GetLaptopUtil()->func : 0)
#define SAFE_SOUNDMOODS_FUNC(func)\
{ if(g_pGame && g_pGame->GetSoundMoods()) g_pGame->GetSoundMoods()->func; }
#define CRAPDOLLS
#endif //__GAME_H__ | [
"mr.a.c.stopher@googlemail.com"
] | mr.a.c.stopher@googlemail.com |
5d9d47670ede286fd36086262b5c2577f11d5293 | 36e529197693c3ed5af7fec19108e082e15f9779 | /cpp/apiclient/apiclient.cpp | d979a59216ea88d47384076d7ce6deb5c6ccf8cb | [] | no_license | vijayrajanna/GPDemo | 68c8a21f4c85171f35407115a921cb575f37e2de | 5900547e8c708f5b44a4c992b72c4269cc351dfb | refs/heads/master | 2021-01-12T03:47:36.599237 | 2017-01-09T04:57:43 | 2017-01-09T04:57:43 | 78,264,947 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,363 | cpp | //////////////////////////////////////////////////////////////////////////////////////
// apiclient.cpp - Example class for communication over the Open Gaze API
// Written in 2013 by Gazepoint www.gazept.com
//
// To the extent possible under law, the author(s) have dedicated all copyright
// and related and neighboring rights to this software to the public domain worldwide.
// This software is distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with this
// software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
//////////////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <conio.h>
#include <string>
#include <iostream>
#include <vector>
#include <sstream>
#include <string>
#include <iostream>
#include <istream>
#include <ostream>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <deque>
#include "..\include\GPClient.h"
void print_inputs()
{
cout << "\n'c' to connect";
cout << "\n'd' to disconnect";
cout << "\n't' to setup tx data";
cout << "\n'q' to query vars";
cout << "\n'x' to exit";
cout << "\nInput?: ";
}
int _tmain(int argc, _TCHAR* argv[])
{
char ch;
deque<string> data_set;
vector<string> cmd[2];
GPClient client;
cmd[0].push_back("ENABLE_SEND_DATA");
cmd[0].push_back("ENABLE_SEND_COUNTER");
cmd[0].push_back("ENABLE_SEND_TIME");
cmd[0].push_back("ENABLE_SEND_TIME_TICK");
cmd[0].push_back("ENABLE_SEND_POG_FIX");
cmd[0].push_back("ENABLE_SEND_POG_LEFT");
cmd[0].push_back("ENABLE_SEND_POG_RIGHT");
cmd[0].push_back("ENABLE_SEND_POG_BEST");
cmd[0].push_back("ENABLE_SEND_PUPIL_LEFT");
cmd[0].push_back("ENABLE_SEND_PUPIL_RIGHT");
cmd[0].push_back("ENABLE_SEND_EYE_LEFT");
cmd[0].push_back("ENABLE_SEND_EYE_RIGHT");
cmd[0].push_back("ENABLE_SEND_CURSOR");
cmd[0].push_back("ENABLE_SEND_BLINK");
cmd[0].push_back("ENABLE_SEND_USER_DATA");
cmd[1].push_back("CALIBRATE_START");
cmd[1].push_back("CALIBRATE_SHOW");
cmd[1].push_back("CALIBRATE_TIMEOUT");
cmd[1].push_back("CALIBRATE_DELAY");
cmd[1].push_back("CALIBRATE_RESULT_SUMMARY");
cmd[1].push_back("CALIBRATE_CLEAR");
cmd[1].push_back("CALIBRATE_RESET");
cmd[1].push_back("CALIBRATE_ADDPOINT");
cmd[1].push_back("USER_DATA");
cmd[1].push_back("TRACKER_DISPLAY");
cmd[1].push_back("TIME_TICK_FREQUENCY");
cmd[1].push_back("SCREEN_SIZE");
cmd[1].push_back("CAMERA_SIZE");
cmd[1].push_back("PRODUCT_ID");
cmd[1].push_back("SERIAL_ID");
cmd[1].push_back("COMPANY_ID");
cmd[1].push_back("API_ID");
cmd[1].push_back("TRACKER_ID");
client.client_connect();
print_inputs();
do
{
ch = NULL;
// check for quick key
if (_kbhit() != 0) { ch = _getch(); }
// 'enter' so show possible inputs
if (ch == 13)
{
print_inputs();
}
// connector or disconnect
if (ch == 'c')
{
cout << "\nAttempt connect";
client.client_connect();
cout << "\nInput?: ";
}
else if (ch == 'd')
{
cout << "\nAttempt disconnect";
client.client_disconnect();
cout << "\nInput?: ";
}
// configure via API
if (ch == 't' || ch == 'q')
{
unsigned int val, sel;
int cmd_type = 0;
char setorget;
string setorgetstr;
ostringstream data;
ostringstream str_strm;
cout << "\n's'et or 'g'et?: ";
setorget = _getch();
if (ch == 'q') { cmd_type = 1; }
if (setorget == 'g' || setorget == 's')
{
for (unsigned int i = 0; i < cmd[cmd_type].size(); i++)
{
cout << "\n" << i << " " << cmd[cmd_type].at(i);
}
cout << "\nInput?: ";
cin >> sel;
if (setorget == 's')
{
setorgetstr = "SET";
if (cmd[cmd_type].at(sel) == "CALIBRATE_TIMEOUT" || cmd[cmd_type].at(sel) == "CALIBRATE_DELAY")
{
float timeval;
cout << "\nVALUE? (float): ";
cin >> timeval;
data << "VALUE=\"" << timeval << "\" ";
}
else if (cmd[cmd_type].at(sel) == "SCREEN_SIZE")
{
int x,y,w,h;
cout << "\nX? (int): ";
cin >> x;
data << "X=\"" << x << "\" ";
cout << "\nY? (int): ";
cin >> y;
data << "Y=\"" << y << "\" ";
cout << "\nWIDTH? (int): ";
cin >> w;
data << "WIDTH=\"" << w << "\" ";
cout << "\nHEIGHT? (int): ";
cin >> h;
data << "HEIGHT=\"" << h << "\" ";
}
else if (cmd[cmd_type].at(sel) == "CALIBRATE_CLEAR")
{
}
else if (cmd[cmd_type].at(sel) == "CALIBRATE_RESET")
{
}
else if (cmd[cmd_type].at(sel) == "CALIBRATE_ADDPOINT")
{
float x,y;
cout << "\nX? (float): ";
cin >> x;
data << "X=\"" << x << "\" ";
cout << "\nY? (float): ";
cin >> y;
data << "Y=\"" << y << "\" ";
}
else if (cmd[cmd_type].at(sel) == "USER_DATA")
{
string str;
cout << "\nVALUE? (string): ";
cin >> str;
data << "VALUE=\"" << str << "\" ";
}
else if (cmd[cmd_type].at(sel) == "TRACKER_ID")
{
string active;
string search;
cout << "\nACTIVE_ID?: ";
cin >> active;
cout << "\nSEARCH? (NONE, SIMPLE, CURSOR, GAZE): ";
cin >> search;
data << "ACTIVE_ID=\"" << active << "\" SEARCH=\"" << search << "\" ";
}
else
{
cout << "\nSTATE?: ";
cin >> val;
data << "STATE=\"" << val << "\" ";
}
}
else
{
setorgetstr = "GET";
}
// create XML string and send
if (sel >= 0 && sel < cmd[cmd_type].size())
{
str_strm << "<" << setorgetstr << " ID=\"" << cmd[cmd_type].at(sel) << "\" " << data.str() << "/>";
cout << str_strm.str().c_str() << "\n";
client.send_cmd(str_strm.str());
}
}
}
// display response on screen
//////////////////////////////////////////////////////////////////////////////////////
// Use this section if you want to see EVERY record (will lag, can't display at 60Hz!)
/*
client.get_rx(data_set);
for (int i = 0; i < data_set.size(); i++)
{
cout << data_set.at(i).c_str() << "\n";
}*/
//////////////////////////////////////////////////////////////////////////////////////
// Use this section if you just want the latest data record
string rxstr = client.get_rx_latest();
if (rxstr != "")
{
cout << rxstr.c_str() << "\n";
}
Sleep (50);
}
while (ch != 'x');
return 0;
}
| [
"vijay.drajanna@gmail.com"
] | vijay.drajanna@gmail.com |
7562315a31ccab5f8b210d6650414dcf645ccb4b | f99c198106e310d5c7c75331eb0c7984430d0354 | /Libs/lua/LuaPlusCD.h | 9498828a0312e2fd9f63d351ed738eeb6548b356 | [] | no_license | xiecunjing/EasyGameLibs | f0cbd1651c130472b2ca5b86fb39df8648a6c828 | 4f46446b1c20bbf32bdd4ad84b62a3ae054bbba2 | refs/heads/master | 2021-01-13T14:39:25.648624 | 2016-11-10T06:36:15 | 2016-11-10T06:36:15 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 74,428 | h | ///////////////////////////////////////////////////////////////////////////////
// This source file is part of the LuaPlus source distribution and is Copyright
// 2001-2005 by Joshua C. Jensen (jjensen@workspacewhiz.com).
//
// The latest version may be obtained from http://wwhiz.com/LuaPlus/.
//
// The code presented in this file may be used in any environment it is
// acceptable to use Lua.
///////////////////////////////////////////////////////////////////////////////
#pragma once
// LuaPlus Call Dispatcher
namespace LPCD
{
struct LuaLightUserData
{
LuaLightUserData(const void* value) :
m_value(value)
{
}
const void* m_value;
};
struct LuaUserData
{
LuaUserData(const void* value) :
m_value(value)
{
}
const void* m_value;
};
struct LuaNil
{
};
inline void Push(lua_State* L, bool value) { lua_pushboolean(L, value); }
inline void Push(lua_State* L, char value) { lua_pushnumber(L, value); }
inline void Push(lua_State* L, unsigned char value) { lua_pushnumber(L, value); }
inline void Push(lua_State* L, short value) { lua_pushnumber(L, value); }
inline void Push(lua_State* L, unsigned short value) { lua_pushnumber(L, value); }
inline void Push(lua_State* L, int value) { lua_pushnumber(L, value); }
inline void Push(lua_State* L, unsigned int value) { lua_pushnumber(L, value); }
inline void Push(lua_State* L, long value) { lua_pushnumber(L, value); }
inline void Push(lua_State* L, unsigned long value) { lua_pushnumber(L, value); }
inline void Push(lua_State* L, double value) { lua_pushnumber(L, (lua_Number)value); }
inline void Push(lua_State* L, float value) { lua_pushnumber(L, (lua_Number)value); }
inline void Push(lua_State* L, const char* value) { lua_pushstring(L, value); }
inline void Push(lua_State* L, const LuaNil&) { lua_pushnil(L); }
inline void Push(lua_State* L, lua_CFunction value) { lua_pushcclosure(L, value, 0); }
inline void Push(lua_State* L, const void* value) { lua_pushlightuserdata(L, (void*)value); }
inline void Push(lua_State* L, const LuaLightUserData& value) { lua_pushlightuserdata(L, (void*)value.m_value); }
inline void Push(lua_State* L, INT64 value)
{
void *buf = lua_newuserdata(L,sizeof(LuaInteger64));
memcpy(buf,&value,sizeof(LuaInteger64));
LuaInteger64::setmetatable(L);
}
inline void Push(lua_State* L, UINT64 value)
{
void *buf = lua_newuserdata(L,sizeof(LuaInteger64));
memcpy(buf,&value,sizeof(LuaInteger64));
LuaInteger64::setmetatable(L);
}
inline void Push(lua_State* L, LuaDAMAGE_INFO& value)
{
void *buf = lua_newuserdata(L,sizeof(LuaDAMAGE_INFO));
memcpy(buf,&value,sizeof(LuaDAMAGE_INFO));
LuaDAMAGE_INFO::SetMetaTable(L);
}
inline void Push(lua_State* L, LuaSKILL_EFFECT_DATA& value)
{
void *buf = lua_newuserdata(L,sizeof(LuaSKILL_EFFECT_DATA));
memcpy(buf,&value,sizeof(LuaSKILL_EFFECT_DATA));
LuaSKILL_EFFECT_DATA::SetMetaTable(L);
}
inline void Push(lua_State* L, CLuaTable& value)
{
lua_newtable(L);
for(size_t i=0;i<value.GetCount();i++)
{
if(value[i].KeyType==LUA_TNUMBER)
{
lua_pushnumber(L,value[i].NumberKey);
if(value[i].ValueType==LUA_TNUMBER)
{
lua_pushnumber(L,value[i].NumberValue);
lua_settable(L, -3);
}
else if(value[i].ValueType==LUA_TSTRING)
{
#ifdef UNICODE
CEasyStringA Temp=value[i].StrValue;
lua_pushstring(L,Temp);
#else
lua_pushstring(L,value[i].StrValue);
#endif
lua_settable(L, -3);
}
else
{
luaL_error(L,"Table Element[%d] ValueType(%d) Is Invalid",i,value[i].ValueType);
}
}
else if(value[i].KeyType==LUA_TSTRING)
{
#ifdef UNICODE
CEasyStringA Temp=value[i].StrKey;
lua_pushstring(L, Temp);
#else
lua_pushstring(L, value[i].StrKey);
#endif
if(value[i].ValueType==LUA_TNUMBER)
{
lua_pushnumber(L,value[i].NumberValue);
lua_settable(L, -3);
}
else if(value[i].ValueType==LUA_TSTRING)
{
#ifdef UNICODE
CEasyStringA Temp=value[i].StrValue;
lua_pushstring(L,Temp);
#else
lua_pushstring(L,value[i].StrValue);
#endif
lua_settable(L, -3);
}
else
{
luaL_error(L,"Table Element[%d] ValueType(%d) Is Invalid",i,value[i].ValueType);
}
}
else
{
luaL_error(L,"Table Element[%d] KeyType(%d) Is Invalid",i,value[i].KeyType);
}
}
}
template<class T> struct TypeWrapper {};
inline bool Match(TypeWrapper<bool>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TBOOLEAN; }
inline bool Match(TypeWrapper<char>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<unsigned char>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<short>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<unsigned short>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<int>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<unsigned int>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<long>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<unsigned long>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<float>, lua_State* L, int idx)
{ int type = lua_type(L, idx); return type == LUA_TNUMBER || type == LUA_TNUMBER; }
inline bool Match(TypeWrapper<double>, lua_State* L, int idx)
{ int type = lua_type(L, idx); return type == LUA_TNUMBER || type == LUA_TNUMBER; }
inline bool Match(TypeWrapper<const char*>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TSTRING; }
inline bool Match(TypeWrapper<lua_State*>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TNONE; }
inline bool Match(TypeWrapper<void*>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TLIGHTUSERDATA; }
inline bool Match(TypeWrapper<INT64>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TUSERDATA || lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<UINT64>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TUSERDATA|| lua_type(L, idx) == LUA_TNUMBER; }
inline bool Match(TypeWrapper<LuaDAMAGE_INFO>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TUSERDATA; }
inline bool Match(TypeWrapper<LuaSKILL_EFFECT_DATA>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TUSERDATA; }
inline bool Match(TypeWrapper<CLuaTable>, lua_State* L, int idx)
{ return lua_type(L, idx) == LUA_TTABLE; }
inline void Get(TypeWrapper<void>, lua_State*, int)
{ }
inline bool Get(TypeWrapper<bool>, lua_State* L, int idx)
{ return lua_toboolean(L, idx) != 0; }
inline char Get(TypeWrapper<char>, lua_State* L, int idx)
{ return static_cast<char>(lua_tonumber(L, idx)); }
inline unsigned char Get(TypeWrapper<unsigned char>, lua_State* L, int idx)
{ return static_cast<unsigned char>(lua_tonumber(L, idx)); }
inline short Get(TypeWrapper<short>, lua_State* L, int idx)
{ return static_cast<short>(lua_tonumber(L, idx)); }
inline unsigned short Get(TypeWrapper<unsigned short>, lua_State* L, int idx)
{ return static_cast<unsigned short>(lua_tonumber(L, idx)); }
inline int Get(TypeWrapper<int>, lua_State* L, int idx)
{ return static_cast<int>(lua_tonumber(L, idx)); }
inline unsigned int Get(TypeWrapper<unsigned int>, lua_State* L, int idx)
{ return static_cast<unsigned int>(lua_tonumber(L, idx)); }
inline long Get(TypeWrapper<long>, lua_State* L, int idx)
{ return static_cast<long>(lua_tonumber(L, idx)); }
inline unsigned long Get(TypeWrapper<unsigned long>, lua_State* L, int idx)
{ return static_cast<unsigned long>(lua_tonumber(L, idx)); }
inline float Get(TypeWrapper<float>, lua_State* L, int idx)
{ return static_cast<float>(lua_tonumber(L, idx)); }
inline double Get(TypeWrapper<double>, lua_State* L, int idx)
{ return static_cast<double>(lua_tonumber(L, idx)); }
inline const char* Get(TypeWrapper<const char*>, lua_State* L, int idx)
{ return static_cast<const char*>(lua_tostring(L, idx)); }
inline LuaNil Get(TypeWrapper<LuaNil>, lua_State* L, int idx)
{ (void)L, (void)idx; return LuaNil(); }
inline lua_CFunction Get(TypeWrapper<lua_CFunction>, lua_State* L, int idx)
{ return static_cast<lua_CFunction>(lua_tocfunction(L, idx)); }
inline void* Get(TypeWrapper<void*>, lua_State* L, int idx)
{ return static_cast<void*>(lua_touserdata(L, idx)); }
inline lua_State* Get(TypeWrapper<lua_State*>, lua_State* L, int /*idx*/)
{ return L; }
inline INT64 Get(TypeWrapper<INT64>, lua_State* L, int idx)
{
void * pData=lua_touserdata(L, idx);
if(pData)
{
return *(static_cast<INT64 *>(pData));
}
else
{
return static_cast<INT64>(lua_tonumber(L, idx));
}
}
inline UINT64 Get(TypeWrapper<UINT64>, lua_State* L, int idx)
{
void * pData=lua_touserdata(L, idx);
if(pData)
{
return *(static_cast<UINT64 *>(pData));
}
else
{
return static_cast<UINT64>(lua_tonumber(L, idx));
}
}
inline LuaDAMAGE_INFO Get(TypeWrapper<LuaDAMAGE_INFO>, lua_State* L, int idx)
{
void * pData=lua_touserdata(L, idx);
if(pData)
{
return *(static_cast<LuaDAMAGE_INFO *>(pData));
}
else
{
return LuaDAMAGE_INFO();
}
}
inline LuaSKILL_EFFECT_DATA Get(TypeWrapper<LuaSKILL_EFFECT_DATA>, lua_State* L, int idx)
{
void * pData=lua_touserdata(L, idx);
if(pData)
{
return *(static_cast<LuaSKILL_EFFECT_DATA *>(pData));
}
else
{
return LuaSKILL_EFFECT_DATA();
}
}
inline CLuaTable Get(TypeWrapper<CLuaTable>, lua_State* L, int idx)
{
CLuaTable LuaTable;
/* table 放在索引 'idx' 处 */
lua_pushnil(L); /* 第一个 key */
while (lua_next(L, idx) != 0)
{
/* 用一下 'key' (在索引 -2 处) 和 'value' (在索引 -1 处) */
if(lua_type(L, -2)==LUA_TNUMBER)
{
LuaTableElement Element;
Element.KeyType=LUA_TNUMBER;
Element.NumberKey=lua_tonumber(L, -2);
if(lua_type(L, -1)==LUA_TNUMBER)
{
Element.ValueType=LUA_TNUMBER;
Element.NumberValue=lua_tonumber(L, -1);
LuaTable.Add(Element);
}
else if(lua_type(L, -1)==LUA_TSTRING)
{
Element.ValueType=LUA_TNUMBER;
Element.StrValue=lua_tostring(L, -1);
LuaTable.Add(Element);
}
else
{
luaL_typerror(L,-1,"number or string");
}
}
else if(lua_type(L, -2)==LUA_TSTRING)
{
LuaTableElement Element;
Element.KeyType=LUA_TSTRING;
Element.StrKey=lua_tostring(L, -2);
if(lua_type(L, -1)==LUA_TNUMBER)
{
Element.ValueType=LUA_TNUMBER;
Element.NumberValue=lua_tonumber(L, -1);
LuaTable.Add(Element);
}
else if(lua_type(L, -1)==LUA_TSTRING)
{
Element.ValueType=LUA_TNUMBER;
Element.StrValue=lua_tostring(L, -1);
LuaTable.Add(Element);
}
else
{
luaL_typerror(L,-1,"number or string");
}
}
else
{
luaL_typerror(L,-2,"number or string");
}
lua_pop(L, 1);
}
return LuaTable;
}
//////////////////////////////////////////////////////////////////////////
#define luaL_argassert(arg, _index_) if (!Match(TypeWrapper<P##arg>(), L, _index_)) \
luaL_argerror(L, _index_, "bad argument")
template<class RT>
struct ReturnSpecialization
{
static int Call(RT (*func)(CLuaThread *), lua_State* L, int /*index*/,CLuaThread * pThreadInfo)
{
return func(pThreadInfo);
// RT ret = func();
// Push(L, ret);
// return 1;
}
template <typename P1>
static int Call(RT (*func)(CLuaThread *,P1), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0)
);
//RT ret = func(
// Get(TypeWrapper<P1>(), L, index + 0)
//);
//Push(L, ret);
//return 1;
}
template <typename P1, typename P2>
static int Call(RT (*func)(CLuaThread *,P1, P2), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1)
);
//RT ret = func(
// Get(TypeWrapper<P1>(), L, index + 0),
// Get(TypeWrapper<P2>(), L, index + 1)
//);
//Push(L, ret);
//return 1;
}
template <typename P1, typename P2, typename P3>
static int Call(RT (*func)(CLuaThread *,P1, P2, P3), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2)
);
//RT ret = func(
// Get(TypeWrapper<P1>(), L, index + 0),
// Get(TypeWrapper<P2>(), L, index + 1),
// Get(TypeWrapper<P3>(), L, index + 2)
//);
//Push(L, ret);
//return 1;
}
template <typename P1, typename P2, typename P3, typename P4>
static int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3)
);
//RT ret = func(
// Get(TypeWrapper<P1>(), L, index + 0),
// Get(TypeWrapper<P2>(), L, index + 1),
// Get(TypeWrapper<P3>(), L, index + 2),
// Get(TypeWrapper<P4>(), L, index + 3)
//);
//Push(L, ret);
//return 1;
}
template <typename P1, typename P2, typename P3, typename P4,
typename P5>
static int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4)
);
//RT ret = func(
// Get(TypeWrapper<P1>(), L, index + 0),
// Get(TypeWrapper<P2>(), L, index + 1),
// Get(TypeWrapper<P3>(), L, index + 2),
// Get(TypeWrapper<P4>(), L, index + 3),
// Get(TypeWrapper<P5>(), L, index + 4)
//);
//Push(L, ret);
//return 1;
}
template <typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6>
static int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5)
);
//RT ret = func(
// Get(TypeWrapper<P1>(), L, index + 0),
// Get(TypeWrapper<P2>(), L, index + 1),
// Get(TypeWrapper<P3>(), L, index + 2),
// Get(TypeWrapper<P4>(), L, index + 3),
// Get(TypeWrapper<P5>(), L, index + 4),
// Get(TypeWrapper<P6>(), L, index + 5)
//);
//Push(L, ret);
//return 1;
}
template <typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6, typename P7>
static int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6)
);
//RT ret = func(
// Get(TypeWrapper<P1>(), L, index + 0),
// Get(TypeWrapper<P2>(), L, index + 1),
// Get(TypeWrapper<P3>(), L, index + 2),
// Get(TypeWrapper<P4>(), L, index + 3),
// Get(TypeWrapper<P5>(), L, index + 4),
// Get(TypeWrapper<P6>(), L, index + 5),
// Get(TypeWrapper<P7>(), L, index + 6)
//);
//Push(L, ret);
//return 1;
}
template <typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6, typename P7, typename P8>
static int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7)
);
}
template <typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6, typename P7, typename P8, typename P9>
static int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8)
);
}
template <typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
static int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
luaL_argassert(10, index + 9);
return func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8),
Get(TypeWrapper<P10>(), L, index + 9)
);
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
template <typename Callee>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *), lua_State* L, int /*index*/,CLuaThread * pThreadInfo)
{
RT ret = (RT)(callee.*func)(pThreadInfo);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee,typename P1>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
RT ret = (RT)(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
RT ret = (RT)(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
RT ret = (callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
RT ret = (callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
RT ret = (callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
RT ret = (callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
RT ret = (callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
RT ret = (callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
RT ret = (callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
static int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
luaL_argassert(10, index + 9);
RT ret = (callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8),
Get(TypeWrapper<P10>(), L, index + 9)
);
if (ret == -1) return -1;
Push(L, ret);
return 1;
}
};
template<>
struct ReturnSpecialization<void>
{
static int Call(void (*func)(CLuaThread *), lua_State* L, int /*index*/,CLuaThread * pThreadInfo)
{
(void)L;
func(pThreadInfo);
return 0;
}
template <typename P1>
static int Call(void (*func)(CLuaThread *,P1), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0)
);
return 0;
}
template <typename P1, typename P2>
static int Call(void (*func)(CLuaThread *,P1, P2), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1)
);
return 0;
}
template <typename P1, typename P2, typename P3>
static int Call(void (*func)(CLuaThread *,P1, P2, P3), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2)
);
return 0;
}
template <typename P1, typename P2, typename P3, typename P4>
static int Call(void (*func)(CLuaThread *,P1, P2, P3, P4), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3)
);
return 0;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5>
static int Call(void (*func)(CLuaThread *,P1, P2, P3, P4, P5), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4)
);
return 0;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
static int Call(void (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5)
);
return 0;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
static int Call(void (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6)
);
return 0;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
static int Call(void (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7)
);
return 0;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
static int Call(void (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8)
);
return 0;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
static int Call(void (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
luaL_argassert(10, index + 9);
func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8),
Get(TypeWrapper<P10>(), L, index + 9)
);
return 0;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
template <typename Callee>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *), lua_State* /*L*/, int /*index*/,CLuaThread * pThreadInfo)
{
(callee.*func)(pThreadInfo);
return 0;
}
template <typename Callee, typename P1>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0)
);
return 0;
}
template <typename Callee, typename P1, typename P2>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1, P2), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1)
);
return 0;
}
template <typename Callee, typename P1, typename P2, typename P3>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1, P2, P3), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2)
);
return 0;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1, P2, P3, P4), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3)
);
return 0;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4)
);
return 0;
}
template <typename Callee,typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5)
);
return 0;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6)
);
return 0;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7)
);
return 0;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8)
);
return 0;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
static int Call(Callee& callee, void (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
luaL_argassert(10, index + 9);
(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8),
Get(TypeWrapper<P10>(), L, index + 9)
);
return 0;
}
};
template<>
struct ReturnSpecialization<const char *>
{
static int Call(const char * (*func)(CLuaThread *), lua_State* L, int /*index*/,CLuaThread * pThreadInfo)
{
(void)L;
const char * ret=func(pThreadInfo);
Push(L, ret);
return 1;
}
template <typename P1>
static int Call(const char * (*func)(CLuaThread *,P1), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0)
);
Push(L, ret);
return 1;
}
template <typename P1, typename P2>
static int Call(const char * (*func)(CLuaThread *,P1, P2), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1)
);
Push(L, ret);
return 1;
}
template <typename P1, typename P2, typename P3>
static int Call(const char * (*func)(CLuaThread *,P1, P2, P3), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2)
);
Push(L, ret);
return 1;
}
template <typename P1, typename P2, typename P3, typename P4>
static int Call(const char * (*func)(CLuaThread *,P1, P2, P3, P4), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3)
);
Push(L, ret);
return 1;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5>
static int Call(const char * (*func)(CLuaThread *,P1, P2, P3, P4, P5), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4)
);
Push(L, ret);
return 1;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
static int Call(const char * (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5)
);
Push(L, ret);
return 1;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
static int Call(const char * (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6)
);
Push(L, ret);
return 1;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
static int Call(const char * (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7)
);
Push(L, ret);
return 1;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
static int Call(const char * (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8)
);
Push(L, ret);
return 1;
}
template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
static int Call(const char * (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
luaL_argassert(10, index + 9);
const char * ret=func(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8),
Get(TypeWrapper<P10>(), L, index + 9)
);
Push(L, ret);
return 1;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
template <typename Callee>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *), lua_State* L, int /*index*/,CLuaThread * pThreadInfo)
{
const char * ret=(callee.*func)(pThreadInfo);
Push(L, ret);
return 1;
}
template <typename Callee,typename P1>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0)
);
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1, P2), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1)
);
Push(L, ret);
return 1;
}
template <typename Callee,typename P1, typename P2, typename P3>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1, P2, P3), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2)
);
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1, P2, P3, P4), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3)
);
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4)
);
Push(L, ret);
return 1;
}
template <typename Callee, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5)
);
Push(L, ret);
return 1;
}
template <typename Callee,typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6)
);
Push(L, ret);
return 1;
}
template <typename Callee,typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7)
);
Push(L, ret);
return 1;
}
template <typename Callee,typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8)
);
Push(L, ret);
return 1;
}
template <typename Callee,typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
static int Call(Callee& callee, const char * (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), lua_State* L, int index,CLuaThread * pThreadInfo)
{
luaL_argassert(1, index + 0);
luaL_argassert(2, index + 1);
luaL_argassert(3, index + 2);
luaL_argassert(4, index + 3);
luaL_argassert(5, index + 4);
luaL_argassert(6, index + 5);
luaL_argassert(7, index + 6);
luaL_argassert(8, index + 7);
luaL_argassert(9, index + 8);
luaL_argassert(10, index + 9);
const char * ret=(callee.*func)(pThreadInfo,
Get(TypeWrapper<P1>(), L, index + 0),
Get(TypeWrapper<P2>(), L, index + 1),
Get(TypeWrapper<P3>(), L, index + 2),
Get(TypeWrapper<P4>(), L, index + 3),
Get(TypeWrapper<P5>(), L, index + 4),
Get(TypeWrapper<P6>(), L, index + 5),
Get(TypeWrapper<P7>(), L, index + 6),
Get(TypeWrapper<P8>(), L, index + 7),
Get(TypeWrapper<P9>(), L, index + 8),
Get(TypeWrapper<P10>(), L, index + 9)
);
Push(L, ret);
return 1;
}
};
template <typename RT>
int Call(RT (*func)(CLuaThread *), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT, typename P1>
int Call(RT (*func)(CLuaThread *,P1), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT, typename P1, typename P2>
int Call(RT (*func)(CLuaThread *,P1, P2), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT, typename P1, typename P2, typename P3>
int Call(RT (*func)(CLuaThread *,P1, P2, P3), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT, typename P1, typename P2, typename P3, typename P4>
int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT,typename P1, typename P2, typename P3, typename P4,
typename P5>
int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT, typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6>
int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT,typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6, typename P7>
int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT,typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6, typename P7, typename P8>
int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT,typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6, typename P7, typename P8, typename P9>
int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename RT,typename P1, typename P2, typename P3, typename P4,
typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
int Call(RT (*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(func, L, index,pThreadInfo);
}
template <typename Callee, typename RT>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1, typename P2>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1, typename P2, typename P3>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1, typename P2, typename P3,
typename P4>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1, typename P2, typename P3,
typename P4, typename P5>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8, typename P9>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
template <typename Callee, typename RT, typename P1, typename P2, typename P3,
typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10>
int Call(Callee& callee, RT (Callee::*func)(CLuaThread *,P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), lua_State* L, int index,CLuaThread * pThreadInfo)
{
return ReturnSpecialization<RT>::Call(callee, func, L, index,pThreadInfo);
}
inline unsigned char* GetFirstUpValueAsUserData(lua_State* L)
{
void* buffer;
#ifndef FAST_DISPATCH
buffer = lua_touserdata(L, lua_upvalueindex(1));
#else // FAST_DISPATCH
#endif // FAST_DISPATCH
return (unsigned char*)buffer;
}
// The Helper class is needed for less fortunate compiler template implementations.
template <typename Func>
class DirectCallFunctionDispatchHelper
{
public:
static inline int DirectCallFunctionDispatcher(lua_State* L)
{
unsigned char* buffer = GetFirstUpValueAsUserData(L);
return Call(*(Func*)(buffer), L, 1);
}
};
template <typename Callee, typename Func>
class DirectCallMemberDispatcherHelper
{
public:
static inline int DirectCallMemberDispatcher(lua_State* L)
{
unsigned char* buffer = GetFirstUpValueAsUserData(L);
return Call(**(Callee**)buffer, *(Func*)(buffer + sizeof(Callee*)), L, 1);
}
};
inline int lua_StateFunctionDispatcher(lua_State* L)
{
typedef int (*Functor)(lua_State*);
unsigned char* buffer = GetFirstUpValueAsUserData(L);
Functor& func = *(Functor*)(buffer);
return (*func)(L);
}
template <typename Callee>
class lua_StateMemberDispatcherHelper
{
public:
static inline int lua_StateMemberDispatcher(lua_State* L)
{
typedef int (Callee::*Functor)(lua_State*);
unsigned char* buffer = GetFirstUpValueAsUserData(L);
Callee& callee = **(Callee**)buffer;
Functor& func = *(Functor*)(buffer + sizeof(Callee*));
return (callee.*func)(L);
}
};
} // namespace LPCD
template <typename Func>
inline void lua_pushdirectclosure(lua_State* L, Func func, unsigned int nupvalues)
{
unsigned char* buffer = (unsigned char*)lua_newuserdata(L, sizeof(func));
memcpy(buffer, &func, sizeof(func));
lua_pushcclosure(L, LPCD::DirectCallFunctionDispatchHelper<Func>::DirectCallFunctionDispatcher, nupvalues + 1);
}
template <typename Callee, typename Func>
inline void lua_pushdirectclosure(lua_State* L, const Callee& callee, Func func, unsigned int nupvalues)
{
unsigned char* buffer = (unsigned char*)lua_newuserdata(L, sizeof(Callee*) + sizeof(func));
const void* pCallee = &callee;
memcpy(buffer, &pCallee, sizeof(Callee*));
memcpy(buffer + sizeof(Callee*), &func, sizeof(func));
lua_pushcclosure(L, LPCD::DirectCallMemberDispatcherHelper<Callee, Func>::DirectCallMemberDispatcher, nupvalues + 1);
}
inline void lua_pushfunctorclosure(lua_State* L, int (*func)(lua_State*), unsigned int nupvalues)
{
unsigned char* buffer = (unsigned char*)lua_newuserdata(L, sizeof(func));
memcpy(buffer, &func, sizeof(func));
lua_pushcclosure(L, LPCD::lua_StateFunctionDispatcher, nupvalues + 1);
}
template <typename Callee>
inline void lua_pushfunctorclosureex(lua_State* L, const Callee& callee, int (Callee::*func)(lua_State*), unsigned int nupvalues)
{
unsigned char* buffer = (unsigned char*)lua_newuserdata(L, sizeof(Callee*) + sizeof(func));
const void* pCallee = &callee;
memcpy(buffer, &pCallee, sizeof(Callee*));
memcpy(buffer + sizeof(Callee*), &func, sizeof(func));
lua_pushcclosure(L, LPCD::lua_StateMemberDispatcherHelper<Callee>::lua_StateMemberDispatcher, nupvalues + 1);
}
///////////////////////////////////////////////////////////////////////////////
#include "src/lobject.h"
#include "src/ldo.h"
#include "src/lgc.h"
namespace LPCD
{
inline void* GetObjectUserData1(lua_State* L)
{
StkId o = restorestack(L, sizeof(TValue));
if (ttype(o) == LUA_TUSERDATA)
return *(void**)(rawuvalue(o) + 1);
else
{
luaL_argerror(L, 1, "must be userdata or a table with a userdata member called __object");
}
return NULL;
}
inline void* GetObjectUserData2(lua_State* L)
{
StkId o = restorestack(L, sizeof(TValue)*2);
if (ttype(o) == LUA_TUSERDATA)
return *(void**)(rawuvalue(o) + 1);
else
{
luaL_argerror(L, 1, "must be userdata or a table with a userdata member called __object");
}
return NULL;
}
inline void* GetObjectIndexData1(lua_State* L)
{
StkId o = restorestack(L, sizeof(TValue));
if (ttype(o) == LUA_TLIGHTUSERDATA)
return pvalue(o);
else
{
luaL_argerror(L, 1, "must be userdata or a table with a userdata member called __object");
}
return NULL;
}
inline void* GetObjectIndexData2(lua_State* L)
{
StkId o = restorestack(L, sizeof(TValue) * 2);
if (ttype(o) == LUA_TLIGHTUSERDATA)
return pvalue(o);
else
{
luaL_argerror(L, 1, "must be userdata or a table with a userdata member called __object");
}
return NULL;
}
template <typename Callee>
class Object_MemberDispatcherHelper
{
public:
static inline int Object_MemberDispatcher(lua_State* L)
{
typedef int (Callee::*Functor)(lua_State*);
unsigned char* buffer = GetFirstUpValueAsUserData(L);
Functor& func = *(Functor*)(buffer);
Callee& callee = *(Callee*)GetObjectUserData1(L);
return (callee.*func)(L);
}
};
template <typename Callee, typename Func, int startIndex>
class DirectCallObjectMemberDispatcherHelper
{
public:
static inline int DirectCallMemberDispatcher(lua_State* L)
{
unsigned char* buffer = GetFirstUpValueAsUserData(L);
Callee *callee = dynamic_cast<Callee *>((CBaseScriptHost *)GetObjectIndexData1(L));
CLuaThread * pThreadInfo=(CLuaThread*)GetObjectIndexData2(L);
if(callee)
return Call(*callee, *(Func*)buffer, L, startIndex,pThreadInfo);
else
return 0;
}
};
inline int PropertyMetaTable_newindex(lua_State* L)
{
// t k v
lua_getmetatable(L, 1); // t k v m
lua_pushstring(L, "__props"); // t k v m p
lua_rawget(L, -2); // t k v m pt
if (lua_istable(L, -1))
{
lua_pushvalue(L, 2); // t k v m pt k
lua_rawget(L, -2); // t k v m pt prop
if (lua_isnil(L, -1))
{
luaL_argerror(L, 1, "The property is not available.");
}
lua_rawgeti(L, -1, 2); // t k v m pt prop setf
lua_pushvalue(L, 1); // t k v m pt prop setf t
lua_pushvalue(L, 3); // t k v m pt prop setf t v
lua_call(L, 2, 1);
return 1;
}
return 0;
}
// function gettable_event (table, key)
inline int PropertyMetaTable_index(lua_State* L)
{
// t v
lua_getmetatable(L, 1); // t v m
lua_pushvalue(L, 2); // t v m v
lua_rawget(L, -2); // t v m lookup
if (!lua_isnil(L, -1))
return 1;
lua_pop(L, 1); // t v m
lua_pushstring(L, "__props"); // t k v m __props
lua_rawget(L, -2); // t k v m pt
if (lua_istable(L, -1))
{
lua_pushvalue(L, 2); // t k v m pt k
lua_rawget(L, -2); // t k v m pt prop
if (lua_isnil(L, -1))
{
luaL_argerror(L, 1, "The property is not available.");
}
lua_rawgeti(L, -1, 1); // t k v m pt prop getf
lua_pushvalue(L, 1); // t k v m pt prop getf t
lua_call(L, 1, 1);
return 1;
}
return 0;
}
template <typename Object, typename VarType>
class PropertyMemberHelper
{
public:
static int PropertyGet(lua_State* L)
{
void* offset = lua_touserdata(L, lua_upvalueindex(1));
Object* obj = (Object*)LPCD::GetObjectUserData(L);
LPCD::Push(L, *(VarType*)((unsigned char*)obj + (unsigned int)offset));
return 1;
}
static int PropertySet(lua_State* L)
{
void* offset = lua_touserdata(L, lua_upvalueindex(1));
Object* obj = (Object*)LPCD::GetObjectUserData(L);
if (!Match(TypeWrapper<VarType>(), L, 2))
luaL_argerror(L, 2, "bad argument");
*(VarType*)((unsigned char*)obj + (unsigned int)offset) = LPCD::Get(LPCD::TypeWrapper<VarType>(), L, 2);
return 1;
}
};
template <typename VarType>
class PropertyGlobalHelper
{
public:
static int PropertyGet(lua_State* L)
{
void* offset = lua_touserdata(L, lua_upvalueindex(1));
LPCD::Push(L, *(VarType*)offset);
return 1;
}
static int PropertySet(lua_State* L)
{
void* offset = lua_touserdata(L, lua_upvalueindex(1));
if (!Match(TypeWrapper<VarType>(), L, 1))
luaL_argerror(L, 2, "bad argument");
*(VarType*)offset = LPCD::Get(LPCD::TypeWrapper<VarType>(), L, 1);
return 1;
}
};
} // namespace LPCD
template <typename Callee>
inline void lua_pushobjectfunctorclosure(lua_State* L, int (Callee::*func)(lua_State*), unsigned int nupvalues)
{
unsigned char* buffer = (unsigned char*)lua_newuserdata(L, sizeof(func));
memcpy(buffer, &func, sizeof(func));
lua_pushcclosure(L, LPCD::Object_MemberDispatcherHelper<Callee>::Object_MemberDispatcher, nupvalues + 1);
}
template <typename Callee, typename Func>
inline void lua_pushobjectdirectclosure(lua_State* L, const Callee* callee, Func func, unsigned int nupvalues)
{
unsigned char* buffer = (unsigned char*)lua_newuserdata(L, sizeof(func));
memcpy(buffer, &func, sizeof(func));
lua_pushcclosure(L, LPCD::DirectCallObjectMemberDispatcherHelper<Callee, Func, 2>::DirectCallMemberDispatcher, nupvalues + 1);
}
template <typename Object, typename VarType>
inline void lpcd_pushmemberpropertygetclosure(lua_State* L, VarType Object::* var)
{
lua_pushlightuserdata(L, (void*)&(((Object*)0)->*var));
lua_pushcclosure(L, &LPCD::PropertyMemberHelper<Object, VarType>::PropertyGet, 1);
}
template <typename Object, typename VarType>
inline void lpcd_pushmemberpropertysetclosure(lua_State* L, VarType Object::* var)
{
lua_pushlightuserdata(L, (void*)&(((Object*)0)->*var));
lua_pushcclosure(L, &LPCD::PropertyMemberHelper<Object, VarType>::PropertySet, 1);
}
template <typename VarType>
inline void lpcd_pushglobalpropertygetclosure(lua_State* L, VarType* var)
{
lua_pushlightuserdata(L, (void*)var);
lua_pushcclosure(L, &LPCD::PropertyGlobalHelper<VarType>::PropertyGet, 1);
}
template <typename VarType>
inline void lpcd_pushglobalpropertysetclosure(lua_State* L, VarType* var)
{
lua_pushlightuserdata(L, (void*)var);
lua_pushcclosure(L, &LPCD::PropertyGlobalHelper<VarType>::PropertySet, 1);
}
namespace LPCD
{
}
| [
"sagasarate@sina.com"
] | sagasarate@sina.com |
a0b879eaac808759c4a452c321f321ff78441876 | 260e5dec446d12a7dd3f32e331c1fde8157e5cea | /Indi/SDK/Indi_ECell_Volatile_Ammo_classes.hpp | 9b1b5b6c9857b31625c79fd32337b2a772b79cac | [] | no_license | jfmherokiller/TheOuterWorldsSdkDump | 6e140fde4fcd1cade94ce0d7ea69f8a3f769e1c0 | 18a8c6b1f5d87bb1ad4334be4a9f22c52897f640 | refs/heads/main | 2023-08-30T09:27:17.723265 | 2021-09-17T00:24:52 | 2021-09-17T00:24:52 | 407,437,218 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 680 | hpp | #pragma once
// TheOuterWorlds SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "Indi_ECell_Volatile_Ammo_structs.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass ECell_Volatile_Ammo.ECell_Volatile_Ammo_C
// 0x0000 (0x01A0 - 0x01A0)
class UECell_Volatile_Ammo_C : public UAmmo
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass ECell_Volatile_Ammo.ECell_Volatile_Ammo_C");
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"peterpan0413@live.com"
] | peterpan0413@live.com |
3ed14bcbcf82583d529ba555ba040785244bdab9 | 6ad82a98f6e1caf44420138d0f3ab908616d4a6f | /linked-lists-lcmartinez45-master/data.h | ecd57c982820538498e9134f6301c75f718d20cb | [] | no_license | lcmartinez45/C | 15253cb4346d0c682e5247a902ebb1bdc152acc9 | 62433bac97e7963d23716ca9fb94af80177e2d8e | refs/heads/main | 2023-03-03T14:05:30.416270 | 2021-02-12T02:10:27 | 2021-02-12T02:10:27 | 338,188,237 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 319 | h | /*
* File: data.h
* Author: Alex Katrompas
*
* DO NOT MODIFY THIS FILE
* LEAVE THIS COMMENT HEADER HERE
*/
#ifndef DATA_H
#define DATA_H
#include "string"
using std::string;
struct Data {
int id;
string data;
};
struct Node {
Data data;
Node *next;
Node *prev;
};
#endif /* DATA_H */
| [
"noreply@github.com"
] | noreply@github.com |
13b28700dd13c81521f942eecfb2f6515e3df15b | 7b5246121403301ac26a583127238f5922ea3fa0 | /src/main.cpp | 054d923fdf4e8e9252b3b7ded5e15e84e4b88b4d | [] | no_license | jediofgever/ROS_maskrcnn_openvino | ba250a8e3cbc1e299479aea25efcb545be719139 | 42cfed4f8c34020d164b9f29bd4021f95e18c5da | refs/heads/master | 2022-12-01T14:23:36.485937 | 2020-08-19T09:33:46 | 2020-08-19T09:33:46 | 284,934,724 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,254 | cpp | // Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
/**
* @brief The entry point for inference engine Mask RCNN demo application
* @file mask_rcnn_demo/main.cpp
* @example mask_rcnn_demo/main.cpp
*/
#include <cv_bridge/cv_bridge.h>
#include <ros/package.h>
#include <ros/ros.h>
#include <opencv2/opencv.hpp>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <inference_engine.hpp>
#include "openvino_maskrcnn_inference/common.hpp"
#include "openvino_maskrcnn_inference/ocv_common.hpp"
#define RESET "\033[0m"
#define BLACK "\033[30m" /* Black */
#define RED "\033[31m" /* Red */
#define GREEN "\033[32m" /* Green */
#define YELLOW "\033[33m" /* Yellow */
#define BLUE "\033[34m" /* Blue */
class MaskRCNNInferenceOpenvino {
private:
ros::Subscriber rgb_img_sub_;
ros::Publisher segmentd_img_pub_;
ros::NodeHandle *nh_;
InferenceEngine::Core ie;
InferenceEngine::InputsDataMap inputInfo;
InferenceEngine::CNNNetwork network;
InferenceEngine::ExecutableNetwork executable_network;
InferenceEngine::InferRequest infer_request;
size_t netBatchSize;
size_t netInputHeight;
size_t netInputWidth;
std::string detection_out_name;
public:
MaskRCNNInferenceOpenvino(ros::NodeHandle *nh_ptr_);
~MaskRCNNInferenceOpenvino();
void callBack(const sensor_msgs::ImageConstPtr &msg);
};
MaskRCNNInferenceOpenvino::MaskRCNNInferenceOpenvino(ros::NodeHandle *nh_ptr_) : nh_(nh_ptr_) {
std::cout << "InferenceEngine: " << InferenceEngine::GetInferenceEngineVersion() << std::endl;
/** Read network model **/
std::string this_package_path = ros::package::getPath("openvino_maskrcnn_inference");
std::string network_path = this_package_path + "/maksrcnn_mo/frozen_inference_graph.xml";
network = ie.ReadNetwork(network_path.c_str());
// add DetectionOutput layer as output so we can get detected boxes and their
// probabilities
detection_out_name = "reshape_do_2d";
network.addOutput(detection_out_name.c_str(), 0);
/** Taking information about all topology inputs **/
inputInfo = network.getInputsInfo();
// -----------------------------Prepare input
// blobs-----------------------------------------------------
std::cout << "Preparing input blobs" << std::endl;
std::string imageInputName;
for (const auto &inputInfoItem : inputInfo) {
if (inputInfoItem.second->getTensorDesc().getDims().size() == 4) { // first input contains images
imageInputName = inputInfoItem.first;
inputInfoItem.second->setPrecision(InferenceEngine::Precision::U8);
} else if (inputInfoItem.second->getTensorDesc().getDims().size() == 2) { // second input contains image info
inputInfoItem.second->setPrecision(InferenceEngine::Precision::FP32);
} else {
throw std::logic_error("Unsupported input shape with size = " + std::to_string(inputInfoItem.second->getTensorDesc().getDims().size()));
}
}
/** network dimensions for image input **/
const InferenceEngine::TensorDesc &inputDesc = inputInfo[imageInputName]->getTensorDesc();
IE_ASSERT(inputDesc.getDims().size() == 4);
netBatchSize = getTensorBatch(inputDesc);
netInputHeight = getTensorHeight(inputDesc);
netInputWidth = getTensorWidth(inputDesc);
// -------------------------Load model to the
// device----------------------------------------------------
std::cout << "Loading model to the device" << std::endl;
executable_network = ie.LoadNetwork(network, "CPU");
// -------------------------Create Infer
// Request--------------------------------------------------------
std::cout << "Create infer request" << std::endl;
infer_request = executable_network.CreateInferRequest();
rgb_img_sub_ = nh_->subscribe("/camera/color/image_raw", 1, &MaskRCNNInferenceOpenvino::callBack, this);
segmentd_img_pub_ = nh_->advertise<sensor_msgs::Image>("/output/maskrcnn/segmented", 1);
}
MaskRCNNInferenceOpenvino::~MaskRCNNInferenceOpenvino() {}
void MaskRCNNInferenceOpenvino::callBack(const sensor_msgs::ImageConstPtr &msg) {
std::cout << " \n" << std::endl;
cv_bridge::CvImagePtr cv_ptr;
try {
cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8);
} catch (cv_bridge::Exception &e) {
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
cv::Mat frame = cv_ptr->image;
try {
InferenceEngine::OutputsDataMap outputInfo(network.getOutputsInfo());
for (auto &item : outputInfo) {
item.second->setPrecision(InferenceEngine::Precision::FP32);
}
/** Iterate over all the input blobs **/
for (const auto &inputInfoItem : inputInfo) {
InferenceEngine::Blob::Ptr input = infer_request.GetBlob(inputInfoItem.first);
/** Fill first input tensor with images. First b channel, then g and r
* channels **/
if (inputInfoItem.second->getTensorDesc().getDims().size() == 4) {
/** Iterate over all input images **/
matU8ToBlob<unsigned char>(frame, input, 0);
}
/** Fill second input tensor with image info **/
if (inputInfoItem.second->getTensorDesc().getDims().size() == 2) {
InferenceEngine::LockedMemory<void> inputMapped = InferenceEngine::as<InferenceEngine::MemoryBlob>(input)->wmap();
auto data = inputMapped.as<float *>();
data[0] = static_cast<float>(netInputHeight); // height
data[1] = static_cast<float>(netInputWidth); // width
data[2] = 1;
}
}
// ----------------------------Do
// inference-------------------------------------------------------------
infer_request.Infer();
// -----------------------------------------------------------------------------------------------------
// ---------------------------Postprocess output
// blobs--------------------------------------------------
const auto do_blob = infer_request.GetBlob(detection_out_name.c_str());
InferenceEngine::LockedMemory<const void> doBlobMapped = InferenceEngine::as<InferenceEngine::MemoryBlob>(do_blob)->rmap();
const auto do_data = doBlobMapped.as<float *>();
std::string masks_name = "masks";
const auto masks_blob = infer_request.GetBlob(masks_name.c_str());
InferenceEngine::LockedMemory<const void> masksBlobMapped = InferenceEngine::as<InferenceEngine::MemoryBlob>(masks_blob)->rmap();
const auto masks_data = masksBlobMapped.as<float *>();
const float PROBABILITY_THRESHOLD = 0.2f;
const float MASK_THRESHOLD = 0.5f; // threshold used to determine whether mask pixel corresponds to
// object or to background
// amount of elements in each detected box description (batch, label, prob,
// x1, y1, x2, y2)
IE_ASSERT(do_blob->getTensorDesc().getDims().size() == 2);
size_t BOX_DESCRIPTION_SIZE = do_blob->getTensorDesc().getDims().back();
const InferenceEngine::TensorDesc &masksDesc = masks_blob->getTensorDesc();
IE_ASSERT(masksDesc.getDims().size() == 4);
size_t BOXES = getTensorBatch(masksDesc);
size_t C = getTensorChannels(masksDesc);
size_t H = getTensorHeight(masksDesc);
size_t W = getTensorWidth(masksDesc);
size_t box_stride = W * H * C;
std::map<size_t, size_t> class_color;
// cv::Mat output_image;
// output_image = frame.clone();
cv::Mat output_image(frame.rows, frame.cols, CV_8UC3, cv::Scalar(255, 255, 255));
std::vector<double> detection_box_areas;
/** Iterating over all boxes **/
int obj_index = 1;
for (size_t box = 0; box < BOXES; ++box) {
float *box_info = do_data + box * BOX_DESCRIPTION_SIZE;
auto batch = static_cast<int>(box_info[0]);
if (batch < 0) break;
if (batch >= static_cast<int>(netBatchSize)) throw std::logic_error("Invalid batch ID within detection output box");
float prob = box_info[2];
float x1 = std::min(std::max(0.0f, box_info[3] * frame.cols), static_cast<float>(frame.cols));
float y1 = std::min(std::max(0.0f, box_info[4] * frame.rows), static_cast<float>(frame.rows));
float x2 = std::min(std::max(0.0f, box_info[5] * frame.cols), static_cast<float>(frame.cols));
float y2 = std::min(std::max(0.0f, box_info[6] * frame.rows), static_cast<float>(frame.rows));
int box_width = std::min(static_cast<int>(std::max(0.0f, x2 - x1)), frame.cols);
int box_height = std::min(static_cast<int>(std::max(0.0f, y2 - y1)), frame.rows);
bool is_this_detection_duplicate = false;
double current_box_area = static_cast<double>(box_width * box_height);
for (size_t i = 0; i < detection_box_areas.size(); i++) {
double ratios = current_box_area / detection_box_areas.at(i);
if (ratios > 0.9 && ratios < 1.1) {
std::cout << RED << "FOUND DETECTIONS THAT LOOKS VERY SIMILAR IN SIZE THEY ARE LIKELY SAME OBJECT, GONNA PASS THIS" << std::endl;
std::cout << RESET << std::endl;
is_this_detection_duplicate = true;
continue;
}
}
if (is_this_detection_duplicate) {
continue;
}
detection_box_areas.push_back(static_cast<double>(box_width * box_height));
auto class_id = static_cast<size_t>(box_info[1] + 1e-6f);
if (prob > PROBABILITY_THRESHOLD) {
size_t color_index = class_color.emplace(class_id, class_color.size()).first->second;
auto &color = CITYSCAPES_COLORS[color_index % arraySize(CITYSCAPES_COLORS)];
float *mask_arr = masks_data + box_stride * box + H * W * (class_id - 1);
std::cout << "Detected class" << class_id << " with probability " << prob << " from batch " << batch << ": [" << x1 << ", " << y1 << "], ["
<< x2 << ", " << y2 << "]" << std::endl;
std::cout << "After mask_arr successfully !!" << std::endl;
cv::Mat mask_mat(H, W, CV_32FC1, mask_arr);
cv::Rect roi = cv::Rect(static_cast<int>(x1), static_cast<int>(y1), box_width, box_height);
cv::Mat roi_input_img = output_image(roi);
const float alpha = 1.0f;
cv::Mat resized_mask_mat(box_height, box_width, CV_32FC1);
cv::resize(mask_mat, resized_mask_mat, cv::Size(box_width, box_height));
cv::Mat uchar_resized_mask(box_height, box_width, CV_8UC3, cv::Scalar(40 * obj_index, 40 * obj_index, 30 * obj_index));
roi_input_img.copyTo(uchar_resized_mask, resized_mask_mat <= MASK_THRESHOLD);
cv::addWeighted(uchar_resized_mask, alpha, roi_input_img, 1.0f - alpha, 0.0f, roi_input_img);
// cv::rectangle(output_image, roi, cv::Scalar(color.blue() * box, color.green(), color.red()), -1);
obj_index++;
}
}
// Prepare and publish KITTI raw image
cv_bridge::CvImage cv_bridge_image;
cv_bridge_image.image = output_image;
cv_bridge_image.encoding = "bgr8";
cv_bridge_image.header.stamp = ros::Time::now();
segmentd_img_pub_.publish(cv_bridge_image.toImageMsg());
}
catch (const std::exception &error) {
std::cout << error.what() << std::endl;
return;
} catch (...) {
std::cout << "Unknown/internal exception happened." << std::endl;
return;
}
}
int main(int argc, char *argv[]) {
ros::init(argc, argv, "ros_maskrcnn_openvino_inference_node");
ros::NodeHandle nodeHandle;
MaskRCNNInferenceOpenvino maskRCNNInferenceOpenvino(&nodeHandle);
ros::spin();
return 0;
}
| [
"fetulahatas1@gmail.com"
] | fetulahatas1@gmail.com |
c70d0f96159a56d388dc2bfd41737d5614b25ba4 | e5a0891ab34c7f3d6c78aaa5c137ae7e44281b85 | /Strings/1234.cpp | 48cc86dde059bf7ce8343cd759370fddd7d55e49 | [] | no_license | toki-debug/URI | 406829bf3e5c74616bf5d51e0d4dff5fe6c90b18 | ae5995ab1149a786514b3ad1c25f2db2495a22e0 | refs/heads/master | 2023-06-17T23:46:52.893077 | 2021-06-23T13:07:10 | 2021-06-23T13:07:10 | 277,686,415 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 512 | cpp | //1234 - Dancing Sentence
//Arissa Yoshida
//14/05/2020
#include <bits/stdc++.h>
using namespace std;
main(){
string s;
while(getline(cin,s)){
int x=1;
for(int i=0;i<s.size();i++){
if((s[i]>=65&&s[i]<=122)){
x++;
if(x%2==0){
if(s[i]>=97&&s[i]<=122){
s[i] = s[i] - 32;
}
}else{
if(s[i]>=65&&s[i]<=90){
s[i] = s[i] + 32;
}
}
}
cout << s[i];
}
cout << "\n";
}
return 0;
}
| [
"toki.debug@gmail.com"
] | toki.debug@gmail.com |
140752fc9a870777692a28ef015a9b9dacad57af | fc1cf4c2bb7e066de2b5f14d157916c7303590fd | /Battleships/Battleships/Game.cpp | c9ae59e7d2cfedd2f259a375d8bfb1c2249177c0 | [] | no_license | Karl-jurvanen/Battleships | 045341d34c9693b50f52f5bf5324efe31fca1d80 | c7315dccbc3eac67ef2905eac3d46713a3dabcd0 | refs/heads/master | 2020-03-13T14:49:52.797267 | 2018-04-25T09:03:08 | 2018-04-25T09:03:08 | 131,166,099 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,759 | cpp | #include "Game.h"
#include <string>
#include <iostream>
#include <fstream>
#include <time.h>
#include <Windows.h>
using std::cout;
using std::cin;
using std::endl;
using std::getline;
using std::string;
using std::ofstream;
using std::ios;
Game::Game(): shipSizes_(4) ,board_()
{
srand(static_cast<unsigned int>(time(NULL)));
shipList_ = new int[4];
for (int i = 0; i < 4; i++)
{
shipList_[i] = 1;
}
gameOver_ = 1;
}
Game::Game(int boardsize, int shipList[], int shipSizes, int shipCount): shipSizes_(shipSizes), shipCount_(shipCount),
board_(boardsize, shipCount)
{
srand(static_cast<unsigned int>(time(NULL)));
shipList_ = new int[shipSizes_];
for (int i = 0; i < shipSizes_; i++)
{
shipList_[i] = shipList[i];
}
gameOver_ = 1;
}
Game::~Game()
{
delete[] shipList_;
}
void Game::addShips()
{
//step through shipList[] array that contains number of ships of each size that needs to be added to gameboard
//for example game with {1,2,3,4} ships has 1 five-length ship and 4 two-length ships
for (int i = 0; i < shipSizes_; i++)
{
for (int j = 0; j < shipList_[i]; j++)
{
while (true)
{
int sizeToAdd = shipSizes_ + 1 - i;
string message = ADD_SHIP_START;
string coordinate;
string direction;
//insert in the print out the correct word for ship size
switch (sizeToAdd)
{
case 2: cout << message.insert(5, "kahden");
break;
case 3: cout << message.insert(5, "kolmen");
break;
case 4: cout << message.insert(5, "neljan");
break;
case 5: cout << message.insert(5, "viiden");
break;
case 6: cout << message.insert(5, "kuuden");
break;
case 7: cout << message.insert(5, "seitseman");
break;
case 8: cout << message.insert(5, "kahdeksan");
break;
case 9: cout << message.insert(5, "yhdeksan");
break;
case 10: cout << message.insert(5, "kymmenen");
break;
case 11: cout << message.insert(5, "yhdentoista");
break;
case 12: cout << message.insert(5, "kahdentoista");
break;
case 13: cout << message.insert(5, "kolmentoista");
break;
default:
break;
}
getline(cin, coordinate);
cout << ADD_SHIP_DIR;
getline(cin, direction);
int result = board_.addShip(sizeToAdd, coordinate, direction);
//Check result, if not succesfull continue loop to ask user to try again
if (result == 0) //success
{
board_.printShips();
break;
}
else if (result == 1)
{
cout << BAD_DIRECTION;
}
else if (result == 2)
{
cout << SHIP_OUT_OF_BOUNDS;
}
else if (result == 3)
{
cout << SHIP_ALREADY_THERE;
}
}
}
}
//game can now be started
gameOver_ = 0;
}
void Game::addShipsRandom()
{
//use system time to generate random number
//cast to unsigned int to avoid build warnings
for (int i = 0; i < shipSizes_; i++)
{
for (int j = 0; j < shipList_[i]; j++)
{
while (true)
{
int sizeToAdd = shipSizes_ + 1 - i;
int x;
int y;
int dir;
string direction;
x = rand() % (board_.getBoardSize() );
y = rand() % (board_.getBoardSize() );
dir = rand() % 4;
switch (dir)
{
case 0: direction = "p";
break;
case 1: direction = "i";
break;
case 2: direction = "e";
break;
case 3: direction = "l";
break;
}
if (board_.addShip(sizeToAdd, x, y, direction) == 0)
{
break;
}
}
}
}
board_.printShips();
gameOver_ = 0;
}
void Game::shoot()
{
string input;
while (true)
{
//Skip printing shots if user asked for ship locations last to avoid double printing
if (input != "\\@")
{
board_.printShots();
}
cout << SHOOT_COORD;
getline(cin, input);
if (input == "")
{
cout << BAD_INPUT;
continue;
}
else if (input.at(0) == 'p' || input.at(0) == 'P')
{
break;
}
else if (input == "\\@")
{
board_.printShips();
continue;
}
string printout;
board_.shoot(input, printout);
cout << printout;
if (board_.checkGameOver())
{
board_.printShots();
cout << "Peli loppui.\n\n";
gameOver_ = 1;
break;
}
}
}
void Game::shootRandom()
{
//srand(static_cast<unsigned int>(time(NULL)));
int x;
int y;
board_.printShots();
while (true)
{
x = rand() % (board_.getBoardSize() );
y = rand() % (board_.getBoardSize() );
if (board_.shoot(x, y) != 3) // successfull shot
{
board_.printShots();
Sleep(500);
}
if (board_.checkGameOver())
{
board_.printShots();
cout << "Peli loppui.\n\n";
gameOver_ = 1;
break;
}
}
}
int Game::shootRandomStatistics()
{
int shotsTaken = 0; // keep track of number of shots
int x;
int y;
while (true)
{
x = rand() % (board_.getBoardSize());
y = rand() % (board_.getBoardSize());
if (board_.shoot(x, y) != 3) // successfull shot
{
shotsTaken++;
}
if (board_.checkGameOver())
{
gameOver_ = 1;
return shotsTaken;
}
}
}
int Game::shootAI()
{
int shotsTaken = 0; // keep track of number of shots
board_.printShots();
while (true)
{
int x = 0;
int y = 0;
board_.calculateValues(x, y);
if (board_.shoot(x, y) != 3) // successfull shot
{
system("cls");
board_.printShots();
shotsTaken++;
Sleep(500);
}
if (board_.checkGameOver())
{
board_.printShots();
cout << "Peli loppui.\n\n";
gameOver_ = 1;
return shotsTaken;
}
}
}
int Game::shootAIStatistics()
{
int shotsTaken = 0; // keep track of number of shots
while (true)
{
int x = 0;
int y = 0;
board_.calculateValues(x, y);
if (board_.shoot(x, y) != 3) // successfull shot
{
shotsTaken++;
}
if (board_.checkGameOver())
{
gameOver_ = 1;
return shotsTaken;
}
}
}
void Game::simulateShooting(int simulationtimes, string logfile)
{
ofstream statisticFile(logfile, ios::out);
const string menuText =
"Simulointi - Anna ampumisalgoritmi\n"
"=======================\n\n"
"Valinnat:\n"
"1) Satunnainen\n"
"2) algoritmi\n";
string userChoise;
cout << menuText;
getline(cin, userChoise);
if (!statisticFile)
{
cout << "File could not be opened" << endl;
return;
}
for (int i = 0; i < simulationtimes; i++)
{
board_.initialize();
addShipsRandom();
if (userChoise == "1")
{
statisticFile << shootRandomStatistics() << endl;
}
if (userChoise == "2")
{
statisticFile << shootAIStatistics() << endl;
}
}
return;
}
void Game::menu()
{
const string menuText =
"Laivanupotuspeli\n"
"=======================\n\n"
"Valinnat:\n"
"1) Syota laivat\n"
"2) Pelaa\n"
"3) Arvo sijainnit\n"
"4) Simuloi ampuminen\n"
"L) Lopeta\n\n"
"Valintasi: ";
string userChoise;
while (true)
{
cout << menuText;
getline(cin, userChoise);
if (userChoise == "1")
{
board_.initialize();
addShips();
}
else if (userChoise == "2")
{
//user has not placed the ships on gameboard yet, don't allow shooting
if (gameOver_ != 0)
{
cout << SHIPS_NOT_SET;
}
else
{
shoot();
}
}
else if (userChoise == "3")
{
board_.initialize();
addShipsRandom();
}
else if (userChoise == "4")
{
if (gameOver_ != 0)
{
cout << SHIPS_NOT_SET;
}
else
{
//shootRandom();
shootAI();
}
}
else if (userChoise == "5") // hidden statistical testing
{
cout << "Anna simulointikerrat: ";
getline(cin, userChoise);
int simulateTimes = 0;
try
{
simulateTimes = stoi(userChoise);
}
catch (const std::exception&)
{
cout << "Anna kokonaisluku." << endl;
}
simulateShooting(simulateTimes, "statistics.txt");
}
else if (userChoise == "L" || userChoise == "l")
{
break;
}
else
{
cout << "Virheellinen syote." << endl;
}
}
}
| [
"karl.jurvanen@eng.tamk.fi"
] | karl.jurvanen@eng.tamk.fi |
4e8f9daf30ae12e32817038f6ecdbb091b7a84aa | 62a572ff1fdea62c04d9c72fb41e35b9a1c4144a | /InternetButton/Button.ino | c108c5384b319750fceafd3a99c469ca0e569f9a | [] | no_license | AHerczeg/SET | cc56da7f82d640f8ecf2a6b93381962a25e0bcd5 | b9fa314096e5a3f0680971c78d64f43f320a7c8f | refs/heads/master | 2021-03-19T12:32:08.244389 | 2017-03-16T15:55:41 | 2017-03-16T15:55:41 | 80,115,634 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,002 | ino | #include "InternetButton.h"
#include "rest_client.h"
#define GREEN {0, 255, 0}
#define YELLOW {255, 255, 0}
#define RED {255, 0, 0}
#define BLUE {0, 0, 255}
#define WHITE {255, 255, 255}
#define LIGHTS_ON "/lights/on"
#define LIGHTS_OFF "/lights/off"
#define KETTLE_ON "/kettle/on"
#define KETTLE_OFF "/kettle/off"
InternetButton b = InternetButton();
RestClient client = RestClient("sccug-330-05.lancs.ac.uk",5000);
const char* path = "/button";
typedef struct {
uint8_t r;
uint8_t g;
uint8_t b;
} COLOUR;
COLOUR ledColour = {0, 0, 0};
int lightMode;
int brightness;
int lightSpeed;
// -- EXAMPLE code for demo --
COLOUR allColours[] = {RED, GREEN, BLUE, YELLOW, WHITE};
int currentColour = 0;
bool kettleMode = false;
bool bulbOn = true;
// ---------------------------
Thread* buttonThread;
Thread* blinkingThread;
Thread* serialThread;
os_thread_return_t serialListener(){
String buffer = "";
String tempStr = "";
for(;;){
if(Serial.available() > 0){
Serial.flush();
while (Serial.available() > 0) {
if(Serial.peek() != 10){
buffer = tempStr + buffer + (char)(Serial.read());
} else {Serial.read();}
}
Serial.println("Incoming serial: " + buffer);
if(buffer.compareTo("kettle") == 0){
kettleMode = true;
ledColour = BLUE;
b.allLedsOn(ledColour.r, ledColour.g, ledColour.b);
} else if (buffer.compareTo("light") == 0){
kettleMode = false;
ledColour = WHITE;
b.allLedsOn(ledColour.r, ledColour.g, ledColour.b);
}
buffer = "";
}
}
}
os_thread_return_t buttonListener(){
for(;;){
int pressed = buttonPressed();
if(pressed > 0){
// -- EXAMPLE code for demo --
if(kettleMode){
switch(pressed){
case 15: path = KETTLE_ON;
client.get(path);
colourFade(255, 0, 0);
Serial.println("Switching kettle on");
break;
}
} else {
switch(pressed){
case 1: if(!lightMode){
currentColour -= 1;
if(currentColour < 0)
currentColour = 4;
ledColour = allColours[currentColour];
} else {
brightness -= 25;
if(brightness < 0)
brightness = 0;
b.setBrightness(brightness);
}
break;
case 2: if(lightMode == 0)
lightMode = 1;
else
lightMode = 0;
break;
case 4: if(!lightMode){
currentColour += 1;
if(currentColour > 4)
currentColour = 0;
ledColour = allColours[currentColour];
} else {
brightness += 25;
if(brightness > 255)
brightness = 255;
b.setBrightness(brightness);
}
break;
case 8: if(lightMode == 0)
lightMode = 1;
else
lightMode = 0;
break;
case 15: if(bulbOn){
path = LIGHTS_OFF;
bulbOn = false;
client.get(path);
Serial.println("Switching lights off");
} else {
path = LIGHTS_ON;
bulbOn = true;
client.get(path);
Serial.println("Switching lights on");
}
break;
}
}
// ---------------------------
}
delay(100);
}
}
os_thread_return_t light(){
for(;;){
switch(lightMode){
case 0: blinking(lightMode);
break;
case 1: circle(lightMode);
break;
default: b.allLedsOn(ledColour.r, ledColour.g, ledColour.b);
delay(100);
}
}
}
void setup() {
Serial.begin(9600);
b.begin();
lightMode = -1;
brightness = 0;
lightSpeed = 5;
ledColour = WHITE;
buttonThread = new Thread("buttonListener", buttonListener);
blinkingThread = new Thread("light", light);
serialThread = new Thread("serial", serialListener);
b.allLedsOn(ledColour.r, ledColour.g, ledColour.b);
}
void loop() {
code();
}
void code(){
delay(5000);
}
void buttonPressed(){
uint8_t button = 0x00;
while(!b.allButtonsOff()){
if(b.buttonOn(1))
button = button | 0x01;
if(b.buttonOn(2))
button = button | 0x02;
if(b.buttonOn(3))
button = button | 0x04;
if(b.buttonOn(4))
button = button | 0x08;
delay(100);
}
client.post(path, (const char*) button);
return (int) button;
}
void blinking(int myMode){
while(brightness < 255 && lightMode == myMode){
brightness += 5;
if(brightness > 255)
brightness = 255;
b.setBrightness(brightness);
b.allLedsOn(ledColour.r, ledColour.g, ledColour.b);
delay (10 + lightSpeed * 10);
}
delay(500 + lightSpeed * 10);
while(brightness > 0 && lightMode == myMode){
brightness -= 5;
if(brightness < 0)
brightness = 0;
b.setBrightness(brightness);
b.allLedsOn(ledColour.r, ledColour.g, ledColour.b);
delay (10 + lightSpeed * 10);
}
delay(500 + lightSpeed * 10);
}
void circle(int myMode){
int i;
for(i = 1; i < 12 && lightMode == myMode; i++){
b.allLedsOff();
b.ledOn(i, ledColour.r * 0.1, ledColour.g * 0.1, ledColour.b * 0.1);
b.ledOn(((i+1)/12 + (i+1)%12), ledColour.r * 0.2, ledColour.g * 0.2, ledColour.b * 0.2);
b.ledOn(((i+2)/12 + (i+2)%12), ledColour.r * 0.3, ledColour.g * 0.3, ledColour.b * 0.3);
b.ledOn(((i+3)/12 + (i+3)%12), ledColour.r * 0.4, ledColour.g * 0.4, ledColour.b * 0.4);
b.ledOn(((i+4)/12 + (i+4)%12), ledColour.r * 0.5, ledColour.g * 0.5, ledColour.b * 0.5);
b.ledOn(((i+5)/12 + (i+5)%12), ledColour.r * 0.6, ledColour.g * 0.6, ledColour.b * 0.6);
b.ledOn(((i+6)/12 + (i+6)%12), ledColour.r * 0.7, ledColour.g * 0.7, ledColour.b * 0.7);
b.ledOn(((i+7)/12 + (i+7)%12), ledColour.r * 0.8, ledColour.g * 0.8, ledColour.b * 0.8);
b.ledOn(((i+8)/12 + (i+8)%12), ledColour.r * 0.9, ledColour.g * 0.9, ledColour.b * 0.9);
b.ledOn(((i+9)/12 + (i+9)%12), ledColour.r, ledColour.g, ledColour.b);
delay(100 + lightSpeed * 5);
}
}
void setColour(int red, int green, int blue){
if (red <= 255 && red >= 0 && green <= 255 && green >= 0 && blue <= 255 && blue >= 0)
ledColour = {red, green, blue};
}
void setMode(int mode){
if(mode >= 0)
lightMode = mode;
}
void setSpeed(int speed){
if(speed >= 0)
lightSpeed = speed;
}
void setBrightness(int newBrightness){
if(brightness >= 0 && brightness <= 255)
brightness = newBrightness;
}
void colourFade(int red, int green, int blue){
if (red <= 255 && red >= 0 && green <= 255 && green >= 0 && blue <= 255 && blue >= 0)
{
while(ledColour.r != red || ledColour.g != green || ledColour.b != blue){
if(ledColour.r < red){
if(ledColour.r <= 250)
ledColour.r += 5;
else
ledColour.r = 255;
} else if(ledColour.r > red){
if(ledColour.r >= 5)
ledColour.r -= 5;
else
ledColour.r = 0;
}
if(ledColour.g < green){
if(ledColour.g <= 250)
ledColour.g += 5;
else
ledColour.g = 255;
} else if(ledColour.g > green){
if(ledColour.g >= 5)
ledColour.g -= 5;
else
ledColour.g = 0;
}
if(ledColour.b < blue){
if(ledColour.b <= 250)
ledColour.b += 5;
else
ledColour.b = 255;
} else if(ledColour.b > blue){
if(ledColour.b >= 5)
ledColour.b -= 5;
else
ledColour.b = 0;
}
delay(300);
}
}
}
| [
"h.herczeg.andras@gmail.com"
] | h.herczeg.andras@gmail.com |
cf6b789f20ee2aaf9e1371b9f12906befe31ae3a | 756e02074e609f9087f58934a0e2fbfa48715575 | /Classes/HelloWorldScene.h | 9bd4de5cfe39fdff194614c322a0652aa1d6a35c | [] | no_license | zhaogaoxing/lol | 6647155355c83f8bd47d28b51b54d5d2eed4e459 | 509a8be5071a4f81935c684899079e67e51db068 | refs/heads/master | 2020-12-28T23:35:22.092797 | 2016-07-11T02:12:16 | 2016-07-11T02:12:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 750 | h | #ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include"ui/CocosGUI.h"
#include "cocos2d.h"
USING_NS_CC;
class HelloWorld : public cocos2d::Layer
{
public:
static cocos2d::Scene* createScene();
virtual bool init();
// a selector callback
void menuCloseCallback(cocos2d::Ref* pSender);
// implement the "static create()" method manually
CREATE_FUNC(HelloWorld);
Sprite* start;
Sprite* pause;
Sprite* stop;
Sprite*dian;
Sprite*zou;
Sprite*you;
Sprite*hen;
void updateCustom(float dt);
void updateCustom1(float dt);
bool move;
void _start();
void _start1();
void _stop();
int i;
int speed;
Size visibleSize;
Size a;
Size b;
//ui::Button* button;
};
#endif // __HELLOWORLD_SCENE_H__
| [
"758482981@qq.com"
] | 758482981@qq.com |
eb2a1ce90ddee335628b79b7d9dfd43e8defdafa | 670b6ad9defe9767e3b7c06d54cc783709bb8113 | /sources/cpp/Jezero.cpp | b3c22b75499bb2f9d66412c3f46ef2bc9e46c9e3 | [] | no_license | crazykaktus/iceage | 1b3b913cf0c0f0885ca87261801ac453dee8673e | 8492b65775133da8ff5807918cb20ae323dce4ed | refs/heads/master | 2021-09-20T06:14:54.612953 | 2018-08-05T14:57:34 | 2018-08-05T14:57:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,071 | cpp | /**
@file
*/
#include "../hlavicky/Jezero.h"
/**
Konstruktor
*/
IceAge::Jezero::Jezero(std::string novyNazev):Command(novyNazev) {
}
/**
Destruktor
*/
IceAge::Jezero::~Jezero() {
}
/**
Podedena metoda pridavajici algoritmus pro prozkoumani lokace Jezero.
*/
void IceAge::Jezero::prozkoumat(IceAge::Veverka* scrat, std::vector<IceAge::Beast*> vektorBeast, std::vector<IceAge::Humanoid*> vektorHumanoid, IceAge::Reka* reka) {
char volba='a';/**< @brief Lokalni promenna pozivana pro nacitani odpovedi od uzivatele.*/
unsigned int index=0;/**< @brief Lokalni promenna pouzivana pro cislovani moznosti, ktere se zobrazi uzivateli.*/
std::cout << std::endl;
std::cout << "Jsi na pokraji mensiho jezera. V prumeru je mensi jak reka, mistami vidis mokriny, ktere jdou prebrodit." << std::endl << std::endl;
std::cout << "Na vrcholku veze vidis hnizdko." << std::endl;
std::cin.ignore();
/** @brief Vykresleni obrazku*/
std::cout << " .-." << std::endl;
std::cout << " |/`\\\\.._" << std::endl;
std::cout << " _..._,,--. `\\ /.--.\\ _.-." << std::endl;
std::cout << " ,/' ..:::.. \\ .._.-'/ \\` .\\/" << std::endl;
std::cout << " / ...:::.`\\ ,/:..| |(o) / /o)|" << std::endl;
std::cout << "|:.. | ..:::::'|:.. ;\\ `---'. `--'" << std::endl;
std::cout << ";::... | .::::,/:.. .`--. .:.`\\_" << std::endl;
std::cout << " |::.. ; ..::'/:.. .--' ;\\ :::.`\\" << std::endl;
std::cout << " ;::../ ..::|::. /' ;. ':'.---." << std::endl;
std::cout << " `--| ..::;\\:. `\\,,,____,,,/';\\. (_) |)" << std::endl;
std::cout << " ; ..::/:\\:.`\\| ,__,/`;----'" << std::endl;
std::cout << " `\\ ;:.. \\: `-.. `-._,/,_,/" << std::endl;
std::cout << " \\ ;:. ). `\\ `> _:\\" << std::endl;
std::cout << " `\\, ;:.. \\ \\ _> </,/`\\" << std::endl;
std::cout << " `\\|:. `-' <_/:. |" << std::endl;
std::cout << " ;: |:. `----':. /" << std::endl;
std::cout << " \\,__,/'-::....; ,/" << std::endl;
std::cout << " |:| `----'" << std::endl;
std::cout << " / < \\ /:/" << std::endl;
std::cout << " `-'-'-' <:.`-._" << std::endl;
std::cout << " `\\,>>'" << std::endl;
std::cout << std::endl;
std::cout << std::endl;
std::cout << std::endl;
std::cout << "[0] Cmuchej" <<std::endl;
std::cout << "Vyber akci:";
std::cin >> volba; std::cin.ignore();
bool cyklus2=true;/**< @brief Lokalni promenna pouzivana pro udrzovani cyklu v chodu. Konkretne u ziskavani odpovedi od uzivatele.*/
while(cyklus2)/**< @brief Cyklus pro pasaz cmuchani.*/
{
switch(volba)
{
case '0':
cyklus2=false;
break;
default:
std::cout << "Vyber akci:";
std::cin >> volba;std::cin.ignore();
break;
}
}
cyklus2=true; volba='a';/**< @brief Reset lokalnich promennych na puvodni hodnoty.*/
std::cout << "Orisek je urcite nekde pobliz. Citis ho." << std::endl << std::endl;
std::cout << "[0] Hledej dal" <<std::endl;
std::cout << "Vyber akci:";
std::cin >> volba;std::cin.ignore();
while(cyklus2)/**< @brief Cyklus pro hledani dal.*/
{
switch(volba)
{
case '0':
cyklus2=false;
break;
default:
std::cout << "Vyber akci:";
std::cin >> volba;std::cin.ignore();
break;
}
}
cyklus2=true; volba='a';/**< @brief Reset lokalnich promennych na puvodni hodnoty.*/
std::cout << std::endl << "Citis zde " << vektorBeast.at(0)->getNazev() << std::endl;
std::cout << "Pach je slaby, daleko silneji ho prekryva pach orisku" << std::endl;
std::cout << std::endl;
std::cin.ignore();
std::cout << "Rychle skaces po melcine ke skalce."<< std::endl;
/** @brief Pokud ma hrac stale lodicku, tak mu ji sebereme.*/
if(scrat->getPravaRuka() != nullptr){
std::cout << "Kdyz zjistis, ze se nahoru neda jen tak dostat, vztekem roztriskas svoji lodicku" << std::endl;
scrat->zahodPravaRuka();
}
else std::cout << "Nahoru se dostat neda, aspon ne s tim co mas po ruce." << std::endl;
std::cin.ignore();
std::cout << std::endl;
std::cout << "Rozhlizis se po okoli, hledaje neco, co by ti pomohlo dostat se do hnizda." << std::endl;
std::cout << "V okoli se nachazi nekolik velkych vrb. Svou vyskou mohou konkurovat stromum v pralese." << std::endl;
bool cyklus=true;/**< @brief Lokalni promenna pouzivana pro udrzovani cyklu v chodu. Konkretne u opakovani vypisu nejake cinnosti a ziskavani odpovedi (cyklus2)*/
while(cyklus)/**< @brief Cyklus pro trhani proutku. Pokud neutrhnu vic kusu, budu tu cyklit.*/
{
std::cout << std::endl;
std::cout << "[" << index << "] Utrhnout si proutek" << std::endl; index++;
std::cout << "[" << index << "] Utrhnout si hodne proutku a uplest z nich jedno silne lano." << std::endl; index=0;
std::cout << "Vyber akci:";
while(cyklus2)/**< @brief Ziskavani odpovedi od uzivatele.*/
{
std::cin >> volba;std::cin.ignore();
std::cout << std::endl;
switch(volba)
{
case '0':
cyklus2=false;
std::cout << "Utrhnes si jeden proutek. Kdyz zkousis jeho pevnost, tak ti praskne." << std::endl << std::endl;
break;
case '1':
std::cout << "Po hodine mas dostatecne silne a dlouhe lano." << std::endl;
scrat->setPravaRuka(new IceAge::Orisek("Proutkove lano"));
cyklus2=false; cyklus=false;
break;
default:
break;
}
}
cyklus2=true; volba='a';/**< @brief Reset lokalnich promennych na puvodni hodnoty.*/
}
cyklus2=true;/**< @brief Reset lokalnich promennych na puvodni hodnoty.*/
std::cout << "Hazes lano na vrsek skalky a lezes nahoru." << std::endl;
std::cin.ignore();
IceAge::Orisek *scratuvOrisek=new IceAge::Orisek("Orisek");
/** @brief Pasaz se Supomutim mladetem*/
std::cout << std::endl;
std::cout << "Vylezl si nahoru. Vidis tu jen " << vektorBeast.at(1)->getNazev() << " a " << scratuvOrisek->getNazev() << std::endl;
std::cin.ignore();
std::cout << scratuvOrisek->getNazev() << "!!!" << std::endl;
std::cin.ignore();
scrat->zahodPravaRuka();
std::cout << "Poustis lano a pripravujes se k boji!" << std::endl;
std::cin.ignore();
IceAge::boj(scrat,vektorBeast.at(1));
scrat->setPravaRuka(scratuvOrisek);
/** @brief Hrac ziskal orisek a utika pryc.*/
std::cout << "Prastil si " << vektorBeast.at(1)->getNazev() << " po hlave a utikas s ukoristenym oriskem." << std::endl;
std::cout << std::endl;
std::cout << "[" << index << "] Skocit pres okraj" << std::endl; index++;
std::cout << "[" << index << "] Pouzit lano k ceste dolu" << std::endl; index=0;
while(cyklus2)/**< @brief Cyklus pro ziskani odpovedi "kudy zdrhnout"*/
{
std::cout << "Vyber akci:";
std::cin >> volba;std::cin.ignore();
switch(volba)
{
case '0':
cyklus2=false;
std::cout << "Padas do vody. V ruce uz mas jen Orisek." << std::endl << std::endl;
break;
case '1':
std::cout << "Aby si se mohl drzet lana a neztratit Orisek, hazes klacek po " << vektorBeast.at(1)->getNazev() << std::endl;
std::cout << "Kdyz jsi v puli cesty, tak ti " << vektorBeast.at(1)->getNazev() << " precvakne lano." << std::endl;
cyklus2=false;
break;
default:
break;
}
}
cyklus2=true;/**< @brief Reset lokalnich promennych na puvodni hodnoty.*/
scrat->zahodLevaRuka(); /**< @brief Zahozeni klacku.*/
std::cin.ignore();
std::cout << std::endl;
/** @brief Pasaz s rybickama a kung-fu Scratem*/
std::cout << "Stoji proti tobe strasne moc ryb. Ocividne chteji tvuj orisek!" << std::endl;
std::cout << std::endl;
std::cout << "[" << index << "] Utect" << std::endl; index++;
std::cout << "[" << index << "] Nikdy nedostanete muj Orisek!" << std::endl; index=0;
while(cyklus2)/**< @brief Cyklus pro ziskani odpovedi a pripadne pro boj s rybami*/
{
std::cout << "Vyber akci:";
std::cin >> volba;std::cin.ignore();
switch(volba)
{
case '0':
cyklus2=false;
std::cout << "Podarilo se ti uprchnout." << std::endl << std::endl;
break;
case '1':
/** @brief Zde je popsan boj s rybami. Boj je zcela automaticky a casovany. Pred bojem se hracovi zvednou staty*/
scrat->enrageZapnout();
for(unsigned int i=2; i<vektorBeast.size(); i++){
IceAge::boj(scrat,vektorBeast.at(i));
std::cout << i-1 << ". " << vektorBeast.at(i)->getNazev() << " je omracen." << std::endl;
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
scrat->enrageVypnout();
cyklus2=false;
break;
default:
break;
}
}
std::cin.ignore();
std::cin.ignore();
/** @brief Zaverecny obrazek a vypis*/
std::cout << "Konecne jsi sam. Na ledovci s oriskem. Nasel sis svoje mistecko." << std::endl;
std::cin.ignore();
std::cout << " .-----. .'`-." << std::endl;
std::cout << " / ,-- | .- `-." << std::endl;
std::cout << " ,' ,-' `. _.-' ,-.`.)" << std::endl;
std::cout << " ; / ,=---`--+' .- -. `." << std::endl;
std::cout << "( \\ ,' =,- ,' ( o ) | /\\" << std::endl;
std::cout << " : : / =,-' / \\-' ;(o :" << std::endl;
std::cout << " \\ | ' ; ( `--' \\ ;" << std::endl;
std::cout << " \\ | = | \\`--+ --. `(" << std::endl;
std::cout << " `+ =/ : : `. `. \\" << std::endl;
std::cout << " ' =/ \\ `--. '-. `. `." << std::endl;
std::cout << " \\ =; `._ : ( `-. `. `." << std::endl;
std::cout << " \\ = ; `._.' `-.-`-._\\ `-." << std::endl;
std::cout << " \\= ' _.-'_) (::::)" << std::endl;
std::cout << " `+ -. `--7' `--`..'" << std::endl;
std::cout << " ( : .' ;" << std::endl;
std::cout << " \\ | | /" << std::endl;
std::cout << " \\ | _.-| +---'" << std::endl;
std::cout << " `--+ `. \\ \\" << std::endl;
std::cout << " /`. '-.-\\ `--." << std::endl;
std::cout << " / /#### `----.'" << std::endl;
std::cout << " ( ,-'############\\" << std::endl;
std::cout << " \\\\/###############;" << std::endl;
std::cout << " \\###############/" << std::endl;
std::cout << " |--------------| _.---------" << std::endl;
std::cout << " :::::::::::::::|_.-''" << std::endl;
std::cout << " ::::::::::_.-''" << std::endl;
std::cout << " .-''..'---'-------''" << std::endl;
std::cin.ignore();
IceAge::MemoryArbiter::cycleDelete();/**< @brief Uvolneni pameti.*/
exit(0);/**< @brief Uspesne ukonceni.*/
}
| [
"srejber.michal@email.cz"
] | srejber.michal@email.cz |
ced30a5ac9bef4ad3091e6528b23d3c70d644725 | 536656cd89e4fa3a92b5dcab28657d60d1d244bd | /base/allocator/partition_allocator/page_allocator.cc | 28d90fe9b8f0739ebe4f57d9f4b8e904a6403c6a | [
"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 | 9,396 | cc | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/allocator/partition_allocator/page_allocator.h"
#include <limits.h>
#include <atomic>
#include "base/allocator/partition_allocator/address_space_randomization.h"
#include "base/allocator/partition_allocator/page_allocator_internal.h"
#include "base/allocator/partition_allocator/spin_lock.h"
#include "base/bits.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/numerics/checked_math.h"
#include "build/build_config.h"
#if defined(OS_WIN)
#include <windows.h>
#endif
#if defined(OS_WIN)
#include "base/allocator/partition_allocator/page_allocator_internals_win.h"
#elif defined(OS_POSIX)
#include "base/allocator/partition_allocator/page_allocator_internals_posix.h"
#elif defined(OS_FUCHSIA)
#include "base/allocator/partition_allocator/page_allocator_internals_fuchsia.h"
#else
#error Platform not supported.
#endif
namespace base {
namespace {
// We may reserve/release address space on different threads.
subtle::SpinLock& GetReserveLock() {
static NoDestructor<subtle::SpinLock> s_reserveLock;
return *s_reserveLock;
}
// We only support a single block of reserved address space.
void* s_reservation_address = nullptr;
size_t s_reservation_size = 0;
void* AllocPagesIncludingReserved(void* address,
size_t length,
PageAccessibilityConfiguration accessibility,
PageTag page_tag,
bool commit) {
void* ret =
SystemAllocPages(address, length, accessibility, page_tag, commit);
if (ret == nullptr) {
const bool cant_alloc_length = kHintIsAdvisory || address == nullptr;
if (cant_alloc_length) {
// The system cannot allocate |length| bytes. Release any reserved address
// space and try once more.
ReleaseReservation();
ret = SystemAllocPages(address, length, accessibility, page_tag, commit);
}
}
return ret;
}
// Trims |base| to given |trim_length| and |alignment|.
//
// On failure, on Windows, this function returns nullptr and frees |base|.
void* TrimMapping(void* base,
size_t base_length,
size_t trim_length,
uintptr_t alignment,
PageAccessibilityConfiguration accessibility,
bool commit) {
size_t pre_slack = reinterpret_cast<uintptr_t>(base) & (alignment - 1);
if (pre_slack) {
pre_slack = alignment - pre_slack;
}
size_t post_slack = base_length - pre_slack - trim_length;
DCHECK(base_length >= trim_length || pre_slack || post_slack);
DCHECK(pre_slack < base_length);
DCHECK(post_slack < base_length);
return TrimMappingInternal(base, base_length, trim_length, accessibility,
commit, pre_slack, post_slack);
}
} // namespace
void* SystemAllocPages(void* hint,
size_t length,
PageAccessibilityConfiguration accessibility,
PageTag page_tag,
bool commit) {
DCHECK(!(length & kPageAllocationGranularityOffsetMask));
DCHECK(!(reinterpret_cast<uintptr_t>(hint) &
kPageAllocationGranularityOffsetMask));
DCHECK(commit || accessibility == PageInaccessible);
return SystemAllocPagesInternal(hint, length, accessibility, page_tag,
commit);
}
void* AllocPages(void* address,
size_t length,
size_t align,
PageAccessibilityConfiguration accessibility,
PageTag page_tag,
bool commit) {
DCHECK(length >= kPageAllocationGranularity);
DCHECK(!(length & kPageAllocationGranularityOffsetMask));
DCHECK(align >= kPageAllocationGranularity);
// Alignment must be power of 2 for masking math to work.
DCHECK(base::bits::IsPowerOfTwo(align));
DCHECK(!(reinterpret_cast<uintptr_t>(address) &
kPageAllocationGranularityOffsetMask));
uintptr_t align_offset_mask = align - 1;
uintptr_t align_base_mask = ~align_offset_mask;
DCHECK(!(reinterpret_cast<uintptr_t>(address) & align_offset_mask));
// If the client passed null as the address, choose a good one.
if (address == nullptr) {
address = GetRandomPageBase();
address = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(address) &
align_base_mask);
}
// First try to force an exact-size, aligned allocation from our random base.
#if defined(ARCH_CPU_32_BITS)
// On 32 bit systems, first try one random aligned address, and then try an
// aligned address derived from the value of |ret|.
constexpr int kExactSizeTries = 2;
#else
// On 64 bit systems, try 3 random aligned addresses.
constexpr int kExactSizeTries = 3;
#endif
for (int i = 0; i < kExactSizeTries; ++i) {
void* ret = AllocPagesIncludingReserved(address, length, accessibility,
page_tag, commit);
if (ret != nullptr) {
// If the alignment is to our liking, we're done.
if (!(reinterpret_cast<uintptr_t>(ret) & align_offset_mask))
return ret;
// Free the memory and try again.
FreePages(ret, length);
} else {
// |ret| is null; if this try was unhinted, we're OOM.
if (kHintIsAdvisory || address == nullptr)
return nullptr;
}
#if defined(ARCH_CPU_32_BITS)
// For small address spaces, try the first aligned address >= |ret|. Note
// |ret| may be null, in which case |address| becomes null.
address = reinterpret_cast<void*>(
(reinterpret_cast<uintptr_t>(ret) + align_offset_mask) &
align_base_mask);
#else // defined(ARCH_CPU_64_BITS)
// Keep trying random addresses on systems that have a large address space.
address = GetRandomPageBase();
address = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(address) &
align_base_mask);
#endif
}
// Make a larger allocation so we can force alignment.
size_t try_length = length + (align - kPageAllocationGranularity);
CHECK(try_length >= length);
void* ret;
do {
// Continue randomizing only on POSIX.
address = kHintIsAdvisory ? GetRandomPageBase() : nullptr;
ret = AllocPagesIncludingReserved(address, try_length, accessibility,
page_tag, commit);
// The retries are for Windows, where a race can steal our mapping on
// resize.
} while (ret != nullptr &&
(ret = TrimMapping(ret, try_length, length, align, accessibility,
commit)) == nullptr);
return ret;
}
void FreePages(void* address, size_t length) {
DCHECK(!(reinterpret_cast<uintptr_t>(address) &
kPageAllocationGranularityOffsetMask));
DCHECK(!(length & kPageAllocationGranularityOffsetMask));
FreePagesInternal(address, length);
}
bool TrySetSystemPagesAccess(void* address,
size_t length,
PageAccessibilityConfiguration accessibility) {
DCHECK(!(length & kSystemPageOffsetMask));
return TrySetSystemPagesAccessInternal(address, length, accessibility);
}
void SetSystemPagesAccess(void* address,
size_t length,
PageAccessibilityConfiguration accessibility) {
DCHECK(!(length & kSystemPageOffsetMask));
SetSystemPagesAccessInternal(address, length, accessibility);
}
void DecommitSystemPages(void* address, size_t length) {
DCHECK_EQ(0UL, length & kSystemPageOffsetMask);
DecommitSystemPagesInternal(address, length);
}
bool RecommitSystemPages(void* address,
size_t length,
PageAccessibilityConfiguration accessibility) {
DCHECK_EQ(0UL, length & kSystemPageOffsetMask);
DCHECK_NE(PageInaccessible, accessibility);
return RecommitSystemPagesInternal(address, length, accessibility);
}
void DiscardSystemPages(void* address, size_t length) {
DCHECK_EQ(0UL, length & kSystemPageOffsetMask);
DiscardSystemPagesInternal(address, length);
}
bool ReserveAddressSpace(size_t size) {
// To avoid deadlock, call only SystemAllocPages.
subtle::SpinLock::Guard guard(GetReserveLock());
if (s_reservation_address == nullptr) {
void* mem = SystemAllocPages(nullptr, size, PageInaccessible,
PageTag::kChromium, false);
if (mem != nullptr) {
// We guarantee this alignment when reserving address space.
DCHECK(!(reinterpret_cast<uintptr_t>(mem) &
kPageAllocationGranularityOffsetMask));
s_reservation_address = mem;
s_reservation_size = size;
return true;
}
}
return false;
}
bool ReleaseReservation() {
// To avoid deadlock, call only FreePages.
subtle::SpinLock::Guard guard(GetReserveLock());
if (!s_reservation_address)
return false;
FreePages(s_reservation_address, s_reservation_size);
s_reservation_address = nullptr;
s_reservation_size = 0;
return true;
}
bool HasReservationForTesting() {
subtle::SpinLock::Guard guard(GetReserveLock());
return s_reservation_address != nullptr;
}
uint32_t GetAllocPageErrorCode() {
return s_allocPageErrorCode;
}
} // namespace base
| [
"pcding@ucdavis.edu"
] | pcding@ucdavis.edu |
fb96f644e8dd31894d639fabd483811cae88983c | 9b7833aef93ca709e6f9aece5037ffff41a96d01 | /RoboCup2016/GoalKeeper2016/Brain/State Machine/States/Init.h | e5e403ea6010e2bf0ed5d0f9fe0975f757cda20a | [
"Apache-2.0"
] | permissive | BIURoboCup/RoboCup2016 | 8210ea87822fe9fb705ed8b9a208c20ab4c3fe97 | a8a73538996dec6e4f7693ac45ae1ae40393cb44 | refs/heads/master | 2016-09-01T09:01:11.704880 | 2016-03-15T10:00:02 | 2016-03-15T10:00:02 | 45,212,791 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 133 | h | #include "../State.h"
class Init : public State
{
public:
Init();
virtual ~Init();
virtual void Play() = 0;
};
| [
"assafrabin@gmail.com"
] | assafrabin@gmail.com |
7e1946411370dbee621a840e21f0519ffcffc694 | 560090526e32e009e2e9331e8a2b4f1e7861a5e8 | /Compiled/blaze-3.2/blazetest/src/mathtest/dmatdmatschur/SDaSDa.cpp | 4521123d4bbe7d60f6542e58dee3f80999ef400e | [
"BSD-3-Clause"
] | permissive | jcd1994/MatlabTools | 9a4c1f8190b5ceda102201799cc6c483c0a7b6f7 | 2cc7eac920b8c066338b1a0ac495f0dbdb4c75c1 | refs/heads/master | 2021-01-18T03:05:19.351404 | 2018-02-14T02:17:07 | 2018-02-14T02:17:07 | 84,264,330 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,865 | cpp | //=================================================================================================
/*!
// \file src/mathtest/dmatdmatschur/SDaSDa.cpp
// \brief Source file for the SDaSDa dense matrix/dense matrix Schur product math test
//
// Copyright (C) 2012-2017 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group nor the names of its contributors
// may be used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
*/
//=================================================================================================
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <cstdlib>
#include <iostream>
#include <blaze/math/DynamicMatrix.h>
#include <blaze/math/SymmetricMatrix.h>
#include <blazetest/mathtest/Creator.h>
#include <blazetest/mathtest/dmatdmatschur/OperationTest.h>
#include <blazetest/system/MathTest.h>
//=================================================================================================
//
// MAIN FUNCTION
//
//=================================================================================================
//*************************************************************************************************
int main()
{
std::cout << " Running 'SDaSDa'..." << std::endl;
using blazetest::mathtest::TypeA;
try
{
// Matrix type definitions
typedef blaze::SymmetricMatrix< blaze::DynamicMatrix<TypeA> > SDa;
// Creator type definitions
typedef blazetest::Creator<SDa> CSDa;
// Running tests with small matrices
for( size_t i=0UL; i<=9UL; ++i ) {
RUN_DMATDMATSCHUR_OPERATION_TEST( CSDa( i ), CSDa( i ) );
}
// Running tests with large matrices
RUN_DMATDMATSCHUR_OPERATION_TEST( CSDa( 67UL ), CSDa( 67UL ) );
RUN_DMATDMATSCHUR_OPERATION_TEST( CSDa( 128UL ), CSDa( 128UL ) );
}
catch( std::exception& ex ) {
std::cerr << "\n\n ERROR DETECTED during dense matrix/dense matrix Schur product:\n"
<< ex.what() << "\n";
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
//*************************************************************************************************
| [
"jonathan.doucette@alumni.ubc.ca"
] | jonathan.doucette@alumni.ubc.ca |
26c7b366a207811cd847a379165941afb521a078 | af0aa93c55cbf9fcd8589cd0f764f9c348db8c9f | /Engine/Systems/Physics/snippetvehiclecommon/SnippetVehicleCreate.cpp | 0ee6b84777191d269a08c4c3b971730f8c164900 | [] | no_license | Kickass-Global/Checkered | c758ad2ebd963fc8b07949c58e5f225eb486de06 | 399e1e666a16b4b35740ae6c46f339f9c7514b67 | refs/heads/master | 2020-12-06T07:03:43.419680 | 2020-04-20T17:29:45 | 2020-04-20T17:29:45 | 232,375,415 | 5 | 1 | null | 2020-04-20T16:27:50 | 2020-01-07T17:11:52 | C++ | UTF-8 | C++ | false | false | 15,199 | cpp | //
// 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 NVIDIA CORPORATION 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 ``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.
//
// Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
#include <new>
#include "SnippetVehicleCreate.h"
#include "SnippetVehicleSceneQuery.h"
#include "SnippetVehicleFilterShader.h"
#include "SnippetVehicleTireFriction.h"
#include "PxPhysicsAPI.h"
namespace snippetvehicle {
using namespace physx;
PxRigidStatic *
createDrivablePlane(const PxFilterData &simFilterData, PxMaterial *material,
PxPhysics *physics) {
//Add a plane to the scene.
PxRigidStatic *groundPlane = PxCreatePlane(*physics,
PxPlane(0, 1, 0, 0),
*material);
//Get the plane shape so we can set query and simulation filter data.
PxShape *shapes[1];
groundPlane->getShapes(shapes, 1);
//Set the query filter data of the ground plane so that the vehicle raycasts can hit the ground.
PxFilterData qryFilterData;
setupDrivableSurface(qryFilterData);
shapes[0]->setQueryFilterData(qryFilterData);
//Set the simulation filter data of the ground plane so that it collides with the chassis of a vehicle but not the wheels.
shapes[0]->setSimulationFilterData(simFilterData);
return groundPlane;
}
static PxConvexMesh *
createConvexMesh(const PxVec3 *verts, const PxU32 numVerts,
PxPhysics &physics, PxCooking &cooking) {
// Create descriptor for convex mesh
PxConvexMeshDesc convexDesc;
convexDesc.points.count = numVerts;
convexDesc.points.stride = sizeof(PxVec3);
convexDesc.points.data = verts;
convexDesc.flags = PxConvexFlag::eCOMPUTE_CONVEX;
PxConvexMesh *convexMesh = NULL;
PxDefaultMemoryOutputStream buf;
if (cooking.cookConvexMesh(convexDesc, buf)) {
PxDefaultMemoryInputData id(buf.getData(), buf.getSize());
convexMesh = physics.createConvexMesh(id);
}
return convexMesh;
}
PxConvexMesh *createChassisMesh(const PxVec3 dims, PxPhysics &physics,
PxCooking &cooking) {
const PxF32 x = dims.x * 0.5f;
const PxF32 y = dims.y * 0.5f;
const PxF32 z = dims.z * 0.5f;
PxVec3 verts[8] =
{
PxVec3(x, y, -z),
PxVec3(x, y, z),
PxVec3(x, -y, z),
PxVec3(x, -y, -z),
PxVec3(-x, y, -z),
PxVec3(-x, y, z),
PxVec3(-x, -y, z),
PxVec3(-x, -y, -z)
};
return createConvexMesh(verts, 8, physics, cooking);
}
PxConvexMesh *
createWheelMesh(const PxF32 width, const PxF32 radius, PxPhysics &physics,
PxCooking &cooking) {
PxVec3 points[2 * 16];
for (PxU32 i = 0; i < 16; i++) {
const PxF32 cosTheta = PxCos(i * PxPi * 2.0f / 16.0f);
const PxF32 sinTheta = PxSin(i * PxPi * 2.0f / 16.0f);
const PxF32 y = radius * cosTheta;
const PxF32 z = radius * sinTheta;
points[2 * i + 0] = PxVec3(-width / 2.0f, y, z);
points[2 * i + 1] = PxVec3(+width / 2.0f, y, z);
}
return createConvexMesh(points, 32, physics, cooking);
}
PxRigidDynamic *createVehicleActor
(const PxVehicleChassisData &chassisData,
PxMaterial **wheelMaterials, PxConvexMesh **wheelConvexMeshes,
const PxU32 numWheels, const PxFilterData &wheelSimFilterData,
PxMaterial **chassisMaterials, PxConvexMesh **chassisConvexMeshes,
const PxU32 numChassisMeshes,
const PxFilterData &chassisSimFilterData,
PxPhysics &physics,
PxTransform& chassis_local_pose) {
//We need a rigid body actor for the vehicle.
//Don't forget to add the actor to the scene after setting up the associated vehicle.
PxRigidDynamic *vehActor = physics.createRigidDynamic(
PxTransform(PxIdentity));
//Wheel and chassis query filter data.
//Optional: cars don't drive on other cars.
PxFilterData wheelQryFilterData;
setupNonDrivableSurface(wheelQryFilterData);
PxFilterData chassisQryFilterData;
setupNonDrivableSurface(chassisQryFilterData);
//Add all the wheel shapes to the actor.
for (PxU32 i = 0; i < numWheels; i++) {
PxConvexMeshGeometry geom(wheelConvexMeshes[i]);
PxShape *wheelShape = PxRigidActorExt::createExclusiveShape(
*vehActor, geom, *wheelMaterials[i]);
wheelShape->setQueryFilterData(wheelQryFilterData);
wheelShape->setSimulationFilterData(wheelSimFilterData);
wheelShape->setLocalPose(PxTransform(PxIdentity));
}
//Add the chassis shapes to the actor.
for (PxU32 i = 0; i < numChassisMeshes; i++) {
PxShape *chassisShape = PxRigidActorExt::createExclusiveShape(
*vehActor, PxConvexMeshGeometry(chassisConvexMeshes[i]),
*chassisMaterials[i]);
chassisShape->setQueryFilterData(chassisQryFilterData);
chassisShape->setSimulationFilterData(chassisSimFilterData);
chassisShape->setLocalPose(chassis_local_pose);
chassisShape->setName("chassis");
}
vehActor->setMass(chassisData.mMass);
vehActor->setMassSpaceInertiaTensor(chassisData.mMOI);
vehActor->setCMassLocalPose(
PxTransform(chassisData.mCMOffset, PxQuat(PxIdentity)));
return vehActor;
}
void
configureUserData(PxVehicleWheels *vehicle, ActorUserData *actorUserData,
ShapeUserData *shapeUserDatas) {
if (actorUserData) {
vehicle->getRigidDynamicActor()->userData = actorUserData;
actorUserData->vehicle = vehicle;
}
if (shapeUserDatas) {
PxShape *shapes[PX_MAX_NB_WHEELS + 1];
vehicle->getRigidDynamicActor()->getShapes(shapes,
PX_MAX_NB_WHEELS + 1);
for (PxU32 i = 0; i < vehicle->mWheelsSimData.getNbWheels(); i++) {
const PxI32 shapeId = vehicle->mWheelsSimData.getWheelShapeMapping(
i);
shapes[shapeId]->userData = &shapeUserDatas[i];
shapeUserDatas[i].isWheel = true;
shapeUserDatas[i].wheelId = i;
}
}
}
void customizeVehicleToLengthScale(const PxReal lengthScale,
PxRigidDynamic *rigidDynamic,
PxVehicleWheelsSimData *wheelsSimData,
PxVehicleDriveSimData *driveSimData) {
//Rigid body center of mass and moment of inertia.
{
PxTransform t = rigidDynamic->getCMassLocalPose();
t.p *= lengthScale;
rigidDynamic->setCMassLocalPose(t);
PxVec3 moi = rigidDynamic->getMassSpaceInertiaTensor();
moi *= (lengthScale * lengthScale);
rigidDynamic->setMassSpaceInertiaTensor(moi);
}
//Wheels, suspensions, wheel centers, tire/susp force application points.
{
for (PxU32 i = 0; i < wheelsSimData->getNbWheels(); i++) {
PxVehicleWheelData wheelData = wheelsSimData->getWheelData(i);
wheelData.mRadius *= lengthScale;
wheelData.mWidth *= lengthScale;
wheelData.mDampingRate *= lengthScale * lengthScale;
wheelData.mMaxBrakeTorque *= lengthScale * lengthScale;
wheelData.mMaxHandBrakeTorque *= lengthScale * lengthScale;
wheelData.mMOI *= lengthScale * lengthScale;
wheelsSimData->setWheelData(i, wheelData);
PxVehicleSuspensionData suspData = wheelsSimData->getSuspensionData(
i);
suspData.mMaxCompression *= lengthScale;
suspData.mMaxDroop *= lengthScale;
wheelsSimData->setSuspensionData(i, suspData);
PxVec3 v = wheelsSimData->getWheelCentreOffset(i);
v *= lengthScale;
wheelsSimData->setWheelCentreOffset(i, v);
v = wheelsSimData->getSuspForceAppPointOffset(i);
v *= lengthScale;
wheelsSimData->setSuspForceAppPointOffset(i, v);
v = wheelsSimData->getTireForceAppPointOffset(i);
v *= lengthScale;
wheelsSimData->setTireForceAppPointOffset(i, v);
}
}
//Slow forward speed correction.
{
wheelsSimData->setSubStepCount(5.0f * lengthScale, 3, 1);
wheelsSimData->setMinLongSlipDenominator(4.0f * lengthScale);
}
//Engine
if (driveSimData) {
PxVehicleEngineData engineData = driveSimData->getEngineData();
engineData.mMOI *= lengthScale * lengthScale;
engineData.mPeakTorque *= lengthScale * lengthScale;
engineData.mDampingRateFullThrottle *= lengthScale * lengthScale;
engineData.mDampingRateZeroThrottleClutchEngaged *=
lengthScale * lengthScale;
engineData.mDampingRateZeroThrottleClutchDisengaged *=
lengthScale * lengthScale;
driveSimData->setEngineData(engineData);
}
//Clutch.
if (driveSimData) {
PxVehicleClutchData clutchData = driveSimData->getClutchData();
clutchData.mStrength *= lengthScale * lengthScale;
driveSimData->setClutchData(clutchData);
}
//Scale the collision meshes too.
{
PxShape *shapes[16];
const PxU32 nbShapes = rigidDynamic->getShapes(shapes, 16);
for (PxU32 i = 0; i < nbShapes; i++) {
switch (shapes[i]->getGeometryType()) {
case PxGeometryType::eSPHERE: {
PxSphereGeometry sphere;
shapes[i]->getSphereGeometry(sphere);
sphere.radius *= lengthScale;
shapes[i]->setGeometry(sphere);
}
break;
case PxGeometryType::ePLANE:
PX_ASSERT(false);
break;
case PxGeometryType::eCAPSULE: {
PxCapsuleGeometry capsule;
shapes[i]->getCapsuleGeometry(capsule);
capsule.radius *= lengthScale;
capsule.halfHeight *= lengthScale;
shapes[i]->setGeometry(capsule);
}
break;
case PxGeometryType::eBOX: {
PxBoxGeometry box;
shapes[i]->getBoxGeometry(box);
box.halfExtents *= lengthScale;
shapes[i]->setGeometry(box);
}
break;
case PxGeometryType::eCONVEXMESH: {
PxConvexMeshGeometry convexMesh;
shapes[i]->getConvexMeshGeometry(convexMesh);
convexMesh.scale.scale *= lengthScale;
shapes[i]->setGeometry(convexMesh);
}
break;
case PxGeometryType::eTRIANGLEMESH: {
PxTriangleMeshGeometry triMesh;
shapes[i]->getTriangleMeshGeometry(triMesh);
triMesh.scale.scale *= lengthScale;
shapes[i]->setGeometry(triMesh);
}
break;
case PxGeometryType::eHEIGHTFIELD: {
PxHeightFieldGeometry hf;
shapes[i]->getHeightFieldGeometry(hf);
hf.columnScale *= lengthScale;
hf.heightScale *= lengthScale;
hf.rowScale *= lengthScale;
shapes[i]->setGeometry(hf);
}
break;
case PxGeometryType::eINVALID:
case PxGeometryType::eGEOMETRY_COUNT:
break;
}
}
}
}
void customizeVehicleToLengthScale(const PxReal lengthScale,
PxRigidDynamic *rigidDynamic,
PxVehicleWheelsSimData *wheelsSimData,
PxVehicleDriveSimData4W *driveSimData) {
customizeVehicleToLengthScale(lengthScale, rigidDynamic, wheelsSimData,
static_cast<PxVehicleDriveSimData *>(driveSimData));
//Ackermann geometry.
if (driveSimData) {
PxVehicleAckermannGeometryData ackermannData = driveSimData->getAckermannGeometryData();
ackermannData.mAxleSeparation *= lengthScale;
ackermannData.mFrontWidth *= lengthScale;
ackermannData.mRearWidth *= lengthScale;
driveSimData->setAckermannGeometryData(ackermannData);
}
}
} // namespace snippetvehicle
| [
"jacksoncougar@gmail.com"
] | jacksoncougar@gmail.com |
608405a1669ac920d4d66bbe319596a84d9d303d | 20e7067fb0a5a7ab343d567d4c79a6ff54de4402 | /inttoRoman/IntToRoman.cpp | 5d3af453ad145a8ebd00ba870cde4587ed651c92 | [] | no_license | andrewrong/Interview | 7a6007d53a0e522cbcfad1cc69e2c3a7085d2628 | 4e2c59f52bf32c3c36a82b14be5da3b81403b9c4 | refs/heads/master | 2020-12-24T16:42:34.549602 | 2013-05-18T12:22:22 | 2013-05-18T12:22:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,289 | cpp | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
string IntToRoman(int lhs)
{
string result;
char romanChar[7] = {'M','D','C','L','X','V','I'};
int romanInt[7] = {1000,500,100,50,10,5,1};
int tmp = lhs;
for(int i = 0; i < 7 && tmp;)
{
int divisor = tmp / romanInt[i];
if(divisor)
{
if(divisor <= 3)
{
for(int j = 0;j < divisor; j++)
{
result += romanChar[i];
}
tmp -= (int)(divisor * romanInt[i]);
}
else
{
result += romanChar[i];
result += romanChar[i-1];
tmp -= (int)(divisor * romanInt[i]);
i++;
}
}
else
{
if(tmp >= (int)(0.9 * romanInt[i]))
{
if(i == 1 || i == 3 || i == 5)
{
result += romanChar[i+1];
result += romanChar[i];
tmp -= (int)(0.8 * romanInt[i]);
i++;
}
else
{
result += romanChar[i+2];
result += romanChar[i];
tmp -= (int)(0.9 * romanInt[i]);
i += 2;
}
}
else
{
i++;
}
}
}
return result;
}
int main()
{
ofstream inf("int.txt",ios_base::app);
if(!inf)
{
cerr << "Don't open your file" << endl;
return -1;
}
for(int i = 1; i <= 3999; i++)
{
inf << IntToRoman(i) << " " << i << endl;
}
inf.close();
return 0;
}
| [
"smy19890720@gmail.com"
] | smy19890720@gmail.com |
c27f1c2b7b9e3d18c0870b4abb4add15c59c2d41 | b399235d6532394c27a4bd5157479275a5dc0197 | /Interpolation_Search.cpp | bfec8e2ca97ff739bd386a624f7741175446cd6d | [] | no_license | chhaya74/HactoberFest2021 | 01390baea42a9ebf10a4f3fff72dd146526bc5cb | afb348d723763e58331fd022bf3d67c6c8c5586a | refs/heads/main | 2023-08-24T21:11:45.181579 | 2021-10-28T14:12:25 | 2021-10-28T14:12:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,006 | cpp | //Searching element in a sorted uniformly distributed array using interpolation search
#include <iostream>
using namespace std;
int interpolation_search(int a[],int n,int key)
{
int pos,first,last;
first=0;
last=n-1;
while(first<=last)
{
pos=(first+key-a[first])*(last-first)/(a[last]-a[first]);
if(a[pos]==key)
{
return pos;
}
else if(key<a[pos])
{
last=pos-1;
}
else if(key>a[pos])
{
first=pos+1;
}
}
return -1;
}
int main()
{
int n,a[20],b,i,key;
cout<<"Enter the size of array : ";
cin>>n;
cout<<"Enter the elements of the array : ";
for(i=0;i<n;i++)
{
cin>>a[i];
}
cout<<"Enter the element you want to search : ";
cin>>key;
b=interpolation_search(a,n,key);
if(b==-1)
{
cout<<"Element not found ";
}
else
{
cout<<"Element found at index "<<b;
}
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
e4c8702823cedabb8434a2cb22e24fcbdc8eff75 | 0601003cd1ef4ece56db78967c38689a7714e05f | /Talisman_Game/Mines.h | bbdfec87c7f7639be9f4973c06716a8c860ec75f | [] | no_license | Maromarius/talisman_game | e2ed85fbf2135f856b1d6266c4a3b5057c97091f | 622093f22f442396c20526bc1a1f41db9653d272 | refs/heads/master | 2020-06-07T07:04:10.221993 | 2012-12-09T03:47:19 | 2012-12-09T03:47:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 239 | h | #ifndef MINES_H
#define MINES_H
#include <string>
#include "Area.h"
using namespace std;
class Mines: public Area
{
public:
static const string NAME ;
static const string DESCRIPTION;
Mines(int);
~Mines();
};
#endif | [
"xmike.natale@gmail.com"
] | xmike.natale@gmail.com |
637bb48e6406d678f1c18e057427c1f4fe2352aa | 1b2c0284370ebef255a1fbe8027f059022946f56 | /source/ideal_gas.cpp | 3de17b45ad4df34716a2de74e59548266628e708 | [] | no_license | eladtan/Eulerian1D | dbe5172e198d08276dac5f37fceb0d0c0f17b2b6 | d17829429640cf887339f2c141dafd85a9a5ed7d | refs/heads/master | 2020-04-17T05:25:15.428769 | 2020-04-12T19:44:08 | 2020-04-12T19:44:08 | 166,277,961 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,258 | cpp | #include <cmath>
#include "ideal_gas.hpp"
#include "universal_error.hpp"
IdealGas::IdealGas(double AdiabaticIndex, bool SR):
g_(AdiabaticIndex), SR_(SR) {}
double IdealGas::getAdiabaticIndex(void) const
{
return g_;
}
double IdealGas::dp2e(double d, double p) const
{
if(SR_)
return p * g_ / (d*(g_ - 1));
else
return p/d/(g_-1);
}
double IdealGas::de2p(double d, double e) const
{
if (e < 0)
throw UniversalError("Negative thermal energy");
if(SR_)
return e * (g_ - 1)*d / g_;
else
return (g_-1)*e*d;
}
double IdealGas::dp2c(double d, double p) const
{
if (d < 0 || p < 0)
{
UniversalError eo("Imaginary Cs");
eo.AddEntry("Density", d);
eo.AddEntry("Pressure", p);
throw eo;
}
if(SR_)
return std::sqrt(g_*p / (d + p * g_ / ((g_ - 1))));
else
return sqrt(g_*p/d);
}
double IdealGas::de2c(double d, double e) const
{
double p = de2p(d, e);
if(SR_)
return std::sqrt(g_*p / (d*(1 + e)));
else
return sqrt(g_*p/d);
}
double IdealGas::dp2s(double d, double p) const
{
return p*pow(d,-g_);
}
double IdealGas::sd2p(double s, double d) const
{
if (d < 0 || s < 0)
{
UniversalError eo("Imaginary pressure");
eo.AddEntry("Density", d);
eo.AddEntry("Entropy", s);
throw eo;
}
return s*pow(d,g_);
}
| [
"eladtan1@Gmail.com"
] | eladtan1@Gmail.com |
e2ca6f6c9be8a638c1a3d7ffdac65702560af518 | 53e78fcbe38c09773edd28ec1dfe5954159436b3 | /beadandó/widget.cpp | 046b00e72929cd7e4bdf0f7161107e75cb28b792 | [] | no_license | CrazyMage24/bead_2 | 94c74e16dfa3827a11413b171ced7836acfed273 | 71c7db41a7be2f9d03680032277a21281fdf8795 | refs/heads/master | 2022-04-17T02:26:54.505485 | 2020-04-13T01:19:00 | 2020-04-13T01:19:00 | 254,690,480 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,044 | cpp | #include "widget.hpp"
Widget::Widget(int x_,int y_,int w_,int h_) : x(x_), y(y_), w(w_), h(h_)
{
kijelolt = false;
opened = false;
}
bool Widget::is_selected(int pos_x, int pos_y)
{
if(opened)
{
if(pos_x>x && pos_x<x+w && pos_y>y && pos_y<y+max_h+h)
{
kijelolt = true;
return true;
}
else
{
kijelolt = false;
return false;
}
}
else
{
if(pos_x>x && pos_x<x+w && pos_y>y && pos_y<y+h)
{
kijelolt = true;
return true;
}
else
{
kijelolt = false;
return false;
}
}
}
Number::Number(int x,int y,int w,int h,int mini,int maxi) : Widget(x,y,w,h)
{
this->mini=mini;
this->maxi=maxi;
NUM = (mini+maxi)/2;
}
void Number::show()
{
int part = w - h/2;
int r,g,b;
if(kijelolt)
{
r=255;
g=0;
b=0;
}
else
{
r=0;
g=128;
b=255;
}
// szines szele
gout << color(r,g,b) << move_to(x-2,y-2) << box(w+4,h+4);
// textbox
gout << color(220,220,220) << move_to(x,y) << box(part-1,h);
// pluszos
gout << color(220,220,220) << move_to(x+part+1,y) << box(h/2,h/2-1);
gout << color(r,g,b) << move_to(x+part+5, y+h*0.25 - 1) << box(h/2-8,2);
gout << color(r,g,b) << move_to(x+part+h/4, y + 4) << box(2,h*0.5 - 8);
// minuszos
gout << color(220,220,220) << move_to(x+part+1,y+h/2 + 2) << box(h/2,h/2 - 2);
gout << color(r,g,b) << move_to(x+part+5, y+h*0.75 + 1) << box(h/2-8,2);
stringstream ss;
ss << NUM;
gout << color(0,0,0) << move_to(x+5,y+h/2+10) << text(ss.str());
}
void Number::write(char s)
{
stringstream ss;
ss << NUM << s;
stringstream zz(ss.str());
zz >> NUM;
if(NUM > maxi)
{
NUM = maxi;
ss.str("");
}
if(NUM < mini)
{
NUM = mini;
ss.str("");
}
}
void Number::changeNUM(int x)
{
if(x>0 && NUM < maxi)
{
NUM+=x;
}
if(x<0 && NUM > mini)
{
NUM+=x;
}
}
void Number::drag(int pos_x, int pos_y)
{
x = pos_x - mouseX;
y = pos_y - mouseY;
}
void Number::boundaries(int maxW, int maxH)
{
if(x<2)
{
x=2;
}
if(y<2)
{
y=2;
}
if(x+w>maxW+3)
{
x= maxW - w - 3;
}
if(y+h>maxH+3)
{
y = maxH - h - 3;
}
}
void Number::deleteDigit()
{
NUM /= 10;
}
void Number::operation(int pos_x, int pos_y)
{
int part = w - h/2;
int r=255;
int g=0;
int b=0;
if(pos_x>x+part && pos_x < x+w && pos_y>y && pos_y < y + h/2)
{
// pluszos
gout << color(255,255,255) << move_to(x+part+1,y) << box(h/2,h/2-1);
gout << color(r,g,b) << move_to(x+part+5, y+h*0.25 - 1) << box(h/2-8,2);
gout << color(r,g,b) << move_to(x+part+h/4, y + 4) << box(2,h*0.5 - 8);
changeNUM(1);
}
if(pos_x>x+part && pos_x < x+w && pos_y>y + h/2 && pos_y < y + h)
{
// minuszos
gout << color(255,255,255) << move_to(x+part+1,y+h/2 + 2) << box(h/2,h/2 - 2);
gout << color(r,g,b) << move_to(x+part+5, y+h*0.75 + 1) << box(h/2-8,2);
changeNUM(-1);
}
}
void Number::setMouse(int pos_x, int pos_y)
{
mouseX = pos_x - x;
mouseY = pos_y - y;
}
void Number::setVersus(int x)
{
NUM*=x;
}
string Number::writeData()
{
stringstream ss;
ss << NUM;
return ss.str();
}
//---------------------------------------------------------------------------------------
DropDown::DropDown(int x,int y,int min_w,int min_h, int max_h, vector<string> items) : Widget(x,y,min_w,min_h)
{
this->max_h = max_h;
this->items=items;
highlight_string = items[0];
opened = false;
rollCount = 0;
}
void DropDown::show()
{
int part = w-h;
int r,g,b;
int full_h = items.size() * h;
int kifer = max_h / h;
int max_letekeres = items.size() / kifer;
if(kijelolt)
{
r=255;
g=0;
b=0;
}
else
{
r=41;
g=132;
b=65;
}
if(opened)
{
//textbox
gout << color(r,g,b) << move_to(x-2,y-2) << box(w+4,h+4);
gout << color(220,220,220) << move_to(x,y) << box(part-1,h);
gout << color(220,220,220) << move_to(x+part+1,y) << box(w-part,h);
for(int i = 0; i < 5; i++)
{
gout << color(r,g,b) << move_to(x+part+1,y+h/3+i + h/2) << line(h/2+1,-h/2+1);
gout << color(r,g,b) << move_to(x+w,y+h/3+i + h/2) << line(-h/2-1,-h/2+1);
}
}
else
{
//textbox
gout << color(r,g,b) << move_to(x-2,y-2) << box(w+4,h+4);
gout << color(220,220,220) << move_to(x,y) << box(part-1,h);
gout << color(220,220,220) << move_to(x+part+1,y) << box(w-part,h);
for(int i = 0; i < 5; i++)
{
gout << color(r,g,b) << move_to(x+part+1,y+h/3+i) << line(h/2+1,h/2+1);
gout << color(r,g,b) << move_to(x+w,y+h/3+i) << line(-h/2-1,h/2+1);
}
}
gout << color(0,0,0) <<move_to(x+2,y+h/1.5) << text(highlight_string);
if(opened && kijelolt)
{
for(size_t i = 0; i < items.size(); i++)
{
if((i+1)*h<= max_h)
{
if(items[i]==highlight_string)
{
gout << color(r,g,b) << move_to(x-2,y+(i+1)*h-2) << box(w+4,h+4);
gout << color(r,g,b) << move_to(x,y+(i+1)*h) << box(w,h);
gout << color(255,255,255) <<move_to(x+2,y+(i+1)*h + h/1.5) << text(items[i]);
}
else
{
gout << color(r,g,b) << move_to(x-2,y+(i+1)*h-2) << box(w+4,h+4);
gout << color(220,220,220) << move_to(x,y+(i+1)*h) << box(w,h);
gout << color(0,0,0) <<move_to(x+2,y+(i+1)*h + h/1.5) << text(items[i]);
}
}
}
if(max_h < full_h)
{
gout << color(120,120,120) << move_to(x+w*0.9,y+h+rollCount) << box(w*0.1,h*max_h/full_h);
}
}
}
void DropDown::write(char s)
{
}
void DropDown::changeNUM(int x)
{
if(opened && rollCount < items.size())
{
rollCount+=x;
}
}
void DropDown::drag(int pos_x, int pos_y)
{
x = pos_x - mouseX;
y = pos_y - mouseY;
}
void DropDown::boundaries(int maxW, int maxH)
{
if(opened)
{
if(x<2)
{
x=2;
}
if(y<2)
{
y=2;
}
if(x+w>maxW+3)
{
x= maxW - w - 3;
}
if(y + h + max_h >maxH+3)
{
y = maxH - max_h - h - 3;
}
}
else
{
if(x<2)
{
x=2;
}
if(y<2)
{
y=2;
}
if(x+w>maxW+3)
{
x= maxW - w - 3;
}
if(y+h>maxH+3)
{
y = maxH - h - 3;
}
}
}
void DropDown::deleteDigit()
{
}
void DropDown::operation(int pos_x, int pos_y)
{
int part = w - h;
int r,g,b;
if(kijelolt)
{
r=255;
g=0;
b=0;
}
else
{
r=41;
g=132;
b=65;
}
if(pos_x>x+part && pos_x < x+w && pos_y>y && pos_y < y + h)
{
opened = !opened;
}
if(opened)
{
for(size_t i = 0; i < items.size(); i++)
{
if((i+1)*h<= max_h)
{
if(items[i]==highlight_string)
{
gout << color(r,g,b) << move_to(x-2,y+(i+1)*h-2) << box(w+4,h+4);
gout << color(r,g,b) << move_to(x,y+(i+1)*h) << box(w,h);
gout << color(255,255,255) <<move_to(x+2,y+(i+1)*h + h/1.5) << text(items[i]);
}
else
{
gout << color(r,g,b) << move_to(x-2,y+(i+1)*h-2) << box(w+4,h+4);
gout << color(220,220,220) << move_to(x,y+(i+1)*h) << box(w,h);
gout << color(0,0,0) <<move_to(x+2,y+(i+1)*h + h/1.5) << text(items[i]);
}
}
if(pos_x > x && pos_x < x + w)
{
if(pos_y > y+(i+1)*h && pos_y < y+(i+2)*h)
{
highlight_string = items[i];
opened = false;
}
}
}
}
}
void DropDown::setMouse(int pos_x, int pos_y)
{
mouseX = pos_x - x;
mouseY = pos_y - y;
}
void DropDown::setVersus(int x)
{
}
string DropDown::writeData()
{
return highlight_string;
}
| [
"noreply@github.com"
] | noreply@github.com |
f96ddeb8780fb3f864f8e934bba7d9f63c2180f1 | a9215be73392dda1653a2ea6b339704f872a8e90 | /src/server/game/Weather/WeatherMgr.cpp | 3cbfabebe284cc631e9b03c88fd80122277585af | [] | no_license | szu-lab/CoreMop | e9e261ed960d5455130f1019cc20573b64d883f7 | 29fd952d181d38b92afc0d85a2d62c95a2544bc5 | refs/heads/master | 2020-09-13T20:32:33.154146 | 2019-11-18T15:16:42 | 2019-11-18T15:16:42 | 222,895,411 | 3 | 2 | null | 2019-11-20T09:06:29 | 2019-11-20T09:06:28 | null | UTF-8 | C++ | false | false | 5,400 | cpp | /*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* 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, see <http://www.gnu.org/licenses/>.
*/
/** \file
\ingroup world
*/
#include "WeatherMgr.h"
#include "Weather.h"
#include "Log.h"
#include "ObjectMgr.h"
#include "AutoPtr.h"
namespace WeatherMgr
{
namespace
{
typedef UNORDERED_MAP<uint32, JadeCore::AutoPtr<Weather, ACE_Null_Mutex> > WeatherMap;
typedef UNORDERED_MAP<uint32, WeatherData> WeatherZoneMap;
WeatherMap m_weathers;
WeatherZoneMap mWeatherZoneMap;
WeatherData const* GetWeatherData(uint32 zone_id)
{
WeatherZoneMap::const_iterator itr = mWeatherZoneMap.find(zone_id);
return (itr != mWeatherZoneMap.end()) ? &itr->second : NULL;
}
}
/// Find a Weather object by the given zoneid
Weather* FindWeather(uint32 id)
{
WeatherMap::const_iterator itr = m_weathers.find(id);
return (itr != m_weathers.end()) ? itr->second.get() : 0;
}
/// Remove a Weather object for the given zoneid
void RemoveWeather(uint32 id)
{
// not called at the moment. Kept for completeness
WeatherMap::iterator itr = m_weathers.find(id);
if (itr != m_weathers.end())
m_weathers.erase(itr);
}
/// Add a Weather object to the list
Weather* AddWeather(uint32 zone_id)
{
WeatherData const* weatherChances = GetWeatherData(zone_id);
// zone does not have weather, ignore
if (!weatherChances)
return NULL;
Weather* w = new Weather(zone_id, weatherChances);
m_weathers[w->GetZone()].reset(w);
w->ReGenerate();
w->UpdateWeather();
return w;
}
void LoadWeatherData()
{
uint32 oldMSTime = getMSTime();
uint32 count = 0;
QueryResult result = WorldDatabase.Query("SELECT "
// 1 2 3 4
"zone, spring_rain_chance, spring_snow_chance, spring_storm_chance,"
// 5 6 7
"summer_rain_chance, summer_snow_chance, summer_storm_chance,"
// 8 9 10
"fall_rain_chance, fall_snow_chance, fall_storm_chance,"
// 11 12 13
"winter_rain_chance, winter_snow_chance, winter_storm_chance,"
// 14
"ScriptName FROM game_weather");
if (!result)
{
sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 weather definitions. DB table `game_weather` is empty.");
return;
}
do
{
Field* fields = result->Fetch();
uint32 zone_id = fields[0].GetUInt32();
WeatherData& wzc = mWeatherZoneMap[zone_id];
for (uint8 season = 0; season < WEATHER_SEASONS; ++season)
{
wzc.data[season].rainChance = fields[season * (MAX_WEATHER_TYPE-1) + 1].GetUInt8();
wzc.data[season].snowChance = fields[season * (MAX_WEATHER_TYPE-1) + 2].GetUInt8();
wzc.data[season].stormChance = fields[season * (MAX_WEATHER_TYPE-1) + 3].GetUInt8();
if (wzc.data[season].rainChance > 100)
{
wzc.data[season].rainChance = 25;
sLog->outError(LOG_FILTER_SQL, "Weather for zone %u season %u has wrong rain chance > 100%%", zone_id, season);
}
if (wzc.data[season].snowChance > 100)
{
wzc.data[season].snowChance = 25;
sLog->outError(LOG_FILTER_SQL, "Weather for zone %u season %u has wrong snow chance > 100%%", zone_id, season);
}
if (wzc.data[season].stormChance > 100)
{
wzc.data[season].stormChance = 25;
sLog->outError(LOG_FILTER_SQL, "Weather for zone %u season %u has wrong storm chance > 100%%", zone_id, season);
}
}
wzc.ScriptId = sObjectMgr->GetScriptId(fields[13].GetCString());
++count;
}
while (result->NextRow());
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u weather definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void SendFineWeatherUpdateToPlayer(Player* player)
{
WorldPacket data(SMSG_WEATHER, (4+4+4));
data << float(0.0f);
data << (uint32)WEATHER_STATE_FINE;
data.WriteBit(0);
player->GetSession()->SendPacket(&data);
}
void Update(uint32 diff)
{
///- Send an update signal to Weather objects
WeatherMap::iterator itr, next;
for (itr = m_weathers.begin(); itr != m_weathers.end(); itr = next)
{
next = itr;
++next;
if (!itr->second)
continue;
///- and remove Weather objects for zones with no player
// As interval > WorldTick
if (!itr->second->Update(diff))
m_weathers.erase(itr);
}
}
} // namespace
| [
"gennady.zamalaev@gmail.com"
] | gennady.zamalaev@gmail.com |
df9e76a64bc8752b31d52e2fb2b914fd7966b37a | d5b8f1d6b847f27d14b0a73baea0d6d563538a67 | /LEVEL_2_MEDIUM/45_c_AutomaticTypeDeduction_Error_if_not_initialised.cpp | 155480dbf933d1cfc7e429a5fafa1919ecdc2bb8 | [] | no_license | RS-codes/CppQuickRef | 047d0d65cce3316fe83b4b678aafc5ed14e04a55 | 67b0152e28d4b259fa57815ead9fa4b4f9993657 | refs/heads/master | 2020-12-03T06:10:35.481444 | 2020-01-22T04:34:14 | 2020-01-22T04:34:14 | 231,223,871 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 276 | cpp | //#45_c. Automatic Type Deduction C++11 Feature:
//Error if not initialised-Demo
#include<iostream>
using namespace std;
int main()
{
/*note:initialise immediatly MUST!!!*/
auto qty;//ERROR
qty=10;//ERROR shud be iniatised, wer its declared
cout<<qty;
return 0;
}
| [
"RS-codes@github.com"
] | RS-codes@github.com |
a38a693d4a121649563b0e6a62740436263d728b | 0d709da61a4684f1aabe3bdb8edf78be238e2e27 | /Exam - Mar 2020/03.Snake/Snake.h | c06ff3f69571531c427faccca46431ee68f18f6d | [] | no_license | Vikadie/Cpp-codes | f1f947e104049fc90f3c46ab83d244cac351882c | c59cc576f8d839a0d74bcd66862d527e70b3aee6 | refs/heads/master | 2022-12-12T23:02:45.605465 | 2020-09-06T17:34:59 | 2020-09-06T17:34:59 | 283,164,981 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 812 | h | #ifndef SNAKE_H_
#define SNAKE_H_
#include "Structs.h"
#include "Defines.h"
#include <deque>
class Snake
{
public:
Snake(const int fieldRows,
const int fieldCols,
const Point & startPos);
~Snake();
StatusCode move(const Direction dir,
const std::vector<Point> & obstacles,
std::vector<Point> & powerUps);
std::deque<Point> & getSnakeNodes();
private:
const int _FIELD_ROWS;
const int _FIELD_COLS;
Point _currPos;
//std::deque<> has same API as std::vector<>
//with some additional functionalities
std::deque<Point> _snakeNodes; //holds snake head + body nodes
};
#endif /* SNAKE_H_ */
| [
"68245263+Vikadie@users.noreply.github.com"
] | 68245263+Vikadie@users.noreply.github.com |
ea05a28285025e79ce91015073b0c28c521352e4 | a1dec9b8941cdefce699d2b0c5c907b7f9f5cce1 | /C language/Cprogram/Max2nd.cpp | e0a84e864f7e46b488b9bffc374523093887e104 | [] | no_license | ddarkclay/programming-cookbook | 876763762e5922f267259233ddbca71b0d833ddb | 1ebe5ab0a1798cef25aeababfa3deb0e6a4b0d10 | refs/heads/master | 2020-11-24T09:14:08.502636 | 2019-12-14T18:34:52 | 2019-12-14T18:34:52 | 228,066,456 | 0 | 3 | null | 2019-12-15T02:34:29 | 2019-12-14T18:02:29 | Python | UTF-8 | C++ | false | false | 393 | cpp | /* program to print second greatest no*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,max2=0,max=0;
int no[5]={60,11,5,2,50};
clrscr();
max = no[0];
for(i=1;i<5;i++)
{
if(no[i] > max)
{
max2=max;
max=no[i];
}
else
if(no[i] > max2)
max2=no[i];
}
printf("\nGreatest no is %d",max);
printf("\n2nd greatst no is %d",max2);
getch();
}
| [
"vaibhavchaudhari8625@gmail.com"
] | vaibhavchaudhari8625@gmail.com |
b2ed10105de6ffae27bd06da0a2745dcd1890d9f | e542522d4bcddbe88a66879a7183a73c1bbdbb17 | /Codeforces/Rounds/Global/14/D/solve.cpp | 261c2288ed14ba76d30235dc1f53f77fe9d60d2d | [] | no_license | ishank-katiyar/Competitive-programming | 1103792f0196284cf24ef3f24bd243d18536f2f6 | 5240227828d5e94e2587d5d2fd69fa242d9d44ef | refs/heads/master | 2023-06-21T17:30:48.855410 | 2021-08-13T14:51:53 | 2021-08-13T14:51:53 | 367,391,580 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,159 | cpp | #include <bits/stdc++.h>
class ToString {
constexpr static int float_precision = 6;
public:
template<typename T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
static std::string to_string(const T x) { return std::to_string(x); }
template<typename T, typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr>
static std::string to_string(const T x) { std::stringstream tmp; tmp << std::fixed << std::setprecision(float_precision) << x; return tmp.str(); }
static std::string to_string(const std::string s) { return "\"" + s + "\""; }
static std::string to_string(const char* ch) { return to_string(std::string(ch)); }
static std::string to_string(const char ch) { return "\'" + std::string(1, ch) + "\'"; }
static std::string to_string(const bool b) { return (b ? "true" : "false"); }
template<typename X, typename Y>
static std::string to_string(const std::pair<X, Y> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template<int index, typename... X>
struct print_tuple { auto operator() (std::tuple<X...> a, std::vector<std::string>& __vector_tuple) { __vector_tuple.push_back(to_string(std::get<index>(a))); print_tuple<index - 1, X...>{}(a, __vector_tuple); } };
template<typename... X>
struct print_tuple<0, X...> { auto operator() (std::tuple<X...> a, std::vector<std::string>& __vector_tuple) { __vector_tuple.push_back(to_string(std::get<0>(a))); } };
template<typename... T>
static std::string to_string(const std::tuple<T...> a) { std::vector<std::string> __vector_tuple; print_tuple<std::tuple_size<decltype(a)>::value - 1, T...>{}(a, __vector_tuple); std::reverse (__vector_tuple.begin(), __vector_tuple.end()); return to_string(__vector_tuple); }
static std::string to_string(const std::vector<bool> v) { bool first = true; std::string res = "{"; for (const bool x: v) { if (!first) res += ", "; first = false, res += to_string(x); } res += "}"; return res; }
template <size_t N>
static std::string to_string(const std::bitset<N> v) { std::string res = ""; for (size_t i = 0; i < N; i++) { res += static_cast<char> ('0' + v[i]); } return to_string(res); }
template<typename ...T>
static std::string to_string(const std::queue<T...> A) { auto a = A; if (a.empty()) return to_string (std::vector<int>(0)); auto tmp_back = a.front(); std::vector<decltype(tmp_back)> res; while(a.empty() == false) { res.push_back(a.front()); a.pop(); } return to_string(res); }
template<typename ...T>
static std::string to_string(const std::stack<T...> A) { auto a = A; if (a.empty()) return to_string (std::vector<int>(0)); auto tmp_top = a.top(); std::vector<decltype(tmp_top)> res; while(a.empty() == false) { res.push_back(a.top()); a.pop(); } return to_string(res); }
template<typename ...T>
static std::string to_string(const std::priority_queue<T...> A) { auto a = A; if (a.empty()) return to_string (std::vector<int>(0)); auto tmp_top = a.top(); std::vector<decltype(tmp_top)> res; while(a.empty() == false) { res.push_back(a.top()); a.pop(); } return to_string(res); }
// check if container have contant iterator and begin and end - "https://stackoverflow.com/a/25216349/11587347"
template<typename...> struct void_ { using type = void; };
template<typename... Args> using Void = typename void_<Args...>::type;
template<typename T, typename = void> struct has_const_iterator : std::false_type {};
template<typename T> struct has_const_iterator<T, Void<typename T::const_iterator>> : std::true_type {};
struct has_begin_end_impl { template<typename T, typename Begin = decltype(std::declval<const T&>().begin()), typename End = decltype(std::declval<const T&>().end())> static std::true_type test(int); template<typename...> static std::false_type test(...); };
template<typename T> struct has_begin_end : decltype(has_begin_end_impl::test<T>(0)) {};
template<typename T, typename std::enable_if<has_const_iterator<T>::value && has_begin_end<T>::value>::type* = nullptr>
static std::string to_string(const T a) { std::string res = "{"; bool first = true; for(const auto& x: a) { if(first == false) res += ", "; first = false, res += to_string(x); } res += "}"; return res; }
// SFINAE test to check if if class have to_string method - "https://stackoverflow.com/a/257382/11587347"
template <typename T>
class have_to_string {
typedef char one;
struct two { char x[2]; };
template <typename C> static one test( decltype(&C::to_string) ) ;
template <typename C> static two test(...);
public:
constexpr static bool value = sizeof(test<T>(0)) == sizeof(char);
};
template<typename T, typename std::enable_if<have_to_string<T>::value>::type* = nullptr>
static std::string to_string (const T x) {
return x.to_string ();
}
};
void debug() { std::cerr << "]" << std::endl; }
template<class H, class... T>
void debug(H head, T... tail) { std::cerr << ToString::to_string(head) << " "; debug(tail...); }
#ifdef LOCAL
#define debug(...) std::cerr << "[" << #__VA_ARGS__ << " ] = ["; debug(__VA_ARGS__);
#else
#define debug(...)
#endif
// Ordered_set
#include <ext/pb_ds/assoc_container.hpp> // Common file
using namespace __gnu_pbds;
template<class X, class cmp = std::less<X>>
using ordered_set = tree<X, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
// Random number Generator
std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
template<class A> A rnd(A x, A y) { return std::uniform_int_distribution<A> (x, y) (rng); }
namespace std {
template<class Fun>
class y_combinator_result {
Fun fun_;
public:
template<class T> explicit y_combinator_result(T &&fun): fun_(std::forward<T>(fun)) {}
template<class ...Args> decltype(auto) operator()(Args &&...args) { return fun_(std::ref(*this), std::forward<Args>(args)...); }
};
template<class Fun> decltype(auto) y_combinator(Fun &&fun) { return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun)); }
} // namespace std
using namespace std;
int main() {
std::cin.tie(0)->sync_with_stdio(0);
auto solve = [&] () -> void {
int n, l, r;
cin >> n >> l >> r;
vector<pair<int, int>> a (n);
for (int i = 0; i < n; i++) {
int x;
cin >> x;
--x;
(i < l ? a[x].first : a[x].second) += 1;
}
for (int i = 0; i < n; i++) {
int mn = min (a[i].first, a[i].second);
a[i].first -= mn;
a[i].second -= mn;
}
int bal = l - r;
int ans = 0;
for (int i = 0; i < n; i++) {
assert (a[i].first == 0 || a[i].second == 0);
if (bal > 0) {
int xx = a[i].first;
xx /= 2;
xx = min (xx, bal / 2);
bal -= 2 * xx;
ans += xx;
a[i].first -= 2 * xx;
}
if (bal < 0) {
int xx = a[i].second;
xx /= 2;
xx = min (xx, abs(bal) / 2);
bal += 2 * xx;
ans += xx;
a[i].second -= 2 * xx;
}
}
// assert (bal == 0);
ans += abs (bal) / 2;
int cnt = 0;
for (int i = 0; i < n; i++) {
cnt += a[i].first + a[i].second;
}
assert (cnt % 2 == 0);
cout << ans + cnt / 2 << '\n';
};
int TestCase = 1;
cin >> TestCase;
for (int TestCaseNumber = 1; TestCaseNumber <= TestCase; TestCaseNumber += 1) {
solve ();
}
return 0;
}
| [
"ishankkatiyar162@gmail.com"
] | ishankkatiyar162@gmail.com |
ad0ee16ae0abffb2edc9bbbb0bdf512bbcd3c4fe | 7dc53606032bd907765cccc88245c0efd3e495cb | /cusend/property/can_query.hpp | b9d32ce66e278ab357e4a13b6c6d320cb4dc96d6 | [] | no_license | nerikhman/cusend | c8a1b2fd3fd428d492c6a682d40c0596214010a5 | 0c797af1a462a357af78df954d4aaf64fc038878 | refs/heads/master | 2022-11-19T20:01:37.025920 | 2020-07-17T22:12:30 | 2020-07-17T22:12:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,976 | hpp | // Copyright (c) 2020, NVIDIA CORPORATION. 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 NVIDIA CORPORATION 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 ``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.
#pragma once
#include "../detail/prologue.hpp"
#include "../detail/type_traits/is_detected.hpp"
#include "query.hpp"
CUSEND_NAMESPACE_OPEN_BRACE
template<class T, class P>
using can_query = detail::is_detected<query_t, T, P>;
#if __cpp_variable_templates
template<class T, class P>
constexpr bool can_query_v = can_query<T,P>::value;
#endif
CUSEND_NAMESPACE_CLOSE_BRACE
#include "../detail/epilogue.hpp"
| [
"jaredhoberock@gmail.com"
] | jaredhoberock@gmail.com |
877e1adddf1703972df8a957dd8a94bb7238c092 | ef0908274c3f260d8e5cd1b905acf158b5147d59 | /C/algorithm2/Graph/prac_queue.cpp | fec9de366c6725cfa72ffaee90ab705eb09715cd | [] | no_license | comeeasy/study | 240d24999edc07d02f10261092abd9781f716b4a | ccb0de2ee944a29234ca643c1ce1dd39012d405b | refs/heads/master | 2021-06-28T19:43:24.893583 | 2021-06-07T14:10:46 | 2021-06-07T14:10:46 | 228,672,620 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 384 | cpp | #include <queue>
#include <iostream>
using namespace std;
void show_queue(queue<int> q) {
for(int i=0; !(q.empty()); ++i) {
cout << q.front() << ' ';
q.pop();
}
cout << endl;
}
int main() {
queue<int> q;
q.push(1);
q.push(2);
q.push(3);
q.push(4);
q.push(5);
show_queue(q);
q.pop();
show_queue(q);
return 0;
}
| [
"zz1236zz@naver.com"
] | zz1236zz@naver.com |
a0f690e133f561c6d0338d41884dc67b89164de5 | 784631d8a595a332ac82f01118f88bc885b6fd9d | /third-part/SkMatrix/include/SkTypes.h | 222627f002b109881522c3d8184d994eae481ec5 | [] | no_license | huanghaining/soui | 2e98e7085ed9f41aadbf1ad9fbb0b77c87badfea | 0074b10977923af5362bb43c395048f2f719f4a5 | refs/heads/master | 2023-01-01T23:03:48.505764 | 2020-10-30T13:12:05 | 2020-10-30T13:12:05 | 308,633,022 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,278 | h | /*
* Copyright 2006 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkTypes_DEFINED
#define SkTypes_DEFINED
#include <memory>
#include <assert.h>
#include "SkPreConfig.h"
#ifndef RC_INVOKED
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef signed char int_least8_t;
typedef short int_least16_t;
typedef int int_least32_t;
typedef long long int_least64_t;
typedef unsigned char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned int uint_least32_t;
typedef unsigned long long uint_least64_t;
typedef signed char int_fast8_t;
typedef int int_fast16_t;
typedef int int_fast32_t;
typedef long long int_fast64_t;
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
typedef unsigned long long uint_fast64_t;
typedef long long intmax_t;
typedef unsigned long long uintmax_t;
#endif // RC_INVOKED
/** \file SkTypes.h
*/
/** See SkGraphics::GetVersion() to retrieve these at runtime
*/
//#define SKIA_VERSION_MAJOR 1
//#define SKIA_VERSION_MINOR 0
//#define SKIA_VERSION_PATCH 0
namespace SOUI {
// bzero is safer than memset, but we can't rely on it, so... sk_bzero()
static inline void sk_bzero(void* buffer, size_t size) {
memset(buffer, 0, size);
}
///////////////////////////////////////////////////////////////////////////////
#define SK_INIT_TO_AVOID_WARNING = 0
#ifdef SK_DEBUG
#define SkASSERT(cond) assert(cond)
#define SkDEBUGFAIL(message) SkASSERT(false && message)
#define SkDEBUGCODE(code) code
#define SkDECLAREPARAM(type, var) , type var
#define SkPARAM(var) , var
#define SkDEBUGF(args ) SkDebugf args
#define SkAssertResult(cond) SkASSERT(cond)
#else
#define SkASSERT(cond)
#define SkDEBUGFAIL(message)
#define SkDEBUGCODE(code)
#define SkDEBUGF(args)
#define SkDECLAREPARAM(type, var)
#define SkPARAM(var)
// unlike SkASSERT, this guy executes its condition in the non-debug build
#define SkAssertResult(cond) cond
#endif
#define SkFAIL(message) SK_ALWAYSBREAK(false && message)
// We want to evaluate cond only once, and inside the SkASSERT somewhere so we see its string form.
// So we use the comma operator to make an SkDebugf that always returns false: we'll evaluate cond,
// and if it's true the assert passes; if it's false, we'll print the message and the assert fails.
#define SkASSERTF(cond, fmt, ...) SkASSERT((cond) || (SkDebugf(fmt"\n", __VA_ARGS__), false))
#ifdef SK_DEVELOPER
#define SkDEVCODE(code) code
#else
#define SkDEVCODE(code)
#endif
#ifdef SK_IGNORE_TO_STRING
#define SK_TO_STRING_NONVIRT()
#define SK_TO_STRING_VIRT()
#define SK_TO_STRING_PUREVIRT()
#define SK_TO_STRING_OVERRIDE()
#else
// the 'toString' helper functions convert Sk* objects to human-readable
// form in developer mode
#define SK_TO_STRING_NONVIRT() void toString(SkString* str) const;
#define SK_TO_STRING_VIRT() virtual void toString(SkString* str) const;
#define SK_TO_STRING_PUREVIRT() virtual void toString(SkString* str) const = 0;
#define SK_TO_STRING_OVERRIDE() virtual void toString(SkString* str) const SK_OVERRIDE;
#endif
template <bool>
struct SkCompileAssert {
};
// Uses static_cast<bool>(expr) instead of bool(expr) due to
// https://connect.microsoft.com/VisualStudio/feedback/details/832915
// The extra parentheses in SkCompileAssert<(...)> are a work around for
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57771
// which was fixed in gcc 4.8.2.
#define SK_COMPILE_ASSERT(expr, msg) \
typedef SkCompileAssert<(static_cast<bool>(expr))> \
msg[static_cast<bool>(expr) ? 1 : -1] SK_USED
/*
* Usage: SK_MACRO_CONCAT(a, b) to construct the symbol ab
*
* SK_MACRO_CONCAT_IMPL_PRIV just exists to make this work. Do not use directly
*
*/
#define SK_MACRO_CONCAT(X, Y) SK_MACRO_CONCAT_IMPL_PRIV(X, Y)
#define SK_MACRO_CONCAT_IMPL_PRIV(X, Y) X ## Y
/*
* Usage: SK_MACRO_APPEND_LINE(foo) to make foo123, where 123 is the current
* line number. Easy way to construct
* unique names for local functions or
* variables.
*/
#define SK_MACRO_APPEND_LINE(name) SK_MACRO_CONCAT(name, __LINE__)
/**
* For some classes, it's almost always an error to instantiate one without a name, e.g.
* {
* SkAutoMutexAcquire(&mutex);
* <some code>
* }
* In this case, the writer meant to hold mutex while the rest of the code in the block runs,
* but instead the mutex is acquired and then immediately released. The correct usage is
* {
* SkAutoMutexAcquire lock(&mutex);
* <some code>
* }
*
* To prevent callers from instantiating your class without a name, use SK_REQUIRE_LOCAL_VAR
* like this:
* class classname {
* <your class>
* };
* #define classname(...) SK_REQUIRE_LOCAL_VAR(classname)
*
* This won't work with templates, and you must inline the class' constructors and destructors.
* Take a look at SkAutoFree and SkAutoMalloc in this file for examples.
*/
#define SK_REQUIRE_LOCAL_VAR(classname) \
SK_COMPILE_ASSERT(false, missing_name_for_##classname)
///////////////////////////////////////////////////////////////////////
/**
* Fast type for signed 8 bits. Use for parameter passing and local variables,
* not for storage.
*/
typedef int S8CPU;
/**
* Fast type for unsigned 8 bits. Use for parameter passing and local
* variables, not for storage
*/
typedef unsigned U8CPU;
/**
* Fast type for signed 16 bits. Use for parameter passing and local variables,
* not for storage
*/
typedef int S16CPU;
/**
* Fast type for unsigned 16 bits. Use for parameter passing and local
* variables, not for storage
*/
typedef unsigned U16CPU;
/**
* Meant to be faster than bool (doesn't promise to be 0 or 1,
* just 0 or non-zero
*/
typedef int SkBool;
/**
* Meant to be a small version of bool, for storage purposes. Will be 0 or 1
*/
typedef uint8_t SkBool8;
#define SkToS8(x) ((int8_t)(x))
#define SkToU8(x) ((uint8_t)(x))
#define SkToS16(x) ((int16_t)(x))
#define SkToU16(x) ((uint16_t)(x))
#define SkToS32(x) ((int32_t)(x))
#define SkToU32(x) ((uint32_t)(x))
#define SkToInt(x) ((int)(x))
#define SkToUInt(x) ((unsigned)(x))
#define SkToSizeT(x) ((size_t)(x))
/** Returns 0 or 1 based on the condition
*/
#define SkToBool(cond) ((cond) != 0)
#define SK_MaxS16 32767
#define SK_MinS16 -32767
#define SK_MaxU16 0xFFFF
#define SK_MinU16 0
#define SK_MaxS32 0x7FFFFFFF
#define SK_MinS32 -SK_MaxS32
#define SK_MaxU32 0xFFFFFFFF
#define SK_MinU32 0
#define SK_NaN32 (1 << 31)
/** Returns true if the value can be represented with signed 16bits
*/
static inline bool SkIsS16(long x) {
return (int16_t)x == x;
}
/** Returns true if the value can be represented with unsigned 16bits
*/
static inline bool SkIsU16(long x) {
return (uint16_t)x == x;
}
//////////////////////////////////////////////////////////////////////////////
#ifndef SK_OFFSETOF
#define SK_OFFSETOF(type, field) (size_t)((char*)&(((type*)1)->field) - (char*)1)
#endif
/** Returns the number of entries in an array (not a pointer)
*/
#define SK_ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0]))
#define SkAlign2(x) (((x) + 1) >> 1 << 1)
#define SkIsAlign2(x) (0 == ((x) & 1))
#define SkAlign4(x) (((x) + 3) >> 2 << 2)
#define SkIsAlign4(x) (0 == ((x) & 3))
#define SkAlign8(x) (((x) + 7) >> 3 << 3)
#define SkIsAlign8(x) (0 == ((x) & 7))
#define SkAlignPtr(x) (sizeof(void*) == 8 ? SkAlign8(x) : SkAlign4(x))
#define SkIsAlignPtr(x) (sizeof(void*) == 8 ? SkIsAlign8(x) : SkIsAlign4(x))
typedef uint32_t SkFourByteTag;
#define SkSetFourByteTag(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
/** 32 bit integer to hold a unicode value
*/
typedef int32_t SkUnichar;
/** 32 bit value to hold a millisecond count
*/
typedef uint32_t SkMSec;
/** 1 second measured in milliseconds
*/
#define SK_MSec1 1000
/** maximum representable milliseconds
*/
#define SK_MSecMax 0x7FFFFFFF
/** Returns a < b for milliseconds, correctly handling wrap-around from 0xFFFFFFFF to 0
*/
#define SkMSec_LT(a, b) ((int32_t)(a) - (int32_t)(b) < 0)
/** Returns a <= b for milliseconds, correctly handling wrap-around from 0xFFFFFFFF to 0
*/
#define SkMSec_LE(a, b) ((int32_t)(a) - (int32_t)(b) <= 0)
/** The generation IDs in Skia reserve 0 has an invalid marker.
*/
#define SK_InvalidGenID 0
/** The unique IDs in Skia reserve 0 has an invalid marker.
*/
#define SK_InvalidUniqueID 0
/****************************************************************************
The rest of these only build with C++
*/
#ifdef __cplusplus
/** Faster than SkToBool for integral conditions. Returns 0 or 1
*/
static inline int Sk32ToBool(uint32_t n) {
return (n | (0-n)) >> 31;
}
/** Generic swap function. Classes with efficient swaps should specialize this function to take
their fast path. This function is used by SkTSort. */
template <typename T> inline void SkTSwap(T& a, T& b) {
T c(a);
a = b;
b = c;
}
static inline int32_t SkAbs32(int32_t value) {
if (value < 0) {
value = -value;
}
return value;
}
template <typename T> inline T SkTAbs(T value) {
if (value < 0) {
value = -value;
}
return value;
}
static inline int32_t SkMax32(int32_t a, int32_t b) {
if (a < b)
a = b;
return a;
}
static inline int32_t SkMin32(int32_t a, int32_t b) {
if (a > b)
a = b;
return a;
}
template <typename T> const T& SkTMin(const T& a, const T& b) {
return (a < b) ? a : b;
}
template <typename T> const T& SkTMax(const T& a, const T& b) {
return (b < a) ? a : b;
}
static inline int32_t SkSign32(int32_t a) {
return (a >> 31) | ((unsigned) -a >> 31);
}
static inline int32_t SkFastMin32(int32_t value, int32_t max) {
if (value > max) {
value = max;
}
return value;
}
/** Returns signed 32 bit value pinned between min and max, inclusively
*/
static inline int32_t SkPin32(int32_t value, int32_t min, int32_t max) {
if (value < min) {
value = min;
}
if (value > max) {
value = max;
}
return value;
}
static inline uint32_t SkSetClearShift(uint32_t bits, bool cond,
unsigned shift) {
SkASSERT((int)cond == 0 || (int)cond == 1);
return (bits & ~(1 << shift)) | ((int)cond << shift);
}
static inline uint32_t SkSetClearMask(uint32_t bits, bool cond,
uint32_t mask) {
return cond ? bits | mask : bits & ~mask;
}
///////////////////////////////////////////////////////////////////////////////
/** Use to combine multiple bits in a bitmask in a type safe way.
*/
template <typename T>
T SkTBitOr(T a, T b) {
return (T)(a | b);
}
/**
* Use to cast a pointer to a different type, and maintaining strict-aliasing
*/
template <typename Dst> Dst SkTCast(const void* ptr) {
union {
const void* src;
Dst dst;
} data;
data.src = ptr;
return data.dst;
}
//////////////////////////////////////////////////////////////////////////////
/** \class SkNoncopyable
SkNoncopyable is the base class for objects that may do not want to
be copied. It hides its copy-constructor and its assignment-operator.
*/
class SK_API SkNoncopyable {
public:
SkNoncopyable() {}
private:
SkNoncopyable(const SkNoncopyable&);
SkNoncopyable& operator=(const SkNoncopyable&);
};
// Can't guard the constructor because it's a template class.
#endif /* C++ */
}//end of namespace SOUI
#endif
| [
"harlinhuang@futunn.com"
] | harlinhuang@futunn.com |
0f1cfeaacabda4566b2fe6c548f07b2da6038d16 | ee289a64857bcc39551a28bdc0e271a95674c88b | /Listas/Lista 4/Lista 4_05/Lista 4_05.cpp | 99e1ca046ebcb778ba217ce02ccd1506e0c4b74b | [] | no_license | JorgeCalligopoulo/Estudos-Cplusplus | ac1f2e50959ecef1c7c0a06e6bb63371f4bbd070 | d6bbc7389d0bba703f7909e8f19d5a24810cf680 | refs/heads/master | 2023-02-25T04:39:53.796410 | 2021-01-25T19:06:02 | 2021-01-25T19:06:02 | 275,227,447 | 1 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 704 | cpp | /* Lista 4_05.cpp : This file contains the 'main' function. Program execution begins and ends there.
Escreva um programa que declare um inteiro, um real e um char, e ponteiros
para inteiro, real e char. Associe as variáveis aos ponteiros (use &). Modifique
os valores de cada variável usando os ponteiros. Imprima os valores das
variáveis antes e após a modificação.
*/
#include <iostream>
int a=15,*pa;
float b=16.15,*pb;
char c='c',*pc;
int main()
{
std::cout << "inteiro: " << a << "\nReal: " << b << "\nChar: " << c << std::endl;
pa = &a;
pb = &b;
pc = &c;
*pa = 10;
*pb = 15.16;
*pc = 'p';
std::cout << "inteiro: " << a << "\nReal: " << b << "\nChar: " << c << std::endl;
}
| [
"calligopoulo@Gmail.com"
] | calligopoulo@Gmail.com |
f757ecb3e633b9414d6b0c56af02d1bc7b25a40a | 726502b45c9c486a672be060a5b421d458f72b77 | /CarbonRender/Inc/CRSceneManager.h | fb86e054003f5571a01a09946878b11bf6a128ff | [
"MIT"
] | permissive | KinNoVation/CarbonRender | 6b2b83d9ecbb3ef0e392e74606990f0eaa9feb1e | 43634814379dd9590216623b59a96a5158b75668 | refs/heads/master | 2021-05-21T22:41:57.795487 | 2020-04-02T14:11:02 | 2020-04-02T14:11:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 686 | h | #ifndef CR_SCENEMANAGER
#define CR_SCENEMANAGER
#include "..\Inc\CRFbxImportManager.h"
#include "..\Inc\CRControllerManager.h"
#include "..\Inc\CRTerrainManager.h"
class SceneManager
{
private:
SceneManager();
static SceneManager* ins;
Object sceneRoot;
void Init();
public:
~SceneManager();
static SceneManager* Instance();
void LoadScene(string sceneName);
void WriteObj2XMLNode(xml_document<>* sceneDoc, xml_node<>* parent, Object* obj);
void ReadObjFromXMLNode(xml_node<>* xmlNode, Object* sceneNodeParent);
void SaveScene(string sceneName);
void Draw (Object* node, GLuint shaderProgram);
void DrawScene(GLuint shaderProgram);
Object* GetRootNode();
};
#endif | [
"carbonsunsu@gmail.com"
] | carbonsunsu@gmail.com |
11a33699a3d8b426cea8234dc0915ca08fe355d6 | 70f8491a27470287090d3c2be061d5fce23f07a9 | /algorithms/p342/342.hpp | e3fb26d9a3e5c3625e9fd07366086d96d608d095 | [
"Apache-2.0"
] | permissive | baishuai/leetcode | 44094a91e95c0557394cf15324008f79fc2d6688 | 440ff08cf15e03ee64b3aa18370af1f75e958d18 | refs/heads/master | 2021-09-01T01:02:33.335046 | 2017-12-24T01:01:47 | 2017-12-24T01:01:47 | 84,698,557 | 10 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 647 | hpp |
#ifndef LEETCODE_342_HPP
#define LEETCODE_342_HPP
#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <numeric>
#include <cmath>
using namespace std;
/**
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.
Example:
Given num = 16, return true. Given num = 5, return false.
Follow up: Could you solve it without loops/recursion?
*/
class Solution {
public:
bool isPowerOfFour(int num) {
return num > 0 && (num & (num - 1)) == 0 && (num & 0x55555555) != 0;
}
};
#endif //LEETCODE_342_HPP
| [
"baishuai.io@gmail.com"
] | baishuai.io@gmail.com |
028653ddebe0eaa8e3683db21dd44f6794a8ab87 | 27a26f99716c63bcf9c98f430e20b8eb8de11aea | /demo_Grove_DHTsensor/demo_Grove_DHTsensor.ino | 287faf7bea290bfa889d7f685b1ed446dcd531af | [
"MIT"
] | permissive | soracom-labs/Hardware-exampleCode | 4c9438c89d3021ba45edbe7b80b3fa9268f3aa84 | dae47a31b044dab807665ccb967fdee3858e6348 | refs/heads/main | 2023-02-18T23:50:39.311553 | 2021-01-18T20:09:33 | 2021-01-18T20:09:33 | 328,619,209 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,146 | ino | /* Copyright (c) 2020 SORACOM
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.
Dependent Modules
Arduino : by Arduino LLC, subject to the GNU Lesser General Public License. This library is available in the Arduino IDE and also at https://github.com/arduino/Arduino
DHT : by Adafruit Industries, subject to the MIT License (MIT) written. This library is available in the Arduino IDE and also at https://github.com/Seeed-Studio/Grove_Temperature_And_Humidity_Sensor
Wire : by Arduino LLC, subject to GNU Lesser General Public License. This library is available in the Arduino IDE and also at https://github.com/esp8266/Arduino/tree/master/libraries/Wire
EXAMPLE NOTES
1. Install the Grove DHT11 sensor into slot 'D0' on the Arduino MKR Connector Carrier board
2. Make the USB connection between the Arduino MKR 1400 your Arduino IDE (PC)
3. Use the Arduino IDE to verify and upload the Arduino image to the MKR GPS 1400, you may need to install additional libraries from the IDE (CTRL SHIFT I) to verify the sketch.
4. Start the serial monitor, the serial connection speed is set by SERIAL_SPEED at 9600 bps
A. Observe Farenheit, Celcius & Humidity readings from the sensor
B. The content (value) of a 'static' variable persists, for example value of 'tsStart' persists between calls to the 'timerExpired' function, the value of the variable is initialized the first time the function is called and retains its value between calls.
C. The 'F("STRING")' construct places static data into flash storage, preserving RAM for your code
D. The timerExpired function has limited accuracy and is expected to drift over time.
OUTPUT AT THE SERIAL PORT
Starting the sensor DHT11_Grove_sensor...
*/
#include <Arduino.h>
#include <DHT.h>
#include <Wire.h>
#define DHTPIN 0
#define DHTTYPE DHT11
#define UPDATE_DELAY 5000
#define SERIAL_SPEED 9600
DHT groveSensor(DHTPIN, DHTTYPE);
bool timerExpired(unsigned long timeDelta = 1000)
{
static unsigned long tsStart = millis(); // this value will persist, see note B above.
unsigned long tsNow = millis();
unsigned long tsEnd = tsStart + timeDelta;
if(tsNow <= tsEnd)
{ // not expired
return false;
}
else
{ // expired
tsStart = tsNow;
return true;
}
};
void setup() {
Serial.begin(SERIAL_SPEED);
while(!Serial)
delay(1000); // remove this while loop to start the sketch at power-on, else the sketch will wait for a serial connection
Serial.println(F(""));
Serial.println(F("Starting the sensor DHT11_Grove_sensor"));
Wire.begin(DHTPIN);
groveSensor.begin();
}
void loop() {
if(timerExpired(UPDATE_DELAY)) {
float cTemp = groveSensor.readTemperature(false); // get reading from the sensor in Fahrenheit
float fTemp = groveSensor.convertCtoF(cTemp); // convert the result to Celcius
float hum = groveSensor.readHumidity();
Serial.print(F("Fahrenheit:"));
Serial.print(fTemp, DEC);
Serial.print(F("\tCelcius:"));
Serial.print(cTemp, DEC);
Serial.print(F("\tHumidity:"));
Serial.println(hum, DEC);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
d016d17ce9f7010268f6c353f25f231fe5868860 | c17b578c457f4abc8fa1253ce794aeffa4629893 | /Labs/Lab3/main.cpp | 857c2c16c196cf1dcd5082954c14c3ae5d5c447c | [] | no_license | Neos-codes/DataStructures | 91e441dbc18e107d0b46492483c8cc9097e819d2 | e1ef33fc750051ea79133f96955c8f272b90c617 | refs/heads/main | 2023-01-04T17:09:11.400240 | 2020-11-05T18:59:49 | 2020-11-05T18:59:49 | 310,389,101 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 270 | cpp | #include <iostream>
#include "ListADT.h"
#include "arrayList.h"
using namespace std;
int main(){
List *a = new arrayList();
a->push_back(19);
a->push_back(10);
a->push_back(9);
cout << a->size() << " " << a->at(0) << endl;
delete a;
return 0;
}
| [
"72319913+Neos-codes@users.noreply.github.com"
] | 72319913+Neos-codes@users.noreply.github.com |
f8944107392b82dc2031c0c3b9390d8be8f1aacd | 48165c78833beb50663afd653114f03cfb60c173 | /planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner/src/vehicle_model/vehicle_model_interface.cpp | 5cd0e31a8bd14896d723d3d8503ee572d04c27c1 | [
"Apache-2.0"
] | permissive | wep21/autoware.iv.universe | 611e5dafc7ea14fdb549f96d81581f4afe1e7aa6 | 8bcfbf7419552b5f6050e28c89c6488804652666 | refs/heads/master | 2023-04-03T11:37:28.114239 | 2020-09-25T06:32:13 | 2020-09-25T06:33:34 | 300,148,301 | 0 | 0 | Apache-2.0 | 2022-02-07T04:10:35 | 2020-10-01T04:54:28 | null | UTF-8 | C++ | false | false | 1,099 | cpp | /*
* Copyright 2018-2019 Autoware Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "obstacle_avoidance_planner/vehicle_model/vehicle_model_interface.h"
VehicleModelInterface::VehicleModelInterface(int dim_x, int dim_u, int dim_y)
: dim_x_(dim_x), dim_u_(dim_u), dim_y_(dim_y)
{
}
int VehicleModelInterface::getDimX() { return dim_x_; }
int VehicleModelInterface::getDimU() { return dim_u_; }
int VehicleModelInterface::getDimY() { return dim_y_; }
void VehicleModelInterface::setCurvature(const double curvature) { curvature_ = curvature; }
| [
"ryohsuke.mitsudome@tier4.jp"
] | ryohsuke.mitsudome@tier4.jp |
189bc5ac0705e085629c89d25790243709d82989 | ae33a8387824a09eaf6910772d66ff4fc963439a | /main.cpp | 02d19c55e4d4707da622a030ec5f30f6e5a40805 | [] | no_license | nsdavankar/Inheritance- | d363a1d3b4528bbcddeb7c688f0066766d496f0e | 8d2e4cc322b2546ef97bd90085365ed65a44fd33 | refs/heads/master | 2020-12-09T13:45:35.418031 | 2020-01-12T01:49:45 | 2020-01-12T01:49:45 | 233,323,622 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,561 | cpp | /**************************************************************************
* AUTHOR : Nisha Davankar
* Student ID : 1045735
* Assignment : 2
* CLASS : CS1C
* SECTION : MW 5pm
* DUE DATE : 01/30/19
**************************************************************************/
#include "Header.h"
/**************************************************************************
* Employee Inheritance
* -------------------------------------------------------------------------
* This program has an Employee class that has name, ID, phone number, gender,
*age, job title, salary, and date as private data member. The Employee
*class has public members to change the private data members. There are
*also two inherited classes, Programmer and Architect that can access the
*public members of Employee and have some private data members such as
*department number, supervisor name and salary percentage.
* --------------------------------------------------------------------------
* INPUT
*
*
* OUTPUT
*
***************************************************************************/
int main()
{
Employee defEmployee;
//PROCESSING- non default constructor
Employee nondefEmployee("Tom Brady", 12345, 9495551234, 40, 'M',
"Quarterback", 100000, 8, 31, 2014);
nondefEmployee.printEmployee();
//PROCESSING- changing attributes of the Employee class
nondefEmployee.changeEmployeeName();
nondefEmployee.changeEmployeeId();
nondefEmployee.changeEmployeePhoneNumber();
nondefEmployee.changeEmployeeAge();
nondefEmployee.changeEmployeeJobTitle();
nondefEmployee.changeEmployeeSalary();
nondefEmployee.changeEmployeeHireDate();
//OUTPUT
nondefEmployee.printEmployee();
nondefEmployee.changeEmployeeName();
nondefEmployee.changeEmployeeId();
nondefEmployee.changeEmployeePhoneNumber();
nondefEmployee.changeEmployeeAge();
nondefEmployee.changeEmployeeGender();
nondefEmployee.changeEmployeeJobTitle();
nondefEmployee.changeEmployeeSalary();
nondefEmployee.changeEmployeeHireDate();
//OUTPUT
nondefEmployee.printEmployee();
nondefEmployee.changeEmployeeName();
nondefEmployee.changeEmployeeId();
nondefEmployee.changeEmployeePhoneNumber();
nondefEmployee.changeEmployeeAge();
nondefEmployee.changeEmployeeGender();
nondefEmployee.changeEmployeeJobTitle();
nondefEmployee.changeEmployeeSalary();
nondefEmployee.changeEmployeeHireDate();
//OUTPUT
nondefEmployee.printEmployee();
cout << "\nProgrammers";
Programmer defProgrammer;
//PROCESSING- non default constructor
Programmer nondefProgrammer("Sam Software", 54321, 8191234567, 21,
'M', "Programmer", 223000, 12, 24, 2011, 5432122, "Joe Boss", 4,
true, false);
//PROCESSING- changing attributes of the Programmer class
defProgrammer.changeEmployeeName();
defProgrammer.changeEmployeeId();
defProgrammer.changeEmployeePhoneNumber();
defProgrammer.changeEmployeeAge();
defProgrammer.changeEmployeeGender();
defProgrammer.changeEmployeeJobTitle();
defProgrammer.changeEmployeeSalary();
defProgrammer.changeEmployeeHireDate();
defProgrammer.progChangeDeptNum();
defProgrammer.progChangesupName();
defProgrammer.progChangeSalaryPer();
defProgrammer.progChangecIden();
defProgrammer.progChangejIden();
//OUTPUT
cout << "\nProgrammers";
nondefProgrammer.printEmployeeinfo();
defProgrammer.printEmployeeinfo();
nondefProgrammer.progPrintProgrammer();
defProgrammer.progPrintProgrammer();
cin.ignore(1000, '\n');
cout << "\nSoftware Architechs";
Architect defArchitect;
//PROCESSING- non default constructor
Architect nondefArchitect("Alex Arch", 88888, 8191234444, 31, 'M',
"Architech", 323000, 12,24,2009, 1434222, "Big Boss", 5, 4);
//PROCESSING- changing attributes of the Architect class
defArchitect.changeEmployeeName();
defArchitect.changeEmployeeId();
defArchitect.changeEmployeePhoneNumber();
defArchitect.changeEmployeeAge();
defArchitect.changeEmployeeGender();
defArchitect.changeEmployeeJobTitle();
defArchitect.changeEmployeeSalary();
defArchitect.changeEmployeeHireDate();
defArchitect.archChangeDeptNum();
defArchitect.archChangesupName();
defArchitect.archChangeSalaryPer();
defArchitect.archChangeYears();
//OUTPUT
cout << "\nSoftware Architechs";
nondefArchitect.printEmployeeinfo();
defArchitect.printEmployeeinfo();
nondefArchitect.archPrintArchitect();
defArchitect.archPrintArchitect();
cout << endl;
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
877595af8b9d38bc2437611df2678d24ec160595 | 02d47913737ad197a7eea70db2a8e85eb87b5fe1 | /src/reverse_iterate.h | 3e05882175622857440af9aa91820dcf393f63a2 | [
"MIT"
] | permissive | SiqsTeam/Siqs | 5f686ee5f2b84adb69f481caca7cc82c9e6152a3 | 01c9ec738274a2ca15af8c01fd1d8fd92a5661c3 | refs/heads/master | 2020-04-28T18:48:59.953842 | 2019-03-15T13:14:02 | 2019-03-15T13:14:02 | 175,490,939 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 778 | h | // Copyright (c) 2017 The SIQS developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
/*
Template used for reverse iteration in C++11 range-based for loops.
std::vector<int> v = {1, 2, 3, 4, 5};
for (auto x : reverse_iterate(v))
std::cout << x << " ";
*/
template <typename T>
class reverse_range
{
T &x;
public:
reverse_range(T &x) : x(x) {}
auto begin() const -> decltype(this->x.rbegin())
{
return x.rbegin();
}
auto end() const -> decltype(this->x.rend())
{
return x.rend();
}
};
template <typename T>
reverse_range<T> reverse_iterate(T &x)
{
return reverse_range<T>(x);
}
| [
"teslagoteam@gmail.com"
] | teslagoteam@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.